ctrlmesh

package module
v0.0.0-...-8b3bbdc Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageType_name = map[int32]string{
		0: "Zero",
		1: "Hello",
		2: "FullState",
	}
	MessageType_value = map[string]int32{
		"Zero":      0,
		"Hello":     1,
		"FullState": 2,
	}
)

Enum value maps for MessageType.

View Source
var File_peerlist_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(cfg *AgentConfig) (*Agent, error)

func (*Agent) Join

func (self *Agent) Join() error

func (*Agent) Query

func (self *Agent) Query()

func (*Agent) Status

func (self *Agent) Status()

type AgentConfig

type AgentConfig struct {
	Identity         string `cf:"identity"`
	BindAddress      string `cf:"bind_address"`
	AdvertiseAddress string `cf:"advertise_address"`
	InitialPeerList  string `cf:"initial_peer"`
	DataListener     string `cf:"data_listener"`
}

func Load

func Load(path string) (*AgentConfig, error)

type FullStateMessage

type FullStateMessage struct {
	Peers []*PeerMessage `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"`
	// contains filtered or unexported fields
}

func (*FullStateMessage) Descriptor deprecated

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

Deprecated: Use FullStateMessage.ProtoReflect.Descriptor instead.

func (*FullStateMessage) GetPeers

func (x *FullStateMessage) GetPeers() []*PeerMessage

func (*FullStateMessage) ProtoMessage

func (*FullStateMessage) ProtoMessage()

func (*FullStateMessage) ProtoReflect

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

func (*FullStateMessage) Reset

func (x *FullStateMessage) Reset()

func (*FullStateMessage) String

func (x *FullStateMessage) String() string

type HelloMessage

type HelloMessage struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloMessage) Descriptor deprecated

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

Deprecated: Use HelloMessage.ProtoReflect.Descriptor instead.

func (*HelloMessage) GetId

func (x *HelloMessage) GetId() string

func (*HelloMessage) GetVersion

func (x *HelloMessage) GetVersion() uint32

func (*HelloMessage) ProtoMessage

func (*HelloMessage) ProtoMessage()

func (*HelloMessage) ProtoReflect

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

func (*HelloMessage) Reset

func (x *HelloMessage) Reset()

func (*HelloMessage) String

func (x *HelloMessage) String() string

type MessageType

type MessageType int32
const (
	MessageType_Zero      MessageType = 0
	MessageType_Hello     MessageType = 1
	MessageType_FullState MessageType = 2
)

func (MessageType) Descriptor

func (MessageType) Enum

func (x MessageType) Enum() *MessageType

func (MessageType) EnumDescriptor deprecated

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

Deprecated: Use MessageType.Descriptor instead.

func (MessageType) Number

func (x MessageType) Number() protoreflect.EnumNumber

func (MessageType) String

func (x MessageType) String() string

func (MessageType) Type

type PeerList

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

func NewPeerList

func NewPeerList(cfg *PeerListConfig) (*PeerList, error)

type PeerListConfig

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

func LoadPeerListConfig

func LoadPeerListConfig(data map[string]interface{}) (*PeerListConfig, error)

func LoadPeerListConfigYaml

func LoadPeerListConfigYaml(path string) (*PeerListConfig, error)

type PeerMessage

type PeerMessage struct {
	Id      string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Ads     []string `protobuf:"bytes,2,rep,name=ads,proto3" json:"ads,omitempty"`
	Updated uint32   `protobuf:"varint,3,opt,name=updated,proto3" json:"updated,omitempty"`
	// contains filtered or unexported fields
}

func (*PeerMessage) Descriptor deprecated

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

Deprecated: Use PeerMessage.ProtoReflect.Descriptor instead.

func (*PeerMessage) GetAds

func (x *PeerMessage) GetAds() []string

func (*PeerMessage) GetId

func (x *PeerMessage) GetId() string

func (*PeerMessage) GetUpdated

func (x *PeerMessage) GetUpdated() uint32

func (*PeerMessage) ProtoMessage

func (*PeerMessage) ProtoMessage()

func (*PeerMessage) ProtoReflect

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

func (*PeerMessage) Reset

func (x *PeerMessage) Reset()

func (*PeerMessage) String

func (x *PeerMessage) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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