Documentation
¶
Index ¶
- Variables
- type AuthManager
- type Catalog
- func (r *Catalog) CatalogType() catalog.Type
- func (r *Catalog) CheckNamespaceExists(ctx context.Context, namespace table.Identifier) (bool, error)
- func (r *Catalog) CheckTableExists(ctx context.Context, identifier table.Identifier) (bool, error)
- func (r *Catalog) CheckViewExists(ctx context.Context, identifier table.Identifier) (bool, error)
- func (r *Catalog) CommitTable(ctx context.Context, ident table.Identifier, requirements []table.Requirement, ...) (table.Metadata, string, error)
- func (r *Catalog) CommitTransaction(ctx context.Context, commits []table.TableCommit) error
- func (r *Catalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error
- func (r *Catalog) CreateTable(ctx context.Context, identifier table.Identifier, schema *iceberg.Schema, ...) (*table.Table, error)
- func (r *Catalog) CreateView(ctx context.Context, identifier table.Identifier, version *view.Version, ...) (*view.View, error)
- func (r *Catalog) DropNamespace(ctx context.Context, namespace table.Identifier) error
- func (r *Catalog) DropTable(ctx context.Context, identifier table.Identifier) error
- func (r *Catalog) DropView(ctx context.Context, identifier table.Identifier) error
- func (r *Catalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)
- func (r *Catalog) ListTables(ctx context.Context, namespace table.Identifier) iter.Seq2[table.Identifier, error]
- func (r *Catalog) ListViews(ctx context.Context, namespace table.Identifier) iter.Seq2[table.Identifier, error]
- func (r *Catalog) LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error)
- func (r *Catalog) LoadTable(ctx context.Context, identifier table.Identifier) (*table.Table, error)
- func (r *Catalog) LoadView(ctx context.Context, identifier table.Identifier) (*view.View, error)
- func (r *Catalog) Name() string
- func (r *Catalog) PurgeTable(ctx context.Context, identifier table.Identifier) error
- func (r *Catalog) RegisterTable(ctx context.Context, identifier table.Identifier, metadataLoc string) (*table.Table, error)
- func (r *Catalog) RegisterView(ctx context.Context, identifier table.Identifier, metadataLoc string) (*view.View, error)
- func (r *Catalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)
- func (r *Catalog) SetPageSize(ctx context.Context, sz int) context.Context
- func (r *Catalog) UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, ...) (catalog.PropertiesUpdateSummary, error)
- func (r *Catalog) UpdateTable(ctx context.Context, ident table.Identifier, requirements []table.Requirement, ...) (*table.Table, error)
- func (r *Catalog) UpdateView(ctx context.Context, ident table.Identifier, requirements []view.Requirement, ...) (*view.View, error)
- type Oauth2AuthManager
- type Option
- func WithAdditionalProps(props iceberg.Properties) Option
- func WithAudience(audience string) Option
- func WithAuthManager(authManager AuthManager) Option
- func WithAuthURI(uri *url.URL) Option
- func WithAwsConfig(cfg aws.Config) Option
- func WithCredential(cred string) Option
- func WithCustomTransport(transport http.RoundTripper) Option
- func WithHeaders(headers map[string]string) Option
- func WithMetadataLocation(loc string) Option
- func WithOAuthTLSConfig(config *tls.Config) Option
- func WithOAuthToken(token string) Option
- func WithPrefix(prefix string) Option
- func WithResource(resource string) Option
- func WithScope(scope string) Option
- func WithSigV4() Option
- func WithSigV4RegionSvc(region, service string) Option
- func WithTLSConfig(config *tls.Config) Option
- func WithWarehouseLocation(loc string) Option
Constants ¶
This section is empty.
Variables ¶
var ( ErrRESTError = errors.New("REST error") ErrBadRequest = fmt.Errorf("%w: bad request", ErrRESTError) ErrForbidden = fmt.Errorf("%w: forbidden", ErrRESTError) ErrAuthorizationExpired = fmt.Errorf("%w: authorization expired", ErrRESTError) ErrServerError = fmt.Errorf("%w: server error", ErrRESTError) // ErrCommitFailed wraps both ErrRESTError and table.ErrCommitFailed // so that callers can detect retryable commit conflicts via // errors.Is(err, table.ErrCommitFailed). ErrCommitFailed = fmt.Errorf("%w: %w", ErrRESTError, table.ErrCommitFailed) ErrCommitStateUnknown = fmt.Errorf("%w: commit failed due to unknown reason", ErrRESTError) ErrOAuthError = fmt.Errorf("%w: oauth error", ErrRESTError) )
Functions ¶
This section is empty.
Types ¶
type AuthManager ¶ added in v0.5.0
type AuthManager interface {
// AuthHeader returns the key and value for the authorization header.
AuthHeader() (string, string, error)
}
AuthManager is an interface for providing custom authorization headers.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
func NewCatalog ¶
func (*Catalog) CatalogType ¶
func (*Catalog) CheckNamespaceExists ¶
func (*Catalog) CheckTableExists ¶
func (*Catalog) CheckViewExists ¶
func (*Catalog) CommitTable ¶
func (*Catalog) CommitTransaction ¶ added in v0.6.0
CommitTransaction atomically commits changes to multiple tables in a single request. It implements catalog.TransactionalCatalog.
The server applies all changes or none (all-or-nothing). On success (204 No Content) the method returns nil. Callers must LoadTable individually to obtain updated metadata.
func (*Catalog) CreateNamespace ¶
func (r *Catalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error
func (*Catalog) CreateTable ¶
func (*Catalog) CreateView ¶ added in v0.3.0
func (r *Catalog) CreateView(ctx context.Context, identifier table.Identifier, version *view.Version, schema *iceberg.Schema, opts ...catalog.CreateViewOpt) (*view.View, error)
CreateView creates a new view in the catalog.
func (*Catalog) DropNamespace ¶
func (*Catalog) ListNamespaces ¶
func (r *Catalog) ListNamespaces(ctx context.Context, parent table.Identifier) ([]table.Identifier, error)
func (*Catalog) ListTables ¶
func (r *Catalog) ListTables(ctx context.Context, namespace table.Identifier) iter.Seq2[table.Identifier, error]
func (*Catalog) ListViews ¶
func (r *Catalog) ListViews(ctx context.Context, namespace table.Identifier) iter.Seq2[table.Identifier, error]
func (*Catalog) LoadNamespaceProperties ¶
func (r *Catalog) LoadNamespaceProperties(ctx context.Context, namespace table.Identifier) (iceberg.Properties, error)
func (*Catalog) PurgeTable ¶
func (*Catalog) RegisterTable ¶
func (*Catalog) RegisterView ¶ added in v0.6.0
func (r *Catalog) RegisterView(ctx context.Context, identifier table.Identifier, metadataLoc string) (*view.View, error)
RegisterView registers an existing view in the catalog using its metadata file location. The metadata file must already be accessible to the catalog. This is the view equivalent of RegisterTable, using the REST endpoint POST /namespaces/{ns}/register-view defined in the Iceberg REST catalog specification.
func (*Catalog) RenameTable ¶
func (*Catalog) SetPageSize ¶
func (*Catalog) UpdateNamespaceProperties ¶
func (r *Catalog) UpdateNamespaceProperties(ctx context.Context, namespace table.Identifier, removals []string, updates iceberg.Properties, ) (catalog.PropertiesUpdateSummary, error)
func (*Catalog) UpdateTable ¶
func (*Catalog) UpdateView ¶ added in v0.5.0
func (r *Catalog) UpdateView(ctx context.Context, ident table.Identifier, requirements []view.Requirement, updates []view.Update) (*view.View, error)
UpdateView updates a view in the catalog.
type Oauth2AuthManager ¶ added in v0.5.0
type Oauth2AuthManager struct {
// contains filtered or unexported fields
}
Oauth2AuthManager is an implementation of the AuthManager interface which uses an oauth2.TokenSource to provide bearer tokens. The token source handles caching, thread-safe refresh, and expiry management.
func (*Oauth2AuthManager) AuthHeader ¶ added in v0.5.0
func (o *Oauth2AuthManager) AuthHeader() (string, string, error)
AuthHeader returns the authorization header with the bearer token.
type Option ¶
type Option func(*options)
func WithAdditionalProps ¶
func WithAdditionalProps(props iceberg.Properties) Option
func WithAudience ¶ added in v0.6.0
WithAudience sets the audience parameter sent in OAuth token requests. See RFC 8693 for details on token exchange audiences.
func WithAuthManager ¶ added in v0.5.0
func WithAuthManager(authManager AuthManager) Option
func WithAuthURI ¶
func WithAwsConfig ¶
func WithCredential ¶
func WithCustomTransport ¶ added in v0.4.0
func WithCustomTransport(transport http.RoundTripper) Option
WithCustomTransport replaces the internally configured http.Transport with the provided http.RoundTripper. Certain options such as WithTLSConfig which modify the default http.Transport will no longer work since the entire transport is replaced.
func WithHeaders ¶ added in v0.5.0
func WithMetadataLocation ¶
func WithOAuthTLSConfig ¶ added in v0.6.0
WithOAuthTLSConfig sets a separate TLS configuration for the HTTP client used to communicate with the OAuth2 server. This is useful when the OAuth2 server (oauth2-server-uri) is a different host than the catalog and requires different TLS settings (e.g. a different CA or client certificate).
If not set, the OAuth2 client reuses the catalog's HTTP client (and its TLS configuration).
func WithOAuthToken ¶
func WithPrefix ¶
func WithResource ¶ added in v0.6.0
WithResource sets the resource parameter sent in OAuth token requests. See RFC 8707 for details on resource indicators.