auxpb

package
v0.0.0-...-8c897c6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncodedJSON

type EncodedJSON string

An 'encoded JSON' type that encodes to native JSON.

func (EncodedJSON) MarshalJSON

func (s EncodedJSON) MarshalJSON() ([]byte, error)

func (*EncodedJSON) UnmarshalJSON

func (s *EncodedJSON) UnmarshalJSON(data []byte) error

type Entry

type Entry struct {
	Key       Key         `json:"key"`
	ValueJSON EncodedJSON `json:"value_json"`
	Timestamp time.Time   `json:"timestamp"`
}

Entry uses 'raw' JSON for its ValueJSON field: you can replace the GetResponse with your own result type matching this JSON data fingerprint to have automated decoding via clientutil.Call().

type GetRequest

type GetRequest struct {
	Keys []Key `json:"keys"`
}

type GetResponse

type GetResponse struct {
	Results []*Entry `json:"results"`
}

type Key

type Key struct {
	Shard      string
	Type       string
	ResourceID string
	AppKey     string
}

func ParseKey

func ParseKey(s string) (k Key, err error)

func (Key) String

func (k Key) String() string

type LoadEntry

type LoadEntry struct {
	ResourceID string `json:"resource_id"`
	AppKey     string `json:"app_key"`
	ValueJSON  string `json:"value_json"`
}

type LoadRequest

type LoadRequest struct {
	Type      string      `json:"type"`
	Timestamp time.Time   `json:"timestamp"`
	TTL       int         `json:"ttl"`
	Entries   []LoadEntry `json:"entries"`
}

type QueryParam

type QueryParam struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

type QueryRequest

type QueryRequest struct {
	QueryName string       `json:"query_name"`
	Params    []QueryParam `json:"params"`
	Shards    []string     `json:"shards"`
}

func (*QueryRequest) ParamsMap

func (r *QueryRequest) ParamsMap() map[string]interface{}

type QueryResponse

type QueryResponse struct {
	Results [][]interface{} `json:"results"`
	Partial bool            `json:"partial"`
}

type SetRequest

type SetRequest struct {
	Type       string    `json:"type"`
	ResourceID string    `json:"resource_id"`
	AppKey     string    `json:"app_key"`
	ValueJSON  string    `json:"value_json"`
	Timestamp  time.Time `json:"timestamp"`
	TTL        int       `json:"ttl"`
}

Jump to

Keyboard shortcuts

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