Documentation ¶
Index ¶
- func ErrCode(msg string, err error) error
- type S3Repository
- func (s *S3Repository) Create(ctx context.Context, account, id string, metadata *dataset.Metadata) (*dataset.Metadata, error)
- func (s *S3Repository) Delete(ctx context.Context, account, id string) error
- func (s *S3Repository) Get(ctx context.Context, account, id string) (*dataset.Metadata, error)
- func (s *S3Repository) Promote(ctx context.Context, account, id, user string) (*dataset.Metadata, error)
- func (s *S3Repository) Update(ctx context.Context, account, id string, metadata *dataset.Metadata) (*dataset.Metadata, error)
- type S3RepositoryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
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)