goety

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 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 DynamoClient

type DynamoClient interface {
	ScanAll(ctx context.Context, input *dynamodb.ScanInput) ([]map[string]types.AttributeValue, error)
	BatchDeleteItems(ctx context.Context, tableName string, keys []map[string]types.AttributeValue) (*dynamodb.BatchWriteItemOutput, error)
}

type Emitter added in v0.0.4

type Emitter interface {
	Publish(msg string)
}

type Service

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

func New

func New(client DynamoClient, logger *slog.Logger, emitter emitter.MessagePublisher, dryRun bool) Service

func (Service) Dump added in v0.0.4

func (s Service) Dump(ctx context.Context, tableName string, path string, attrs ...string) error

Dump all items from the given table. Optionally specify a list of attributes to extract.

Example:

Dump(ctx, "my-table", "path/to/file.json", []string{"attr1", "attr2"})

func (Service) Purge

func (s Service) Purge(ctx context.Context, tableName string, keys TableKeys) error

Purge all items from the given table

Example:

Purge(ctx, "my-table", TableKeys{ PartitionKey: "pk", SortKey: "sk" })

type TableKeys

type TableKeys struct {
	PartitionKey string
	SortKey      string
}

type WriteFile added in v0.0.4

type WriteFile struct {
}

func (*WriteFile) WriteFile added in v0.0.4

func (w *WriteFile) WriteFile(name string, data []byte, perm fs.FileMode) error

WriteFile saves data to a file.

Jump to

Keyboard shortcuts

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