Documentation ¶
Overview ¶
This file supports the keyspace for the keyvalue data type.
Package neuronjson implements DVID support for neuron JSON annotations
Index ¶
- Constants
- Variables
- func DecodeTKey(tk storage.TKey) (string, error)
- func NewJSONSchemaTKey() (storage.TKey, error)
- func NewSchemaBatchTKey() (storage.TKey, error)
- func NewSchemaTKey() (storage.TKey, error)
- func NewTKey(key string) (storage.TKey, error)
- type Data
- func (d *Data) DeleteData(ctx storage.VersionedCtx, keyStr string) error
- func (d *Data) DescribeTKeyClass(tkc storage.TKeyClass) string
- func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error
- func (d *Data) Equals(d2 *Data) bool
- func (d *Data) GetAll(ctx storage.VersionedCtx, fieldMap map[string]struct{}, showFields Fields) (ListNeuronJSON, error)
- func (d *Data) GetData(ctx storage.VersionedCtx, keyStr string, fieldMap map[string]struct{}, ...) ([]byte, bool, error)
- func (d *Data) GetFields(ctx storage.VersionedCtx) ([]string, error)
- func (d *Data) GetKeys(ctx storage.VersionedCtx) (out []string, err error)
- func (d *Data) GetKeysInRange(ctx storage.VersionedCtx, keyBeg, keyEnd string) (keys []string, err error)
- func (d *Data) GobDecode(b []byte) error
- func (d *Data) GobEncode() ([]byte, error)
- func (d *Data) Help() string
- func (d *Data) Initialize()
- func (d *Data) IsMutationRequest(action, endpoint string) bool
- func (d *Data) JSONString() (jsonStr string, err error)
- func (d *Data) KeyExists(ctx storage.VersionedCtx, keyStr string) (found bool, err error)
- func (d *Data) MarshalJSON() ([]byte, error)
- func (d *Data) PutData(ctx *datastore.VersionedCtx, keyStr string, value []byte, ...) error
- func (d *Data) Query(ctx *datastore.VersionedCtx, w http.ResponseWriter, uuid dvid.UUID, ...) (err error)
- func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, ...) (activity map[string]interface{})
- type FieldExistence
- type Fields
- type ListNeuronJSON
- type ListQueryJSON
- type NeuronJSON
- type QueryJSON
- type Schema
- type Type
Constants ¶
const ( Version = "0.1" RepoURL = "github.com/janelia-flyem/dvid/datatype/neuronjson" TypeName = "neuronjson" )
Variables ¶
var MaxAnnotationTKey = storage.MaxTKey(keyAnnotation)
var MinAnnotationTKey = storage.MinTKey(keyAnnotation)
Functions ¶
func DecodeTKey ¶
DecodeTKey returns the string of the bodyid used for this annotation.
func NewJSONSchemaTKey ¶ added in v0.9.17
NewJSONSchemaTKey returns a TKey for JSON validation schema storage.
func NewSchemaBatchTKey ¶
NewSchemaBatchTKey returns a TKey for batch schema storage.
func NewSchemaTKey ¶
NewSchemaTKey returns a TKey for schema storage.
Types ¶
type Data ¶
Data embeds the datastore's Data and extends it with neuronjson properties.
func GetByUUIDName ¶
GetByUUIDName returns a pointer to labelblk data given a UUID and data name.
func (*Data) DeleteData ¶
func (d *Data) DeleteData(ctx storage.VersionedCtx, keyStr string) error
DeleteData deletes a key-value pair
func (*Data) DescribeTKeyClass ¶
DescribeTKeyClass returns a string explanation of what a particular TKeyClass is used for. Implements the datastore.TKeyClassDescriber interface.
func (*Data) GetAll ¶
func (d *Data) GetAll(ctx storage.VersionedCtx, fieldMap map[string]struct{}, showFields Fields) (ListNeuronJSON, error)
func (*Data) GetData ¶
func (d *Data) GetData(ctx storage.VersionedCtx, keyStr string, fieldMap map[string]struct{}, showFields Fields) ([]byte, bool, error)
GetData gets a byte value using a key
func (*Data) GetKeysInRange ¶
func (d *Data) GetKeysInRange(ctx storage.VersionedCtx, keyBeg, keyEnd string) (keys []string, err error)
GetKeysInRange returns all keys in the range [keyBeg, keyEnd]. Results on HEAD are ordered by integer key, while results on other branches are ordered lexicographically.
func (*Data) Initialize ¶ added in v0.9.17
func (d *Data) Initialize()
Initialize loads mutable properties of the neuronjson data instance, which in this case is the in-memory neuron json map for the specified versions.
func (*Data) IsMutationRequest ¶ added in v1.0.0
IsMutationRequest overrides the default behavior to specify POST /query as an immutable request.
func (*Data) JSONString ¶
JSONString returns the JSON for this Data's configuration
func (*Data) MarshalJSON ¶
func (*Data) PutData ¶
func (d *Data) PutData(ctx *datastore.VersionedCtx, keyStr string, value []byte, conditionals []string, replace bool) error
PutData puts a valid JSON []byte into a neuron key at a given uuid. If replace is true, will use given value instead of updating fields that were given. If field values are given but do not change, the _user and _time fields will not be updated.
func (*Data) Query ¶ added in v0.9.17
func (d *Data) Query(ctx *datastore.VersionedCtx, w http.ResponseWriter, uuid dvid.UUID, onlyid bool, fieldMap map[string]struct{}, showFields Fields, in io.ReadCloser) (err error)
Query reads POSTed data and returns JSON.
type FieldExistence ¶ added in v1.0.0
type FieldExistence bool // field is present or not
type ListNeuronJSON ¶ added in v0.9.17
type ListNeuronJSON []NeuronJSON
func (*ListNeuronJSON) Len ¶ added in v1.0.0
func (lnj *ListNeuronJSON) Len() int
func (*ListNeuronJSON) Less ¶ added in v1.0.0
func (lnj *ListNeuronJSON) Less(i, j int) bool
func (*ListNeuronJSON) Swap ¶ added in v1.0.0
func (lnj *ListNeuronJSON) Swap(i, j int)
type ListQueryJSON ¶ added in v0.9.17
type ListQueryJSON []QueryJSON
type NeuronJSON ¶ added in v0.9.17
type NeuronJSON map[string]interface{}
func (*NeuronJSON) UnmarshalJSON ¶ added in v0.9.17
func (nj *NeuronJSON) UnmarshalJSON(jsonText []byte) error
UnmarshalJSON parses JSON with numbers preferentially converted to uint64 or int64 if negative.
type QueryJSON ¶ added in v0.9.17
type QueryJSON map[string]interface{}
func (*QueryJSON) UnmarshalJSON ¶ added in v0.9.17
UnmarshalJSON parses JSON with numbers preferentially converted to uint64 or int64 if negative, and strings with "re/" as prefix are compiled as a regular expression.
type Schema ¶ added in v1.0.0
type Schema uint8
Schema describe various formats for neuron annotations
type Type ¶
Type embeds the datastore's Type to create a unique type for neuronjson functions.
func NewType ¶
func NewType() *Type
NewType returns a pointer to a new neuronjson Type with default values set.
func (*Type) NewDataService ¶
func (dtype *Type) NewDataService(uuid dvid.UUID, id dvid.InstanceID, name dvid.InstanceName, c dvid.Config) (datastore.DataService, error)
NewDataService returns a pointer to new neuronjson data with default values.