tagdb

package
v0.1.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	PutMultiple(ctx context.Context, rows []*TagRow) error
	FindByTag(ctx context.Context, tag string) (*TagRow, error)
	FindByDigest(ctx context.Context, digest string) (*TagRow, error)
	GetAll(ctx context.Context) ([]*TagRow, error)
	GetByTagPrefix(ctx context.Context, tagPrefix string) ([]*TagRow, error)
	GetByObjectKey(ctx context.Context, objectKey string) ([]*TagRow, error)
	DeleteMultiple(ctx context.Context, rows []*TagRow) error
}

type ClientImpl

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

func NewClientImpl

func NewClientImpl(cfg aws.Config, tableName string) *ClientImpl

func (*ClientImpl) DeleteMultiple

func (c *ClientImpl) DeleteMultiple(ctx context.Context, rows []*TagRow) error

func (*ClientImpl) FindByDigest

func (c *ClientImpl) FindByDigest(ctx context.Context, digest string) (*TagRow, error)

func (*ClientImpl) FindByTag

func (c *ClientImpl) FindByTag(ctx context.Context, tag string) (*TagRow, error)

func (*ClientImpl) GetAll

func (c *ClientImpl) GetAll(ctx context.Context) ([]*TagRow, error)

func (*ClientImpl) GetByObjectKey

func (c *ClientImpl) GetByObjectKey(ctx context.Context, objectKey string) ([]*TagRow, error)

func (*ClientImpl) GetByTagPrefix

func (c *ClientImpl) GetByTagPrefix(ctx context.Context, tagPrefix string) ([]*TagRow, error)

func (*ClientImpl) PutMultiple

func (c *ClientImpl) PutMultiple(ctx context.Context, rows []*TagRow) error

type DynamoDBTagRow

type DynamoDBTagRow struct {
	Type      string                  `dynamodbav:"type"`       // PK
	Tag       string                  `dynamodbav:"tag"`        // SK, GSI1SK
	ObjectKey string                  `dynamodbav:"object_key"` // GSI1PK
	UpdatedAt attributevalue.UnixTime `dynamodbav:"updated_at"`
}

func (*DynamoDBTagRow) GetKey

func (r *DynamoDBTagRow) GetKey() map[string]types.AttributeValue

func (*DynamoDBTagRow) ToTagRow

func (r *DynamoDBTagRow) ToTagRow() *TagRow

type PutMultipleParam

type PutMultipleParam struct {
	Tags      []string
	ObjectKey string
	UpdatedAt time.Time
}

type TagRow

type TagRow struct {
	Type      string
	Tag       string
	ObjectKey string
	UpdatedAt time.Time
}

func (*TagRow) ToDynamoDBTagRow

func (r *TagRow) ToDynamoDBTagRow() *DynamoDBTagRow

Jump to

Keyboard shortcuts

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