server

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetaSize = 26
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACMESynchronization

type ACMESynchronization struct {
	From        uint64
	AccountFile *acme.AccountFile
	Bundle      *acme.Bundle
}

type Config

type Config struct {
	Context            context.Context
	Logger             *zap.Logger
	Network            Network
	PeerTLSListener    net.Listener
	PeerQUICListener   quic.Listener
	PeerTLSConfig      *tls.Config
	ClientTLSListener  net.Listener
	ClientQUICListener quic.Listener
	Multiplexer        MultiplexerConfig
	Gossip             GossipConfig
	CertManager        *acme.CertManager
	Debug              bool
	Domain             string
}

type GossipConfig

type GossipConfig struct {
	Port    int
	Keyring []string
	Members []string
}

type Meta

type Meta struct {
	ConnectIP   string
	ConnectPort uint64
	PeerID      uint64
	Protocol    protocol.Protocol
	RespondOnly bool
}

func (*Meta) MarshalBinary added in v0.5.1

func (m *Meta) MarshalBinary() ([]byte, error)

func (Meta) MarshalLogObject added in v0.5.0

func (m Meta) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*Meta) UnmarshalBinary added in v0.5.1

func (m *Meta) UnmarshalBinary(b []byte) error

type MultiplexerConfig

type MultiplexerConfig struct {
	Peer        int
	Protocol    protocol.Protocol
	RespondOnly bool
}

type Network

type Network struct {
	AdvertiseAddr string
	BindAddr      string
}

type Server

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

func New

func New(conf Config) (*Server, error)

func (*Server) AckPayload added in v0.5.3

func (s *Server) AckPayload() []byte

func (*Server) Direct

func (s *Server) Direct(ctx context.Context, link multiplexer.Link) (net.Conn, error)

func (*Server) Forward

func (s *Server) Forward(ctx context.Context, conn net.Conn, link multiplexer.Link) (<-chan error, error)

func (*Server) GetBroadcasts

func (s *Server) GetBroadcasts(overhead, limit int) [][]byte

func (*Server) Gossip

func (s *Server) Gossip() error

func (*Server) ListenForClients

func (s *Server) ListenForClients()

func (*Server) ListenForPeers

func (s *Server) ListenForPeers()

func (*Server) LocalState

func (s *Server) LocalState(join bool) []byte

func (*Server) MergeRemoteState

func (s *Server) MergeRemoteState(buf []byte, join bool)

func (*Server) NodeMeta

func (s *Server) NodeMeta(limit int) []byte

func (*Server) NotifyJoin

func (s *Server) NotifyJoin(node *memberlist.Node)

func (*Server) NotifyLeave

func (s *Server) NotifyLeave(node *memberlist.Node)

func (*Server) NotifyMsg

func (s *Server) NotifyMsg(msg []byte)

func (*Server) NotifyPingComplete added in v0.5.3

func (s *Server) NotifyPingComplete(other *memberlist.Node, rtt time.Duration, payload []byte)

func (*Server) NotifyUpdate

func (s *Server) NotifyUpdate(node *memberlist.Node)

func (*Server) PeerID

func (s *Server) PeerID() uint64

Jump to

Keyboard shortcuts

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