Categorygithub.com/pseudomuto/iceberg-rest-go
modulepackage
0.1.2
Repository: https://github.com/pseudomuto/iceberg-rest-go.git
Documentation: pkg.go.dev

# README

iceberg-rest-go

CI Status

A Go client library for interacting with an Iceberg Rest Catalog.

Getting Started

go get https://github.com/pseudomuto/iceberg-rest-go

// Or simply
import "github.com/pseudomuto/iceberg-rest-go"

The test cases are the best place to look for examples, but just as a quick demo, here's how you can use this library.

Getting a Namespace

func main() {
  client, err := NewClient("http://localhost:8181")
  if err != nil {
    log.Fatal(err)
  }

  ns := Namespaces{"data", "testing"}
  res, err := client.LoadNamespaceMetadataWithResponse(ctx, NamespaceString(ns))
  if err != nil {
    log.Fatal(err)
  }

  fmt.Println("Namespace properties:")
  for k, v := range *nsResp.JSON200.Properties {
    fmt.Printf("Key: %s, Value: %s\n", k, v)
  }
}

Contributing

This library is (largely) auto-generated from the OpenAPI spec for the Rest catalog. Running make update-api will fetch the latest version and perform a few updates to the downloaded file to make it work correctly (see the Makefile for changes).

Once there's a new version, running make generate will generate the new Go code in client.gen.go.

make help is your friend.

Testing

The tests all run against a running rest server (make catalog) and record their results in tests/testdata/ so future test runs won't require a live server.

If you need to create a new test, create a new test file, run make catalog and then make test which will record the interaction. To re-record, simply delete the JSON file and run again (ensuring the catalog is running). You may need to restart the catalog server to ensure there's no existing data preventing the test from succeeding (it's ephemeral).

Each test should be completely independent so that we can re-record one test without depending on ordering from any of the others.

# Packages

No description provided by the author

# Functions

No description provided by the author
Creates a new Client, with reasonable defaults.
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling.
NewCommitTransactionRequest calls the generic CommitTransaction builder with application/json body.
NewCommitTransactionRequestWithBody generates requests for CommitTransaction with any type of body.
NewCreateNamespaceRequest calls the generic CreateNamespace builder with application/json body.
NewCreateNamespaceRequestWithBody generates requests for CreateNamespace with any type of body.
NewCreateTableRequest calls the generic CreateTable builder with application/json body.
NewCreateTableRequestWithBody generates requests for CreateTable with any type of body.
NewCreateViewRequest calls the generic CreateView builder with application/json body.
NewCreateViewRequestWithBody generates requests for CreateView with any type of body.
NewDropNamespaceRequest generates requests for DropNamespace.
NewDropTableRequest generates requests for DropTable.
NewDropViewRequest generates requests for DropView.
NewGetConfigRequest generates requests for GetConfig.
NewGetTokenRequestWithBody generates requests for GetToken with any type of body.
NewGetTokenRequestWithFormdataBody calls the generic GetToken builder with application/x-www-form-urlencoded body.
NewListNamespacesRequest generates requests for ListNamespaces.
NewListTablesRequest generates requests for ListTables.
NewListViewsRequest generates requests for ListViews.
NewLoadNamespaceMetadataRequest generates requests for LoadNamespaceMetadata.
NewLoadTableRequest generates requests for LoadTable.
NewLoadViewRequest generates requests for LoadView.
NewNamespaceExistsRequest generates requests for NamespaceExists.
NewRegisterTableRequest calls the generic RegisterTable builder with application/json body.
NewRegisterTableRequestWithBody generates requests for RegisterTable with any type of body.
NewRenameTableRequest calls the generic RenameTable builder with application/json body.
NewRenameTableRequestWithBody generates requests for RenameTable with any type of body.
NewRenameViewRequest calls the generic RenameView builder with application/json body.
NewRenameViewRequestWithBody generates requests for RenameView with any type of body.
NewReplaceViewRequest calls the generic ReplaceView builder with application/json body.
NewReplaceViewRequestWithBody generates requests for ReplaceView with any type of body.
NewReportMetricsRequest calls the generic ReportMetrics builder with application/json body.
NewReportMetricsRequestWithBody generates requests for ReportMetrics with any type of body.
NewTableExistsRequest generates requests for TableExists.
NewUpdatePropertiesRequest calls the generic UpdateProperties builder with application/json body.
NewUpdatePropertiesRequestWithBody generates requests for UpdateProperties with any type of body.
NewUpdateTableRequest calls the generic UpdateTable builder with application/json body.
NewUpdateTableRequestWithBody generates requests for UpdateTable with any type of body.
NewViewExistsRequest generates requests for ViewExists.
ParseCommitTransactionServerResponse parses an HTTP response from a CommitTransactionWithResponse call.
ParseCreateNamespaceServerResponse parses an HTTP response from a CreateNamespaceWithResponse call.
ParseCreateTableServerResponse parses an HTTP response from a CreateTableWithResponse call.
ParseCreateViewServerResponse parses an HTTP response from a CreateViewWithResponse call.
ParseDropNamespaceServerResponse parses an HTTP response from a DropNamespaceWithResponse call.
ParseDropTableServerResponse parses an HTTP response from a DropTableWithResponse call.
ParseDropViewServerResponse parses an HTTP response from a DropViewWithResponse call.
ParseGetConfigServerResponse parses an HTTP response from a GetConfigWithResponse call.
ParseGetTokenServerResponse parses an HTTP response from a GetTokenWithResponse call.
ParseListNamespacesServerResponse parses an HTTP response from a ListNamespacesWithResponse call.
ParseListTablesServerResponse parses an HTTP response from a ListTablesWithResponse call.
ParseListViewsServerResponse parses an HTTP response from a ListViewsWithResponse call.
ParseLoadNamespaceMetadataServerResponse parses an HTTP response from a LoadNamespaceMetadataWithResponse call.
ParseLoadTableServerResponse parses an HTTP response from a LoadTableWithResponse call.
ParseLoadViewServerResponse parses an HTTP response from a LoadViewWithResponse call.
ParseNamespaceExistsServerResponse parses an HTTP response from a NamespaceExistsWithResponse call.
ParseRegisterTableServerResponse parses an HTTP response from a RegisterTableWithResponse call.
ParseRenameTableServerResponse parses an HTTP response from a RenameTableWithResponse call.
ParseRenameViewServerResponse parses an HTTP response from a RenameViewWithResponse call.
ParseReplaceViewServerResponse parses an HTTP response from a ReplaceViewWithResponse call.
ParseReportMetricsServerResponse parses an HTTP response from a ReportMetricsWithResponse call.
ParseTableExistsServerResponse parses an HTTP response from a TableExistsWithResponse call.
ParseUpdatePropertiesServerResponse parses an HTTP response from a UpdatePropertiesWithResponse call.
ParseUpdateTableServerResponse parses an HTTP response from a UpdateTableWithResponse call.
ParseViewExistsServerResponse parses an HTTP response from a ViewExistsWithResponse call.
No description provided by the author
No description provided by the author
WithBaseURL overrides the baseURL.
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client.
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request.

# Constants

Defines values for LoadTableParamsSnapshots.
Defines values for SnapshotSummaryOperation.
Defines values for SortDirection.
Defines values for AssertCreateType.
Defines values for AssertCurrentSchemaIdType.
Defines values for AssertDefaultSortOrderIdType.
Defines values for AssertDefaultSpecIdType.
Defines values for AssertLastAssignedFieldIdType.
Defines values for AssertLastAssignedPartitionIdType.
Defines values for AssertRefSnapshotIdType.
Defines values for AssertTableUUIDType.
Defines values for AssertViewUUIDType.
Defines values for OAuthTokenResponseTokenType.
No description provided by the author
Defines values for OAuthClientCredentialsRequestGrantType.
Defines values for CreateTableParamsXIcebergAccessDelegation.
Defines values for CreateTableParamsXIcebergAccessDelegation.
Defines values for DataAccess.
Defines values for DataAccess.
Defines values for SnapshotSummaryOperation.
Defines values for SortDirection.
Defines values for OAuthErrorError.
Defines values for OAuthErrorError.
Defines values for OAuthErrorError.
Defines values for OAuthErrorError.
Defines values for ListTypeType.
Defines values for OAuthTokenResponseTokenType.
Defines values for MapTypeType.
Defines values for OAuthTokenResponseTokenType.
No description provided by the author
Defines values for NullOrder.
Defines values for NullOrder.
No description provided by the author
Defines values for SnapshotSummaryOperation.
Defines values for LoadTableParamsSnapshots.
Defines values for LoadTableParamsXIcebergAccessDelegation.
Defines values for SnapshotSummaryOperation.
Defines values for SchemaType.
Defines values for SetSnapshotRefUpdateType.
Defines values for SetSnapshotRefUpdateType.
Defines values for SnapshotReferenceType.
Defines values for SnapshotReferenceType.
Defines values for StructTypeType.
Defines values for TransformTermType.
Defines values for OAuthErrorError.
Defines values for OAuthErrorError.
Defines values for OAuthTokenExchangeRequestGrantType.
Defines values for TokenType.
Defines values for TokenType.
Defines values for TokenType.
Defines values for TokenType.
Defines values for TokenType.
Defines values for TokenType.
Defines values for LoadTableParamsXIcebergAccessDelegation.

# Variables

PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.
PrimitiveTypes See: https://iceberg.apache.org/spec/#primitive-types.

# Structs

AndOrExpression defines model for AndOrExpression.
AssertCreate The table must not already exist; used for create transactions.
AssertCurrentSchemaId The table's current schema id must match the requirement's `current-schema-id`.
AssertDefaultSortOrderId The table's default sort order id must match the requirement's `default-sort-order-id`.
AssertDefaultSpecId The table's default spec id must match the requirement's `default-spec-id`.
AssertLastAssignedFieldId The table's last assigned column id must match the requirement's `last-assigned-field-id`.
AssertLastAssignedPartitionId The table's last assigned partition id must match the requirement's `last-assigned-partition-id`.
AssertRefSnapshotId The table branch or tag identified by the requirement's `ref` must reference the requirement's `snapshot-id`; if `snapshot-id` is `null` or missing, the ref must not already exist.
AssertTableUUID The table UUID must match the requirement's `uuid`.
AssertViewUUID The view UUID must match the requirement's `uuid`.
BaseUpdate defines model for BaseUpdate.
BlobMetadata defines model for BlobMetadata.
CatalogConfig Server-provided configuration for the catalog.
Client which conforms to the OpenAPI3 specification for this service.
ClientWithResponses builds on ClientInterface to offer response payloads.
CommitReport defines model for CommitReport.
CommitTableRequest defines model for CommitTableRequest.
CommitTableResponse defines model for CommitTableResponse.
CommitTransactionRequest defines model for CommitTransactionRequest.
No description provided by the author
CommitViewRequest defines model for CommitViewRequest.
CounterResult defines model for CounterResult.
CreateNamespaceRequest defines model for CreateNamespaceRequest.
CreateNamespaceResponse defines model for CreateNamespaceResponse.
No description provided by the author
CreateTableParams defines parameters for CreateTable.
CreateTableRequest defines model for CreateTableRequest.
No description provided by the author
CreateViewRequest defines model for CreateViewRequest.
No description provided by the author
No description provided by the author
DropTableParams defines parameters for DropTable.
No description provided by the author
No description provided by the author
ErrorModel JSON error payload returned in a response with further details on the error.
Expression defines model for Expression.
GetConfigParams defines parameters for GetConfig.
No description provided by the author
GetNamespaceResponse defines model for GetNamespaceResponse.
No description provided by the author
IcebergErrorResponse JSON wrapper for all error responses (non-2xx).
ListNamespacesParams defines parameters for ListNamespaces.
ListNamespacesResponse defines model for ListNamespacesResponse.
No description provided by the author
ListTablesParams defines parameters for ListTables.
ListTablesResponse defines model for ListTablesResponse.
No description provided by the author
ListType defines model for ListType.
ListViewsParams defines parameters for ListViews.
No description provided by the author
LiteralExpression defines model for LiteralExpression.
No description provided by the author
LoadTableParams defines parameters for LoadTable.
LoadTableResult Result used when a table is successfully loaded.
No description provided by the author
LoadViewResult Result used when a view is successfully loaded.
No description provided by the author
MapType defines model for MapType.
MetricResult defines model for MetricResult.
No description provided by the author
NotExpression defines model for NotExpression.
OAuthClientCredentialsRequest The `oauth/tokens` endpoint and related schemas are **DEPRECATED for REMOVAL** from this spec, see description of the endpoint.
OAuthError The `oauth/tokens` endpoint and related schemas are **DEPRECATED for REMOVAL** from this spec, see description of the endpoint.
OAuthTokenExchangeRequest The `oauth/tokens` endpoint and related schemas are **DEPRECATED for REMOVAL** from this spec, see description of the endpoint.
OAuthTokenRequest The `oauth/tokens` endpoint and related schemas are **DEPRECATED for REMOVAL** from this spec, see description of the endpoint.
OAuthTokenResponse The `oauth/tokens` endpoint and related schemas are **DEPRECATED for REMOVAL** from this spec, see description of the endpoint.
PartitionField defines model for PartitionField.
PartitionSpec defines model for PartitionSpec.
PartitionStatisticsFile defines model for PartitionStatisticsFile.
RegisterTableRequest defines model for RegisterTableRequest.
No description provided by the author
RenameTableRequest defines model for RenameTableRequest.
No description provided by the author
No description provided by the author
No description provided by the author
ReportMetricsRequest defines model for ReportMetricsRequest.
No description provided by the author
ScanReport defines model for ScanReport.
Schema defines model for Schema.
SetExpression defines model for SetExpression.
SetSnapshotRefUpdate defines model for SetSnapshotRefUpdate.
Snapshot defines model for Snapshot.
Snapshot_Summary defines model for Snapshot.Summary.
SnapshotReference defines model for SnapshotReference.
SortField defines model for SortField.
SortOrder defines model for SortOrder.
SQLViewRepresentation defines model for SQLViewRepresentation.
StatisticsFile defines model for StatisticsFile.
StructField defines model for StructField.
StructType defines model for StructType.
No description provided by the author
TableIdentifier defines model for TableIdentifier.
TableMetadata defines model for TableMetadata.
TableRequirement defines model for TableRequirement.
TableUpdate defines model for TableUpdate.
Term defines model for Term.
TimerResult defines model for TimerResult.
TransformTerm defines model for TransformTerm.
Type defines model for Type.
UnaryExpression defines model for UnaryExpression.
UpdateNamespacePropertiesRequest defines model for UpdateNamespacePropertiesRequest.
UpdateNamespacePropertiesResponse defines model for UpdateNamespacePropertiesResponse.
No description provided by the author
No description provided by the author
No description provided by the author
ViewHistoryEntry defines model for ViewHistoryEntry.
ViewMetadata defines model for ViewMetadata.
ViewRepresentation defines model for ViewRepresentation.
ViewRequirement defines model for ViewRequirement.
ViewUpdate defines model for ViewUpdate.
ViewVersion defines model for ViewVersion.

# Interfaces

The interface specification for the client above.
ClientWithResponsesInterface is the interface specification for the client with responses above.
Doer performs HTTP requests.

# Type aliases

AddPartitionSpecUpdate defines model for AddPartitionSpecUpdate.
AddSchemaUpdate defines model for AddSchemaUpdate.
AddSnapshotUpdate defines model for AddSnapshotUpdate.
AddSortOrderUpdate defines model for AddSortOrderUpdate.
AddViewVersionUpdate defines model for AddViewVersionUpdate.
AssertCreateType defines model for AssertCreate.Type.
AssertCurrentSchemaIdType defines model for AssertCurrentSchemaId.Type.
AssertDefaultSortOrderIdType defines model for AssertDefaultSortOrderId.Type.
AssertDefaultSpecIdType defines model for AssertDefaultSpecId.Type.
AssertLastAssignedFieldIdType defines model for AssertLastAssignedFieldId.Type.
AssertLastAssignedPartitionIdType defines model for AssertLastAssignedPartitionId.Type.
AssertRefSnapshotIdType defines model for AssertRefSnapshotId.Type.
AssertTableUUIDType defines model for AssertTableUUID.Type.
AssertViewUUIDType defines model for AssertViewUUID.Type.
AssignUUIDUpdate defines model for AssignUUIDUpdate.
AuthenticationTimeoutResponse JSON wrapper for all error responses (non-2xx).
BadRequestErrorResponse JSON wrapper for all error responses (non-2xx).
ClientOption allows setting custom parameters during construction.
CommitTransactionJSONRequestBody defines body for CommitTransaction for application/json ContentType.
CreateNamespaceJSONRequestBody defines body for CreateNamespace for application/json ContentType.
CreateTableJSONRequestBody defines body for CreateTable for application/json ContentType.
CreateTableParamsXIcebergAccessDelegation defines parameters for CreateTable.
CreateTableResponse Result used when a table is successfully loaded.
CreateViewJSONRequestBody defines body for CreateView for application/json ContentType.
DataAccess defines model for data-access.
ExpressionType defines model for ExpressionType.
ForbiddenResponse JSON wrapper for all error responses (non-2xx).
GetTokenFormdataRequestBody defines body for GetToken for application/x-www-form-urlencoded ContentType.
ListTypeType defines model for ListType.Type.
LoadTableParamsSnapshots defines parameters for LoadTable.
LoadTableParamsXIcebergAccessDelegation defines parameters for LoadTable.
LoadTableResponse Result used when a table is successfully loaded.
LoadViewResponse Result used when a view is successfully loaded.
MapTypeType defines model for MapType.Type.
MetadataLog defines model for MetadataLog.
Metrics defines model for Metrics.
Namespace defines model for namespace.
Namespaces Reference to one or more levels of a namespace.
NullOrder defines model for NullOrder.
OAuthClientCredentialsRequestGrantType defines model for OAuthClientCredentialsRequest.GrantType.
OAuthErrorError defines model for OAuthError.Error.
OAuthErrorResponse The `oauth/tokens` endpoint and related schemas are **DEPRECATED for REMOVAL** from this spec, see description of the endpoint.
OAuthTokenExchangeRequestGrantType defines model for OAuthTokenExchangeRequest.GrantType.
OAuthTokenResponseTokenType Access token type for client credentials or token exchange See https://datatracker.ietf.org/doc/html/rfc6749#section-7.1.
PageSize defines model for page-size.
PageToken An opaque token that allows clients to make use of pagination for list APIs (e.g.
PrimitiveType defines model for PrimitiveType.
Reference defines model for Reference.
RegisterTableJSONRequestBody defines body for RegisterTable for application/json ContentType.
RemovePropertiesUpdate defines model for RemovePropertiesUpdate.
RemoveSnapshotRefUpdate defines model for RemoveSnapshotRefUpdate.
RemoveSnapshotsUpdate defines model for RemoveSnapshotsUpdate.
RemoveStatisticsUpdate defines model for RemoveStatisticsUpdate.
RenameTableJSONRequestBody defines body for RenameTable for application/json ContentType.
RenameViewJSONRequestBody defines body for RenameView for application/json ContentType.
ReplaceViewJSONRequestBody defines body for ReplaceView for application/json ContentType.
ReportMetricsJSONRequestBody defines body for ReportMetrics for application/json ContentType.
RequestEditorFn is the function signature for the RequestEditor callback function.
SchemaType defines model for Schema.Type.
ServerErrorResponse JSON wrapper for all error responses (non-2xx).
ServiceUnavailableResponse JSON wrapper for all error responses (non-2xx).
SetCurrentSchemaUpdate defines model for SetCurrentSchemaUpdate.
SetCurrentViewVersionUpdate defines model for SetCurrentViewVersionUpdate.
SetDefaultSortOrderUpdate defines model for SetDefaultSortOrderUpdate.
SetDefaultSpecUpdate defines model for SetDefaultSpecUpdate.
SetLocationUpdate defines model for SetLocationUpdate.
SetPropertiesUpdate defines model for SetPropertiesUpdate.
SetSnapshotRefUpdateType defines model for SetSnapshotRefUpdate.Type.
SetStatisticsUpdate defines model for SetStatisticsUpdate.
SnapshotLog defines model for SnapshotLog.
SnapshotReferences defines model for SnapshotReferences.
SnapshotReferenceType defines model for SnapshotReference.Type.
SnapshotSummaryOperation defines model for Snapshot.Summary.Operation.
SortDirection defines model for SortDirection.
StructTypeType defines model for StructType.Type.
Table defines model for table.
TokenType Token type identifier, from RFC 8693 Section 3 See https://datatracker.ietf.org/doc/html/rfc8693#section-3.
Transform defines model for Transform.
TransformTermType defines model for TransformTerm.Type.
UnauthorizedResponse JSON wrapper for all error responses (non-2xx).
UnsupportedOperationResponse JSON error payload returned in a response with further details on the error.
UpdatePropertiesJSONRequestBody defines body for UpdateProperties for application/json ContentType.
UpdateTableJSONRequestBody defines body for UpdateTable for application/json ContentType.
UpgradeFormatVersionUpdate defines model for UpgradeFormatVersionUpdate.
View defines model for view.