types

package
v0.0.0-...-1472157 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolUnspecified = "nil"
	ProtocolGrpc        = "grpc"
)

Variables

View Source
var (
	EmptyTopic = Topic{}
)

Functions

This section is empty.

Types

type Change

type Change struct {
	Op    Operation
	Topic Topic
}

func NewChange

func NewChange(op Operation, t Topic) *Change

func (*Change) Marshal

func (c *Change) Marshal() *pb.Change

func (*Change) Unmarshal

func (c *Change) Unmarshal(cg *pb.Change)

type Member

type Member struct {
	Cname string
	Name  string
	Pro   Protocol
	Host  string
	Port  string
}

func (Member) Address

func (m Member) Address() string

func (Member) Equals

func (m Member) Equals(x Member) bool

func (Member) EqualsId

func (m Member) EqualsId(x Member) bool

type Message

type Message struct {
	Topic  Topic
	Mode   Mode
	Method Method
	Data   []byte
	TP     time.Time
}

func (*Message) Marshal

func (m *Message) Marshal() *pb.Message

func (Message) String

func (m Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(msg *pb.Message) error

type Method

type Method byte
const (
	MethodUnspecified Method = iota
	MethodEmpty
	MethodCreate
	MethodUpdate
	MethodDelete
)

func (*Method) FromBuf

func (m *Method) FromBuf(p pb.Method)

func (Method) String

func (m Method) String() string

func (Method) ToBuf

func (m Method) ToBuf() pb.Method

type Mode

type Mode byte
const (
	ModeUnspecified Mode = iota
	ModeAny
	ModeRoute
	ModeRoot
)

func (*Mode) FromBuf

func (m *Mode) FromBuf(buf pb.Mode)

func (Mode) String

func (m Mode) String() string

func (Mode) ToBuf

func (m Mode) ToBuf() pb.Mode

type Operation

type Operation byte
const (
	OperationUnspecified Operation = iota
	OperationAdd
	OperationDel
)

func (*Operation) FromBuf

func (o *Operation) FromBuf(buf pb.Operation)

func (Operation) String

func (o Operation) String() string

func (Operation) ToBuf

func (o Operation) ToBuf() pb.Operation

type Protocol

type Protocol string

func (Protocol) String

func (p Protocol) String() string

type Topic

type Topic []string

func (Topic) Empty

func (t Topic) Empty() bool

Empty topic means a wildcard for all kinds of topic

Jump to

Keyboard shortcuts

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