net

package
v0.0.0-...-bc0e287 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowList

type AllowList map[types.Token]types.Peer

func (AllowList) AddPeer

func (al AllowList) AddPeer(peer types.Peer) bool

func (AllowList) CheckToken

func (al AllowList) CheckToken(token types.Token) bool

func (AllowList) FindPeer

func (al AllowList) FindPeer(token types.Token) (types.Peer, bool)

type ChunkResolver

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

func (*ChunkResolver) CreateOrUpdate

func (s *ChunkResolver) CreateOrUpdate(mi MessageChunk) (m Message)

func (*ChunkResolver) IsMessageResolved

func (s *ChunkResolver) IsMessageResolved(id types.ID64) bool

func (*ChunkResolver) Resolve

func (s *ChunkResolver) Resolve(id types.ID64)

type Container

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

func NewNetContainer

func NewNetContainer() *Container

func (*Container) Net

func (c *Container) Net(id types.ID64) (net *Net, ok bool)

func (*Container) SetState

func (c *Container) SetState(state types.State)

type GlobalHandler

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

func NewGlobalHandler

func NewGlobalHandler(conf types.NetPartition) *GlobalHandler

func (*GlobalHandler) Message

func (h *GlobalHandler) Message(header types.NetMessage)

func (*GlobalHandler) Start

func (h *GlobalHandler) Start()

func (*GlobalHandler) Stop

func (h *GlobalHandler) Stop()

type HandlerGlobalTree

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

type HandlerLocalTree

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

type LocalHandler

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

func NewLocalHandler

func NewLocalHandler() *LocalHandler

func (*LocalHandler) Message

func (h *LocalHandler) Message(header types.NetMessage)

func (*LocalHandler) Start

func (h *LocalHandler) Start()

func (*LocalHandler) Stop

func (h *LocalHandler) Stop()

type LocalMessage

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

type LocalProcessor

type LocalProcessor func(m LocalMessage)

type Message

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

func (Message) Assembled

func (m Message) Assembled() bool

func (*Message) Update

func (m *Message) Update(data []byte) bool

type MessageChunk

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

type MessageHandler

type MessageHandler interface {
	Message(msg types.NetMessage)
	Start()
	Stop()
}

type MessageHandlerContainer

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

func NewMessageHandlerContainer

func NewMessageHandlerContainer(state types.State) *MessageHandlerContainer

func (*MessageHandlerContainer) Message

func (m *MessageHandlerContainer) Message(msg types.NetMessage)

func (*MessageHandlerContainer) UpdateState

func (m *MessageHandlerContainer) UpdateState(state types.State)

type Net

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

func NewNet

func NewNet(state types.State) *Net

func (*Net) AllowList

func (n *Net) AllowList() AllowList

func (*Net) HandleMessage

func (n *Net) HandleMessage(header types.NetMessage)

func (*Net) IsActive

func (n *Net) IsActive() bool

func (*Net) ProxyMessage

func (n *Net) ProxyMessage(header types.NetMessage)

func (*Net) State

func (n *Net) State() types.State

func (*Net) Table

func (n *Net) Table() *routing.Table

func (*Net) UpdateState

func (n *Net) UpdateState(state types.State)

type Processor

type Processor func(m Message)

type Receiver

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

func NewReceiverHandler

func NewReceiverHandler(netCont *Container) *Receiver

func (*Receiver) ServeHTTP

func (rh *Receiver) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Rest

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

func NewRestServer

func NewRestServer(netCont *Container, addr string, secret interface{}) *Rest

func (*Rest) Listen

func (r *Rest) Listen() error

Jump to

Keyboard shortcuts

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