remote

package
v0.0.0-...-87ea4a5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Neighbour

type Neighbour struct {
	util.Neighbour
	Encoder            *codec.BinaryEncoder
	WaitUntilAliveChan chan int // Dummy channel that we use to block other processes until the connection becomes live
	ConnLock           *sync.RWMutex
}

func NewNeighbour

func NewNeighbour(id, address, pk string) *Neighbour

func (*Neighbour) GetAddress

func (n *Neighbour) GetAddress() string

func (*Neighbour) GetConnLock

func (n *Neighbour) GetConnLock() *sync.RWMutex

func (*Neighbour) GetEncoder

func (n *Neighbour) GetEncoder() codec.Encoder

GetEncoder will block until connection is alive

func (*Neighbour) GetID

func (n *Neighbour) GetID() string

func (*Neighbour) GetPK

func (n *Neighbour) GetPK() string

func (*Neighbour) GetType

func (n *Neighbour) GetType() string

func (*Neighbour) IsAlive

func (n *Neighbour) IsAlive() bool

func (*Neighbour) MarshalAndSend

func (n *Neighbour) MarshalAndSend(message message.Message)

func (*Neighbour) Send

func (n *Neighbour) Send(buf []byte)

func (*Neighbour) SetConnAndEncoderAndSignalAlive

func (n *Neighbour) SetConnAndEncoderAndSignalAlive(conn *net.TCPConn)

func (*Neighbour) WaitUntilAlive

func (n *Neighbour) WaitUntilAlive()

type Node

type Node struct {
	Address            string
	Encoder            *codec.BinaryEncoder
	WaitUntilAliveChan chan int
}

func NewNode

func NewNode(address string) *Node

func (*Node) GetAddress

func (n *Node) GetAddress() string

func (*Node) GetEncoder

func (n *Node) GetEncoder() codec.Encoder

GetEncoder will block until connection is alive

func (*Node) GetType

func (n *Node) GetType() string

func (*Node) IsAlive

func (n *Node) IsAlive() bool

func (*Node) SetConnAndEncoderAndSignalAlive

func (n *Node) SetConnAndEncoderAndSignalAlive(conn *net.TCPConn)

func (*Node) WaitUntilAlive

func (n *Node) WaitUntilAlive()

type Remote

type Remote interface {
	GetAddress() string
	GetEncoder() codec.Encoder
	SetConnAndEncoderAndSignalAlive(conn *net.TCPConn)
	GetType() string
}

Jump to

Keyboard shortcuts

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