Documentation ¶
Index ¶
Constants ¶
const ( FacetRootCollection = "/" FacetCollection = "collection" FacetItemType = "itemtype" FacetItemVariant = "variant" FacetLinkType = "linktype" ValueLinkTypeItem = "item" ValueLinkTypeVersion = "version" ErrorInvalid = "invalid-input" // the input was not valid ErrorAlreadyExists = "already-exists" // the input object can't be created - it exists already ErrorIllegal = "illegal-operation" // the operation is not permitted ErrorNotFound = "not-found" // an explicitly given Id was not found ErrorNotServing = "operation-rejected" // the server is not serving requests (ie. shutting down / maintenance) )
Variables ¶
This section is empty.
Functions ¶
func ChooseClientConfig ¶
func ChooseServerConfig ¶
func ReadConfig ¶
Read configuration information from a file
Types ¶
type Collection ¶
type Collection struct { Parent string `json:"Parent"` Name string `json:"Name"` Id string `json:"Id"` Uri string `json:"Uri"` Facets map[string]string `json:"Facets"` }
A collection is the highest level of object in wysteria. Each collection has a unique name and is used mostly to form logical groupings and help divide the search space for items into hopefully even-ish chunks.
func (*Collection) MarshalJSON ¶
func (j *Collection) MarshalJSON() ([]byte, error)
MarshalJSON marshal bytes to json - template
func (*Collection) MarshalJSONBuf ¶
func (j *Collection) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*Collection) UnmarshalJSON ¶
func (j *Collection) UnmarshalJSON(input []byte) error
UnmarshalJSON umarshall json - template of ffjson
func (*Collection) UnmarshalJSONFFLexer ¶
func (j *Collection) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type Item ¶
type Item struct { Parent string `json:"Parent"` Id string `json:"Id"` Uri string `json:"Uri"` ItemType string `json:"ItemType"` Variant string `json:"Variant"` Facets map[string]string `json:"Facets"` }
Items are the second tier of object in wysteria. Each has a parent collection denoted by the 'parent' field (the Id of a Collection). An 'Item' represents an abstract resource of a specific variant. For example different varieties of trees may all have type 'tree' and variants of 'oak' 'pine' etc. An Item doesn't refer to any particular version of something, rather it's the concept OF the thing independent of the specifics.
func (*Item) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*Item) MarshalJSONBuf ¶
func (j *Item) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*Item) UnmarshalJSON ¶
UnmarshalJSON umarshall json - template of ffjson
func (*Item) UnmarshalJSONFFLexer ¶
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type Link ¶
type Link struct { Name string `json:"Name"` Id string `json:"Id"` Uri string `json:"Uri"` Src string `json:"Src"` Dst string `json:"Dst"` Facets map[string]string `json:"Facets"` }
A Link is an abstract named link "the thing of Id Src relates to the thing of Id Dst" The name is intended to convey the nature of the relationship.
func (*Link) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*Link) MarshalJSONBuf ¶
func (j *Link) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*Link) UnmarshalJSON ¶
UnmarshalJSON umarshall json - template of ffjson
func (*Link) UnmarshalJSONFFLexer ¶
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type Marshalable ¶
Interface for turning the struct into some byte representation. By default we're using ffjson to encode & later decode these but middleware needn't use this if they've got different requirements.
type QueryDesc ¶
type QueryDesc struct { Parent string Id string Uri string VersionNumber int32 ItemType string Variant string Facets map[string]string Name string ResourceType string Location string LinkSrc string LinkDst string }
A QueryDesc is a generic way to describe what one is searching for. Each field of a given QueryDesc is understood as an AND. Multiple QueryDesc's together are understood as an OR. That is, given a list of QueryDesc objects, results should be returned that match ALL of the fields (relevant to what you're search for) from at least one of the QueryDesc objects.
func (*QueryDesc) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*QueryDesc) MarshalJSONBuf ¶
func (j *QueryDesc) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*QueryDesc) UnmarshalJSON ¶
UnmarshalJSON umarshall json - template of ffjson
func (*QueryDesc) UnmarshalJSONFFLexer ¶
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type Resource ¶
type Resource struct { Parent string `json:"Parent"` Name string `json:"Name"` ResourceType string `json:"ResourceType"` Id string `json:"Id"` Uri string `json:"Uri"` Location string `json:"Location"` Facets map[string]string `json:"Facets"` }
A Resource is a path to specific named URI with some type. The name string is intended to convey what the resource is or represents. The resource type string is intended to convey how the resource should be understood or used. Location is the actual URI to the resource For example, an image resource might have name:thumbnail type:url location:www.foo.com/bar.jpg
func (*Resource) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*Resource) MarshalJSONBuf ¶
func (j *Resource) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON umarshall json - template of ffjson
func (*Resource) UnmarshalJSONFFLexer ¶
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
type Version ¶
type Version struct { Parent string `json:"Parent"` Id string `json:"Id"` Uri string `json:"Uri"` Number int32 `json:"Number"` Facets map[string]string `json:"Facets"` }
Versions represent a specific version or iteration of an Item. That is, assuming you were designing a model for an oak tree (an Item) your first model would be attached to Version #1 of item Oak Tree. If you then made a better model, that would constitute Version #2 of item Oak Tree.
func (*Version) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*Version) MarshalJSONBuf ¶
func (j *Version) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
func (*Version) UnmarshalJSON ¶
UnmarshalJSON umarshall json - template of ffjson
func (*Version) UnmarshalJSONFFLexer ¶
UnmarshalJSONFFLexer fast json unmarshall - template ffjson
Directories ¶
Path | Synopsis |
---|---|
grpc_proto
Package wysteria_grpc is a generated protocol buffer package.
|
Package wysteria_grpc is a generated protocol buffer package. |