Documentation
¶
Index ¶
- func Delete(ctx context.Context, cli WriteClient, items WriteItemFunc) error
- func Get(ctx context.Context, cli GetClient, getKeys GetKeyFunc, fetch FetchItemFunc) error
- func IsNil(record interface{}) bool
- func IsNotFound(err error) bool
- func Put(ctx context.Context, cli WriteClient, items WriteItemFunc) error
- func Query(ctx context.Context, cli QueryClient, condition QueryConditionFunc, ...) error
- func Scan(ctx context.Context, cli ScanClient, table string, fetch FetchItemsFunc) error
- func Update(ctx context.Context, cli WriteClient, items WriteItemFunc) error
- func UpdateItems(ctx context.Context, fields ...UpdateField) expression.UpdateBuilder
- type FetchItemFunc
- type FetchItemsFunc
- type GetClient
- type GetKeyFunc
- type QueryClient
- type QueryConditionFunc
- type RecordNotFoundException
- type ScanClient
- type UpdateField
- type WriteClient
- type WriteItemFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, cli WriteClient, items WriteItemFunc) error
func Get ¶
func Get(ctx context.Context, cli GetClient, getKeys GetKeyFunc, fetch FetchItemFunc) error
func IsNotFound ¶
func Put ¶
func Put(ctx context.Context, cli WriteClient, items WriteItemFunc) error
func Query ¶ added in v0.0.2
func Query(ctx context.Context, cli QueryClient, condition QueryConditionFunc, fetch FetchItemsFunc, limit ...int32) error
func Scan ¶ added in v0.0.6
func Scan(ctx context.Context, cli ScanClient, table string, fetch FetchItemsFunc) error
func Update ¶
func Update(ctx context.Context, cli WriteClient, items WriteItemFunc) error
func UpdateItems ¶
func UpdateItems(ctx context.Context, fields ...UpdateField) expression.UpdateBuilder
Types ¶
type FetchItemFunc ¶
type FetchItemFunc func(tableName string, value map[string]types.AttributeValue) error
type FetchItemsFunc ¶ added in v0.0.2
type FetchItemsFunc func(tableName string, value []map[string]types.AttributeValue) error
type GetClient ¶
type GetClient interface {
GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
}
type GetKeyFunc ¶
type QueryClient ¶ added in v0.0.2
type QueryClient interface {
Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
}
type QueryConditionFunc ¶ added in v0.0.2
type QueryConditionFunc func() (table, index string, expr expression.Expression, desc bool, err error)
type RecordNotFoundException ¶ added in v0.0.3
type RecordNotFoundException struct{}
var ErrNotFound *RecordNotFoundException
func (*RecordNotFoundException) Error ¶ added in v0.0.3
func (err *RecordNotFoundException) Error() string
type ScanClient ¶ added in v0.0.6
type UpdateField ¶
type UpdateField func(ctx context.Context, builder *expression.UpdateBuilder) expression.UpdateBuilder
type WriteClient ¶
type WriteClient interface { PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error) UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error) }
type WriteItemFunc ¶
type WriteItemFunc func() (table string, item map[string]types.AttributeValue, expr expression.Expression, err error)
Click to show internal directories.
Click to hide internal directories.