go_micro_network_mucp

package
Version: v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdvertType_name = map[int32]string{
		0: "AdvertAnnounce",
		1: "AdvertUpdate",
	}
	AdvertType_value = map[string]int32{
		"AdvertAnnounce": 0,
		"AdvertUpdate":   1,
	}
)

Enum value maps for AdvertType.

View Source
var (
	EventType_name = map[int32]string{
		0: "Create",
		1: "Delete",
		2: "Update",
	}
	EventType_value = map[string]int32{
		"Create": 0,
		"Delete": 1,
		"Update": 2,
	}
)

Enum value maps for EventType.

View Source
var File_github_com_micro_go_micro_network_mucp_proto_network_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Advert struct {

	// id of the advertising router
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// type of advertisement
	Type AdvertType `protobuf:"varint,2,opt,name=type,proto3,enum=go.micro.network.mucp.AdvertType" json:"type,omitempty"`
	// unix timestamp of the advertisement
	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// TTL of the Advert
	Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// events is a list of advertised events
	Events []*Event `protobuf:"bytes,5,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

Advert is router advertsement streamed by Watch

func (*Advert) Descriptor deprecated

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

Deprecated: Use Advert.ProtoReflect.Descriptor instead.

func (*Advert) GetEvents

func (x *Advert) GetEvents() []*Event

func (*Advert) GetId

func (x *Advert) GetId() string

func (*Advert) GetTimestamp

func (x *Advert) GetTimestamp() int64

func (*Advert) GetTtl

func (x *Advert) GetTtl() int64

func (*Advert) GetType

func (x *Advert) GetType() AdvertType

func (*Advert) ProtoMessage

func (*Advert) ProtoMessage()

func (*Advert) ProtoReflect

func (x *Advert) ProtoReflect() protoreflect.Message

func (*Advert) Reset

func (x *Advert) Reset()

func (*Advert) String

func (x *Advert) String() string

type AdvertType

type AdvertType int32

AdvertType defines the type of advert

const (
	AdvertType_AdvertAnnounce AdvertType = 0
	AdvertType_AdvertUpdate   AdvertType = 1
)

func (AdvertType) Descriptor

func (AdvertType) Descriptor() protoreflect.EnumDescriptor

func (AdvertType) Enum

func (x AdvertType) Enum() *AdvertType

func (AdvertType) EnumDescriptor deprecated

func (AdvertType) EnumDescriptor() ([]byte, []int)

Deprecated: Use AdvertType.Descriptor instead.

func (AdvertType) Number

func (x AdvertType) Number() protoreflect.EnumNumber

func (AdvertType) String

func (x AdvertType) String() string

func (AdvertType) Type

type Close

type Close struct {

	// network node
	Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// contains filtered or unexported fields
}

Close is sent when the node disconnects from the network

func (*Close) Descriptor deprecated

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

Deprecated: Use Close.ProtoReflect.Descriptor instead.

func (*Close) GetNode

func (x *Close) GetNode() *Node

func (*Close) ProtoMessage

func (*Close) ProtoMessage()

func (*Close) ProtoReflect

func (x *Close) ProtoReflect() protoreflect.Message

func (*Close) Reset

func (x *Close) Reset()

func (*Close) String

func (x *Close) String() string

type Connect

type Connect struct {

	// network mode
	Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// contains filtered or unexported fields
}

Connect is sent when the node connects to the network

func (*Connect) Descriptor deprecated

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

Deprecated: Use Connect.ProtoReflect.Descriptor instead.

func (*Connect) GetNode

func (x *Connect) GetNode() *Node

func (*Connect) ProtoMessage

func (*Connect) ProtoMessage()

func (*Connect) ProtoReflect

func (x *Connect) ProtoReflect() protoreflect.Message

func (*Connect) Reset

func (x *Connect) Reset()

func (*Connect) String

func (x *Connect) String() string

type Error

type Error struct {
	Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	Msg   string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

Error tracks network errors

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCount

func (x *Error) GetCount() uint32

func (*Error) GetMsg

func (x *Error) GetMsg() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

func (x *Error) ProtoReflect() protoreflect.Message

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type Event

type Event struct {

	// the unique event id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// type of event
	Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=go.micro.network.mucp.EventType" json:"type,omitempty"`
	// unix timestamp of event
	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// service route
	Route *Route `protobuf:"bytes,4,opt,name=route,proto3" json:"route,omitempty"`
	// contains filtered or unexported fields
}

Event is routing table event

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetId

func (x *Event) GetId() string

func (*Event) GetRoute

func (x *Event) GetRoute() *Route

func (*Event) GetTimestamp

func (x *Event) GetTimestamp() int64

func (*Event) GetType

func (x *Event) GetType() EventType

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type EventType

type EventType int32

EventType defines the type of event

const (
	EventType_Create EventType = 0
	EventType_Delete EventType = 1
	EventType_Update EventType = 2
)

func (EventType) Descriptor

func (EventType) Descriptor() protoreflect.EnumDescriptor

func (EventType) Enum

func (x EventType) Enum() *EventType

func (EventType) EnumDescriptor deprecated

func (EventType) EnumDescriptor() ([]byte, []int)

Deprecated: Use EventType.Descriptor instead.

func (EventType) Number

func (x EventType) Number() protoreflect.EnumNumber

func (EventType) String

func (x EventType) String() string

func (EventType) Type

type Node

type Node struct {

	// node id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// node address
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// the network
	Network string `protobuf:"bytes,3,opt,name=network,proto3" json:"network,omitempty"`
	// associated metadata
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// node status
	Status *Status `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Node is network node

func (*Node) Descriptor deprecated

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetAddress

func (x *Node) GetAddress() string

func (*Node) GetId

func (x *Node) GetId() string

func (*Node) GetMetadata

func (x *Node) GetMetadata() map[string]string

func (*Node) GetNetwork

func (x *Node) GetNetwork() string

func (*Node) GetStatus

func (x *Node) GetStatus() *Status

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type Peer

type Peer struct {

	// network node
	Node *Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// node peers
	Peers []*Peer `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"`
	// contains filtered or unexported fields
}

Peer is used to advertise node peers

func (*Peer) Descriptor deprecated

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

Deprecated: Use Peer.ProtoReflect.Descriptor instead.

func (*Peer) GetNode

func (x *Peer) GetNode() *Node

func (*Peer) GetPeers

func (x *Peer) GetPeers() []*Peer

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) ProtoReflect

func (x *Peer) ProtoReflect() protoreflect.Message

func (*Peer) Reset

func (x *Peer) Reset()

func (*Peer) String

func (x *Peer) String() string

type Route

type Route struct {

	// service for the route
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// the address that advertise this route
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// gateway as the next hop
	Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	// the network for this destination
	Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"`
	// router if the router id
	Router string `protobuf:"bytes,5,opt,name=router,proto3" json:"router,omitempty"`
	// the network link
	Link string `protobuf:"bytes,6,opt,name=link,proto3" json:"link,omitempty"`
	// the metric / score of this route
	Metric int64 `protobuf:"varint,7,opt,name=metric,proto3" json:"metric,omitempty"`
	// metadata for the route
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

Route is a service route

func (*Route) Descriptor deprecated

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

Deprecated: Use Route.ProtoReflect.Descriptor instead.

func (*Route) GetAddress

func (x *Route) GetAddress() string

func (*Route) GetGateway

func (x *Route) GetGateway() string
func (x *Route) GetLink() string

func (*Route) GetMetadata

func (x *Route) GetMetadata() map[string]string

func (*Route) GetMetric

func (x *Route) GetMetric() int64

func (*Route) GetNetwork

func (x *Route) GetNetwork() string

func (*Route) GetRouter

func (x *Route) GetRouter() string

func (*Route) GetService

func (x *Route) GetService() string

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) ProtoReflect

func (x *Route) ProtoReflect() protoreflect.Message

func (*Route) Reset

func (x *Route) Reset()

func (*Route) String

func (x *Route) String() string

type Status

type Status struct {
	Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

Status is node status

func (*Status) Descriptor deprecated

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

Deprecated: Use Status.ProtoReflect.Descriptor instead.

func (*Status) GetError

func (x *Status) GetError() *Error

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) ProtoReflect

func (x *Status) ProtoReflect() protoreflect.Message

func (*Status) Reset

func (x *Status) Reset()

func (*Status) String

func (x *Status) String() string

type Sync

type Sync struct {

	// peer origin
	Peer *Peer `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
	// node routes
	Routes []*Route `protobuf:"bytes,2,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

Sync is network sync message

func (*Sync) Descriptor deprecated

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

Deprecated: Use Sync.ProtoReflect.Descriptor instead.

func (*Sync) GetPeer

func (x *Sync) GetPeer() *Peer

func (*Sync) GetRoutes

func (x *Sync) GetRoutes() []*Route

func (*Sync) ProtoMessage

func (*Sync) ProtoMessage()

func (*Sync) ProtoReflect

func (x *Sync) ProtoReflect() protoreflect.Message

func (*Sync) Reset

func (x *Sync) Reset()

func (*Sync) String

func (x *Sync) String() string

Jump to

Keyboard shortcuts

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