rest

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRESTError            = errors.New("REST error")
	ErrBadRequest           = fmt.Errorf("%w: bad request", ErrRESTError)
	ErrForbidden            = fmt.Errorf("%w: forbidden", ErrRESTError)
	ErrUnauthorized         = fmt.Errorf("%w: unauthorized", ErrRESTError)
	ErrAuthorizationExpired = fmt.Errorf("%w: authorization expired", ErrRESTError)
	ErrServiceUnavailable   = fmt.Errorf("%w: service unavailable", ErrRESTError)
	ErrServerError          = fmt.Errorf("%w: server error", ErrRESTError)
	ErrCommitFailed         = fmt.Errorf("%w: commit failed, refresh and try again", ErrRESTError)
	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 NewCatalog(ctx context.Context, name, uri string, opts ...Option) (*Catalog, error)

func (*Catalog) CatalogType

func (r *Catalog) CatalogType() catalog.Type

func (*Catalog) CheckNamespaceExists

func (r *Catalog) CheckNamespaceExists(ctx context.Context, namespace table.Identifier) (bool, error)

func (*Catalog) CheckTableExists

func (r *Catalog) CheckTableExists(ctx context.Context, identifier table.Identifier) (bool, error)

func (*Catalog) CheckViewExists

func (r *Catalog) CheckViewExists(ctx context.Context, identifier table.Identifier) (bool, error)

func (*Catalog) CommitTable

func (r *Catalog) CommitTable(ctx context.Context, ident table.Identifier, requirements []table.Requirement, updates []table.Update) (table.Metadata, string, error)

func (*Catalog) CreateNamespace

func (r *Catalog) CreateNamespace(ctx context.Context, namespace table.Identifier, props iceberg.Properties) error

func (*Catalog) CreateTable

func (r *Catalog) CreateTable(ctx context.Context, identifier table.Identifier, schema *iceberg.Schema, opts ...catalog.CreateTableOpt) (*table.Table, error)

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 (r *Catalog) DropNamespace(ctx context.Context, namespace table.Identifier) error

func (*Catalog) DropTable

func (r *Catalog) DropTable(ctx context.Context, identifier table.Identifier) error

func (*Catalog) DropView

func (r *Catalog) DropView(ctx context.Context, identifier table.Identifier) error

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) LoadTable

func (r *Catalog) LoadTable(ctx context.Context, identifier table.Identifier) (*table.Table, error)

func (*Catalog) LoadView added in v0.5.0

func (r *Catalog) LoadView(ctx context.Context, identifier table.Identifier) (*view.View, error)

LoadView loads a view from the catalog.

func (*Catalog) Name

func (r *Catalog) Name() string

func (*Catalog) PurgeTable

func (r *Catalog) PurgeTable(ctx context.Context, identifier table.Identifier) error

func (*Catalog) RegisterTable

func (r *Catalog) RegisterTable(ctx context.Context, identifier table.Identifier, metadataLoc string) (*table.Table, error)

func (*Catalog) RenameTable

func (r *Catalog) RenameTable(ctx context.Context, from, to table.Identifier) (*table.Table, error)

func (*Catalog) SetPageSize

func (r *Catalog) SetPageSize(ctx context.Context, sz int) context.Context

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 (r *Catalog) UpdateTable(ctx context.Context, ident table.Identifier, requirements []table.Requirement, updates []table.Update) (*table.Table, error)

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 {
	Token      string
	Credential string

	AuthURI *url.URL
	Scope   string
	Client  *http.Client
}

Oauth2AuthManager is an implementation of the AuthManager interface which simply returns the provided token as a bearer token. If a credential is provided instead of a static token, it will fetch and refresh the token as needed.

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 WithAuthManager added in v0.5.0

func WithAuthManager(authManager AuthManager) Option

func WithAuthURI

func WithAuthURI(uri *url.URL) Option

func WithAwsConfig

func WithAwsConfig(cfg aws.Config) Option

func WithCredential

func WithCredential(cred string) Option

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 WithHeaders(headers map[string]string) Option

func WithMetadataLocation

func WithMetadataLocation(loc string) Option

func WithOAuthToken

func WithOAuthToken(token string) Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithScope

func WithScope(scope string) Option

func WithSigV4

func WithSigV4() Option

func WithSigV4RegionSvc

func WithSigV4RegionSvc(region, service string) Option

func WithTLSConfig

func WithTLSConfig(config *tls.Config) Option

func WithWarehouseLocation

func WithWarehouseLocation(loc string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL