{"modulePath":"github.com/aws-samples/aws-dynamodb-enterprise-application","version":"v0.0.0-20191107062627-dc52cdd39334","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package db\n\n## Functions\n\n```go\nfunc InterfaceSlice(slice interface{}) []interface{}\n```\nTODO: to evaluate th value of this tradeoff: this is probably a little slow but abstract the complexity for all uses of the save many function(and actually any core operation on array of interface)\n\n## Types\n\n```go\ntype DBConfig struct {\n\tDbService  *dynamodb.DynamoDB\n\tPrimaryKey string\n\tSortKey    string\n\tTableName  string\n}\n```\n\n```go\nfunc Init(tn string, pk string, sk string) DBConfig\n```\ninit setup teh session and define table name, primary key and sort key\n\n```go\nfunc (dbc DBConfig) Delete(prop interface{}) (interface{}, error)\n```\n\n```go\nfunc (dbc DBConfig) DeleteMany(data interface{}) error\n```\nDeletes many items to a single table\n\n```go\nfunc (dbc DBConfig) FindByGsi(value string, indexName string, indexPk string, data interface{}) error\n```\n\n```go\nfunc (dbc DBConfig) FindStartingWith(pk string, value string, data interface{}) error\n```\n\n```go\nfunc (dbc DBConfig) Get(pk string, sk string, data interface{}) error\n```\n\n```go\nfunc (dbc DBConfig) Save(prop interface{}) (interface{}, error)\n```\n\n```go\nfunc (dbc DBConfig) SaveMany(data interface{}) error\n```\nWrittes many items to a single table\n\n","path":"github.com/aws-samples/aws-dynamodb-enterprise-application/lambda/src/cloudrack-lambda-core/db","name":"db","synopsis":"","isRedistributable":true}
