Versions in this module Expand all Collapse all v1 v1.1.1 Dec 26, 2019 v1.1.0 Sep 8, 2019 Changes in this version + var DialTimeout = 10 * time.Second + var ErrInvalidToken = errors.New("Invalid node token") + var ErrNodeComm = errors.New("Network error") + var ErrRemoteAction = errors.New("Remote error") + var ErrUnknownTarget = errors.New("Unknown target node") + var ErrUntrustedTarget = errors.New("Unexpected SSL certificate from target node") + var LogDebug = Logger(LogNull) + var LogInfo = Logger(log.Print) + var LogNull = func(v ...interface{}) + type Client struct + func NewClient(secret string, clientCert *tls.Certificate) *Client + func (c *Client) Peers() ([]string, []string) + func (c *Client) RegisterPeer(node string, rpc string, fingerprint string) error + func (c *Client) RemovePeer(node string) + func (c *Client) SSLFingerprint() string + func (c *Client) SendData(node string, ctrl map[string]string, data []byte) ([]byte, error) + func (c *Client) SendPing(node string, rpc string) ([]string, string, error) + func (c *Client) SendRequest(node string, remoteCall RPCFunction, args map[RequestArgument]interface{}) (interface{}, error) + func (c *Client) Shutdown() + type Error struct + Detail string + IsNotExist bool + Type error + func (ge *Error) Error() string + type Logger func(v ...interface{}) + type RPCFunction string + const RPCData + const RPCPing + type RequestArgument int + const RequestCTRL + const RequestDATA + const RequestTARGET + const RequestTOKEN + type RequestHandler func(ctrl map[string]string, data []byte) ([]byte, error) + type RufsNode struct + Client *Client + DataHandler RequestHandler + func NewNode(rpcInterface string, name string, secret string, clientCert *tls.Certificate, ...) *RufsNode + func (rn *RufsNode) LogInfo(v ...interface{}) + func (rn *RufsNode) Name() string + func (rn *RufsNode) SSLFingerprint() string + func (rn *RufsNode) Shutdown() error + func (rn *RufsNode) Start(serverCert *tls.Certificate) error + type RufsNodeToken struct + NodeAuth string + NodeName string + type RufsServer struct + func (s *RufsServer) Data(request map[RequestArgument]interface{}, response *interface{}) error + func (s *RufsServer) Ping(request map[RequestArgument]interface{}, response *interface{}) error