neuronjson

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

This file supports the keyspace for the keyvalue data type.

Package neuronjson implements DVID support for neuron JSON annotations

Index

Constants

View Source
const (
	Version  = "0.1"
	RepoURL  = "github.com/janelia-flyem/dvid/datatype/neuronjson"
	TypeName = "neuronjson"
)

Variables

View Source
var (
	ErrInvalidLengthIngest = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowIngest   = fmt.Errorf("proto: integer overflow")
)

Functions

func DecodeTKey

func DecodeTKey(tk storage.TKey) (string, error)

DecodeTKey returns the string of the bodyid used for this annotation.

func NewSchemaBatchTKey

func NewSchemaBatchTKey() (storage.TKey, error)

NewSchemaBatchTKey returns a TKey for batch schema storage.

func NewSchemaTKey

func NewSchemaTKey() (storage.TKey, error)

NewSchemaTKey returns a TKey for schema storage.

func NewTKey

func NewTKey(key string) (storage.TKey, error)

NewTKey returns a TKey for the annotation kv pairs.

Types

type Data

type Data struct {
	*datastore.Data
	// contains filtered or unexported fields
}

Data embeds the datastore's Data and extends it with neuronjson properties.

func GetByUUIDName

func GetByUUIDName(uuid dvid.UUID, name dvid.InstanceName) (*Data, error)

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

func (d *Data) DescribeTKeyClass(tkc storage.TKeyClass) string

DescribeTKeyClass returns a string explanation of what a particular TKeyClass is used for. Implements the datastore.TKeyClassDescriber interface.

func (*Data) DoRPC

func (d *Data) DoRPC(request datastore.Request, reply *datastore.Response) error

DoRPC acts as a switchboard for RPC commands.

func (*Data) Equals

func (d *Data) Equals(d2 *Data) bool

func (*Data) GetAll

func (d *Data) GetAll(ctx storage.VersionedCtx) ([]map[string]interface{}, error)

func (*Data) GetData

func (d *Data) GetData(ctx storage.VersionedCtx, keyStr string) ([]byte, bool, error)

GetData gets a byte value using a key

func (*Data) GetFields

func (d *Data) GetFields() ([]string, error)

func (*Data) GetKeys

func (d *Data) GetKeys(ctx storage.VersionedCtx) (out []string, err error)

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) GobDecode

func (d *Data) GobDecode(b []byte) error

func (*Data) GobEncode

func (d *Data) GobEncode() ([]byte, error)

func (*Data) Help

func (d *Data) Help() string

func (*Data) InitDataHandlers

func (d *Data) InitDataHandlers() error

InitDataHandlers initializes ephemeral data for this instance, which is the in-memory keyvalue store where the values are neuron annotation JSON.

func (*Data) JSONString

func (d *Data) JSONString() (jsonStr string, err error)

JSONString returns the JSON for this Data's configuration

func (*Data) KeyExists

func (d *Data) KeyExists(ctx storage.VersionedCtx, keyStr string) (found bool, err error)

KeyExists returns true if a key is found.

func (*Data) MarshalJSON

func (d *Data) MarshalJSON() ([]byte, error)

func (*Data) PutData

func (d *Data) PutData(ctx storage.VersionedCtx, keyStr string, value []byte) error

PutData puts a byte value into key at a given uuid

func (*Data) ServeHTTP

func (d *Data) ServeHTTP(uuid dvid.UUID, ctx *datastore.VersionedCtx, w http.ResponseWriter, r *http.Request) (activity map[string]interface{})

ServeHTTP handles all incoming HTTP requests for this data.

type KeyValue

type KeyValue struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*KeyValue) Descriptor

func (*KeyValue) Descriptor() ([]byte, []int)

func (*KeyValue) Equal

func (this *KeyValue) Equal(that interface{}) bool

func (*KeyValue) GetKey

func (m *KeyValue) GetKey() string

func (*KeyValue) GetValue

func (m *KeyValue) GetValue() []byte

func (*KeyValue) GoString

func (this *KeyValue) GoString() string

func (*KeyValue) Marshal

func (m *KeyValue) Marshal() (dAtA []byte, err error)

func (*KeyValue) MarshalTo

func (m *KeyValue) MarshalTo(dAtA []byte) (int, error)

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) Reset

func (m *KeyValue) Reset()

func (*KeyValue) Size

func (m *KeyValue) Size() (n int)

func (*KeyValue) String

func (this *KeyValue) String() string

func (*KeyValue) Unmarshal

func (m *KeyValue) Unmarshal(dAtA []byte) error

type KeyValues

type KeyValues struct {
	Kvs []*KeyValue `protobuf:"bytes,1,rep,name=kvs" json:"kvs,omitempty"`
}

func (*KeyValues) Descriptor

func (*KeyValues) Descriptor() ([]byte, []int)

func (*KeyValues) Equal

func (this *KeyValues) Equal(that interface{}) bool

func (*KeyValues) GetKvs

func (m *KeyValues) GetKvs() []*KeyValue

func (*KeyValues) GoString

func (this *KeyValues) GoString() string

func (*KeyValues) Marshal

func (m *KeyValues) Marshal() (dAtA []byte, err error)

func (*KeyValues) MarshalTo

func (m *KeyValues) MarshalTo(dAtA []byte) (int, error)

func (*KeyValues) ProtoMessage

func (*KeyValues) ProtoMessage()

func (*KeyValues) Reset

func (m *KeyValues) Reset()

func (*KeyValues) Size

func (m *KeyValues) Size() (n int)

func (*KeyValues) String

func (this *KeyValues) String() string

func (*KeyValues) Unmarshal

func (m *KeyValues) Unmarshal(dAtA []byte) error

type Keys

type Keys struct {
	Keys []string `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"`
}

func (*Keys) Descriptor

func (*Keys) Descriptor() ([]byte, []int)

func (*Keys) Equal

func (this *Keys) Equal(that interface{}) bool

func (*Keys) GetKeys

func (m *Keys) GetKeys() []string

func (*Keys) GoString

func (this *Keys) GoString() string

func (*Keys) Marshal

func (m *Keys) Marshal() (dAtA []byte, err error)

func (*Keys) MarshalTo

func (m *Keys) MarshalTo(dAtA []byte) (int, error)

func (*Keys) ProtoMessage

func (*Keys) ProtoMessage()

func (*Keys) Reset

func (m *Keys) Reset()

func (*Keys) Size

func (m *Keys) Size() (n int)

func (*Keys) String

func (this *Keys) String() string

func (*Keys) Unmarshal

func (m *Keys) Unmarshal(dAtA []byte) error

type Type

type Type struct {
	datastore.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) Help

func (dtype *Type) Help() string

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.

Jump to

Keyboard shortcuts

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