executor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLock

func WithLock(lock Lock) func(options *Options)

func WithMapFn

func WithMapFn(mapFn func(map[string]types.AttributeValue) (interface{}, error)) func(options *Options)

func WithUnmarhshalToItemMapFn

func WithUnmarhshalToItemMapFn[T any]() func(options *Options)

Types

type DynamodbClient

type DynamodbClient interface {
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
	Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(options *dynamodb.Options)) (*dynamodb.ScanOutput, error)
}

type Executor

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

func NewExecutor

func NewExecutor(client DynamodbClient) *Executor

func (*Executor) Query

func (e *Executor) Query(ctx context.Context, query *dynamodb.QueryInput, optFns ...func(options *Options)) chan interface{}

func (*Executor) Scan

func (e *Executor) Scan(ctx context.Context, query *dynamodb.ScanInput, optFns ...func(options *Options)) chan interface{}

type Lock

type Lock interface {
	Refresh(ctx context.Context) error
}

type Options

type Options struct {
	// MapFn is used to map all returned elements in the executor
	MapFn func(map[string]types.AttributeValue) (interface{}, error)

	// Lock if not nil Lock is refreshed after every call
	// Note there are no guarantees that retrieved data is still locked by the lock
	Lock Lock
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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