s3metadatarepository

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCode

func ErrCode(msg string, err error) error

Types

type S3Repository

type S3Repository struct {
	S3     s3iface.S3API
	Bucket string
	Prefix string
	// contains filtered or unexported fields
}

S3Repository is an implementation of a metadata respository in S3

func New

func New(opts ...S3RepositoryOption) (*S3Repository, error)

New creates an S3Repository from a list of S3RepositoryOption functions

func NewDefaultRepository

func NewDefaultRepository(config map[string]interface{}) (*S3Repository, error)

NewDefaultRepository creates a new repository from the default config data

func (*S3Repository) Create

func (s *S3Repository) Create(ctx context.Context, account, id string, metadata *dataset.Metadata) (*dataset.Metadata, error)

Create creates a new metadata object in the repository

func (*S3Repository) Delete

func (s *S3Repository) Delete(ctx context.Context, account, id string) error

Delete deletes a metadata object from the repository by id

func (*S3Repository) Get

func (s *S3Repository) Get(ctx context.Context, account, id string) (*dataset.Metadata, error)

Get gets a metadata object from the repository by id

func (*S3Repository) Promote added in v0.7.0

func (s *S3Repository) Promote(ctx context.Context, account, id, user string) (*dataset.Metadata, error)

Promote sets the finalized_at time and finalized_by user in the metadata object, as well as derivative=false

func (*S3Repository) Update

func (s *S3Repository) Update(ctx context.Context, account, id string, metadata *dataset.Metadata) (*dataset.Metadata, error)

Update updates a metadata object in the repository

type S3RepositoryOption

type S3RepositoryOption func(*S3Repository)

S3RepositoryOption is a function to set repository options

func WithBucket

func WithBucket(bucket string) S3RepositoryOption

WithBucket sets the bucket for the S3Repository

func WithEndpoint

func WithEndpoint(endpoint string) S3RepositoryOption

WithEndpoint sets the endpoint for the S3Repository

func WithPrefix

func WithPrefix(prefix string) S3RepositoryOption

WithPrefix sets the bucket prefix for the S3Repository

func WithRegion

func WithRegion(region string) S3RepositoryOption

WithRegion sets the region for the S3Repository

func WithStaticCredentials

func WithStaticCredentials(akid, secret, token string) S3RepositoryOption

WithStaticCredentials authenticates with AWS static credentials (key, secret, token)

Jump to

Keyboard shortcuts

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