stateclient

package
v0.0.0-...-147f0cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL