Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeSet ¶
ChangeSet is an input for marshalling json input and out from the api
func ChangeSetOutput ¶
type Field ¶
type Field string
Field is an input for marshalling json input and output from the api
func FieldsOutput ¶
type FieldScore ¶
FieldScore is an input for marshalling json input and out from the api
type FieldValueScore ¶
type FieldValueScore struct { Field Field `json:"field"` Value []byte `json:"value"` Score int64 `json:"score"` }
FieldValueScore is an input for marshalling json input and out from the api
type Key ¶
type Key string
Key is an input for marshalling json input and output from the api
func KeysOutput ¶
type MembersInput ¶
type MembersInput struct {
Members []FieldValueScore `json:"members"`
}
MembersInput defines a simple type for marshalling and unmarshalling members
type Presence ¶
type Presence struct { Present bool `json:"present"` Inserted bool `json:"inserted"` Score int64 `json:"score"` }
Presence is an input for marshalling json input and out from the api
type Transport ¶
type Transport interface { TransportNetwork // Insert takes a key and value and stores with in the underlying store. // Returns ChangeSet of success and failure Insert(selectors.Key, []selectors.FieldValueScore) (selectors.ChangeSet, error) // Delete removes a value associated with the key. // Returns ChangeSet of success and failure Delete(selectors.Key, []selectors.FieldValueScore) (selectors.ChangeSet, error) // Select retrieves a field and score associated with the store. // Returns Field, Value and Score if the value found Select(selectors.Key, selectors.Field) (selectors.FieldValueScore, error) // Keys returns all the potential keys that are stored with in the store. Keys() ([]selectors.Key, error) // Size returns the number of members for the key are stored in the store. Size(selectors.Key) (int64, error) // Members returns the members associated for a key Members(selectors.Key) ([]selectors.Field, error) // Score returns the specific score for the field with in the key. Score(selectors.Key, selectors.Field) (selectors.Presence, error) }
Transport wraps the API transportation request to provide an agnostic approach to the store. As long as the API implements the following transportation service then any protocol can be used; http, gRPC, raw udp
type TransportNetwork ¶
type TransportNetwork interface { // Hash returns the transport unique hash Hash() uint32 // Host returns the transport underlying host Host() string }
TransportNetwork defines a hash and host
type TransportStrategy ¶
type TransportStrategy interface { // Apply applies a host to create a new api.Transport Apply(string) Transport }
TransportStrategy defines a way to create a transport