wanfed

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GossipPacketMaxIdleTime controls how long we keep an idle connection
	// open to a server.
	//
	// Conceptually similar to: agent/consul/server.go:serverRPCCache
	GossipPacketMaxIdleTime = 2 * time.Minute

	// GossipPacketMaxByteSize is the maximum allowed size of a packet
	// forwarded via wanfed. This is 4MB which should be way bigger than serf
	// or memberlist allow practically so it should never be hit in practice.
	GossipPacketMaxByteSize = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func SplitNodeName

func SplitNodeName(nodeName string) (shortName, dc string, err error)

SplitNodeName splits a node name as it would be represented in serf/memberlist in the WAN pool of the form "<short-node-name>.<datacenter>" like "nyc-web42.dc5" => "nyc-web42" & "dc5"

Types

type IngestionAwareTransport added in v1.9.17

type IngestionAwareTransport interface {
	memberlist.NodeAwareTransport
	IngestPacket(conn net.Conn, addr net.Addr, now time.Time, shouldClose bool) error
	IngestStream(conn net.Conn) error
}

type MeshGatewayResolver

type MeshGatewayResolver func(datacenter string) string

type Transport

type Transport struct {
	IngestionAwareTransport
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(
	tlsConfigurator *tlsutil.Configurator,
	transport IngestionAwareTransport,
	datacenter string,
	gwResolver MeshGatewayResolver,
) (*Transport, error)

func (*Transport) DialAddressTimeout

func (t *Transport) DialAddressTimeout(addr memberlist.Address, timeout time.Duration) (net.Conn, error)

DialAddressTimeout implements memberlist.NodeAwareTransport.

func (*Transport) Shutdown

func (t *Transport) Shutdown() error

Shutdown implements memberlist.Transport.

func (*Transport) WriteToAddress

func (t *Transport) WriteToAddress(b []byte, addr memberlist.Address) (time.Time, error)

WriteToAddress implements memberlist.NodeAwareTransport.

Jump to

Keyboard shortcuts

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