server

package
v0.0.0-...-d76c376 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(listeningAddr string) (server, error)

New constructs a default server listening to listeningAddr with a Go map as server.AddrStore implementation and the Go standard log package as logr.Logger. It is strongly recommended reviewing the server.DomainTimeout field.

Types

type AddressStore

type AddressStore interface {
	// ProcessAddress takes a domain id (of peer connections) and returns all addresses registered to that id except addr.
	// Furthermore, this method associates addr to id.
	// All occurrences of addr should be removed in the returned slice, i.e. the return slice should not contain addr.
	// An empty return slice is not an error case. A non-existent identifier should return an empty slice.
	//
	// This method should be safe for concurrent use.
	//
	// ProcessAddress deletes addr from domain id after timeout if timeout is non-negative. If timeout is negative,
	// nothing should be deleted.
	ProcessAddress(id string, addr string, timeout time.Duration) ([]string, error)

	// FetchAllAddresses returns all addresses currently in the address store as []string or an error.
	// This method must be safe for concurrent use with AddressStore.ProcessAddress.
	FetchAllAddresses() ([]string, error)
}

AddressStore stores addresses with domain ids and allows to process those. AddressStore must be safe for concurrent use.

Jump to

Keyboard shortcuts

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