comm

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: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comm

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

func NewComm

func NewComm(cert, caCert *x509.Certificate, priv *ecdsa.PrivateKey, l net.Listener) (*Comm, error)

func (*Comm) Addr

func (c *Comm) Addr() string

func (Comm) CloseConn

func (c Comm) CloseConn(addr string)

func (Comm) Gossip

func (c Comm) Gossip(addr string, args *pb.State) (*pb.StateResponse, error)

func (*Comm) Register

func (c *Comm) Register(p pb.GossipServer)

func (Comm) Send

func (c Comm) Send(addr string, args *pb.Msg) (*pb.MsgResponse, error)

func (*Comm) Start

func (c *Comm) Start()

func (*Comm) Stop

func (c *Comm) Stop()

func (Comm) StreamMessenger

func (c Comm) StreamMessenger(addr string, input, reply chan []byte) error

type CryptoUnit

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

func LoadCu

func LoadCu(cryptoPath string, identity pkix.Name, caAddr string) (*CryptoUnit, error)

func NewCu

func NewCu(config *CryptoUnitConfig) (*CryptoUnit, error)

func NewCu(identity pkix.Name, workingDir string, caAddr string, dnsLabel string) (*CryptoUnit, error) {

func (*CryptoUnit) CaCertificate

func (cu *CryptoUnit) CaCertificate() *x509.Certificate

func (*CryptoUnit) Certificate

func (cu *CryptoUnit) Certificate() *x509.Certificate

func (*CryptoUnit) ContactList

func (cu *CryptoUnit) ContactList() []*x509.Certificate

func (*CryptoUnit) NumRings

func (cu *CryptoUnit) NumRings() uint32

func (*CryptoUnit) Priv

func (cu *CryptoUnit) Priv() *ecdsa.PrivateKey

func (*CryptoUnit) SaveCertificate

func (cu *CryptoUnit) SaveCertificate() error

func (*CryptoUnit) SavePrivateKey

func (cu *CryptoUnit) SavePrivateKey() error

func (*CryptoUnit) Sign

func (cu *CryptoUnit) Sign(data []byte) ([]byte, []byte, error)

func (*CryptoUnit) Trusted

func (cu *CryptoUnit) Trusted() bool

func (*CryptoUnit) Verify

func (cu *CryptoUnit) Verify(data, r, s []byte, pub *ecdsa.PublicKey) bool

type CryptoUnitConfig

type CryptoUnitConfig struct {
	Identity pkix.Name
	CaAddr   string
	DNSNames []string
	Path     string
}

type UDPServer

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

func NewUdpServer

func NewUdpServer(ps pongSigner, conn *net.UDPConn) (*UDPServer, error)

func (*UDPServer) Addr

func (us *UDPServer) Addr() string

func (*UDPServer) Pause

func (us *UDPServer) Pause(d time.Duration)

func (*UDPServer) Ping

func (us *UDPServer) Ping(addr string, p *pb.Ping) (*pb.Pong, error)

func (*UDPServer) Start

func (us *UDPServer) Start()

func (*UDPServer) Stop

func (us *UDPServer) Stop()

Jump to

Keyboard shortcuts

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