Documentation ¶
Index ¶
- type StateClient
- func (cl *StateClient) Delete(key string) error
- func (cl *StateClient) Get(key string, record interface{}) (found bool, err error)
- func (cl *StateClient) GetMultiple(keys []string) (values map[string][]byte, err error)
- func (cl *StateClient) Set(key string, record interface{}) error
- func (cl *StateClient) SetMultiple(kv map[string][]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateClient ¶
type StateClient struct {
// contains filtered or unexported fields
}
StateClient is a marshaller for service messages using a provided hub connection. This uses the default serializer to marshal and unmarshal messages.
func NewStateClient ¶
func NewStateClient(hc *hubclient.HubClient) *StateClient
NewStateClient returns a client to access state
hc is the hub client connection to use.
func (*StateClient) Delete ¶
func (cl *StateClient) Delete(key string) error
Delete removes the record with the given key.
func (*StateClient) Get ¶
func (cl *StateClient) Get(key string, record interface{}) (found bool, err error)
Get reads and unmarshals the record with the given key. If the key doesn't exist this returns an empty record.
func (*StateClient) GetMultiple ¶
func (cl *StateClient) GetMultiple(keys []string) (values map[string][]byte, err error)
GetMultiple reads multiple records with the given keys. This marshalling and unmarshalling is up to the caller.
func (*StateClient) Set ¶
func (cl *StateClient) Set(key string, record interface{}) error
Set marshals and writes a record
func (*StateClient) SetMultiple ¶
func (cl *StateClient) SetMultiple(kv map[string][]byte) error
SetMultiple writes multiple record
Click to show internal directories.
Click to hide internal directories.