procedure

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Limit added in v0.5.0

func Limit(value int) limitModifier

Limit provides an input modifier for adjusting the number of items returned on a scan or query. Non-positive values are ignored.

func StartKey

func StartKey(item ezddb.Item) startKeyModifier

StartKey creates a new input modifier for adding pagination tokens to scan or query procedure.

func StartToken added in v0.5.0

func StartToken(token string, provider StartKeyProvider) startTokenModifier

StartToken creates a new input modifier for adding pagination tokens to scan or query procedure.

Types

type BatchGet added in v0.5.0

type BatchGet func(context.Context) (*dynamodb.BatchGetItemInput, error)

BatchGet functions generate dynamodb put input data given some context.

func NewBatchGetProcedure added in v0.4.0

func NewBatchGetProcedure() BatchGet

NewBatchGetProcedure creates a new batch get procedure instance.

func (BatchGet) Execute added in v0.5.0

func (b BatchGet) Execute(ctx context.Context,
	getter ezddb.BatchGetter, options ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)

Execute executes the procedure, returning the API result.

func (BatchGet) Invoke added in v0.5.0

Invoke is a wrapper around the function invocation for stylistic purposes.

func (BatchGet) Modify added in v0.5.0

func (b BatchGet) Modify(modifiers ...BatchGetModifier) BatchGet

Modify adds modifying functions to the procedure, transforming the input before it is executed.

type BatchGetModifier

type BatchGetModifier interface {
	// ModifyBatchGetItemInput is invoked when this modifier is applied to the provided input.
	ModifyBatchGetItemInput(context.Context, *dynamodb.BatchGetItemInput) error
}

BatchGetModifier makes modifications to the input before the procedure is executed.

type BatchWrite added in v0.5.0

type BatchWrite func(context.Context) (*dynamodb.BatchWriteItemInput, error)

BatchWrite functions generate dynamodb put input data given some context.

func NewBatchWriteProcedure added in v0.4.0

func NewBatchWriteProcedure() BatchWrite

NewBatchWriteProcedure creates a new batch write procedure instance.

func (BatchWrite) Execute added in v0.5.0

func (b BatchWrite) Execute(ctx context.Context,
	writer ezddb.BatchWriter, options ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)

Execute executes the procedure, returning the API result.

func (BatchWrite) Invoke added in v0.5.0

Invoke is a wrapper around the function invocation for stylistic purposes.

func (BatchWrite) Modify added in v0.5.0

func (b BatchWrite) Modify(modifiers ...BatchWriteModifier) BatchWrite

Modify adds modifying functions to the procedure, transforming the input before it is executed.

type BatchWriteModifier

type BatchWriteModifier interface {
	// ModifyBatchWriteItemInput is invoked when this modifier is applied to the provided input.
	ModifyBatchWriteItemInput(context.Context, *dynamodb.BatchWriteItemInput) error
}

BatchWriteModifier makes modifications to the input before the procedure is executed.

type Delete added in v0.5.0

type Delete func(context.Context) (*dynamodb.DeleteItemInput, error)

Delete functions generate dynamodb put input data given some context.

func (Delete) Execute added in v0.5.0

func (d Delete) Execute(ctx context.Context,
	deleter ezddb.Deleter, options ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)

Execute executes the procedure, returning the API result.

func (Delete) Invoke added in v0.5.0

func (d Delete) Invoke(ctx context.Context) (*dynamodb.DeleteItemInput, error)

Invoke is a wrapper around the function invocation for stylistic purposes.

func (Delete) Modify added in v0.5.0

func (d Delete) Modify(modifiers ...DeleteModifier) Delete

Modify adds modifying functions to the procedure, transforming the input before it is executed.

func (Delete) ModifyBatchWriteItemInput added in v0.5.0

func (d Delete) ModifyBatchWriteItemInput(ctx context.Context, input *dynamodb.BatchWriteItemInput) error

ModifyBatchWriteItemInput implements the BatchWriteModifier interface.

func (Delete) ModifyTransactWriteItemsInput added in v0.5.0

func (d Delete) ModifyTransactWriteItemsInput(ctx context.Context, input *dynamodb.TransactWriteItemsInput) error

ModifyTransactWriteItemsInput implements the TransactWriteModifier interface.

type DeleteModifier

type DeleteModifier interface {
	// ModifyDeleteItemInput is invoked when this modifier is applied to the provided input.
	ModifyDeleteItemInput(context.Context, *dynamodb.DeleteItemInput) error
}

DeleteModifier makes modifications to the input before the procedure is executed.

type DeleteModifierFunc

type DeleteModifierFunc modifier[dynamodb.DeleteItemInput]

DeleteModifierFunc is a function that implements DeleteModifier.

func (DeleteModifierFunc) ModifyDeleteItemInput

func (d DeleteModifierFunc) ModifyDeleteItemInput(ctx context.Context, input *dynamodb.DeleteItemInput) error

type Get added in v0.5.0

Get functions generate dynamodb put input data given some context.

func (Get) Execute added in v0.5.0

func (g Get) Execute(ctx context.Context,
	getter ezddb.Getter, options ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)

Execute executes the procedure, returning the API result.

func (Get) Invoke added in v0.5.0

func (g Get) Invoke(ctx context.Context) (*dynamodb.GetItemInput, error)

Invoke is a wrapper around the function invocation for stylistic purposes.

func (Get) Modify added in v0.5.0

func (p Get) Modify(modifiers ...GetModifier) Get

Modify adds modifying functions to the procedure, transforming the input before it is executed.

func (Get) ModifyBatchGetItemInput added in v0.5.0

func (g Get) ModifyBatchGetItemInput(ctx context.Context, input *dynamodb.BatchGetItemInput) error

ModifyBatchWriteItemInput implements the BatchWriteModifier interface.

func (Get) ModifyTransactGetItemsInput added in v0.5.0

func (g Get) ModifyTransactGetItemsInput(ctx context.Context, input *dynamodb.TransactGetItemsInput) error

ModifyTransactWriteItemsInput implements the TransactWriteModifier interface.

type GetModifier

type GetModifier interface {
	// ModifyGetItemInput is invoked when this modifier is applied to the provided input.
	ModifyGetItemInput(context.Context, *dynamodb.GetItemInput) error
}

GetModifier makes modifications to the input before the procedure is executed.

type GetModifierFunc

type GetModifierFunc modifier[dynamodb.GetItemInput]

GetModifierFunc is a function that implements GetModifier.

func (GetModifierFunc) ModifyGetItemInput

func (g GetModifierFunc) ModifyGetItemInput(ctx context.Context, input *dynamodb.GetItemInput) error

type MultiBatchGet added in v0.5.0

type MultiBatchGet []BatchGet

func (MultiBatchGet) Execute added in v0.5.0

func (m MultiBatchGet) Execute(ctx context.Context,
	writer ezddb.BatchGetter, options ...func(*dynamodb.Options)) ([]*dynamodb.BatchGetItemOutput, error)

func (MultiBatchGet) ExecuteAsync added in v0.5.0

func (m MultiBatchGet) ExecuteAsync(ctx context.Context,
	writer ezddb.BatchGetter, options ...func(*dynamodb.Options)) *MultiBatchGetResult

func (MultiBatchGet) Invoke added in v0.5.0

type MultiBatchGetResult added in v0.5.0

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

func (*MultiBatchGetResult) Wait added in v0.5.0

type MultiBatchWrite added in v0.5.0

type MultiBatchWrite []BatchWrite

func (MultiBatchWrite) Execute added in v0.5.0

func (m MultiBatchWrite) Execute(ctx context.Context,
	writer ezddb.BatchWriter, options ...func(*dynamodb.Options)) ([]*dynamodb.BatchWriteItemOutput, error)

func (MultiBatchWrite) ExecuteAsync added in v0.5.0

func (m MultiBatchWrite) ExecuteAsync(ctx context.Context,
	writer ezddb.BatchWriter, options ...func(*dynamodb.Options)) *MultiBatchWriteResult

func (MultiBatchWrite) Invoke added in v0.5.0

type MultiBatchWriteResult added in v0.5.0

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

func (*MultiBatchWriteResult) Wait added in v0.5.0

type MultiTransactionGet added in v0.5.0

type MultiTransactionGet []TransactionGet

func (MultiTransactionGet) Execute added in v0.5.0

func (MultiTransactionGet) ExecuteAsync added in v0.5.0

func (m MultiTransactionGet) ExecuteAsync(ctx context.Context,
	writer ezddb.TransactionGetter, options ...func(*dynamodb.Options)) *MultiTransactionGetResult

func (MultiTransactionGet) Invoke added in v0.5.0

type MultiTransactionGetResult added in v0.5.0

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

func (*MultiTransactionGetResult) Wait added in v0.5.0

type MultiTransactionWrite added in v0.5.0

type MultiTransactionWrite []TransactionWrite

func (MultiTransactionWrite) Execute added in v0.5.0

func (MultiTransactionWrite) ExecuteAsync added in v0.5.0

func (m MultiTransactionWrite) ExecuteAsync(ctx context.Context,
	writer TransactionWriter, options ...func(*dynamodb.Options)) *MultiTransactionWriteResult

func (MultiTransactionWrite) Invoke added in v0.5.0

type MultiTransactionWriteResult added in v0.5.0

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

func (*MultiTransactionWriteResult) Wait added in v0.5.0

type PageQueryCallback

type PageQueryCallback = func(context.Context, *dynamodb.QueryOutput) bool

PageQueryCallback is invoked each time the stored procedure is executed. The result of the execution is provided for further processing; to halt further page calls, return false.

type PageScanCallback

type PageScanCallback = func(context.Context, *dynamodb.ScanOutput) bool

PageScanCallback is invoked each time the stored procedure is executed. The result of the execution is provided for further processing; to halt further page calls, return false.

type Put added in v0.5.0

Put functions generate dynamodb put input data given some context.

func (Put) Execute added in v0.5.0

func (p Put) Execute(ctx context.Context, putter ezddb.Putter, options ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)

Execute executes the procedure, returning the API result.

func (Put) Invoke added in v0.5.0

func (p Put) Invoke(ctx context.Context) (*dynamodb.PutItemInput, error)

Invoke is a wrapper around the function invocation for stylistic purposes.

func (Put) Modify added in v0.5.0

func (p Put) Modify(modifiers ...PutModifier) Put

Modify adds modifying functions to the procedure, transforming the input before it is executed.

func (Put) ModifyBatchWriteItemInput added in v0.5.0

func (p Put) ModifyBatchWriteItemInput(ctx context.Context, input *dynamodb.BatchWriteItemInput) error

ModifyBatchWriteItemInput implements the BatchWriteModifier interface.

func (Put) ModifyTransactWriteItemsInput added in v0.5.0

func (p Put) ModifyTransactWriteItemsInput(ctx context.Context, input *dynamodb.TransactWriteItemsInput) error

ModifyTransactWriteItemsInput implements the TransactWriteModifier interface.

type PutModifier

type PutModifier interface {
	// ModifyPutItemInput is invoked when this modifier is applied to the provided input.
	ModifyPutItemInput(context.Context, *dynamodb.PutItemInput) error
}

PutModifier makes modifications to the input before the procedure is executed.

type PutModifierFunc

type PutModifierFunc modifier[dynamodb.PutItemInput]

PutModifierFunc is a function that implements PutModifier.

func (PutModifierFunc) ModifyPutItemInput

func (p PutModifierFunc) ModifyPutItemInput(ctx context.Context, input *dynamodb.PutItemInput) error

type Query added in v0.5.0

type Query func(context.Context) (*dynamodb.QueryInput, error)

Query functions generate dynamodb input data given some context.

func (Query) Execute added in v0.5.0

func (p Query) Execute(ctx context.Context,
	querier ezddb.Querier, options ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)

Execute executes the procedure, returning the API result.

func (Query) Invoke added in v0.5.0

func (q Query) Invoke(ctx context.Context) (*dynamodb.QueryInput, error)

Invoke is a wrapper around the function invocation for stylistic purposes.

func (Query) Modify added in v0.5.0

func (p Query) Modify(modifiers ...QueryModifier) Query

Modify adds modifying functions to the procedure, transforming the input before it is executed.

func (Query) WithPagination added in v0.5.0

func (p Query) WithPagination(callback PageQueryCallback) QueryExecutor

WithPagination creates a new procedure that exhastively retrieves items from the database using the initial procedure. Use the callback to access data from each response.

type QueryExecutor

type QueryExecutor func(context.Context, ezddb.Querier, ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)

QueryExecutor functions execute the dynamoDB query items API.

func (QueryExecutor) Execute

func (q QueryExecutor) Execute(ctx context.Context, querier ezddb.Querier, options ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)

Execute invokes the query items API using the provided querier and options.

type QueryModifier

type QueryModifier interface {
	// ModifyQueryInput is invoked when this modifier is applied to the provided input.
	ModifyQueryInput(context.Context, *dynamodb.QueryInput) error
}

QueryModifier makes modifications to the scan input before the procedure is executed.

type QueryModifierFunc

type QueryModifierFunc modifier[dynamodb.QueryInput]

QueryModifierFunc is a function that implements QueryModifier.

func (QueryModifierFunc) ModifyQueryInput

func (q QueryModifierFunc) ModifyQueryInput(ctx context.Context, input *dynamodb.QueryInput) error

type Scan added in v0.5.0

type Scan func(context.Context) (*dynamodb.ScanInput, error)

Scan functions generate dynamodb scan input data given some context.

func (Scan) Execute added in v0.5.0

func (p Scan) Execute(ctx context.Context,
	Scanner ezddb.Scanner, options ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)

Execute executes the procedure, returning the API result.

func (Scan) Invoke added in v0.5.0

func (q Scan) Invoke(ctx context.Context) (*dynamodb.ScanInput, error)

Invoke is a wrapper around the function invocation for stylistic purposes.

func (Scan) Modify added in v0.5.0

func (p Scan) Modify(modifiers ...ScanModifier) Scan

Modify adds modifying functions to the procedure, transforming the input before it is executed.

func (Scan) WithPagination added in v0.5.0

func (p Scan) WithPagination(callback PageScanCallback) ScanExecutor

WithPagination creates a new procedure that exhastively retrieves items from the database using the initial procedure. Use the callback to access data from each response.

type ScanExecutor

type ScanExecutor func(context.Context, ezddb.Scanner, ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)

ScanExecutor functions execute the dynamoDB scan items API.

func (ScanExecutor) Execute

func (s ScanExecutor) Execute(ctx context.Context,
	scanner ezddb.Scanner, options ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)

Execute invokes the scan items API using the provided scanner and options.

type ScanModifier

type ScanModifier interface {
	// ModifyScanInput is invoked when this modifier is applied to the provided input.
	ModifyScanInput(context.Context, *dynamodb.ScanInput) error
}

ScanModifier makes modifications to the scan input before the procedure is executed.

type StartKeyProvider

type StartKeyProvider interface {
	// GetStartKey gets the start key from the provided token.
	GetStartKey(ctx context.Context, token string) (ezddb.Item, error)
}

StartKeyProvider provides a method for converting an opaque token to a start key used in dynamodb pagination.

type StartKeyTokenProvider

type StartKeyTokenProvider interface {
	// GetStartKeyToken gets the opaque token from the provided start key.
	GetStartKeyToken(context.Context, ezddb.Item) (string, error)
}

StartKeyTokenProvider provides a method for converting a dynamodb evaluated start key into an opaque token.

type TransactionGet added in v0.5.0

type TransactionGet func(context.Context) (*dynamodb.TransactGetItemsInput, error)

TransactionGet functions generate dynamodb input data given some context.

func NewTransactionGetProcedure added in v0.4.0

func NewTransactionGetProcedure() TransactionGet

NewTransactionGetProcedure returns a new transaction get procedure instance.

func (TransactionGet) Execute added in v0.5.0

Execute executes the procedure, returning the API result.

func (TransactionGet) Invoke added in v0.5.0

Invoke is a wrapper around the function invocation for stylistic purposes.

func (TransactionGet) Modify added in v0.5.0

func (t TransactionGet) Modify(modifiers ...TransactionGetModifier) TransactionGet

Modify adds modifying functions to the procedure, transforming the input before it is executed.

type TransactionGetModifier

type TransactionGetModifier interface {
	// ModifyTransactGetItemsInput is invoked when this modifier is applied to the provided input.
	ModifyTransactGetItemsInput(context.Context, *dynamodb.TransactGetItemsInput) error
}

TransactionGetModifier makes modifications to the input before the procedure is executed.

type TransactionGetModifierFunc

type TransactionGetModifierFunc modifier[dynamodb.TransactGetItemsInput]

TransactionGetModifierFunc is a function that implements TransactionGetModifier.

func (TransactionGetModifierFunc) ModifyTransactGetItemsInput

func (t TransactionGetModifierFunc) ModifyTransactGetItemsInput(ctx context.Context, input *dynamodb.TransactGetItemsInput) error

type TransactionWrite added in v0.5.0

type TransactionWrite func(context.Context) (*dynamodb.TransactWriteItemsInput, error)

TransactionWrite functions generate dynamodb input data given some context.

func NewTransactionWriteProcedure added in v0.4.0

func NewTransactionWriteProcedure() TransactionWrite

NewTransactionWriteProcedure returns a new transaction write procedure instance.

func (TransactionWrite) Execute added in v0.5.0

Execute executes the procedure, returning the API result.

func (TransactionWrite) Invoke added in v0.5.0

Invoke is a wrapper around the function invocation for stylistic purposes.

func (TransactionWrite) Modify added in v0.5.0

Modify adds modifying functions to the procedure, transforming the input before it is executed.

type TransactionWriteModifier

type TransactionWriteModifier interface {
	// ModifyTransactWriteItemsInput is invoked when this modifier is applied to the provided input.
	ModifyTransactWriteItemsInput(context.Context, *dynamodb.TransactWriteItemsInput) error
}

TransactionWriteModifier makes modifications to the input before the procedure is executed.

type TransactionWriteModifierFunc

type TransactionWriteModifierFunc modifier[dynamodb.TransactWriteItemsInput]

TransactionWriteModifierFunc is a function that implements TransactionWriteModifier.

func (TransactionWriteModifierFunc) ModifyTransactWriteItemsInput

func (t TransactionWriteModifierFunc) ModifyTransactWriteItemsInput(ctx context.Context, input *dynamodb.TransactWriteItemsInput) error

type TransactionWriter

type TransactionWriter interface {
	TransactWriteItems(context.Context,
		*dynamodb.TransactWriteItemsInput, ...func(*dynamodb.Options)) (*dynamodb.TransactWriteItemsOutput, error)
}

TransactionWriter implements the dynamodb Transact Write API.

type Update added in v0.5.0

type Update func(context.Context) (*dynamodb.UpdateItemInput, error)

Update functions generate dynamodb input data given some context.

func (Update) Execute added in v0.5.0

func (u Update) Execute(ctx context.Context,
	Updater ezddb.Updater, options ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)

Execute executes the procedure, returning the API result.

func (Update) Invoke added in v0.5.0

func (u Update) Invoke(ctx context.Context) (*dynamodb.UpdateItemInput, error)

Invoke is a wrapper around the function invocation for stylistic purposes.

func (Update) Modify added in v0.5.0

func (u Update) Modify(modifiers ...UpdateModifier) Update

Modify adds modifying functions to the procedure, transforming the input before it is executed.

func (Update) ModifyTransactWriteItemsInput added in v0.5.0

func (u Update) ModifyTransactWriteItemsInput(ctx context.Context, input *dynamodb.TransactWriteItemsInput) error

ModifyTransactWriteItemsInput implements the TransactWriteModifier interface.

type UpdateModifier

type UpdateModifier interface {
	// ModifyPutItemInput is invoked when this modifier is applied to the provided input.
	ModifyUpdateItemInput(context.Context, *dynamodb.UpdateItemInput) error
}

UpdateModifier makes modifications to the input before the procedure is executed.

type UpdateModifierFunc

type UpdateModifierFunc modifier[dynamodb.UpdateItemInput]

UpdateModifierFunc is a function that implements UpdateModifier.

func (UpdateModifierFunc) ModifyUpdateItemInput

func (u UpdateModifierFunc) ModifyUpdateItemInput(ctx context.Context, input *dynamodb.UpdateItemInput) error

Jump to

Keyboard shortcuts

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