goety

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 12 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) error

Dump all items from the given table

Example:

Dump(ctx, "my-table", "path/to/file.json")

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