Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTLS ¶
GenerateTLS generates a TLS certificate and private key
Types ¶
type Config ¶
type Config struct {
// Port is the port to listen on
Port int
// Timeout is the timeout for connections
Timeout time.Duration
// TLS is the TLS configuration
TLS TLSConfig
}
Config represents the configuration for the network
type Network ¶
type Network struct {
// Config is the configuration for the network
Config Config
// Peers is a list of peers in the network
Peers []Peer
// Mutex is a mutex to protect access to the peers
Mutex sync.RWMutex
// Listener is the listener for incoming connections
Listener net.Listener
// Dialer is the dialer for outgoing connections
Dialer net.Dialer
}
Network represents a network
func (*Network) MarshalJSON ¶
MarshalJSON marshals the network to JSON
func (*Network) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON to the network
Click to show internal directories.
Click to hide internal directories.