Documentation
¶
Index ¶
- Variables
- func Delete(ctx context.Context, cli WriteClient, items WriteItemFunc, ...) (*dynamodb.DeleteItemOutput, error)
- func EnableErrorWithEmptyList(v bool)
- 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 NotFound(tableName string) *types.ResourceNotFoundException
- 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 ScanAll(ctx context.Context, cli ScanClient, condition ScanFilterFunc, ...) (out *dynamodb.ScanOutput, err error)
- func Setup(ctx context.Context, option ...ConfigOption) (cli *dynamodb.Client, err error)
- func Update(ctx context.Context, cli WriteClient, items WriteItemFunc, ...) (*dynamodb.UpdateItemOutput, error)
- func UpdateBuilder(ctx context.Context, fields ...UpdateField) expression.UpdateBuilder
- func Values[T any](values ...T) (right expression.OperandBuilder, other []expression.OperandBuilder)
- type Client
- type Config
- type ConfigBuilder
- type ConfigOption
- type EnvBuilder
- type EvaluatedKey
- type EvaluatedValue
- type ExpressionFunc
- type FetchItemFunc
- type FetchItemPostprocessor
- type FetchItemsFunc
- type FetchItemsPostprocessor
- type GetClient
- type GetItemFunc
- type GetKeyFunc
- type OptionBuilder
- type PutItemPreprocessor
- type QueryClient
- type QueryConditionFunc
- type Record
- type Records
- type ScanClient
- type ScanFilterFunc
- type UpdateField
- type WriteClient
- type WriteItemFunc
- func ConsistentUpdateItem(ctx context.Context, keyFunc GetKeyFunc, fieldName string, count int, ...) WriteItemFunc
- func DeleteItem(keyFunc GetKeyFunc) WriteItemFunc
- func PutItem(ctx context.Context, tableName string, rec any, f ...ExpressionFunc) WriteItemFunc
- func UpdateItem(ctx context.Context, keyFunc GetKeyFunc, fields ...UpdateField) WriteItemFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound *types.ResourceNotFoundException
Functions ¶
func Delete ¶
func Delete(ctx context.Context, cli WriteClient, items WriteItemFunc, opt ...options.Option) (*dynamodb.DeleteItemOutput, error)
func EnableErrorWithEmptyList ¶ added in v0.1.7
func EnableErrorWithEmptyList(v bool)
EnableErrorWithEmptyList Make the list return an error if it is empty.
func Get ¶
func Get(ctx context.Context, cli GetClient, getKeys GetKeyFunc, fetch FetchItemFunc, opt ...options.Option) (*dynamodb.GetItemOutput, error)
func IsNotFound ¶
func NotFound ¶ added in v0.1.4
func NotFound(tableName string) *types.ResourceNotFoundException
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 ScanAll ¶ added in v0.1.16
func ScanAll(ctx context.Context, cli ScanClient, condition ScanFilterFunc, fetch FetchItemsFunc, opt ...options.Option) (out *dynamodb.ScanOutput, err 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
func Values ¶ added in v0.1.13
func Values[T any](values ...T) (right expression.OperandBuilder, other []expression.OperandBuilder)
Types ¶
type Client ¶ added in v0.1.3
type Client interface { GetClient ScanClient QueryClient WriteClient }
type ConfigBuilder ¶ added in v0.1.11
type ConfigBuilder interface {
Build(ctx context.Context) []ConfigOption
}
type ConfigOption ¶ added in v0.1.17
type ConfigOption func(*Config)
func AwsConfig ¶ added in v0.1.17
func AwsConfig(cfg *aws.Config) ConfigOption
func Debug ¶ added in v0.1.17
func Debug() ConfigOption
func EnabledTracing ¶ added in v0.1.17
func EnabledTracing() ConfigOption
func Endpoint ¶ added in v0.1.17
func Endpoint(endpoint string) ConfigOption
func Local ¶ added in v0.1.17
func Local() ConfigOption
func Profile ¶ added in v0.1.17
func Profile(profile string) ConfigOption
func Region ¶ added in v0.1.17
func Region(region string) ConfigOption
type EnvBuilder ¶ added in v0.1.11
type EnvBuilder struct{}
func (*EnvBuilder) Build ¶ added in v0.1.11
func (b *EnvBuilder) Build(ctx context.Context) (options []ConfigOption)
type EvaluatedKey ¶ added in v0.1.9
type EvaluatedKey map[string]types.AttributeValue
func EvaluatedKeyOf ¶ added in v0.1.9
func EvaluatedKeyOf(key string) (EvaluatedKey, error)
func (EvaluatedKey) String ¶ added in v0.1.9
func (ek EvaluatedKey) String() (string, error)
type EvaluatedValue ¶ added in v0.1.9
type ExpressionFunc ¶ added in v0.1.6
type ExpressionFunc func() (expr expression.Expression, err error)
type FetchItemFunc ¶
type FetchItemPostprocessor ¶ added in v0.1.11
type FetchItemsFunc ¶ added in v0.0.2
func FetchItems ¶ added in v0.1.3
func FetchItems[T any](ctx context.Context, rec *T) FetchItemsFunc
type FetchItemsPostprocessor ¶ added in v0.1.11
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 OptionBuilder ¶ added in v0.1.12
type OptionBuilder struct { Local bool Region string Endpoint string Profile string Debug bool EnabledTracing bool Cfg *aws.Config }
func (*OptionBuilder) Build ¶ added in v0.1.12
func (b *OptionBuilder) Build(ctx context.Context) (options []ConfigOption)
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 Record ¶ added in v0.1.9
type Record map[string]types.AttributeValue
type Records ¶ added in v0.1.9
type Records []map[string]types.AttributeValue
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 AddValue ¶ added in v0.1.17
func AddValue(name string, value any) UpdateField
func DeleteValue ¶ added in v0.1.17
func DeleteValue(name string, value any) UpdateField
func RemoveValue ¶ added in v0.1.17
func RemoveValue(name string) UpdateField
func SetValue ¶ added in v0.1.17
func SetValue(name string, value any) UpdateField
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 ConsistentUpdateItem ¶ added in v0.1.3
func ConsistentUpdateItem(ctx context.Context, keyFunc GetKeyFunc, fieldName string, count int, fields ...UpdateField) WriteItemFunc
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, f ...ExpressionFunc) WriteItemFunc
func UpdateItem ¶ added in v0.1.3
func UpdateItem(ctx context.Context, keyFunc GetKeyFunc, fields ...UpdateField) WriteItemFunc
Click to show internal directories.
Click to hide internal directories.