Documentation ¶
Overview ¶
Package onion implements protocols and encryption onion.
Example onion could look like this:
onion := New( NetLayer(), TorLayer(), TLSLayer(), NaClLayer(), JWTLayer(keyLookupFunc), NaClLayer(), )
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Layer ¶
type Layer interface { // Name - Layer name. Name() string // Conn - Wraps connection with a layer. // Some layers do nothing - for example TOR cant wrap existing connection. // It's usable for encryption layers. Conn(net.Conn) (net.Conn, error) // Listener - Wraps listener with a layer. Listener(net.Listener) (net.Listener, error) // Dial - Dials to address with a timeout. Dial(addr string, timeout time.Duration) (net.Conn, error) // Bool is false when it should be ignored // IsDialer - Returns false if the layer is just an encryption (and/or listening) layer. // Returns true if layer can dial. For example net, tor etc. IsDialer() bool // Close - Closes the layer, removes the keys, closes tor instance etc. Close() error }
Layer - Onion layer.
type Onion ¶
type Onion interface { // Dial - Connect for net.Dialer. Dial(string, string) (net.Conn, error) // Connect - Dials to a target through an onion. Connect(string, time.Duration) (net.Conn, error) // Listener - Wraps a listener with an onion. // Sometimes listener can or even should be empty. Listener(net.Listener) (net.Listener, error) // Close - Closes all layers of the onion. Close() error }
Onion - Onion interface.
Click to show internal directories.
Click to hide internal directories.