Documentation ¶
Overview ¶
Package network is for creating internetworks
Index ¶
- type Error
- type Network
- type Node
- type Option
- func Address(a string) Option
- func Advertise(a string) Option
- func ID(id string) Option
- func Logger(l logger.Logger) Option
- func Meter(m meter.Meter) Option
- func Name(n string) Option
- func Nodes(n ...string) Option
- func Proxy(p proxy.Proxy) Option
- func Router(r router.Router) Option
- func Tracer(t tracer.Tracer) Option
- func Tunnel(t tunnel.Tunnel) Option
- type Options
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error interface { // Count is current count of errors Count() int // Msg is last error message Msg() string }
Error is network node errors
type Network ¶
type Network interface { // Node is network node Node // Initialise options Init(...Option) error // Options returns the network options Options() Options // Name of the network Name() string // Connect starts the resolver and tunnel server Connect() error // Close stops the tunnel and resolving Close() error // Client is micro client Client() client.Client // Server is micro server Server() server.Server }
Network is micro network
type Node ¶
type Node interface { // Id is node id Id() string // Address is node bind address Address() string // Peers returns node peers Peers() []Node // Network is the network node is in Network() Network // Status returns node status Status() Status }
Node is network node
type Options ¶
type Options struct { // Router used for routing Router router.Router // Proxy holds the proxy Proxy proxy.Proxy // Logger used for logging Logger logger.Logger // Meter used for metrics Meter meter.Meter // Tracer used for tracing Tracer tracer.Tracer // Tunnel used for transfer data Tunnel tunnel.Tunnel // ID of the node ID string // Name of the network Name string // Address to bind to Address string // Advertise sets the address to advertise Advertise string // Nodes is a list of nodes to connect to Nodes []string }
Options configure network
func NewOptions ¶
NewOptions returns network default options
Directories ¶
Path | Synopsis |
---|---|
Package transport is an interface for synchronous connection based communication
|
Package transport is an interface for synchronous connection based communication |
Package tunnel provides gre network tunnelling
|
Package tunnel provides gre network tunnelling |
broker
Package broker is a tunnel broker
|
Package broker is a tunnel broker |
transport
Package transport provides a tunnel transport
|
Package transport provides a tunnel transport |
Click to show internal directories.
Click to hide internal directories.