memberlisttlstransport

package module
v0.0.0-...-f3e0859 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MPL-2.0 Imports: 14 Imported by: 0

README

Memberlist TLS Transport

Status: Prove of concept

This is a fork of Memberlist's NetTransport implementing the Transport interface.

Instead of using TCP and UDP like the default transport layer of Memberlist, TLSTransport uses only TCP for both reliable as well as best-effort communication. On top of that TCP layer, TLSTransport uses mutual TLS to secure all communication.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TLSTransport

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

TLSTransport is a Transport implementation that uses connectionless UDP for packet operations, and ad-hoc TCP connections for stream operations.

func NewTLSTransport

func NewTLSTransport(config *TLSTransportConfig, reg prometheus.Registerer) (*TLSTransport, error)

NewTLSTransport returns a net transport with the given configuration. On success all the network listeners will be created and listening.

func (*TLSTransport) DialTimeout

func (t *TLSTransport) DialTimeout(addr string, timeout time.Duration) (net.Conn, error)

See Transport.

func (*TLSTransport) FinalAdvertiseAddr

func (t *TLSTransport) FinalAdvertiseAddr(ip string, port int) (net.IP, int, error)

See Transport.

func (*TLSTransport) GetAutoBindPort

func (t *TLSTransport) GetAutoBindPort() int

GetAutoBindPort returns the bind port that was automatically given by the kernel, if a bind port of 0 was given.

func (*TLSTransport) PacketCh

func (t *TLSTransport) PacketCh() <-chan *memberlist.Packet

See Transport.

func (*TLSTransport) Shutdown

func (t *TLSTransport) Shutdown() error

See Transport.

func (*TLSTransport) StreamCh

func (t *TLSTransport) StreamCh() <-chan net.Conn

See Transport.

func (*TLSTransport) WriteTo

func (t *TLSTransport) WriteTo(b []byte, addr string) (time.Time, error)

See Transport.

type TLSTransportConfig

type TLSTransportConfig struct {
	// BindAddrs is a list of addresses to bind to for both TCP and UDP
	// communications.
	BindAddrs []string

	// BindPort is the port to listen on, for each address above.
	BindPort int

	// Logger is a logger for operator messages.
	Logger *log.Logger

	TLS *tls.Config
}

TLSTransportConfig is used to configure a net transport.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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