Documentation ¶
Index ¶
- Constants
- type ACN
- type Error
- type ErrorACN
- func (e *ErrorACN) Close()
- func (e *ErrorACN) GetBootstrapStatus() (int, string)
- func (e *ErrorACN) GetInfo(addr string) (map[string]string, error)
- func (e *ErrorACN) GetPID() (int, error)
- func (e *ErrorACN) GetStatusCallback() func(int, string)
- func (e *ErrorACN) GetVersion() string
- func (e *ErrorACN) GetVersionCallback() func(string)
- func (e *ErrorACN) Listen(identity PrivateKey, port int) (ListenService, error)
- func (e *ErrorACN) Open(hostname string) (net.Conn, string, error)
- func (e *ErrorACN) Restart()
- func (e *ErrorACN) SetStatusCallback(callback func(int, string))
- func (e *ErrorACN) SetVersionCallback(callback func(string))
- func (e *ErrorACN) WaitTillBootstrapped() error
- type ListenService
- type PrivateKey
- type ProxyACN
- func (p *ProxyACN) Close()
- func (p *ProxyACN) GetBootstrapStatus() (int, string)
- func (p *ProxyACN) GetInfo(addr string) (map[string]string, error)
- func (p *ProxyACN) GetPID() (int, error)
- func (p *ProxyACN) GetStatusCallback() func(int, string)
- func (p *ProxyACN) GetVersion() string
- func (p *ProxyACN) GetVersionCallback() func(string)
- func (p *ProxyACN) Listen(identity PrivateKey, port int) (ListenService, error)
- func (p *ProxyACN) Open(hostname string) (net.Conn, string, error)
- func (p *ProxyACN) ReplaceACN(acn ACN)
- func (p *ProxyACN) Restart()
- func (p *ProxyACN) SetStatusCallback(callback func(int, string))
- func (p *ProxyACN) SetVersionCallback(callback func(string))
- func (p *ProxyACN) WaitTillBootstrapped() error
Constants ¶
const ( // CannotResolveLocalTCPAddressError is thrown when a local ricochet connection has the wrong format. CannotResolveLocalTCPAddressError = Error("CannotResolveLocalTCPAddressError") // CannotDialLocalTCPAddressError is thrown when a connection to a local ricochet address fails. CannotDialLocalTCPAddressError = Error("CannotDialLocalTCPAddressError") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACN ¶
type ACN interface { // GetBootstrapStatus returns an int 0-100 on the percent the bootstrapping of the underlying network is at and an optional string message // On Network down it returns -1 // On ACN error state it returns -2 GetBootstrapStatus() (int, string) // WaitTillBootstrapped Blocks until underlying network is bootstrapped WaitTillBootstrapped() error // Sets the callback function to be called when ACN status changes SetStatusCallback(callback func(int, string)) GetStatusCallback() func(int, string) // Sets the callback function to be called when ACN reboots to emit the version SetVersionCallback(callback func(string)) GetVersionCallback() func(string) // Restarts the underlying connection Restart() // Open takes a hostname and returns a net.conn to the derived endpoint // Open allows a client to resolve various hostnames to connections Open(hostname string) (net.Conn, string, error) // Listen takes a private key and a port and returns a ListenService for it Listen(identity PrivateKey, port int) (ListenService, error) // Get PID GetPID() (int, error) // GetVersion returns a string of what the ACN returns when asked for a version GetVersion() string GetInfo(onion string) (map[string]string, error) Close() }
ACN is Anonymous Communication Network implementation wrapper that supports Open for new connections and Listen to accept connections
func NewLocalACN ¶ added in v1.1.0
func NewLocalACN() ACN
NewLocalACN returns a for testing use only local clearnet implementation of a ACN interface
type ErrorACN ¶ added in v1.6.0
type ErrorACN struct {
// contains filtered or unexported fields
}
ErrorACN - a status-callback safe errored ACN. Use this when ACN construction goes wrong and you need a safe substitute that can later be replaced with a working ACN without impacting calling clients.
func NewErrorACN ¶ added in v1.10.0
func (*ErrorACN) GetBootstrapStatus ¶ added in v1.6.0
func (*ErrorACN) GetStatusCallback ¶ added in v1.8.5
func (*ErrorACN) GetVersion ¶ added in v1.6.0
func (*ErrorACN) GetVersionCallback ¶ added in v1.8.5
func (*ErrorACN) Listen ¶ added in v1.6.0
func (e *ErrorACN) Listen(identity PrivateKey, port int) (ListenService, error)
func (*ErrorACN) SetStatusCallback ¶ added in v1.6.0
func (*ErrorACN) SetVersionCallback ¶ added in v1.8.4
func (*ErrorACN) WaitTillBootstrapped ¶ added in v1.6.0
type ListenService ¶
type ListenService interface { // AddressFull is the full network address, ex: rsjeuxzlexy4fvo75vrdtj37nrvlmvbw57n5mhypcjpzv3xkka3l4yyd.onion:9878 AddressFull() string Accept() (net.Conn, error) Close() }
ListenService is an address that was opened with Listen() and can Accept() new connections
type PrivateKey ¶
type PrivateKey interface{}
PrivateKey represents a private key using an unspecified algorithm.
type ProxyACN ¶ added in v1.6.0
type ProxyACN struct {
// contains filtered or unexported fields
}
ProxyACN because there is rarely a problem that can't be solved by another layer of indirection. ACN is a core resource that many parts of a system may need access too e.g. all clients and servers need an instance and a UI may also need status information and a configuration interface. We want to allow configuration and replacement of an ACN without impacting the API of all downstream systems - introducing ProxyACN - a wrapper around an ACN that allows safe replacement of a running ACN that is transparent to callers.
func NewProxyACN ¶ added in v1.6.0
func (*ProxyACN) GetBootstrapStatus ¶ added in v1.6.0
func (*ProxyACN) GetStatusCallback ¶ added in v1.8.5
func (*ProxyACN) GetVersion ¶ added in v1.6.0
func (*ProxyACN) GetVersionCallback ¶ added in v1.8.5
func (*ProxyACN) Listen ¶ added in v1.6.0
func (p *ProxyACN) Listen(identity PrivateKey, port int) (ListenService, error)
func (*ProxyACN) ReplaceACN ¶ added in v1.6.0
ReplaceACN closes down the current ACN and replaces it with a new ACN.