Documentation
¶
Index ¶
- Constants
- func BuildScanFilterAttr(objPtr runtime.Object, p storage.SelectionPredicate) (filterExpression string, expressionAttributeNames map[string]*string, ...)
- func BuildUpdateAttr(newObj runtime.Object, oldObj runtime.Object, attr map[string]interface{}) (updateExpression string, expressionAttributeNames map[string]*string, ...)
- func ConvertByteToMap(data []byte) (map[string]interface{}, error)
- func ConvertTOJson(items *[]map[string]*awsdb.AttributeValue) ([]map[string]interface{}, int64, error)
- func CreateTable(dbHandler *awsdb.DynamoDB, table string) (string, error)
- func New(sess *session.Session, table string, codec runtime.Codec) *store
- func RandStringRunes(n int) string
- func ScanFilterWithFileds(p storage.SelectionPredicate, expressionAttributeNames map[string]*string, ...) (expression []string)
- func ScanFilterWithLables(p storage.SelectionPredicate, expressionAttributeNames map[string]*string, ...) (expression []string)
- type APIObjectVersioner
Constants ¶
View Source
const ( DynamoDBOpEqual = "=" DynamoDBOpNotEqual = "!=" DynamoDBOpAttrExist = "attribute_exists" DynamoDBOpAttrNotExist = "attribute_not_exists" DynamoDBOpContains = "contains" //"CONTAINS" DynamoDBOpNotContains = "not_contain" //"NOT_CONTAINS" )
Variables ¶
This section is empty.
Functions ¶
func BuildScanFilterAttr ¶
func BuildScanFilterAttr(objPtr runtime.Object, p storage.SelectionPredicate) (filterExpression string, expressionAttributeNames map[string]*string, expressionAttributeValues map[string]*awsdb.AttributeValue)
func BuildUpdateAttr ¶
func BuildUpdateAttr(newObj runtime.Object, oldObj runtime.Object, attr map[string]interface{}) (updateExpression string, expressionAttributeNames map[string]*string, expressionAttributeValues map[string]*awsdb.AttributeValue, err error)
BuildUpdateAttr input attr like as:
type nested Struct{ key1 string key2 string } type Test Struct{ key1 string `json:"key1,omitempty"` key2 string nested nested `json:"nested,omitempty"` }
if you want update Test.key1 and nested.key1 will be have map:
attr:=map[string]interface{}{ "key1":value1, "nested.#key1":value2, }
func ConvertByteToMap ¶
func ConvertTOJson ¶
func RandStringRunes ¶
func ScanFilterWithFileds ¶
func ScanFilterWithFileds(p storage.SelectionPredicate, expressionAttributeNames map[string]*string, expressionAttributeValues map[string]*awsdb.AttributeValue) (expression []string)
ScanFilterWithFileds range FieldSelector convert into dynamodb scan return string is a slice constain of filter expression for dynamodb
func ScanFilterWithLables ¶
func ScanFilterWithLables(p storage.SelectionPredicate, expressionAttributeNames map[string]*string, expressionAttributeValues map[string]*awsdb.AttributeValue) (expression []string)
ScanFilterWithFileds range LablesSelector convert into dynamodb scan return string is a slice constain of filter expression for dynamodb
Types ¶
type APIObjectVersioner ¶
type APIObjectVersioner struct{}
APIObjectVersioner implements versioning and extracting database information for objects that have an embedded ObjectMeta or ListMeta field.
func (APIObjectVersioner) ObjectResourceVersion ¶
func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error)
ObjectResourceVersion implements Versioner
func (APIObjectVersioner) UpdateList ¶
func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64) error
UpdateList implements Versioner
func (APIObjectVersioner) UpdateObject ¶
func (a APIObjectVersioner) UpdateObject(obj runtime.Object, resourceVersion uint64) error
UpdateObject implements Versioner
Click to show internal directories.
Click to hide internal directories.