core

package
v0.0.0-...-7e24c04 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Data  []byte
	Error error
}

type Node

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

func NewNode

func NewNode(comm commService, ps pingService, cm certManager, cs cryptoService) (*Node, error)

func (*Node) Addr

func (n *Node) Addr() string

func (*Node) HttpAddr

func (n *Node) HttpAddr() string

func (*Node) Id

func (n *Node) Id() string

func (*Node) IdToAddr

func (n *Node) IdToAddr(id []byte) (string, error)

func (*Node) LiveMembers

func (n *Node) LiveMembers() []string

func (*Node) Messenger

func (n *Node) Messenger(ctx context.Context, args *pb.Msg) (*pb.MsgResponse, error)

func (*Node) OpenStream

func (n *Node) OpenStream(dest string, input, reply chan []byte)

func (*Node) SaveCertificate

func (n *Node) SaveCertificate() error

func (*Node) SavePrivateKey

func (n *Node) SavePrivateKey() error

func (*Node) SendMessage

func (n *Node) SendMessage(dest string, ch chan *Message, data []byte)

func (*Node) SendMessages

func (n *Node) SendMessages(dest []string, ch chan *Message, data []byte)

func (*Node) SendStream

func (n *Node) SendStream(ch chan<- []byte, data []byte)

func (*Node) SetExternalGossipContent

func (n *Node) SetExternalGossipContent(data []byte)

Exposed to let ifrit client set directly

func (*Node) SetGossipHandler

func (n *Node) SetGossipHandler(newHandler processMsg)

Expose so that client can set new handler directly

func (*Node) SetMsgHandler

func (n *Node) SetMsgHandler(newHandler processMsg)

Expose so that client can set new handler directly

func (*Node) SetResponseHandler

func (n *Node) SetResponseHandler(newHandler func([]byte))

Expose so that client can set new handler directly

func (*Node) SetStreamHandler

func (n *Node) SetStreamHandler(newHandler streamMsg)

Expose so that client can set new handler directly

func (*Node) Sign

func (n *Node) Sign(content []byte) ([]byte, []byte, error)

func (*Node) Spread

func (n *Node) Spread(ctx context.Context, args *pb.State) (*pb.StateResponse, error)

func (*Node) Start

func (n *Node) Start()

func (*Node) Stop

func (n *Node) Stop()

func (*Node) Stream

func (n *Node) Stream(srv pb.Gossip_StreamServer) error

func (*Node) Verify

func (n *Node) Verify(r, s, content []byte, id string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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