Documentation
¶
Index ¶
- func Delete(ctx context.Context, cli WriteClient, items WriteItemFunc, ...) (*dynamodb.DeleteItemOutput, error)
- func Get(ctx context.Context, cli GetClient, getKeys GetKeyFunc, fetch FetchItemFunc, ...) (*dynamodb.GetItemOutput, error)
- func IsNil(record interface{}) bool
- func IsNotFound(err error) bool
- func Put(ctx context.Context, cli WriteClient, items WriteItemFunc, ...) (*dynamodb.PutItemOutput, error)
- func Query(ctx context.Context, cli QueryClient, condition QueryConditionFunc, ...) (*dynamodb.QueryOutput, error)
- func Scan(ctx context.Context, cli ScanClient, condition ScanFilterFunc, ...) (*dynamodb.ScanOutput, error)
- func Update(ctx context.Context, cli WriteClient, items WriteItemFunc, ...) (*dynamodb.UpdateItemOutput, error)
- func UpdateBuilder(ctx context.Context, fields ...UpdateField) expression.UpdateBuilder
- type Client
- type FetchItemFunc
- type FetchItemsFunc
- type GetClient
- type GetItemFunc
- type GetKeyFunc
- type PutItemPreprocessor
- type QueryClient
- type QueryConditionFunc
- type RecordNotFoundException
- type ScanClient
- type ScanFilterFunc
- 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, opt ...options.Option) (*dynamodb.DeleteItemOutput, error)
func Get ¶
func Get(ctx context.Context, cli GetClient, getKeys GetKeyFunc, fetch FetchItemFunc, opt ...options.Option) (*dynamodb.GetItemOutput, error)
func IsNotFound ¶
func Put ¶
func Put(ctx context.Context, cli WriteClient, items WriteItemFunc, opt ...options.Option) (*dynamodb.PutItemOutput, error)
func Query ¶ added in v0.0.2
func Query(ctx context.Context, cli QueryClient, condition QueryConditionFunc, fetch FetchItemsFunc, opt ...options.Option) (*dynamodb.QueryOutput, error)
func Scan ¶ added in v0.0.6
func Scan(ctx context.Context, cli ScanClient, condition ScanFilterFunc, fetch FetchItemsFunc, opt ...options.Option) (*dynamodb.ScanOutput, error)
func Update ¶
func Update(ctx context.Context, cli WriteClient, items WriteItemFunc, opt ...options.Option) (*dynamodb.UpdateItemOutput, error)
func UpdateBuilder ¶ added in v0.1.3
func UpdateBuilder(ctx context.Context, fields ...UpdateField) expression.UpdateBuilder
Types ¶
type Client ¶ added in v0.1.3
type Client interface { GetClient ScanClient QueryClient WriteClient }
type FetchItemFunc ¶
type FetchItemFunc func(tableName string, value map[string]types.AttributeValue) error
func FetchItem ¶ added in v0.1.3
func FetchItem[T any](rec *T) FetchItemFunc
type FetchItemsFunc ¶ added in v0.0.2
type FetchItemsFunc func(tableName string, value []map[string]types.AttributeValue) error
func FetchItems ¶ added in v0.1.3
func FetchItems[T any](rec *T) FetchItemsFunc
type GetClient ¶
type GetClient interface {
GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
}
type GetItemFunc ¶ added in v0.0.9
type GetItemFunc WriteItemFunc
type GetKeyFunc ¶
type PutItemPreprocessor ¶ added in v0.1.3
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, 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 ScanFilterFunc ¶ added in v0.1.3
type ScanFilterFunc func() (table string, expr expression.Expression, err error)
type UpdateField ¶
type UpdateField func(ctx context.Context, builder *expression.UpdateBuilder) expression.UpdateBuilder
func UpdateValue ¶ added in v0.1.3
func UpdateValue(name string, value any) UpdateField
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)
func DeleteItem ¶ added in v0.1.3
func DeleteItem(keyFunc GetKeyFunc) WriteItemFunc
func PutItem ¶ added in v0.1.3
func PutItem(ctx context.Context, tableName string, rec any) WriteItemFunc
func UpdateItem ¶ added in v0.1.3
func UpdateItem(ctx context.Context, keyFunc GetKeyFunc, count int, fields ...UpdateField) WriteItemFunc
Click to show internal directories.
Click to hide internal directories.