Documentation
¶
Index ¶
- Variables
- type BucketReplicationConfig
- type CreateTableBucketOptions
- type CreateTableOptions
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) CreateNamespace(tableBucketARN string, namespace []string) (*Namespace, error)
- func (b *InMemoryBackend) CreateTable(tableBucketARN string, namespace []string, name, format string, ...) (*Table, error)
- func (b *InMemoryBackend) CreateTableBucket(name string, opts CreateTableBucketOptions) (*TableBucket, error)
- func (b *InMemoryBackend) DeleteNamespace(tableBucketARN string, namespace []string) error
- func (b *InMemoryBackend) DeleteTable(tableBucketARN string, namespace []string, name string) error
- func (b *InMemoryBackend) DeleteTableBucket(bucketARN string) error
- func (b *InMemoryBackend) DeleteTableBucketEncryption(bucketARN string) error
- func (b *InMemoryBackend) DeleteTableBucketMetricsConfiguration(bucketARN string) error
- func (b *InMemoryBackend) DeleteTableBucketPolicy(bucketARN string) error
- func (b *InMemoryBackend) DeleteTableBucketReplication(bucketARN, expectedVersionToken string) error
- func (b *InMemoryBackend) DeleteTablePolicy(tableBucketARN string, namespace []string, name string) error
- func (b *InMemoryBackend) DeleteTableReplication(tableArn, versionToken string) error
- func (b *InMemoryBackend) GetNamespace(tableBucketARN string, namespace []string) (*Namespace, error)
- func (b *InMemoryBackend) GetTable(tableBucketARN string, namespace []string, name string) (*Table, error)
- func (b *InMemoryBackend) GetTableBucket(bucketARN string) (*TableBucket, error)
- func (b *InMemoryBackend) GetTableBucketMaintenanceConfiguration(bucketARN string) (map[string]any, error)
- func (b *InMemoryBackend) GetTableBucketMetricsConfiguration(bucketARN string) (string, bool, error)
- func (b *InMemoryBackend) GetTableBucketPolicy(bucketARN string) (string, error)
- func (b *InMemoryBackend) GetTableBucketReplication(bucketARN string) (*BucketReplicationConfig, error)
- func (b *InMemoryBackend) GetTableByARN(tableArn string) (*Table, error)
- func (b *InMemoryBackend) GetTableEncryption(tableBucketARN string, namespace []string, name string) (map[string]any, error)
- func (b *InMemoryBackend) GetTableMaintenanceConfiguration(tableBucketARN string, namespace []string, name string) (map[string]any, string, error)
- func (b *InMemoryBackend) GetTablePolicy(tableBucketARN string, namespace []string, name string) (string, error)
- func (b *InMemoryBackend) GetTableRecordExpirationConfiguration(tableArn string) (*TableRecordExpiryConfig, error)
- func (b *InMemoryBackend) GetTableReplicationConfig(tableArn string) (*TableReplicationConfig, error)
- func (b *InMemoryBackend) GetTableStorageClass(bucketARN string, namespace []string, name string) (string, error)
- func (b *InMemoryBackend) ListNamespaces(tableBucketARN string, p ListNamespacesParams) (page.Page[*Namespace], error)
- func (b *InMemoryBackend) ListTableBuckets(p ListTableBucketsParams) (page.Page[*TableBucket], error)
- func (b *InMemoryBackend) ListTables(tableBucketARN, namespace string, p ListTablesParams) (page.Page[*Table], error)
- func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)
- func (b *InMemoryBackend) PutTableBucketEncryption(bucketARN string, config map[string]any) error
- func (b *InMemoryBackend) PutTableBucketMaintenanceConfiguration(bucketARN, maintenanceType string, value map[string]any) error
- func (b *InMemoryBackend) PutTableBucketMetricsConfiguration(bucketARN string) error
- func (b *InMemoryBackend) PutTableBucketPolicy(bucketARN, policy string) error
- func (b *InMemoryBackend) PutTableBucketReplication(bucketARN, role string, rules []ReplicationRule, expectedVersionToken string) (*BucketReplicationConfig, error)
- func (b *InMemoryBackend) PutTableBucketStorageClass(bucketARN, storageClass string) error
- func (b *InMemoryBackend) PutTableMaintenanceConfiguration(tableBucketARN string, namespace []string, name, maintenanceType string, ...) error
- func (b *InMemoryBackend) PutTablePolicy(tableBucketARN string, namespace []string, name, policy string) error
- func (b *InMemoryBackend) PutTableRecordExpirationConfiguration(tableArn string, cfg *TableRecordExpiryConfig) error
- func (b *InMemoryBackend) PutTableReplication(tableArn, role string, rules []ReplicationRule, expectedVersionToken string) (*TableReplicationConfig, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RenameTable(tableBucketARN string, namespace []string, ...) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TableARN(bucketName, namespaceName, tableName string) string
- func (b *InMemoryBackend) TableBucketARN(name string) string
- func (b *InMemoryBackend) TagResource(resourceArn string, newTags map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateTableMetadataLocation(tableBucketARN string, namespace []string, ...) (*Table, error)
- func (b *InMemoryBackend) ValidateTableExists(tableArn string) error
- type ListNamespacesParams
- type ListTableBucketsParams
- type ListTablesParams
- type Namespace
- type Provider
- type ReplicationDestination
- type ReplicationRule
- type StorageBackend
- type Table
- type TableBucket
- type TableRecordExpiryConfig
- type TableReplicationConfig
Constants ¶
This section is empty.
Variables ¶
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) // 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) // 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 = awserr.New("InvalidParameter", awserr.ErrInvalidParameter) // 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
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
}
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) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the request.
func (*Handler) ExtractResource ¶
ExtractResource extracts the primary resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported S3 Tables operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for S3 Tables requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches S3 Tables API requests.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend. Handler previously had no Snapshot/Restore of its own even though InMemoryBackend did -- dead wiring: cli.go's generic setupPersistence (which type-asserts the registered service.Registerable, i.e. the Handler, for a Snapshot/Restore pair) never picked S3 Tables up at all, so nothing was ever actually persisted despite the backend supporting it. This delegation (matching the cleanrooms/codecommit pattern) is what wires S3 Tables into persistence for the first time.
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.
func (*InMemoryBackend) DeleteTable ¶
func (b *InMemoryBackend) DeleteTable( tableBucketARN string, namespace []string, name string, ) error
DeleteTable deletes a table by bucket ARN, namespace, and name.
func (*InMemoryBackend) DeleteTableBucket ¶
func (b *InMemoryBackend) DeleteTableBucket(bucketARN string) error
DeleteTableBucket deletes a TableBucket by ARN, cascading to namespaces and tables.
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) 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) 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 ¶
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 ¶
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 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"`
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 ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the S3 Tables service backend and handler.
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 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"`
TableBucketARN string `json:"tableBucketARN"`
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"`
// 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).