Documentation
¶
Index ¶
- Variables
- func DeserializeInt32(rawResponse json.RawMessage) (num int32, err error)
- func DeserializeListFromBytes(rawResponse json.RawMessage) ([]json.RawMessage, error)
- func DeserializeMapFromBytes(rawResponse json.RawMessage) (resMap map[string]json.RawMessage, err error)
- func DeserializeNumber(rawResponse json.RawMessage) (count int64, err error)
- func DeserializePropertiesFromBytes(rawResponse json.RawMessage, resMap map[string][]interface{}) (err error)
- func DeserializeStringListFromBytes(rawResponse json.RawMessage) (vals []string, err error)
- func EdgesMatch(edge1, edge2 Edge) (bool, string)
- func GenericValuesMatch(gv1, gv2 GenericValue) (bool, string)
- func VerticesMatch(vertex1, vertex2 Vertex) bool
- type CleanEdge
- type CleanVertex
- type Edge
- type EdgeProperty
- type EdgePropertyValue
- type EdgeValue
- type Edges
- type GenericValue
- type GenericValues
- type ListEdges
- type ListVertices
- type Raw
- type RawSlice
- type Vertex
- func (v Vertex) GetID() string
- func (v Vertex) GetLabel() (string, error)
- func (v Vertex) GetLabels() (labels []string)
- func (v Vertex) GetMetaProperty(key string) (metaMap map[string][]string, err error)
- func (v Vertex) GetMultiProperty(key string) (vals []string, err error)
- func (v Vertex) GetMultiPropertyAs(key, wantType string) (vals []interface{}, err error)
- func (v Vertex) GetMultiPropertyBool(key string) (vals []bool, err error)
- func (v Vertex) GetMultiPropertyInt32(key string) (vals []int32, err error)
- func (v Vertex) GetMultiPropertyInt64(key string) (vals []int64, err error)
- func (v Vertex) GetProperty(key string) (val string, err error)
- func (v Vertex) GetPropertyBool(key string) (val bool, err error)
- func (v Vertex) GetPropertyInt32(key string) (val int32, err error)
- func (v Vertex) GetPropertyInt64(key string) (val int64, err error)
- type VertexProperty
- type VertexPropertyValue
- type VertexValue
Constants ¶
This section is empty.
Variables ¶
var ( ErrorPropertyNotFound = errors.New("property not found") ErrorPropertyIsMeta = errors.New("meta-property found where multi-property expected") ErrorPropertyIsMulti = errors.New("multi-property found where singleton expected") ErrorUnexpectedPropertyType = errors.New("property value could not be cast into expected type") )
Functions ¶
func DeserializeInt32 ¶
func DeserializeInt32(rawResponse json.RawMessage) (num int32, err error)
func DeserializeListFromBytes ¶
func DeserializeListFromBytes(rawResponse json.RawMessage) ([]json.RawMessage, error)
DeserializeListFromBytes validates that the provided RawMessage corresponds to a g:List type and returns a slice of RawMessage values
func DeserializeMapFromBytes ¶
func DeserializeMapFromBytes(rawResponse json.RawMessage) (resMap map[string]json.RawMessage, err error)
func DeserializeNumber ¶
func DeserializeNumber(rawResponse json.RawMessage) (count int64, err error)
DeserializeNumber returns the count from the g:List'd database response
func DeserializePropertiesFromBytes ¶
func DeserializePropertiesFromBytes(rawResponse json.RawMessage, resMap map[string][]interface{}) (err error)
DeserializePropertiesFromBytes is for converting vertex .properties() results into a map
func DeserializeStringListFromBytes ¶
func DeserializeStringListFromBytes(rawResponse json.RawMessage) (vals []string, err error)
DeserializeStringListFromBytes get a g:List value which should be a a list of strings, return those
func EdgesMatch ¶
func GenericValuesMatch ¶
func GenericValuesMatch(gv1, gv2 GenericValue) (bool, string)
func VerticesMatch ¶
Types ¶
type CleanEdge ¶
func ConvertToCleanEdges ¶
type CleanVertex ¶
func ConvertToCleanVertices ¶
func ConvertToCleanVertices(vertices []Vertex) []CleanVertex
type EdgeProperty ¶
type EdgeProperty struct { Type string `json:"@type"` Value EdgePropertyValue `json:"@value"` }
type EdgePropertyValue ¶
type EdgePropertyValue struct { Label string `json:"key"` // Value GenericValue `json:"value"` // this works when value is NOT a string Value json.RawMessage `json:"value"` }
type Edges ¶
type Edges []Edge
func DeserializeEdges ¶
func DeserializeListOfEdgesFromBytes ¶
func DeserializeListOfEdgesFromBytes(rawResponse json.RawMessage) (Edges, error)
type GenericValue ¶
type GenericValue struct { Type string `json:"@type"` Value interface{} `json:"@value"` }
func DeserializeGenericValue ¶
func DeserializeGenericValue(rawResponse string) (response GenericValue, err error)
func DeserializeSingleFromBytes ¶
func DeserializeSingleFromBytes(rawResponse json.RawMessage) (gV GenericValue, err error)
DeserializeSingleFromBytes get a g:List value which should be a singular item, returns that item
type GenericValues ¶
type GenericValues []GenericValue
func DeserializeGenericValues ¶
func DeserializeGenericValues(rawResponse string) (GenericValues, error)
type ListVertices ¶
ListVertices contains a slice of Vertices as value
type Raw ¶
type Raw struct { Type string `json:"@type"` Value json.RawMessage `json:"@value"` }
Raw contains a RawMessage as value
type RawSlice ¶
type RawSlice struct { Type string `json:"@type"` Value []json.RawMessage `json:"@value"` }
RawSlice contains a slice of RawMessages as value
type Vertex ¶
type Vertex struct { Type string `json:"@type"` Value VertexValue `json:"@value"` }
func DeserializeListOfVerticesFromBytes ¶
func DeserializeListOfVerticesFromBytes(rawResponse json.RawMessage) ([]Vertex, error)
DeserializeListOfVerticesFromBytes returns a slice of Vertex from the graphson rawResponse g:List of vertex
func DeserializeVertices ¶
DeserializeVertices converts a graphson string to a slice of Vertex
func DeserializeVerticesFromBytes ¶
func DeserializeVerticesFromBytes(rawResponse json.RawMessage) ([]Vertex, error)
DeserializeVerticesFromBytes returns a slice of Vertex from the graphson rawResponse list of vertex
func (Vertex) GetMetaProperty ¶
GetMetaProperty returns a map[string]string for the given property `key`
func (Vertex) GetMultiProperty ¶
GetMultiProperty returns the ([]string) values for the given property `key` will return an error if the property is not the correct type
func (Vertex) GetMultiPropertyAs ¶
GetMultiPropertyAs returns the values for the given property `key` as type `wantType` will return an error if the property is not a set of the given `wantType` (string, bool, int64)
func (Vertex) GetMultiPropertyBool ¶
GetMultiPropertyBool returns the ([]bool) values for the given property `key` will return an error if the property is not the correct type
func (Vertex) GetMultiPropertyInt32 ¶
GetMultiPropertyInt32 returns the ([]int32) values for the given property `key` will return an error if the property is not the correct type
func (Vertex) GetMultiPropertyInt64 ¶
GetMultiPropertyInt64 returns the ([]int64) values for the given property `key` will return an error if the property is not the correct type
func (Vertex) GetProperty ¶
GetProperty returns the single string value for a given property `key` will return an error if the property is not a single string
func (Vertex) GetPropertyBool ¶
GetPropertyBool returns the single bool value for a given property `key` will return an error if the property is not a single string
func (Vertex) GetPropertyInt32 ¶
GetPropertyInt32 returns the single int32 value for a given property `key` will return an error if the property is not a single string
type VertexProperty ¶
type VertexProperty struct { Type string `json:"@type"` Value VertexPropertyValue `json:"@value"` }
type VertexPropertyValue ¶
type VertexPropertyValue struct { ID GenericValue `json:"id"` Label string `json:"label"` Value interface{} `json:"value"` }
type VertexValue ¶
type VertexValue struct { ID string `json:"id"` Label string `json:"label"` Properties map[string][]VertexProperty `json:"properties"` }