Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultAllSQL = `select k,v from kv where state = 1` DefaultGetSQL = `select v from kv where k = :k and state = 1` DefaultInsertSQL = `insert into kv(k, v, state, created) values(:k, :v, 1, :time)` DefaultUpdateSQL = `update kv set v = :v, updated = :time, state = 1 where k = :k` DefaultDelSQL = `update kv set state = 0 where k = :k` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Config // contains filtered or unexported fields }
Client is a gokv.Store implementation for SQL databases.
func (*Client) Del ¶
Del 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).
Click to show internal directories.
Click to hide internal directories.