Help us shape the future of Go! Take the 2026 Go Developer Survey

s3tables

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 27 Imported by: 0

README

S3 Tables

Parity grade: A · SDK aws-sdk-go-v2/service/s3tables@v1.18.4 · last audited 2026-10-10 (6c5c49416)

Coverage

Metric Value
PARITY entries audited 49 (49 ok)
Feature families 3 (3 ok)
Known gaps none
Deferred items 0
Resource leaks clean

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTableBucketNotFound is returned when a TableBucket does not exist.
	ErrTableBucketNotFound = awserr.New("NotFoundException", awserr.ErrNotFound)
	// ErrTableBucketAlreadyExists is returned when a TableBucket already exists.
	ErrTableBucketAlreadyExists = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrTableBucketNotEmpty is returned when deleting a TableBucket that
	// still contains namespaces.
	ErrTableBucketNotEmpty = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrNamespaceNotFound is returned when a Namespace does not exist.
	ErrNamespaceNotFound = awserr.New("NotFoundException", awserr.ErrNotFound)
	// ErrNamespaceAlreadyExists is returned when a Namespace already exists.
	ErrNamespaceAlreadyExists = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrNamespaceNotEmpty is returned when deleting a Namespace that still
	// contains tables.
	ErrNamespaceNotEmpty = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrTableNotFound is returned when a Table does not exist.
	ErrTableNotFound = awserr.New("NotFoundException", awserr.ErrNotFound)
	// ErrTableAlreadyExists is returned when a Table already exists.
	ErrTableAlreadyExists = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrTableVersionConflict is returned when an optimistic-lock token is stale.
	ErrTableVersionConflict = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrInvalidTableMetadataLocation is returned when an Iceberg metadata URI is invalid.
	ErrInvalidTableMetadataLocation = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
	// ErrNilAppContext is returned when a nil AppContext is passed to Init.
	ErrNilAppContext = errors.New("AppContext is required")
	// ErrInvalidContinuationToken is returned when a list operation's
	// continuation token is malformed.
	ErrInvalidContinuationToken = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
	// ErrInvalidBucketName is returned when a table bucket name violates
	// real S3 Tables naming rules (see validation.go).
	ErrInvalidBucketName = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
	// ErrInvalidName is returned when a namespace or table name violates
	// real S3 Tables naming rules (see validation.go).
	ErrInvalidName = awserr.New("BadRequestException", awserr.ErrInvalidParameter)
)

Functions

This section is empty.

Types

type BucketReplicationConfig

type BucketReplicationConfig struct {
	TableBucketARN string            `json:"-"`
	Role           string            `json:"role"`
	VersionToken   string            `json:"versionToken"`
	Rules          []ReplicationRule `json:"rules"`
}

BucketReplicationConfig holds replication configuration for a table bucket, mirroring types.TableBucketReplicationConfiguration (role + rules) plus a VersionToken for optimistic concurrency: PutTableBucketReplication and DeleteTableBucketReplication both accept an optional versionToken query parameter that, when supplied, must match the stored token (GetTableBucketReplicationOutput.VersionToken).

type CreateTableBucketOptions

type CreateTableBucketOptions struct {
	Encryption   map[string]any
	Tags         map[string]string
	StorageClass string
}

CreateTableBucketOptions holds the optional settings a caller may supply at CreateTableBucket time (encryptionConfiguration, storageClassConfiguration, tags on the wire request) in addition to the required name.

type CreateTableOptions

type CreateTableOptions struct {
	Encryption   map[string]any
	Metadata     map[string]any
	Tags         map[string]string
	StorageClass string
}

CreateTableOptions holds the optional settings a caller may supply at CreateTable time (encryptionConfiguration, storageClassConfiguration, tags on the wire request) in addition to the required name/format.

type Handler

type Handler struct {
	Backend   *InMemoryBackend
	AccountID string
	Region    string
	// contains filtered or unexported fields
}

Handler is the HTTP handler for the AWS S3 Tables API.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a new S3 Tables handler.

func (*Handler) BackendFor

func (h *Handler) BackendFor(region string) *InMemoryBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this handler handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the operation name from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the primary resource identifier from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported S3 Tables operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler serves each request from the handler of its region.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) RegionBackends

func (h *Handler) RegionBackends() []*InMemoryBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches S3 Tables API requests.

func (*Handler) SetMetadataWriter

func (h *Handler) SetMetadataWriter(w MetadataWriter)

SetMetadataWriter wires the S3 hook used to materialize a new table's initial Iceberg metadata.json.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable; other regions ride in an additive "regions" key.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend is an in-memory store for S3 Tables resources.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory S3 Tables backend.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID for this backend.

func (*InMemoryBackend) CreateNamespace

func (b *InMemoryBackend) CreateNamespace(
	tableBucketARN string,
	namespace []string,
) (*Namespace, error)

CreateNamespace creates a new namespace within a table bucket.

func (*InMemoryBackend) CreateTable

func (b *InMemoryBackend) CreateTable(
	tableBucketARN string,
	namespace []string,
	name, format string,
	opts CreateTableOptions,
) (*Table, error)

CreateTable creates a new table within a namespace.

func (*InMemoryBackend) CreateTableBucket

func (b *InMemoryBackend) CreateTableBucket(
	name string,
	opts CreateTableBucketOptions,
) (*TableBucket, error)

CreateTableBucket creates a new TableBucket.

func (*InMemoryBackend) DeleteNamespace

func (b *InMemoryBackend) DeleteNamespace(tableBucketARN string, namespace []string) error

DeleteNamespace deletes a namespace from a table bucket. Real S3 Tables requires the namespace to contain no tables first ("Before you delete a table namespace ... you must delete all tables within the namespace, or move them under another namespace" -- AWS docs, s3-tables-namespace-delete.html); a namespace that still has tables returns ErrNamespaceNotEmpty.

func (*InMemoryBackend) DeleteTable

func (b *InMemoryBackend) DeleteTable(
	tableBucketARN string,
	namespace []string,
	name, versionToken string,
) error

DeleteTable deletes a table by bucket ARN, namespace, and name. When versionToken is non-empty it must match the table's currently stored VersionToken (optimistic concurrency, mirroring DeleteTableInput's optional versionToken query parameter); a mismatch returns ErrTableVersionConflict.

func (*InMemoryBackend) DeleteTableBucket

func (b *InMemoryBackend) DeleteTableBucket(bucketARN string) error

DeleteTableBucket deletes a TableBucket by ARN. Real S3 Tables requires the bucket to contain no namespaces (transitively, no tables, since a namespace can't be deleted while it has tables) first ("Before you delete a table bucket, you must first delete all namespaces and tables within the bucket" -- AWS docs, s3-tables-buckets-delete.html); a non-empty bucket returns ErrTableBucketNotEmpty.

func (*InMemoryBackend) DeleteTableBucketEncryption

func (b *InMemoryBackend) DeleteTableBucketEncryption(bucketARN string) error

DeleteTableBucketEncryption clears the encryption configuration for a bucket, reverting GetTableBucketEncryption to the AWS default (no configuration set).

func (*InMemoryBackend) DeleteTableBucketMetricsConfiguration

func (b *InMemoryBackend) DeleteTableBucketMetricsConfiguration(bucketARN string) error

DeleteTableBucketMetricsConfiguration clears the metrics configuration for a bucket, reverting GetTableBucketMetricsConfiguration to the unconfigured state.

func (*InMemoryBackend) DeleteTableBucketPolicy

func (b *InMemoryBackend) DeleteTableBucketPolicy(bucketARN string) error

DeleteTableBucketPolicy removes the resource policy from a bucket.

func (*InMemoryBackend) DeleteTableBucketReplication

func (b *InMemoryBackend) DeleteTableBucketReplication(bucketARN, expectedVersionToken string) error

DeleteTableBucketReplication removes the replication config for a table bucket. When expectedVersionToken is non-empty it must match the stored VersionToken (mirroring DeleteTableBucketReplicationInput's optional versionToken query parameter); a mismatch returns ErrTableVersionConflict.

func (*InMemoryBackend) DeleteTablePolicy

func (b *InMemoryBackend) DeleteTablePolicy(
	tableBucketARN string,
	namespace []string,
	name string,
) error

DeleteTablePolicy removes the resource policy from a table.

func (*InMemoryBackend) DeleteTableReplication

func (b *InMemoryBackend) DeleteTableReplication(tableArn, versionToken string) error

DeleteTableReplication removes the replication configuration for a table. versionToken must match the stored VersionToken (mirroring DeleteTableReplicationInput, where versionToken is a required field); a mismatch returns ErrTableVersionConflict.

func (*InMemoryBackend) GetNamespace

func (b *InMemoryBackend) GetNamespace(
	tableBucketARN string,
	namespace []string,
) (*Namespace, error)

GetNamespace returns a namespace by bucket ARN and namespace name.

func (*InMemoryBackend) GetTable

func (b *InMemoryBackend) GetTable(
	tableBucketARN string,
	namespace []string,
	name string,
) (*Table, error)

GetTable returns a table by bucket ARN, namespace, and name.

func (*InMemoryBackend) GetTableBucket

func (b *InMemoryBackend) GetTableBucket(bucketARN string) (*TableBucket, error)

GetTableBucket returns a TableBucket by ARN.

func (*InMemoryBackend) GetTableBucketMaintenanceConfiguration

func (b *InMemoryBackend) GetTableBucketMaintenanceConfiguration(
	bucketARN string,
) (map[string]any, error)

GetTableBucketMaintenanceConfiguration returns the maintenance config for a bucket.

func (*InMemoryBackend) GetTableBucketMetricsConfiguration

func (b *InMemoryBackend) GetTableBucketMetricsConfiguration(
	bucketARN string,
) (string, bool, error)

GetTableBucketMetricsConfiguration returns the metrics configuration ID for a bucket. The second return value is false when no metrics configuration has ever been put for the bucket.

func (*InMemoryBackend) GetTableBucketPolicy

func (b *InMemoryBackend) GetTableBucketPolicy(bucketARN string) (string, error)

GetTableBucketPolicy returns the resource policy for a bucket.

func (*InMemoryBackend) GetTableBucketReplication

func (b *InMemoryBackend) GetTableBucketReplication(
	bucketARN string,
) (*BucketReplicationConfig, error)

GetTableBucketReplication returns the replication config for a table bucket.

func (*InMemoryBackend) GetTableByARN

func (b *InMemoryBackend) GetTableByARN(tableArn string) (*Table, error)

GetTableByARN returns a table by its ARN directly, without needing the caller to know its bucket/namespace/name. Real GetTable accepts either tableArn alone or the tableBucketARN+namespace+name triple (see GetTableInput's optional TableArn field) -- this backs the former.

func (*InMemoryBackend) GetTableEncryption

func (b *InMemoryBackend) GetTableEncryption(
	tableBucketARN string,
	namespace []string,
	name string,
) (map[string]any, error)

GetTableEncryption returns the effective encryption configuration for a table: the table's own override if CreateTable set one, else the owning bucket's configuration, else the AWS default (SSE-S3/AES256). There is no PutTableEncryption operation for individual tables in the real API, so GetTableEncryption never returns NotFound the way GetTableBucketEncryption can -- every table has an effective encryption configuration.

func (*InMemoryBackend) GetTableMaintenanceConfiguration

func (b *InMemoryBackend) GetTableMaintenanceConfiguration(
	tableBucketARN string,
	namespace []string,
	name string,
) (map[string]any, string, error)

GetTableMaintenanceConfiguration returns the maintenance config for a table.

func (*InMemoryBackend) GetTablePolicy

func (b *InMemoryBackend) GetTablePolicy(
	tableBucketARN string,
	namespace []string,
	name string,
) (string, error)

GetTablePolicy returns the resource policy for a table.

func (*InMemoryBackend) GetTableRecordExpirationConfiguration

func (b *InMemoryBackend) GetTableRecordExpirationConfiguration(
	tableArn string,
) (*TableRecordExpiryConfig, error)

GetTableRecordExpirationConfiguration returns record expiry config for a table, defaulting to the "disabled" TableRecordExpirationStatus wire value when no configuration has been set.

func (*InMemoryBackend) GetTableReplicationConfig

func (b *InMemoryBackend) GetTableReplicationConfig(tableArn string) (*TableReplicationConfig, error)

GetTableReplicationConfig returns the replication config for a table.

func (*InMemoryBackend) GetTableStorageClass

func (b *InMemoryBackend) GetTableStorageClass(
	bucketARN string,
	namespace []string,
	name string,
) (string, error)

GetTableStorageClass returns the storage class for a table.

func (*InMemoryBackend) ListNamespaces

func (b *InMemoryBackend) ListNamespaces(
	tableBucketARN string,
	p ListNamespacesParams,
) (page.Page[*Namespace], error)

ListNamespaces returns all namespaces in a table bucket sorted by name.

func (*InMemoryBackend) ListTableBuckets

func (b *InMemoryBackend) ListTableBuckets(
	p ListTableBucketsParams,
) (page.Page[*TableBucket], error)

ListTableBuckets returns all TableBuckets sorted by name.

func (*InMemoryBackend) ListTables

func (b *InMemoryBackend) ListTables(
	tableBucketARN, namespace string,
	p ListTablesParams,
) (page.Page[*Table], error)

ListTables returns all tables in a table bucket, optionally filtered by namespace.

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)

ListTagsForResource returns all tags for a resource.

func (*InMemoryBackend) PutTableBucketEncryption

func (b *InMemoryBackend) PutTableBucketEncryption(bucketARN string, config map[string]any) error

PutTableBucketEncryption sets encryption config for a bucket.

func (*InMemoryBackend) PutTableBucketMaintenanceConfiguration

func (b *InMemoryBackend) PutTableBucketMaintenanceConfiguration(
	bucketARN, maintenanceType string,
	value map[string]any,
) error

PutTableBucketMaintenanceConfiguration sets maintenance config for a bucket.

func (*InMemoryBackend) PutTableBucketMetricsConfiguration

func (b *InMemoryBackend) PutTableBucketMetricsConfiguration(bucketARN string) error

PutTableBucketMetricsConfiguration enables metrics for a bucket, assigning it a unique metrics configuration ID.

func (*InMemoryBackend) PutTableBucketPolicy

func (b *InMemoryBackend) PutTableBucketPolicy(bucketARN, policy string) error

PutTableBucketPolicy sets the resource policy for a bucket.

func (*InMemoryBackend) PutTableBucketReplication

func (b *InMemoryBackend) PutTableBucketReplication(
	bucketARN, role string,
	rules []ReplicationRule,
	expectedVersionToken string,
) (*BucketReplicationConfig, error)

PutTableBucketReplication sets the replication configuration for a table bucket. When expectedVersionToken is non-empty it must match the bucket's currently stored VersionToken (optimistic concurrency, mirroring PutTableBucketReplicationInput's optional versionToken query parameter); a mismatch, or a token supplied when no configuration yet exists, returns ErrTableVersionConflict. Returns the stored config (with a freshly minted VersionToken) so the caller can build the {status, versionToken} response PutTableBucketReplicationOutput requires.

func (*InMemoryBackend) PutTableBucketStorageClass

func (b *InMemoryBackend) PutTableBucketStorageClass(bucketARN, storageClass string) error

PutTableBucketStorageClass sets storage class for a bucket.

func (*InMemoryBackend) PutTableMaintenanceConfiguration

func (b *InMemoryBackend) PutTableMaintenanceConfiguration(
	tableBucketARN string,
	namespace []string,
	name, maintenanceType string,
	value map[string]any,
) error

PutTableMaintenanceConfiguration sets maintenance config for a table.

func (*InMemoryBackend) PutTablePolicy

func (b *InMemoryBackend) PutTablePolicy(
	tableBucketARN string,
	namespace []string,
	name, policy string,
) error

PutTablePolicy sets the resource policy for a table.

func (*InMemoryBackend) PutTableRecordExpirationConfiguration

func (b *InMemoryBackend) PutTableRecordExpirationConfiguration(
	tableArn string,
	cfg *TableRecordExpiryConfig,
) error

PutTableRecordExpirationConfiguration sets record expiration config for a table.

func (*InMemoryBackend) PutTableReplication

func (b *InMemoryBackend) PutTableReplication(
	tableArn, role string,
	rules []ReplicationRule,
	expectedVersionToken string,
) (*TableReplicationConfig, error)

PutTableReplication sets the replication configuration for a table. When expectedVersionToken is non-empty it must match the table's currently stored VersionToken (optimistic concurrency, mirroring PutTableReplicationInput's optional versionToken query parameter); a mismatch, or a token supplied when no configuration yet exists, returns ErrTableVersionConflict. Returns the stored config (with a freshly minted VersionToken) so the caller can build the {status, versionToken} response PutTableReplicationOutput requires.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) RenameTable

func (b *InMemoryBackend) RenameTable(
	tableBucketARN string,
	namespace []string,
	name, newNamespace, newName, versionToken string,
) error

RenameTable renames a table or moves it to a different namespace.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) TableARN

func (b *InMemoryBackend) TableARN(bucketName, namespaceName, tableName string) string

TableARN builds an ARN for a Table.

func (*InMemoryBackend) TableBucketARN

func (b *InMemoryBackend) TableBucketARN(name string) string

TableBucketARN builds an ARN for a TableBucket.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, newTags map[string]string) error

TagResource adds or updates tags on a resource (bucket or table ARN).

func (*InMemoryBackend) TaggedResources added in v1.3.1

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every S3 Tables bucket or table ARN that currently has at least one tag applied via TagResource.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateTableMetadataLocation

func (b *InMemoryBackend) UpdateTableMetadataLocation(
	tableBucketARN string,
	namespace []string,
	name, metadataLocation, versionToken string,
) (*Table, error)

UpdateTableMetadataLocation updates the metadata location of a table.

func (*InMemoryBackend) ValidateTableExists

func (b *InMemoryBackend) ValidateTableExists(tableArn string) error

ValidateTableExists checks that a table ARN exists in the backend.

type ListNamespacesParams

type ListNamespacesParams struct {
	Prefix            string
	ContinuationToken string
	MaxNamespaces     int
}

ListNamespacesParams holds the filter and pagination inputs for ListNamespaces, mirroring ListNamespacesInput's prefix/continuationToken/ maxNamespaces fields.

type ListTableBucketsParams

type ListTableBucketsParams struct {
	Prefix            string
	Type              string
	ContinuationToken string
	MaxBuckets        int
}

ListTableBucketsParams holds the filter and pagination inputs for ListTableBuckets, mirroring ListTableBucketsInput's prefix/type/ continuationToken/maxBuckets fields.

type ListTablesParams

type ListTablesParams struct {
	Prefix            string
	ContinuationToken string
	MaxTables         int
}

ListTablesParams holds the filter and pagination inputs for ListTables, mirroring ListTablesInput's prefix/continuationToken/maxTables fields (namespace remains its own positional parameter above since ListTables already took it before this pagination sweep, and existing callers key off that signature).

type MetadataWriter

type MetadataWriter interface {
	WriteWarehouseObject(ctx context.Context, region, bucket, key string, body []byte) error
}

MetadataWriter stores an object in the S3 bucket backing a table warehouse.

type Namespace

type Namespace struct {
	CreatedAt      time.Time `json:"createdAt"`
	TableBucketARN string    `json:"tableBucketARN"`
	OwnerAccountID string    `json:"ownerAccountID"`
	CreatedBy      string    `json:"createdBy"`
	Policy         string    `json:"policy"`
	NamespaceID    string    `json:"namespaceID"`
	// TableBucketID is the owning bucket's system-assigned ID (TableBucket.BucketID
	// at CreateNamespace time), the real GetNamespaceOutput/NamespaceSummary
	// "tableBucketId" member -- GetNamespaceOutput has no tableBucketARN
	// member at all (gopherstack-wla0).
	TableBucketID string   `json:"tableBucketID"`
	Namespace     []string `json:"namespace"`
}

Namespace represents an S3 Tables namespace.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS S3 Tables.

func (*Provider) Init

Init initializes the S3 Tables service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ReplicationDestination

type ReplicationDestination struct {
	DestinationTableBucketARN string `json:"destinationTableBucketARN"`
}

ReplicationDestination is a single replication destination, mirroring types.ReplicationDestination in aws-sdk-go-v2/service/s3tables. The wire field is destinationTableBucketARN -- NOT destinationBucketARN, which was a gopherstack-invented field name never present on the real shape (confirmed via deserializeDocumentReplicationDestination in aws-sdk-go-v2/service/s3tables's deserializers.go).

type ReplicationRule added in v1.2.0

type ReplicationRule struct {
	Destinations []ReplicationDestination `json:"destinations"`
}

ReplicationRule is a single replication rule (a list of destinations). TableBucketReplicationConfiguration and TableReplicationConfiguration both nest their destinations one level deeper than gopherstack previously modeled -- rules: [{destinations: [...]}], not a flat destinations array -- confirmed via deserializeDocumentTableBucketReplicationRule / deserializeDocumentTableReplicationRule in the real SDK's deserializers.go.

type StorageBackend

type StorageBackend interface {
	// TableBucket operations
	TableBucketARN(name string) string
	TableARN(bucketName, namespaceName, tableName string) string
	Region() string
	AccountID() string
	CreateTableBucket(name string, opts CreateTableBucketOptions) (*TableBucket, error)
	GetTableBucket(bucketARN string) (*TableBucket, error)
	DeleteTableBucket(bucketARN string) error
	ListTableBuckets(p ListTableBucketsParams) (page.Page[*TableBucket], error)
	GetTableBucketMaintenanceConfiguration(bucketARN string) (map[string]any, error)
	PutTableBucketMaintenanceConfiguration(bucketARN, maintenanceType string, value map[string]any) error
	GetTableBucketPolicy(bucketARN string) (string, error)
	PutTableBucketPolicy(bucketARN, policy string) error
	DeleteTableBucketPolicy(bucketARN string) error

	DeleteTableBucketEncryption(bucketARN string) error

	// BucketReplication operations
	PutTableBucketReplication(
		bucketARN, role string,
		rules []ReplicationRule,
		expectedVersionToken string,
	) (*BucketReplicationConfig, error)
	GetTableBucketReplication(bucketARN string) (*BucketReplicationConfig, error)
	DeleteTableBucketReplication(bucketARN, expectedVersionToken string) error

	// TableReplication operations
	PutTableReplication(
		tableArn, role string,
		rules []ReplicationRule,
		expectedVersionToken string,
	) (*TableReplicationConfig, error)
	GetTableReplicationConfig(tableArn string) (*TableReplicationConfig, error)
	DeleteTableReplication(tableArn, versionToken string) error

	// TableRecordExpiry operations
	PutTableRecordExpirationConfiguration(tableArn string, cfg *TableRecordExpiryConfig) error
	GetTableRecordExpirationConfiguration(tableArn string) (*TableRecordExpiryConfig, error)

	// Namespace operations
	CreateNamespace(tableBucketARN string, namespace []string) (*Namespace, error)
	GetNamespace(tableBucketARN string, namespace []string) (*Namespace, error)
	DeleteNamespace(tableBucketARN string, namespace []string) error
	ListNamespaces(tableBucketARN string, p ListNamespacesParams) (page.Page[*Namespace], error)

	// Table operations
	CreateTable(tableBucketARN string, namespace []string, name, format string, opts CreateTableOptions) (*Table, error)
	GetTable(tableBucketARN string, namespace []string, name string) (*Table, error)
	GetTableByARN(tableArn string) (*Table, error)
	GetTableEncryption(tableBucketARN string, namespace []string, name string) (map[string]any, error)
	DeleteTable(tableBucketARN string, namespace []string, name, versionToken string) error
	ListTables(tableBucketARN, namespace string, p ListTablesParams) (page.Page[*Table], error)
	RenameTable(tableBucketARN string, namespace []string, name, newNamespace, newName, versionToken string) error
	UpdateTableMetadataLocation(
		tableBucketARN string,
		namespace []string,
		name, metadataLocation, versionToken string,
	) (*Table, error)
	GetTableMaintenanceConfiguration(
		tableBucketARN string,
		namespace []string,
		name string,
	) (map[string]any, string, error)
	PutTableMaintenanceConfiguration(
		tableBucketARN string,
		namespace []string,
		name, maintenanceType string,
		value map[string]any,
	) error
	GetTablePolicy(tableBucketARN string, namespace []string, name string) (string, error)
	PutTablePolicy(tableBucketARN string, namespace []string, name, policy string) error
	DeleteTablePolicy(tableBucketARN string, namespace []string, name string) error

	// Lifecycle
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend defines the interface for S3 Tables backend implementations. All mutating methods must be safe for concurrent use.

type Table

type Table struct {
	CreatedAt                time.Time      `json:"createdAt"`
	ModifiedAt               time.Time      `json:"modifiedAt"`
	MaintenanceConfiguration map[string]any `json:"maintenanceConfiguration"`
	// Encryption is the table-level encryption override set at CreateTable
	// time. When nil, the table has no override and GetTableEncryption
	// falls back to the owning bucket's configuration, then to the AWS
	// default (SSE-S3/AES256) -- see GetTableEncryption. There is no
	// separate PutTableEncryption SDK operation; this can only be set at
	// creation.
	Encryption map[string]any `json:"encryption"`
	// Metadata is the Iceberg metadata supplied at CreateTable time (schema, partition spec,
	// write order, properties).
	Metadata       map[string]any `json:"metadata,omitempty"`
	TableBucketARN string         `json:"tableBucketARN"`
	// TableBucketID is the owning bucket's system-assigned ID (TableBucket.BucketID
	// at CreateTable time), the real GetTableOutput/TableSummary "tableBucketId"
	// member -- neither shape has a tableBucketARN member (gopherstack-wla0).
	TableBucketID     string   `json:"tableBucketID"`
	Format            string   `json:"format"`
	VersionToken      string   `json:"versionToken"`
	MetadataLocation  string   `json:"metadataLocation"`
	WarehouseLocation string   `json:"warehouseLocation"`
	ARN               string   `json:"arn"`
	OwnerAccountID    string   `json:"ownerAccountID"`
	Policy            string   `json:"policy"`
	Name              string   `json:"name"`
	StorageClass      string   `json:"storageClass"`
	Namespace         []string `json:"namespace"`
}

Table represents an S3 Tables table.

type TableBucket

type TableBucket struct {
	CreatedAt                time.Time      `json:"createdAt"`
	MaintenanceConfiguration map[string]any `json:"maintenanceConfiguration"`
	Encryption               map[string]any `json:"encryption"`
	ARN                      string         `json:"arn"`
	Name                     string         `json:"name"`
	OwnerAccountID           string         `json:"ownerAccountID"`
	Policy                   string         `json:"policy"`
	StorageClass             string         `json:"storageClass"`
	// BucketID is the system-assigned unique identifier AWS returns as
	// "tableBucketId" on GetTableBucket/ListTableBuckets and, transitively,
	// on every Namespace/Table nested under this bucket (see
	// Namespace.TableBucketID/Table.TableBucketID) -- distinct from ARN,
	// confirmed via GetTableBucketOutput.TableBucketId in
	// aws-sdk-go-v2/service/s3tables (gopherstack-wla0).
	BucketID string `json:"bucketID"`
	// MetricsConfigurationID is the unique identifier AWS assigns to a table
	// bucket's metrics configuration once PutTableBucketMetricsConfiguration
	// has been called. It is cleared by DeleteTableBucketMetricsConfiguration.
	MetricsConfigurationID string `json:"metricsConfigurationID,omitempty"`
	MetricsEnabled         bool   `json:"metricsEnabled"`
}

TableBucket represents an S3 Tables table bucket.

type TableRecordExpiryConfig

type TableRecordExpiryConfig struct {
	Status   string `json:"status"`
	TableARN string `json:"-"`
	Days     int    `json:"days,omitempty"`
}

TableRecordExpiryConfig holds record expiration configuration for a table, mirroring types.TableRecordExpirationConfigurationValue (status + settings.days) in aws-sdk-go-v2/service/s3tables. Status is the real smithy enum's lowercase wire value ("enabled"/"disabled" -- types.TableRecordExpirationStatus -- NOT "ENABLED"/"DISABLED", which does not match any TableRecordExpirationStatus.Values() entry).

type TableReplicationConfig added in v1.2.0

type TableReplicationConfig struct {
	TableARN     string            `json:"-"`
	Role         string            `json:"role"`
	VersionToken string            `json:"versionToken"`
	Rules        []ReplicationRule `json:"rules"`
}

TableReplicationConfig holds replication configuration for an individual table, mirroring types.TableReplicationConfiguration (role + rules) plus a VersionToken for optimistic concurrency: PutTableReplication accepts an optional versionToken query parameter and DeleteTableReplication requires one; both must match the stored token when supplied (GetTableReplicationOutput.VersionToken).

type TaggedEntry added in v1.3.1

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tags.

Jump to

Keyboard shortcuts

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