Documentation
¶
Overview ¶
Package aws contains an AWS-based storage implementation for Tessera.
TODO: decide whether to rename this package.
This storage implementation uses S3 for long-term storage and serving of entry bundles and log tiles, and MySQL for coordinating updates to AWS when multiple instances of a personality binary are running.
A single S3 bucket is used to hold entry bundles and log internal tiles. The object keys for the bucket are selected so as to conform to the expected layout of a tile-based log.
A MySQL database provides a transactional mechanism to allow multiple frontends to safely update the contents of the log.
Index ¶
Constants ¶
const ( DefaultPushbackMaxOutstanding = 4096 DefaultIntegrationSizeLimit = 5 * 4096 // SchemaCompatibilityVersion represents the expected version (e.g. layout & serialisation) of stored data. // // A binary built with a given version of the Tessera library is compatible with stored data created by a different version // of the library if and only if this value is the same as the compatibilityVersion stored in the Tessera table. // // NOTE: if changing this version, you need to consider whether end-users are going to update their schema instances to be // compatible with the new format, and provide a means to do it if so. SchemaCompatibilityVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
Appender is an implementation of the Tessera appender lifecycle contract.
type Config ¶
type Config struct {
// SDKConfig is an optional AWS config to use when configuring service clients, e.g. to
// use non-AWS S3 or MySQL services.
//
// If nil, the value from config.LoadDefaultConfig() will be used - this is the only
// supported configuration.
SDKConfig *aws.Config
// S3Options is an optional function which can be used to configure the S3 library.
// This is primarily useful when configuring the use of non-AWS S3 or MySQL services.
//
// If nil, the default options will be used - this is the only supported configuration.
S3Options func(*s3.Options)
// Bucket is the name of the S3 bucket to use for storing log state.
Bucket string
// BucketPrefix is an optional prefix to prepend to all log resource paths.
// This can be used e.g. to store multiple logs in the same bucket.
BucketPrefix string
// DSN is the DSN of the MySQL instance to use.
DSN string
// Maximum connections to the MySQL database.
MaxOpenConns int
// Maximum idle database connections in the connection pool.
MaxIdleConns int
// HTTPClient will be used for other HTTP requests. If unset, Tessera will use the net/http DefaultClient.
HTTPClient *http.Client
}
Config holds AWS project and resource configuration for a storage instance.
type MigrationStorage ¶
type MigrationStorage struct {
// contains filtered or unexported fields
}
MigrationStorage implements the tessera.MigrationStorage lifecycle contract.
func (*MigrationStorage) AwaitIntegration ¶
func (*MigrationStorage) IntegratedSize ¶
func (m *MigrationStorage) IntegratedSize(ctx context.Context) (uint64, error)
func (*MigrationStorage) SetEntryBundle ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is an AWS based storage implementation for Tessera.
func (*Storage) Appender ¶
func (s *Storage) Appender(ctx context.Context, opts *tessera.AppendOptions) (*tessera.Appender, tessera.LogReader, error)
Appender creates a new tessera.Appender lifecycle object.
func (*Storage) MigrationWriter ¶
func (s *Storage) MigrationWriter(ctx context.Context, opts *tessera.MigrationOptions) (migrate.MigrationWriter, tessera.LogReader, error)
MigrationWriter creates a new AWS storage for the MigrationWriter lifecycle mode.