Documentation ¶
Overview ¶
redis provides the Redis implementation of the StoreClient interface.
Index ¶
- func NewClient(config bootstrapConfig.Database, credentials bootstrapConfig.Credentials) (interfaces.StoreClient, error)
- type Client
- func (c Client) Disconnect() error
- func (c Client) RemoveFromStore(o interfaces.StoredObject) error
- func (c Client) RetrieveFromStore(appServiceKey string) (objects []interfaces.StoredObject, err error)
- func (c Client) Store(o interfaces.StoredObject) (string, error)
- func (c Client) Update(o interfaces.StoredObject) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(config bootstrapConfig.Database, credentials bootstrapConfig.Credentials) (interfaces.StoreClient, error)
NewClient provides a factory for building a StoreClient
Types ¶
type Client ¶
Client provides an implementation for the Client interface for Redis
func (Client) RemoveFromStore ¶
func (c Client) RemoveFromStore(o interfaces.StoredObject) error
RemoveFromStore removes an object from the data store.
func (Client) RetrieveFromStore ¶
func (c Client) RetrieveFromStore(appServiceKey string) (objects []interfaces.StoredObject, err error)
RetrieveFromStore gets an object from the data store.
func (Client) Store ¶
func (c Client) Store(o interfaces.StoredObject) (string, error)
Store persists a stored object to the data store. Three ("Three shall be the number thou shalt count, and the number of the counting shall be three") keys are used:
- the object id to point to a STRING which is the marshalled JSON.
- the object AppServiceKey to point to a SET containing all object ids associated with this app service. Note the key is prefixed to avoid key collisions.
- the object id to point to a HASH which contains the object AppServiceKey.
func (Client) Update ¶
func (c Client) Update(o interfaces.StoredObject) error
Update replaces the data currently in the store with the provided data.
Click to show internal directories.
Click to hide internal directories.