cxpb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2017 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package cxpb is a generated protocol buffer package.

It is generated from these files:

cx.proto

It has these top-level messages:

Element
NumberVerification
MetaData
Property
Parameter
Error
Node
Edge
NodeAttribute
EdgeAttribute
NetworkAttribute
CartesianLayout
AnonymousAspect

Index

Constants

This section is empty.

Variables

View Source
var KnownAspects = map[string]proto.Message{
	"metaData":          &MetaData{},
	"nodes":             &Node{},
	"edges":             &Edge{},
	"nodeAttributes":    &NodeAttribute{},
	"edgeAttributes":    &EdgeAttribute{},
	"networkAttributes": &NetworkAttribute{},
}

KnownAspects specifies the full set of aspects the Decoder can understand. It provides a map between an aspect name and the Protocol Buffers struct representing the type. The Decoder uses this map to convert JSON elements to their protocol buffers representation.

Functions

func RegisterCyServiceServer

func RegisterCyServiceServer(s *grpc.Server, srv CyServiceServer)

Types

type AnonymousAspect

type AnonymousAspect struct {
	Type    string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
	Element []byte `protobuf:"bytes,2,opt,name=element,proto3" json:"element,omitempty"`
}

func (*AnonymousAspect) Descriptor

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

func (*AnonymousAspect) GetElement

func (m *AnonymousAspect) GetElement() []byte

func (*AnonymousAspect) GetType

func (m *AnonymousAspect) GetType() string

func (*AnonymousAspect) ProtoMessage

func (*AnonymousAspect) ProtoMessage()

func (*AnonymousAspect) Reset

func (m *AnonymousAspect) Reset()

func (*AnonymousAspect) String

func (m *AnonymousAspect) String() string

type CartesianLayout

type CartesianLayout struct {
	Nodeid int64   `protobuf:"varint,1,opt,name=nodeid" json:"nodeid,omitempty"`
	X      float64 `protobuf:"fixed64,2,opt,name=x" json:"x,omitempty"`
	Y      float64 `protobuf:"fixed64,3,opt,name=y" json:"y,omitempty"`
	Viewid int64   `protobuf:"varint,4,opt,name=viewid" json:"viewid,omitempty"`
}

func (*CartesianLayout) Descriptor

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

func (*CartesianLayout) GetNodeid

func (m *CartesianLayout) GetNodeid() int64

func (*CartesianLayout) GetViewid

func (m *CartesianLayout) GetViewid() int64

func (*CartesianLayout) GetX

func (m *CartesianLayout) GetX() float64

func (*CartesianLayout) GetY

func (m *CartesianLayout) GetY() float64

func (*CartesianLayout) ProtoMessage

func (*CartesianLayout) ProtoMessage()

func (*CartesianLayout) Reset

func (m *CartesianLayout) Reset()

func (*CartesianLayout) String

func (m *CartesianLayout) String() string

type CyServiceClient

type CyServiceClient interface {
	StreamElements(ctx context.Context, opts ...grpc.CallOption) (CyService_StreamElementsClient, error)
}

func NewCyServiceClient

func NewCyServiceClient(cc *grpc.ClientConn) CyServiceClient

type CyServiceServer

type CyServiceServer interface {
	StreamElements(CyService_StreamElementsServer) error
}

type CyService_StreamElementsClient

type CyService_StreamElementsClient interface {
	Send(*Element) error
	Recv() (*Element, error)
	grpc.ClientStream
}

type CyService_StreamElementsServer

type CyService_StreamElementsServer interface {
	Send(*Element) error
	Recv() (*Element, error)
	grpc.ServerStream
}

type Decoder

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

Decoder decodes a JSON stream into a stream of protocol buffer elements, and hands them off to it's internal streamer for further processing.

func NewDecoder

func NewDecoder(r io.Reader, o *DecoderOptions, streamer func(*Element) error) *Decoder

NewDecoder initializes and returns a JSON Decoder that decodes to a stream of protobuf elements defined in this package. NewDecoder accepts a stream to read from, r, an options struct, o, and a calback function, s, that accepts a single element s that can stream the element elewhere or handle it in some way. Before calling NewDecoder, a DecoderOptions struct should be made detailing the expected input from the stream.

func (*Decoder) Decode

func (dec *Decoder) Decode()

Decode parses a json stream as specified by the DecoderOptions in protobuf elements. It can parse a singleton network or a list of one or more networks. Every decoded element has a networkId specifing which network it belongs to. A singleton network's elements will all have networkId set to 0. A list of networks will have elements with networkId 1 through DecoderOptions.NumNetworks inclusive. For every element in a network, Decode will call the streamer passed into NewDecoder with the element as the sole argument. The streamer may then decide what to do with the element.

type DecoderOptions

type DecoderOptions struct {
	RequiredAspects []string
	IsCollection    bool
	NumNetworks     int64
}

DecoderOptions provides a simple interfaces to configure a cxpb JSON Decoder. The IsCollection flag specifies whether the Decoder should expect an array of 0 or more networks, or a singleton network. If IsCollection is set, the Decoder will decode the number of networks specified in NumNetworks. Any network Decoded, singleton or nested, should contain at least the Aspects defined in RequiredAspects. RequiredAspects must, in turn, be a subset of KnownAspects. The Decoder will only parse and send Aspects that are in both RequiredAspects and KnownAspects to the streamer.

type Edge

type Edge struct {
	Id          int64  `protobuf:"varint,1,opt,name=id,json=@id" json:"id,omitempty"`
	SourceId    int64  `protobuf:"varint,2,opt,name=sourceId,json=s" json:"sourceId,omitempty"`
	TargetId    int64  `protobuf:"varint,3,opt,name=targetId,json=t" json:"targetId,omitempty"`
	Interaction string `protobuf:"bytes,4,opt,name=interaction,json=i" json:"interaction,omitempty"`
}

func (*Edge) Descriptor

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

func (*Edge) GetId

func (m *Edge) GetId() int64

func (*Edge) GetInteraction

func (m *Edge) GetInteraction() string

func (*Edge) GetSourceId

func (m *Edge) GetSourceId() int64

func (*Edge) GetTargetId

func (m *Edge) GetTargetId() int64

func (*Edge) ProtoMessage

func (*Edge) ProtoMessage()

func (*Edge) Reset

func (m *Edge) Reset()

func (*Edge) String

func (m *Edge) String() string

type EdgeAttribute

type EdgeAttribute struct {
	EdgeId   int64  `protobuf:"varint,1,opt,name=edgeId,json=po" json:"edgeId,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,json=n" json:"name,omitempty"`
	Value    string `protobuf:"bytes,3,opt,name=value,json=v" json:"value,omitempty"`
	Type     string `protobuf:"bytes,4,opt,name=type,json=d" json:"type,omitempty"`
	SubnetId int64  `protobuf:"varint,5,opt,name=subnetId,json=s" json:"subnetId,omitempty"`
}

func (*EdgeAttribute) Descriptor

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

func (*EdgeAttribute) GetEdgeId

func (m *EdgeAttribute) GetEdgeId() int64

func (*EdgeAttribute) GetName

func (m *EdgeAttribute) GetName() string

func (*EdgeAttribute) GetSubnetId

func (m *EdgeAttribute) GetSubnetId() int64

func (*EdgeAttribute) GetType

func (m *EdgeAttribute) GetType() string

func (*EdgeAttribute) GetValue

func (m *EdgeAttribute) GetValue() string

func (*EdgeAttribute) ProtoMessage

func (*EdgeAttribute) ProtoMessage()

func (*EdgeAttribute) Reset

func (m *EdgeAttribute) Reset()

func (*EdgeAttribute) String

func (m *EdgeAttribute) String() string

type Element

type Element struct {
	NetworkId int64 `protobuf:"varint,1,opt,name=networkId" json:"networkId,omitempty"`
	// Types that are valid to be assigned to Value:
	//	*Element_Parameter
	//	*Element_Error
	//	*Element_NumberVerification
	//	*Element_Metadata
	//	*Element_Aspect
	//	*Element_Node
	//	*Element_Edge
	//	*Element_NodeAttribute
	//	*Element_EdgeAttribute
	//	*Element_NetworkAttribute
	//	*Element_CartesianLayout
	Value isElement_Value `protobuf_oneof:"value"`
}

func (*Element) Descriptor

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

func (*Element) GetAspect

func (m *Element) GetAspect() *AnonymousAspect

func (*Element) GetCartesianLayout

func (m *Element) GetCartesianLayout() *CartesianLayout

func (*Element) GetEdge

func (m *Element) GetEdge() *Edge

func (*Element) GetEdgeAttribute

func (m *Element) GetEdgeAttribute() *EdgeAttribute

func (*Element) GetError

func (m *Element) GetError() *Error

func (*Element) GetMetadata

func (m *Element) GetMetadata() *MetaData

func (*Element) GetNetworkAttribute

func (m *Element) GetNetworkAttribute() *NetworkAttribute

func (*Element) GetNetworkId

func (m *Element) GetNetworkId() int64

func (*Element) GetNode

func (m *Element) GetNode() *Node

func (*Element) GetNodeAttribute

func (m *Element) GetNodeAttribute() *NodeAttribute

func (*Element) GetNumberVerification

func (m *Element) GetNumberVerification() *NumberVerification

func (*Element) GetParameter

func (m *Element) GetParameter() *Parameter

func (*Element) GetValue

func (m *Element) GetValue() isElement_Value

func (*Element) ProtoMessage

func (*Element) ProtoMessage()

func (*Element) Reset

func (m *Element) Reset()

func (*Element) String

func (m *Element) String() string

func (*Element) XXX_OneofFuncs

func (*Element) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type Element_Aspect

type Element_Aspect struct {
	Aspect *AnonymousAspect `protobuf:"bytes,6,opt,name=aspect,oneof"`
}

type Element_CartesianLayout

type Element_CartesianLayout struct {
	CartesianLayout *CartesianLayout `protobuf:"bytes,12,opt,name=cartesianLayout,oneof"`
}

type Element_Edge

type Element_Edge struct {
	Edge *Edge `protobuf:"bytes,8,opt,name=edge,oneof"`
}

type Element_EdgeAttribute

type Element_EdgeAttribute struct {
	EdgeAttribute *EdgeAttribute `protobuf:"bytes,10,opt,name=edgeAttribute,oneof"`
}

type Element_Error

type Element_Error struct {
	Error *Error `protobuf:"bytes,3,opt,name=error,oneof"`
}

type Element_Metadata

type Element_Metadata struct {
	Metadata *MetaData `protobuf:"bytes,5,opt,name=metadata,oneof"`
}

type Element_NetworkAttribute

type Element_NetworkAttribute struct {
	NetworkAttribute *NetworkAttribute `protobuf:"bytes,11,opt,name=networkAttribute,oneof"`
}

type Element_Node

type Element_Node struct {
	Node *Node `protobuf:"bytes,7,opt,name=node,oneof"`
}

type Element_NodeAttribute

type Element_NodeAttribute struct {
	NodeAttribute *NodeAttribute `protobuf:"bytes,9,opt,name=nodeAttribute,oneof"`
}

type Element_NumberVerification

type Element_NumberVerification struct {
	NumberVerification *NumberVerification `protobuf:"bytes,4,opt,name=numberVerification,oneof"`
}

type Element_Parameter

type Element_Parameter struct {
	Parameter *Parameter `protobuf:"bytes,2,opt,name=parameter,oneof"`
}

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer, o *EncoderOptions, stream func() (*Element, error)) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode() (errors []*Error)

type EncoderOptions

type EncoderOptions struct {
	RequiredAspects []string
	IsCollection    bool
	NumNetworks     int64
}

type Error

type Error struct {
	Status  int64  `protobuf:"varint,1,opt,name=status" json:"status,omitempty"`
	Code    string `protobuf:"bytes,2,opt,name=code" json:"code,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"`
	Link    string `protobuf:"bytes,4,opt,name=link" json:"link,omitempty"`
}

func (*Error) Descriptor

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

func (*Error) GetCode

func (m *Error) GetCode() string
func (m *Error) GetLink() string

func (*Error) GetMessage

func (m *Error) GetMessage() string

func (*Error) GetStatus

func (m *Error) GetStatus() int64

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

type MetaData

type MetaData struct {
	Name             string      `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Version          string      `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
	IdCounter        int64       `protobuf:"varint,3,opt,name=idCounter" json:"idCounter,omitempty"`
	ElementCount     int64       `protobuf:"varint,4,opt,name=elementCount" json:"elementCount,omitempty"`
	ConsistencyGroup int64       `protobuf:"varint,5,opt,name=consistencyGroup" json:"consistencyGroup,omitempty"`
	Checksum         int64       `protobuf:"varint,6,opt,name=checksum" json:"checksum,omitempty"`
	Properties       []*Property `protobuf:"bytes,7,rep,name=properties" json:"properties,omitempty"`
}

func (*MetaData) Descriptor

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

func (*MetaData) GetChecksum

func (m *MetaData) GetChecksum() int64

func (*MetaData) GetConsistencyGroup

func (m *MetaData) GetConsistencyGroup() int64

func (*MetaData) GetElementCount

func (m *MetaData) GetElementCount() int64

func (*MetaData) GetIdCounter

func (m *MetaData) GetIdCounter() int64

func (*MetaData) GetName

func (m *MetaData) GetName() string

func (*MetaData) GetProperties

func (m *MetaData) GetProperties() []*Property

func (*MetaData) GetVersion

func (m *MetaData) GetVersion() string

func (*MetaData) ProtoMessage

func (*MetaData) ProtoMessage()

func (*MetaData) Reset

func (m *MetaData) Reset()

func (*MetaData) String

func (m *MetaData) String() string

type NetworkAttribute

type NetworkAttribute struct {
	EdgeId   int64  `protobuf:"varint,1,opt,name=edgeId,json=po" json:"edgeId,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,json=n" json:"name,omitempty"`
	Value    string `protobuf:"bytes,3,opt,name=value,json=v" json:"value,omitempty"`
	Type     string `protobuf:"bytes,4,opt,name=type,json=d" json:"type,omitempty"`
	SubnetId int64  `protobuf:"varint,5,opt,name=subnetId,json=s" json:"subnetId,omitempty"`
}

func (*NetworkAttribute) Descriptor

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

func (*NetworkAttribute) GetEdgeId

func (m *NetworkAttribute) GetEdgeId() int64

func (*NetworkAttribute) GetName

func (m *NetworkAttribute) GetName() string

func (*NetworkAttribute) GetSubnetId

func (m *NetworkAttribute) GetSubnetId() int64

func (*NetworkAttribute) GetType

func (m *NetworkAttribute) GetType() string

func (*NetworkAttribute) GetValue

func (m *NetworkAttribute) GetValue() string

func (*NetworkAttribute) ProtoMessage

func (*NetworkAttribute) ProtoMessage()

func (*NetworkAttribute) Reset

func (m *NetworkAttribute) Reset()

func (*NetworkAttribute) String

func (m *NetworkAttribute) String() string

type Node

type Node struct {
	Id         int64  `protobuf:"varint,1,opt,name=id,json=@id" json:"id,omitempty"`
	Name       string `protobuf:"bytes,2,opt,name=name,json=n" json:"name,omitempty"`
	Represents string `protobuf:"bytes,3,opt,name=represents,json=r" json:"represents,omitempty"`
}

func (*Node) Descriptor

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

func (*Node) GetId

func (m *Node) GetId() int64

func (*Node) GetName

func (m *Node) GetName() string

func (*Node) GetRepresents

func (m *Node) GetRepresents() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) String

func (m *Node) String() string

type NodeAttribute

type NodeAttribute struct {
	NodeId   int64  `protobuf:"varint,1,opt,name=nodeId,json=po" json:"nodeId,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,json=n" json:"name,omitempty"`
	Value    string `protobuf:"bytes,3,opt,name=value,json=v" json:"value,omitempty"`
	Type     string `protobuf:"bytes,4,opt,name=type,json=d" json:"type,omitempty"`
	SubnetId int64  `protobuf:"varint,5,opt,name=subnetId,json=s" json:"subnetId,omitempty"`
}

func (*NodeAttribute) Descriptor

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

func (*NodeAttribute) GetName

func (m *NodeAttribute) GetName() string

func (*NodeAttribute) GetNodeId

func (m *NodeAttribute) GetNodeId() int64

func (*NodeAttribute) GetSubnetId

func (m *NodeAttribute) GetSubnetId() int64

func (*NodeAttribute) GetType

func (m *NodeAttribute) GetType() string

func (*NodeAttribute) GetValue

func (m *NodeAttribute) GetValue() string

func (*NodeAttribute) ProtoMessage

func (*NodeAttribute) ProtoMessage()

func (*NodeAttribute) Reset

func (m *NodeAttribute) Reset()

func (*NodeAttribute) String

func (m *NodeAttribute) String() string

type NumberVerification

type NumberVerification struct {
	LongNumber int64 `protobuf:"varint,1,opt,name=longNumber" json:"longNumber,omitempty"`
}

func (*NumberVerification) Descriptor

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

func (*NumberVerification) GetLongNumber

func (m *NumberVerification) GetLongNumber() int64

func (*NumberVerification) ProtoMessage

func (*NumberVerification) ProtoMessage()

func (*NumberVerification) Reset

func (m *NumberVerification) Reset()

func (*NumberVerification) String

func (m *NumberVerification) String() string

type Parameter

type Parameter struct {
	Name  string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

func (*Parameter) Descriptor

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

func (*Parameter) GetName

func (m *Parameter) GetName() string

func (*Parameter) GetValue

func (m *Parameter) GetValue() string

func (*Parameter) ProtoMessage

func (*Parameter) ProtoMessage()

func (*Parameter) Reset

func (m *Parameter) Reset()

func (*Parameter) String

func (m *Parameter) String() string

type Property

type Property struct {
	Name  string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

func (*Property) Descriptor

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

func (*Property) GetName

func (m *Property) GetName() string

func (*Property) GetValue

func (m *Property) GetValue() string

func (*Property) ProtoMessage

func (*Property) ProtoMessage()

func (*Property) Reset

func (m *Property) Reset()

func (*Property) String

func (m *Property) String() string

type ServiceError

type ServiceError struct{}

func (*ServiceError) Error

func (s *ServiceError) Error() string

Jump to

Keyboard shortcuts

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