Documentation ¶
Overview ¶
Package tablestore contains an implementation of the `gokv.Store` interface for Alibaba Cloud Table Store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = Options{ TableName: "gokv", Codec: encoding.JSON, }
DefaultOptions is an Options object with default values. TableName: "gokv", ReservedReadCap: 0, ReservedWriteCap: 0, Codec: encoding.JSON.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a gokv.Store implementation for Table Store.
func (Client) Close ¶
Close closes the client. In the Table Store implementation this doesn't have any effect.
func (Client) Delete ¶
Delete deletes the stored value for the given key. Deleting a non-existing key-value pair does NOT lead to an error. The key must not be "".
func (Client) Get ¶
Get retrieves the stored value for the given key. You need to pass a pointer to the value, so in case of a struct the automatic unmarshalling can populate the fields of the object that v points to with the values of the retrieved object's values. If no value is found it returns (false, nil). The key must not be "" and the pointer must not be nil.
type Options ¶
type Options struct { // URL of the endpoint. // E.g. "https://mytable.ap-southeast-1.ots.aliyuncs.com". EndpointURL string // Name of the instance. // E.g. "mytable". InstanceName string // AccessKey ID. AccessKeyID string // AccessKey secret. AccessKeySecret string // Name of the table. // If the table doesn't exist yet, it's created automatically. // Optional ("gokv" by default). TableName string // Reserved read capacity. // 0 works fine, but doesn't *guarantee* any capacity. // Optional (0 by default). ReservedReadCap int // Reserved write capacity. // 0 works fine, but doesn't *guarantee* any capacity. // Optional (0 by default). ReservedWriteCap int // Encoding format. // Optional (encoding.JSON by default). Codec encoding.Codec }
Options are the options for the Table Store client.