Documentation ¶
Index ¶
- Constants
- type Storage
- func (st *Storage) Create(value interface{}, tableName string) error
- func (st *Storage) CreateTable(value interface{}, tableName string) error
- func (st *Storage) Delete(value interface{}, tableName string, hash interface{}, args ...interface{}) error
- func (st *Storage) Find(value interface{}, tableName string, limit int64, expr string, ...) error
- func (st *Storage) First(value interface{}, tableName string, hash interface{}, args ...interface{}) error
- func (st *Storage) Save(value interface{}, tableName string) error
Constants ¶
View Source
const ( DefaultAWSRegion = "us-east-1" DefaultTimeout = 200 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func (*Storage) CreateTable ¶
CreateTable 创建一个新的存储对象表
func (*Storage) Delete ¶
func (st *Storage) Delete(value interface{}, tableName string, hash interface{}, args ...interface{}) error
Delete 删除一个存储对象(单主键时不需要额外参数,主键+排序键时需要把排序键的值作为额外参数) value 为符合 tag 定义的 struct
func (*Storage) Find ¶
func (st *Storage) Find(value interface{}, tableName string, limit int64, expr string, args ...interface{}) error
Find 获取所有符合要求的对象,性能远低于 First value 为符合 tag 定义的 struct slice ptr (注:&[]struct) limit 为限制数量, <= 0 即不限制数量 expr 为表达式(空代表不使用表达式),参考 dynamodb 文档、或 https://github.com/guregu/dynamo 其他为补充表达式的具体值
Click to show internal directories.
Click to hide internal directories.