Documentation ¶
Index ¶
- func NewMapOperation() riak.MapOperation
- type Client
- func (c *Client) AllKeys(bucket, bucketType string) ([]string, error)
- func (c *Client) Delete(bucket, bucketType, key string) error
- func (c *Client) GetJSON(bucket, bucketType, key string, value interface{}) (err error, isNotFound bool)
- func (c *Client) GetMap(bucket, bucketType, key string, output interface{}) (err error, isNotFound bool)
- func (c *Client) GetRaw(bucket, bucketType, key string) (raw []byte, err error, isNotFound bool)
- func (c *Client) KeysInIndex(bucket, bucketType, indexName, indexValue string, limit uint32) ([]string, error)
- func (c *Client) MapOperation(bucket, bucketType, key string, op riak.MapOperation, context []byte) error
- func (c *Client) SetJSON(bucket, bucketType, key string, value interface{}) error
- func (c *Client) SetMap(bucket, bucketType, key string, input interface{}) error
- func (c *Client) SetRaw(bucket, bucketType, key string, data []byte, opt *Options) error
- type Counter
- type Options
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMapOperation ¶
func NewMapOperation() riak.MapOperation
NewMapOperation returns a new riak.MapOperation that you can for advanced Riak operations
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetJSON ¶
func (c *Client) GetJSON(bucket, bucketType, key string, value interface{}) (err error, isNotFound bool)
GetJSON is the same as GetRaw, but with automatic JSON unmarshalling
func (*Client) GetMap ¶
func (c *Client) GetMap(bucket, bucketType, key string, output interface{}) (err error, isNotFound bool)
GetMap fetches data from Riak and decodes the result into your Go datatype. See SetMap for more info.
func (*Client) GetRaw ¶
GetRaw retuns the raw []byte array that is stored in Riak without any modifications
func (*Client) KeysInIndex ¶
func (*Client) MapOperation ¶
func (*Client) SetJSON ¶
SetJSON saves value as key in the bucket bucket/bucketType Values can automatically be added to indexes with the struct tag goriakindex
func (*Client) SetMap ¶
SetMap automatically converts your Go datatype to the equivalent type in Riak
| Go Type | Riak Type | |------------|-----------| | `struct` | map | | `string` | register | | `[n]byte` | register | | `[]byte` | register | | `[]slice` | set | | `[]slice` | set | | `[][]byte` | set | | `map` | map |
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a wapper to handle Riak Counters Counter needs to be initialized by GetMap() to fully function
func NewCounter ¶
func NewCounter() *Counter
NewCounter returns a partial Counter Counters returned by NewCounter() can only be updated with SetMap(). Counter.Exec() will not work on counters returned by NewCounter()
func (*Counter) Exec ¶
Exec saves changes made to the Counter to Riak Exec only works on Counters initialized by GetMap()
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) AddToIndex ¶
type Set ¶ added in v1.1.0
type Set struct {
// contains filtered or unexported fields
}
Set is a special type to make it easier to work with Riak Sets in Go.
func NewSet ¶ added in v1.1.0
func NewSet() *Set
NewSet returnes a new and empty Set. Sets returned from NewSet() can not be used with Set.Exec()
func (*Set) Add ¶ added in v1.1.0
Add adds an item to the direct value of the Set. Save the changes to Riak with Set.Exec() or SetMap().
func (*Set) Exec ¶ added in v1.1.0
Exec executes the diff created by Add() and Remove(), and saves the data to Riak
func (*Set) Remove ¶ added in v1.1.0
Remove deletes an item to the direct value of the Set. Save the changes to Riak with Set.Exec() or SetMap().
func (*Set) RemoveString ¶ added in v1.1.0
RemoveString is a shortcut to Remove