server

package
v0.0.0-...-9f7a181 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//RPCError
	RPCErrorInvalidAction   = "E(0x001) Unknown TransactionAction"
	RPCErrorRepeatAction    = "E(0x002) Repeat actionId in transaction"
	RPCErrorArgumentInvalid = "E(0x003) One or more arguments are invalid (generic)"
	RPCErrorInvalidIRI      = "E(0x004) Invalid IRI (generic)"
	RPCErrorNotFound        = "E(0x005) Requested record not found"
	RPCErrorFieldRequired   = "E(0x006) Field %s is required"
	RPCErrorFieldUnexpected = "E(0x007) Field %s is unexpected"
	RPCErrorFieldSpecific   = "E(0x008) Error %s on %s"
	RPCErrorDataCorrupted   = "E(0x009) Data is corrupted on %s"
	RPCErrorDuplicateRecord = "E(0x010) Requested record already exists"
	RPCErrorIRISpecific     = "E(0x011) IRI: %s"
	RPCErrorListIterator    = "E(0x012) List iteration failed"
	RPCErrorReadCheck       = "E(0x013) ReadCheck failure in transaction"
	RPCErrorServer          = "E(0x014) Server processing error"
)

RPC Errors Returned by gRPC, standardized on E(0xYYY)

View Source
const (
	DebugServerRequests = true
)
View Source
const (
	KeyReportBelowZero = KeyReportClass(0)
)

Variables

View Source
var CounterKeys = map[int]string{
	0:  "0",
	1:  "1",
	2:  "2",
	3:  "3",
	4:  "4",
	5:  "5",
	6:  "6",
	7:  "7",
	8:  "8",
	9:  "9",
	10: "a",
	11: "b",
	12: "c",
	13: "d",
	14: "e",
	15: "f",
}

Functions

func BytesToInt

func BytesToInt(data []byte) (ret int64, err error)

func CheckFatalError

func CheckFatalError(err error)

func Int64ToBytes

func Int64ToBytes(v int64) ([]byte, error)

func MustInt64ToBytes

func MustInt64ToBytes(v int64) []byte

func NodeResolveId

func NodeResolveId(nID string, nMap *map[string]string) (string, error)

func PreparePayload

func PreparePayload(src []byte) (prop []byte)

func ResolveCounterIRI

func ResolveCounterIRI(tCounter *pb.Counter, nMap *map[string]string, p *perms.Count) (iri.BaseCounter, error)

func ResolveMetaIRI

func ResolveMetaIRI(tMeta *pb.Meta, nMap *map[string]string, p *perms.Meta) (iri.IRI, error)

Types

type CDSCabinetServer

type CDSCabinetServer struct {
	Version int32
	// contains filtered or unexported fields
}

func StartServer

func StartServer() *CDSCabinetServer

func (*CDSCabinetServer) CounterGet

func (s *CDSCabinetServer) CounterGet(ctx context.Context, counter *pb.Counter) (*pb.CounterValueResponse, error)

func (*CDSCabinetServer) EdgeGet

func (s *CDSCabinetServer) EdgeGet(ctx context.Context, edge *pb.EdgeGetRequest) (*pb.Edge, error)

func (*CDSCabinetServer) EdgeList

func (*CDSCabinetServer) IndexChoices

func (s *CDSCabinetServer) IndexChoices(indexRq *pb.IndexChoiceRequest, stream pb.CDSCabinet_IndexChoicesServer) error

func (*CDSCabinetServer) IndexDrop

func (*CDSCabinetServer) IndexGet

func (s *CDSCabinetServer) IndexGet(ctx context.Context, indexGet *pb.IndexGetRequest) (*pb.Index, error)

func (*CDSCabinetServer) IndexList

func (s *CDSCabinetServer) IndexList(indexRq *pb.IndexListRequest, stream pb.CDSCabinet_IndexListServer) error

func (*CDSCabinetServer) MetaGet

func (s *CDSCabinetServer) MetaGet(ctx context.Context, meta *pb.Meta) (*pb.MetaGetResponse, error)

func (*CDSCabinetServer) MetaList

func (*CDSCabinetServer) NodeGet

func (s *CDSCabinetServer) NodeGet(ctx context.Context, nodeRq *pb.NodeGetRequest) (*pb.Node, error)

func (*CDSCabinetServer) NodeList

func (*CDSCabinetServer) ReadCheck

func (*CDSCabinetServer) SequentialCreate

func (s *CDSCabinetServer) SequentialCreate(ctx context.Context, seq *pb.Sequential) (newSeq *pb.Sequential, err error)

func (*CDSCabinetServer) SequentialDelete

func (s *CDSCabinetServer) SequentialDelete(ctx context.Context, seq *pb.Sequential) (*pb.MutationResponse, error)

func (*CDSCabinetServer) SequentialGet

func (s *CDSCabinetServer) SequentialGet(ctx context.Context, seq *pb.Sequential) (*pb.Sequential, error)

func (*CDSCabinetServer) SequentialList

func (*CDSCabinetServer) Transaction

func (s *CDSCabinetServer) Transaction(bStream pb.CDSCabinet_TransactionServer) error

type KeyReport

type KeyReport struct {
	// contains filtered or unexported fields
}

func NewKeyReport

func NewKeyReport(class KeyReportClass, request interface{}, err string, key []byte, value []byte) *KeyReport

type KeyReportClass

type KeyReportClass uint8

type TransactionOperation

type TransactionOperation struct {
	IdMap       map[string]string
	UsedActions map[uint32]bool
	// contains filtered or unexported fields
}

func (*TransactionOperation) CounterDelete

func (o *TransactionOperation) CounterDelete(counter *pb.Counter) error

func (*TransactionOperation) CounterIncrement

func (o *TransactionOperation) CounterIncrement(counter *pb.Counter) error

func (*TransactionOperation) CounterRegister

func (o *TransactionOperation) CounterRegister(counter *pb.Counter) error

func (*TransactionOperation) EdgeClear

func (o *TransactionOperation) EdgeClear(edge *pb.Edge) error

func (*TransactionOperation) EdgeDelete

func (o *TransactionOperation) EdgeDelete(edge *pb.Edge) error

func (*TransactionOperation) EdgeUpdate

func (o *TransactionOperation) EdgeUpdate(edge *pb.Edge) error

func (*TransactionOperation) IndexCreate

func (o *TransactionOperation) IndexCreate(index *pb.Index) error

func (*TransactionOperation) IndexDelete

func (o *TransactionOperation) IndexDelete(index *pb.Index) error

func (*TransactionOperation) MetaClear

func (o *TransactionOperation) MetaClear(meta *pb.Meta) error

func (*TransactionOperation) MetaDelete

func (o *TransactionOperation) MetaDelete(meta *pb.Meta) error

func (*TransactionOperation) MetaUpdate

func (o *TransactionOperation) MetaUpdate(meta *pb.Meta) error

func (*TransactionOperation) NodeCreate

func (o *TransactionOperation) NodeCreate(node *pb.Node) error

func (*TransactionOperation) NodeDelete

func (o *TransactionOperation) NodeDelete(node *pb.Node) error

func (*TransactionOperation) NodeUpdate

func (o *TransactionOperation) NodeUpdate(node *pb.Node) error

func (*TransactionOperation) ReadCheck

func (o *TransactionOperation) ReadCheck(rc *pb.ReadCheckRequest) error

Jump to

Keyboard shortcuts

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