Documentation ¶
Index ¶
- type CacheIterator
- type CheckTrans
- type CheckedExpression
- type CheckedTransExpression
- type Client
- type ConditionalCheckResult
- type ConditionalTransCheckFailPermission
- type Create
- type CreateIfNotExists
- type CreateTrans
- type DataRecord
- type Delete
- type DeleteTrans
- type Find
- type FindMany
- type Get
- type Index
- type IndexRecord
- type Iterator
- type IteratorMover
- type Key
- type KeyRecord
- type KeyRecordBuffer
- type MembershipVersion
- type Query
- type Record
- type RecordBuffer
- type Result
- type TransResult
- type Update
- type UpdateTrans
- type Values
- type WriteTrans
- type WriteTransExpression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheIterator ¶
type CacheIterator interface { Iterator GetSize() int GetAt(index int) RecordBuffer }
CacheIterator describes intreface to read query or scan cached result.
type CheckTrans ¶
type CheckTrans interface { WriteTransExpression Values(Values) CheckTrans Value(name string, value interface{}) CheckTrans Condition(string) CheckTrans }
CheckTrans describes the part of WriteTrans witch builds check-expression.
type CheckedExpression ¶
type CheckedTransExpression ¶
type CheckedTransExpression interface { ss.NoCopy AllowConditionalCheckFail() ConditionalTransCheckFailPermission }
type Client ¶
type Client interface { ss.NoCopy Index(resultRecord IndexRecord) Index Get(KeyRecordBuffer) Get Find(KeyRecordBuffer) Find FindMany() FindMany Query(record RecordBuffer, keyCondition string, values Values) Query CreateIfNotExists(data DataRecord) CreateIfNotExists CreateOrReplace(data DataRecord) Create Update(key KeyRecord) Update Delete(key KeyRecord) Delete DeleteIfExisting(key KeyRecord) Delete Write(WriteTrans) TransResult }
Client is a database client interface.
func GetClientInstance ¶
func GetClientInstance() Client
GetClientInstance returns reference to client singleton.
type ConditionalCheckResult ¶
type ConditionalCheckResult interface {
IsPassed(conditions ...ConditionalTransCheckFailPermission) bool
}
type ConditionalTransCheckFailPermission ¶
type ConditionalTransCheckFailPermission int
func (ConditionalTransCheckFailPermission) GetIndex ¶
func (p ConditionalTransCheckFailPermission) GetIndex() int
type CreateIfNotExists ¶
type CreateIfNotExists interface { CheckedExpression Request() Result }
type CreateTrans ¶
type CreateTrans interface { WriteTransExpression Values(Values) CreateTrans Value(name string, value interface{}) CreateTrans Alias(name, value string) CreateTrans Condition(string) CreateTrans }
CreateTrans describes the part of WriteTrans witch builds create-expression.
type DataRecord ¶
type DataRecord interface { Record GetData() interface{} }
DataRecord describes database record interface with data.
type Delete ¶
type Delete interface { CheckedExpression Condition(string) Delete Values(Values) Delete Request() Result RequestAndReturn(RecordBuffer) Result }
Delete describes the interface to delete one record by key.
type DeleteTrans ¶
type DeleteTrans interface { WriteTransExpression Values(Values) UpdateTrans Condition(string) UpdateTrans }
DeleteTrans describes the part of WriteTrans witch builds delete-expression.
type FindMany ¶
type FindMany interface { ss.NoCopy SetTable(RecordBuffer, []Key) CacheIterator Request() }
FindMany describes the interface to find many records by key.
type Get ¶
type Get interface{ Request() }
Get describes the interface to query one record by key from a database.
type IndexRecord ¶
type IndexRecord interface { RecordBuffer // GetIndex returns index name. GetIndex() string // GetIndexPartitionField returns index partition field name. GetIndexPartitionField() string // GetIndexSortField returns index sort field name. GetIndexSortField() string // GetIndexSortField returns index additional fields for record. GetProjection() []string }
IndexRecord describes database index interface.
type Iterator ¶
type Iterator interface { IteratorMover Get() RecordBuffer }
Iterator describes intreface to read paged data from the database.
type IteratorMover ¶
type IteratorMover interface {
Next() bool
}
IteratorMover describes intreface to move iterator.
type KeyRecordBuffer ¶
type KeyRecordBuffer interface { RecordBuffer Key }
KeyRecordBuffer describes database record interface without data but with key and allows to write database response.
type MembershipVersion ¶
type MembershipVersion uint
MembershipVersion is a version of membership.
func NewMembershipVersion ¶
func NewMembershipVersion(source uint) MembershipVersion
NewMembershipVersion creates new membership version instance.
type Query ¶
type Query interface { ss.NoCopy Filter(string) Query Limit(int64) Query Descending() Query RequestOne() bool RequestPaged() Iterator RequestAll() CacheIterator }
Query describes the interface to query records from a database.
type Record ¶
type Record interface { // GetTable returns table name. GetTable() string // GetKeyPartitionField returns partition field name. GetKeyPartitionField() string // GetKeySortField returns sort field name. GetKeySortField() string }
Record describes database record interface without data.
type RecordBuffer ¶
type RecordBuffer interface { Record Clear() }
RecordBuffer describes database record for write database response.
type TransResult ¶
type TransResult interface { IsSuccess() bool ParseConditions() ConditionalCheckResult MarshalLogMsg(destination map[string]interface{}) }
type Update ¶
type Update interface { CheckedExpression Set(expression string) Update Remove(fieldName string) Update Expression(expression string) Update Values(Values) Update Value(name string, value interface{}) Update Alias(name, value string) Update Condition(string) Update Request() Result RequestAndReturn(RecordBuffer) Result }
Update describes the interface to update one record by key.
type UpdateTrans ¶
type UpdateTrans interface { WriteTransExpression Values(Values) UpdateTrans Value(name string, value interface{}) UpdateTrans Alias(name, value string) UpdateTrans Condition(string) UpdateTrans }
UpdateTrans describes the part of WriteTrans witch builds update-expression.
type WriteTrans ¶
type WriteTrans interface { ss.NoCopy IsEmpty() bool GetSize() int CreateIfNotExists(DataRecord) CreateTrans CreateOrReplace(DataRecord) CreateTrans Replace(DataRecord) CreateTrans Check(KeyRecord) CheckTrans Update(key KeyRecord, update string) UpdateTrans Delete(KeyRecord) DeleteTrans DeleteIfExisting(KeyRecord) DeleteTrans MarshalLogMsg(destination map[string]interface{}) GetResult() *dynamodb.TransactWriteItemsInput // contains filtered or unexported methods }
WriteTrans helps to build write-transaction.
func NewWriteTrans ¶
func NewWriteTrans(isConditionalCheckFail bool) WriteTrans
NewWriteTrans creates new write transaction builder.
type WriteTransExpression ¶
type WriteTransExpression interface{ CheckedTransExpression }
WriteTransExpression describes the part of WriteTrans witch builds typed expression.