Documentation ¶
Overview ¶
Package overlay handles overlay nodes; the public facing portions of the system. An overlay node will publicly announce it's IP address. Overlay nodes are used to connect to the network, participate in the DHT and in leap-frog (onion routing).
Index ¶
- Constants
- Variables
- type Server
- func (s *Server) Close()
- func (s *Server) CommandHandler(c ipcrouter.Command)
- func (s *Server) Forest(key *crypto.Symmetric, dir string) (err error)
- func (s *Server) GetStaticKey() (bool, error)
- func (s *Server) LoadKey() error
- func (s *Server) NetQueryHandler(q ipcrouter.NetQuery)
- func (s *Server) NetSend(msg ipcrouter.NetSendRequest)
- func (s *Server) Port() rnet.Port
- func (s *Server) QueryHandler(q ipcrouter.Query)
- func (s *Server) RandomKey()
- func (s *Server) Receive(pkt []byte, addr *rnet.Addr)
- func (s *Server) Run()
- func (*Server) ServiceID() uint32
- func (s *Server) SetKey() error
- func (s *Server) SetStaticKey(val bool) error
- func (s *Server) SetupNetwork()
Constants ¶
const ( NoCompression = byte(iota) GZipped )
Compression tags
const ErrMsgIDZero = errors.String("Message ID cannot be 0")
ErrMsgIDZero is returned if there is an attempt to send a message with ID of 0 - this is probably a sign that something isn't correctly setting the ID
const ErrNoForest = errors.String("Overlay does not have forest")
ErrNoForest is returned when attempting to perform Overlay operations that require a storage forest before one is initilized
const ErrUnknonNode = errors.String("Unknown node by address")
ErrUnknonNode will occure if a message is received from an unknown address. This shouldn't happen because the packets need to know the node to be decrypted.
Variables ¶
var ErrBadSignPub = errors.String("Public Signature Key does not match")
ErrBadSignPub is returned if a node id does not match
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { NodeTTL uint32 // default TTL in seconds // contains filtered or unexported fields }
Server represents an overlay server.
func (*Server) CommandHandler ¶
CommandHandler for ipc commands to Overlay service
func (*Server) GetStaticKey ¶
GetStaticKey returns the current config value of statickey
func (*Server) LoadKey ¶
LoadKey will load the signing key from the forest, if one exists, otherwise it will create a random key and save it.
func (*Server) NetQueryHandler ¶
NetQueryHandler for Overlay service
func (*Server) NetSend ¶
func (s *Server) NetSend(msg ipcrouter.NetSendRequest)
NetSend service via Overlay
func (*Server) QueryHandler ¶
QueryHandler for ipc queries to Overlay service
func (*Server) RandomKey ¶
func (s *Server) RandomKey()
RandomKey sets the servers signing key to a random key value
func (*Server) Receive ¶
Receive fulfills PacketHandler allowing the server to handle network packets
func (*Server) SetKey ¶
SetKey will set the key on the server. If a forest has been initilized, it will check if the server is configured to use a static key and use that if so. Otherwise it will set a random key.
func (*Server) SetStaticKey ¶
SetStaticKey sets the static key config value. If set to true, the current key value is saved.
func (*Server) SetupNetwork ¶
func (s *Server) SetupNetwork()
SetupNetwork tries to connect to the network.