Documentation ¶
Overview ¶
package dy is a set of utility for DynamoDb to be able to work in a multiaccount environment
Index ¶
- Constants
- func DeserializeKey(key string) (map[string]*dynamodb.AttributeValue, error)
- func DynamoDbInstance() *dynamodb.DynamoDB
- func SerializeKey(data map[string]*dynamodb.AttributeValue) (string, error)
- func StdDFWrapperAccountModel(skPrefix string, da map[string]DynamicAttrFunc)
- func StdDFWrapperAccountUserModel(pkPrefix string, skPrefix string, da map[string]DynamicAttrFunc)
- func StdDFWrapperSharedModel(pkPrefix string, skPrefix string, da map[string]DynamicAttrFunc)
- func StdDFWrapperUserModel(pkPrefix string, skPrefix string, da map[string]DynamicAttrFunc)
- func TableNameWithEnv(tableName string) string
- type Db
- func (r *Db) Create(ctx context.Context, id t.String, data interface{}) error
- func (r *Db) CursorList(ctx context.Context, startAtKey string, limit int64, out interface{}) (*db.CursorListResult, error)
- func (r *Db) Delete(ctx context.Context, id t.String, out interface{}) error
- func (r *Db) Get(ctx context.Context, id t.String, out interface{}) error
- func (r *Db) GetEntityDescriptor(data interface{}) (*EntityDescriptor, error)
- func (r *Db) InternalCursorList(ctx context.Context, input *dynamodb.QueryInput, startAtKey string, ...) (*db.CursorListResult, error)
- func (r *Db) MarshalMap(c context.Context, id t.String, data interface{}) (map[string]*dynamodb.AttributeValue, error)
- func (r *Db) Update(ctx context.Context, id t.String, data interface{}) error
- type DynamicAttrFunc
- type DynamoSaasModel
- type EntityDescriptor
- type IDBuilderFunc
- type Index
Constants ¶
View Source
const (
EntityMappingError errors.TraceableType = "EntityMappingError"
)
View Source
const MarshalingError errors.TraceableType = "MarshalingError"
Variables ¶
This section is empty.
Functions ¶
func DeserializeKey ¶
func DeserializeKey(key string) (map[string]*dynamodb.AttributeValue, error)
func DynamoDbInstance ¶
func SerializeKey ¶
func SerializeKey(data map[string]*dynamodb.AttributeValue) (string, error)
func StdDFWrapperAccountModel ¶
func StdDFWrapperAccountModel(skPrefix string, da map[string]DynamicAttrFunc)
StdDFWrapperAccountModel is a wrapper that adds "Standard" dynamic fields
func StdDFWrapperAccountUserModel ¶
func StdDFWrapperAccountUserModel(pkPrefix string, skPrefix string, da map[string]DynamicAttrFunc)
StdDFWrapperAccountUserModel is a wrapper that adds "Standard" dynamic fields
func StdDFWrapperSharedModel ¶
func StdDFWrapperSharedModel(pkPrefix string, skPrefix string, da map[string]DynamicAttrFunc)
StdDFWrapperSharedModel is a wrapper that adds "Standard" dynamic fields
func StdDFWrapperUserModel ¶
func StdDFWrapperUserModel(pkPrefix string, skPrefix string, da map[string]DynamicAttrFunc)
StdDFWrapperUserModel is a wrapper that adds "Standard" dynamic fields
func TableNameWithEnv ¶
Types ¶
type Db ¶
type Db struct { DynamoDb *dynamodb.DynamoDB TableName string EntityDescriptorMapping map[reflect.Type]*EntityDescriptor db.Getter db.Creator db.Deleter db.Updater db.CursorLister }
func (*Db) CursorList ¶
func (r *Db) CursorList(ctx context.Context, startAtKey string, limit int64, out interface{}) (*db.CursorListResult, error)
CursorList retrieves data from repository and returns as cursor
func (*Db) GetEntityDescriptor ¶
func (r *Db) GetEntityDescriptor(data interface{}) (*EntityDescriptor, error)
func (*Db) InternalCursorList ¶
func (r *Db) InternalCursorList(ctx context.Context, input *dynamodb.QueryInput, startAtKey string, limit int64, out interface{}) (*db.CursorListResult, error)
type DynamicAttrFunc ¶
type EntityDescriptor ¶
type EntityDescriptor struct { DynamicFields map[string]DynamicAttrFunc IDBuilder IDBuilderFunc PK *Index }
type IDBuilderFunc ¶
func StdIDBuilderAccountModel ¶
func StdIDBuilderAccountModel(skPrefix string) IDBuilderFunc
StdIDBuilderAccountModel build the standard ids
func StdIDBuilderAccountUserModel ¶
func StdIDBuilderAccountUserModel(skPrefix string) IDBuilderFunc
StdIDBuilderAccountUserModel build the standard ids
func StdIDBuilderSharedModel ¶
func StdIDBuilderSharedModel(pkPrefix string, skPrefix string) IDBuilderFunc
StdIDBuilderSharedModel build the standard ids
func StdIDBuilderUserModel ¶
func StdIDBuilderUserModel(skPrefix string) IDBuilderFunc
StdIDBuilderUserModel build the standard ids
Click to show internal directories.
Click to hide internal directories.