kelipspb

package
v0.0.0-...-efce6da Latest Latest
Warning

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

Go to latest
Published: May 20, 2018 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package kelipspb is a generated protocol buffer package.

It is generated from these files:

structs.proto

It has these top-level messages:

Tuple
Node
ReqResp
Snapshot

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Address

type Address []byte

Address holds a ip:port format address. IPv4 and IPv6 are supported

func NewAddress

func NewAddress(hostport string) Address

func (Address) IP

func (addr Address) IP() net.IP

IP returns the ip of the address

func (Address) Port

func (addr Address) Port() uint16

Port returns the port of the address

func (Address) String

func (addr Address) String() string

type Node

type Node struct {
	// Auto-generated. Will be unique across cluster
	ID []byte `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// Advertised cluster address
	Address Address `protobuf:"bytes,2,opt,name=Address,proto3,casttype=Address" json:"Address,omitempty"`
	// In nanseconds
	LastSeen int64 `protobuf:"varint,3,opt,name=LastSeen,proto3" json:"LastSeen,omitempty"`
	// Number of times 'contacted' e.g. update on each ping
	Heartbeats uint32 `protobuf:"varint,4,opt,name=Heartbeats,proto3" json:"Heartbeats,omitempty"`
	// Latency from the perspective of the 'cluster' node returning this
	// object in nanseconds
	Latency time.Duration `protobuf:"varint,5,opt,name=Latency,proto3,stdduration" json:"Latency,omitempty"`
	// Additional custom metadata
	Meta map[string]string `` /* 142-byte string literal not displayed */
	// Virtual coordinate space
	Coordinates *vivaldi.Coordinate `protobuf:"bytes,7,opt,name=Coordinates" json:"Coordinates,omitempty"`
}

func NewNode

func NewNode(addr string, port int) *Node

NewNode returns a new node with the given ip and port

func (*Node) Descriptor

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

func (*Node) GetAddress

func (m *Node) GetAddress() Address

func (*Node) GetCoordinates

func (m *Node) GetCoordinates() *vivaldi.Coordinate

func (*Node) GetHeartbeats

func (m *Node) GetHeartbeats() uint32

func (*Node) GetID

func (m *Node) GetID() []byte

func (*Node) GetLastSeen

func (m *Node) GetLastSeen() int64

func (*Node) GetLatency

func (m *Node) GetLatency() time.Duration

func (*Node) GetMeta

func (m *Node) GetMeta() map[string]string

func (*Node) HashID

func (node *Node) HashID(h hash.Hash) []byte

HashID returns the hash the node address

func (*Node) Marshal

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

func (*Node) MarshalJSON

func (node *Node) MarshalJSON() ([]byte, error)

MarshalJSON marshals the node to human readable json

func (*Node) MarshalTo

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

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) Size

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

func (*Node) String

func (m *Node) String() string

func (*Node) Unmarshal

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

type ReqResp

type ReqResp struct {
	Key   []byte  `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
	Nodes []*Node `protobuf:"bytes,2,rep,name=Nodes" json:"Nodes,omitempty"`
}

func (*ReqResp) Descriptor

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

func (*ReqResp) GetKey

func (m *ReqResp) GetKey() []byte

func (*ReqResp) GetNodes

func (m *ReqResp) GetNodes() []*Node

func (*ReqResp) Marshal

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

func (*ReqResp) MarshalTo

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

func (*ReqResp) ProtoMessage

func (*ReqResp) ProtoMessage()

func (*ReqResp) Reset

func (m *ReqResp) Reset()

func (*ReqResp) Size

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

func (*ReqResp) String

func (m *ReqResp) String() string

func (*ReqResp) Unmarshal

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

type Snapshot

type Snapshot struct {
	Groups int32    `protobuf:"varint,1,opt,name=Groups,proto3" json:"Groups,omitempty"`
	Tuples []*Tuple `protobuf:"bytes,2,rep,name=Tuples" json:"Tuples,omitempty"`
	Nodes  []*Node  `protobuf:"bytes,3,rep,name=Nodes" json:"Nodes,omitempty"`
}

func (*Snapshot) Descriptor

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

func (*Snapshot) GetGroups

func (m *Snapshot) GetGroups() int32

func (*Snapshot) GetNodes

func (m *Snapshot) GetNodes() []*Node

func (*Snapshot) GetTuples

func (m *Snapshot) GetTuples() []*Tuple

func (*Snapshot) Marshal

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

func (*Snapshot) MarshalTo

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

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) Size

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

func (*Snapshot) String

func (m *Snapshot) String() string

func (*Snapshot) Unmarshal

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

type Tuple

type Tuple struct {
	Key   []byte   `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
	Hosts [][]byte `protobuf:"bytes,2,rep,name=Hosts" json:"Hosts,omitempty"`
}

func (*Tuple) Descriptor

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

func (*Tuple) GetHosts

func (m *Tuple) GetHosts() [][]byte

func (*Tuple) GetKey

func (m *Tuple) GetKey() []byte

func (*Tuple) Marshal

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

func (*Tuple) MarshalTo

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

func (*Tuple) ProtoMessage

func (*Tuple) ProtoMessage()

func (*Tuple) Reset

func (m *Tuple) Reset()

func (*Tuple) Size

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

func (*Tuple) String

func (m *Tuple) String() string

func (*Tuple) Unmarshal

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

Jump to

Keyboard shortcuts

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