Versions in this module Expand all Collapse all v0 v0.5.0 May 24, 2024 Changes in this version + func NewAWSDynamoDBClient(awsConfig aws.Config) *dynamodb.Client + type Delete struct + Result ExecutionResult + func (d *Delete) Execute(ctx context.Context) (ExecutionResult, error) + type DynamoDB struct + NowFunc func() time.Time + TimeMarshalerFunc func(time.Time) any + func NewDynamoDB(conf config.Config, dynamoDBClient *dynamodb.Client) *DynamoDB + func (d *DynamoDB) CreateTable(ctx context.Context, model Model) error + func (d *DynamoDB) CreateTables(ctx context.Context, models ...Model) error + func (d *DynamoDB) Delete(model Model) *Delete + func (d *DynamoDB) DeleteAllTables(ctx context.Context) error + func (d *DynamoDB) DeleteTable(ctx context.Context, model Model) error + func (d *DynamoDB) Get(target Model) *Query + func (d *DynamoDB) Insert(model Model) *InsertOne + func (d *DynamoDB) ListTables(ctx context.Context) ([]string, error) + func (d *DynamoDB) Query(targetSlice any) *Query + func (d *DynamoDB) Update(target Model) *Update + type ExecutionResult struct + ConsumedCapacity *types.ConsumedCapacity + Err error + Metadata middleware.Metadata + type InsertOne struct + Result ExecutionResult + func (i *InsertOne) Execute(ctx context.Context) (ExecutionResult, error) + type Model interface + GetCreateTs func() time.Time + GetPK func() PrimaryKey + GetTableName func() string + SetCreateTs func(time.Time) + SetPK func(PrimaryKey) + type ModelWithUpdateTs interface + GetUpdateTs func() time.Time + GetUpdateTsKey func() string + SetUpdateTs func(time.Time) + type PrimaryKey struct + Hash string + HashKey string + Range any + RangeKey string + type Query struct + AllowScan bool + ExecuteStatementInput dynamodb.ExecuteStatementInput + Result ExecutionResult + WhereArgs []any + WhereClause string + func (q *Query) Execute(ctx context.Context) (ExecutionResult, error) + func (q *Query) Where(where string, args ...any) *Query + func (q *Query) WithAllowScan() *Query + func (q *Query) WithConsistentRead() *Query + func (q *Query) WithPKs(pks ...PrimaryKey) *Query + type Update struct + Result ExecutionResult + func (u *Update) AddToSet(field string, values ...any) *Update + func (u *Update) AppendToList(field string, values ...any) *Update + func (u *Update) Execute(ctx context.Context) (ExecutionResult, error) + func (u *Update) Increment(field string, value any) *Update + func (u *Update) Remove(field string) *Update + func (u *Update) RemoveFromList(field string, idx int) *Update + func (u *Update) RemoveFromSet(field string, values ...any) *Update + func (u *Update) Set(field string, value any) *Update