boltdb

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

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

Archive implements a resource version archive using BoltDB backed by AWS S3.

func New

func New(ctx context.Context, cfg Config, s *settings.Settings) (*Archive, error)

func (*Archive) Close

func (a *Archive) Close(ctx context.Context) error

func (*Archive) History

func (a *Archive) History(ctx context.Context, latest []byte) (history [][]byte, err error)

func (*Archive) Put

func (a *Archive) Put(ctx context.Context, next ...[]byte) error

type Config

type Config struct {
	// The bucket name where the boltdb database file is persisted in between builds
	Bucket string `json:"bucket" validate:"required"`
	// AWS session credentials
	Credentials *Credentials `json:"credentials,omitempty" validate:"omitempty,dive"`
	// A custom S3 endpoint, useful for testing
	Endpoint string `json:"endpoint"`
	// The AWS region where the bucket was created
	Region string `json:"region" validate:"required"`
	// The fully qualified S3 object key used for persisting the database file in
	// between builds
	Key string `json:"key" validate:"required"`
}

Config describes the available resource-specific configuration settings

type Credentials

type Credentials struct {
	// The AWS_ACCESS_KEY_ID value to use for authenticating with S3
	AccessKey string `json:"access_key" validate:"required"`
	// The AWS_SECRET_ACCESS_KEY value to use for authenticating with S3
	SecretKey string `json:"secret_key" validate:"required"`
	// The AWS_SESSION_TOKEN value to use for authenticating with S3
	SessionToken string `json:"session_token"`
}

Credentials describes AWS session credentials used for authenticating with S3

Jump to

Keyboard shortcuts

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