Documentation
¶
Overview ¶
Package s3vectors emulates Amazon S3 Vectors: vector buckets, indexes and exact nearest-neighbour search.
Index ¶
- Variables
- type Bucket
- type Encryption
- 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) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SetKeyChecker(k KeyChecker)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- type Index
- type KeyChecker
- type Provider
- type Vector
- type VectorSet
Constants ¶
This section is empty.
Variables ¶
var ( ErrKmsNotFound = errors.New("kms key not found") ErrKmsDisabled = errors.New("kms key disabled") ErrKmsInvalidState = errors.New("kms key state invalid") ErrKmsInvalidKeyUsage = errors.New("kms key usage invalid") )
The ErrKms* errors are returned by a KeyChecker and surface as the matching Kms*Exception.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
Created time.Time `json:"created"`
Tags map[string]string `json:"tags,omitempty"`
Encryption Encryption `json:"encryption"`
Account string `json:"account"`
Region string `json:"region"`
Name string `json:"name"`
ARN string `json:"arn"`
DefaultIndexMode string `json:"defaultIndexMode"`
Policy string `json:"policy,omitempty"`
}
Bucket is a vector bucket.
type Encryption ¶
type Encryption struct {
SseType string `json:"sseType"`
KmsKeyArn string `json:"kmsKeyArn,omitempty"`
}
Encryption is a bucket or index encryption configuration.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
DefaultRegion string
// contains filtered or unexported fields
}
Handler serves the S3 Vectors REST-JSON API.
func (*Handler) ChaosOperations ¶
ChaosOperations lists the fault-injectable operations.
func (*Handler) ChaosRegions ¶
ChaosRegions lists the regions this handler serves.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase service name for fault rules.
func (*Handler) ExtractOperation ¶
ExtractOperation returns the operation name.
func (*Handler) ExtractResource ¶
ExtractResource returns the tagged resource ARN, when the operation has one.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations lists every implemented operation.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the echo handler.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher matches by SigV4 signing name (or SDK user agent) plus a known path shape.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the S3 Vectors state; one coarse lock guards every table.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates an empty backend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the default account.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default Region.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads a snapshot; an incompatible version is discarded.
func (*InMemoryBackend) SetKeyChecker ¶
func (b *InMemoryBackend) SetKeyChecker(k KeyChecker)
SetKeyChecker wires the KMS lookup behind data-plane operations on KMS-encrypted indexes.
type Index ¶
type Index struct {
Created time.Time `json:"created"`
Tags map[string]string `json:"tags,omitempty"`
Encryption Encryption `json:"encryption"`
Account string `json:"account"`
Region string `json:"region"`
Bucket string `json:"bucket"`
Name string `json:"name"`
ARN string `json:"arn"`
DataType string `json:"dataType"`
DistanceMetric string `json:"distanceMetric"`
Mode string `json:"mode"`
NonFilterable []string `json:"nonFilterable,omitempty"`
Dimension int `json:"dimension"`
}
Index is a vector index inside a bucket.
type KeyChecker ¶
KeyChecker validates a KMS key ARN; it returns one of the ErrKms* errors.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for Amazon S3 Vectors.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init builds the backend and handler.