Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CreateTable = testutil.CreateTable
CreateTable is an alias of CreateTable func defined in testutil package. Mainly used for test and local dev purposes.
Functions ¶
This section is empty.
Types ¶
type ClientAPI ¶
type ClientAPI interface { dynamodb.QueryAPIClient GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error) 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) }
ClientAPI presents an interface for a sub-part of the AWS Dynamodb client service: github.com/aws/aws-sdk-go-v2/service/dynamodb
type KeyEngine ¶
type KeyEngine interface { core.KeyEngine NamespaceRegistry }
KeyEngine extends core.KeyEngine to add NamespaceRegistry utilities
func NewKeyEngine ¶
func NewKeyEngine(svc ClientAPI, table string, opts ...func(ec *KeyEngineConfig)) KeyEngine
NewKeyEngine returns a core.KeyEngine implementation built on top of a Dynamodb table.
It requires a non-empty value for Dynamodb client service and table name parameters. Otherwise, it will panic.
type KeyEngineConfig ¶ added in v0.2.2
type KeyEngineConfig core.KeyEngineConfig
KeyEngineConfig is an alias to core.KeyEngineConfig type defined in the core package. It may change later to extend the core one.
type KeyItem ¶
type KeyItem struct { Item Namespace string `dynamodbav:"_nspace"` KeyID string `dynamodbav:"_kid"` Key []byte `dynamodbav:"_key"` State string `dynamodbav:"_state"` CreatedAt int64 `dynamodbav:"_createdAt"` DisabledAt int64 `dynamodbav:"_disabledAt,omitempty"` DeletedAt int64 `dynamodbav:"_deletedAt,omitempty"` EnabledAt int64 `dynamodbav:"_enabledAt,omitempty"` }
KeyItem defines Dynamodb Key Engine table schema.
type NamespaceItem ¶
type NamespaceRegistry ¶
type NamespaceRegistry interface { // ListNamespace returns a list of registred namespaces. // Namespaces are mainly added to the internal registry during the GetOrCtreateKeys ops. ListNamespace(ctx context.Context) ([]string, error) }
NamespaceRegistry mainly used internally or by a cron to look up for namespaces to clean.