sessions

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 20 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP struct {
	// contains filtered or unexported fields
}

func (*HTTP) Client

func (h *HTTP) Client() *http.Client

func (*HTTP) Mux

func (h *HTTP) Mux() *http.ServeMux

type Sessions

type Sessions struct {
	// contains filtered or unexported fields
}

func NewSessions

func NewSessions(log *log.Logger, r *router.Router) *Sessions

func (*Sessions) Accept

func (q *Sessions) Accept() (net.Conn, error)

Accept blocks until a new session request is received. The connection returned by this function will be TLS-encrypted.

func (*Sessions) Addr

func (q *Sessions) Addr() net.Addr

func (*Sessions) Close

func (q *Sessions) Close() error

func (*Sessions) Dial

func (q *Sessions) Dial(network, addr string) (net.Conn, error)

Dial dials a given public key using the supplied network. The network field can be used to specify which routing algorithm to use for the session: "ed25519+greedy" for greedy routing or "ed25519+source" for source routing. DHT lookups and pathfinds will be performed for these networks automatically. Otherwise, the default "ed25519" will use snake routing. The address must be the destination public key specified in hex.

func (*Sessions) DialContext

func (q *Sessions) DialContext(ctx context.Context, network, addrstr string) (net.Conn, error)

DialContext dials a given public key using the supplied network. The network field can be used to specify which routing algorithm to use for the session: "ed25519+greedy" for greedy routing or "ed25519+source" for source routing - DHT lookups and pathfinds will be performed for these networks automatically. Otherwise, the default "ed25519" will use snake routing. The address must be the destination public key specified in hex. If the context expires then the session will be torn down automatically.

func (*Sessions) DialTLS

func (q *Sessions) DialTLS(network, addr string) (net.Conn, error)

DialTLS is an alias for Dial, as all sessions are TLS-encrypted.

func (*Sessions) DialTLSContext

func (q *Sessions) DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error)

DialTLSContext is an alias for DialContext, as all sessions are TLS-encrypted.

func (*Sessions) HTTP

func (q *Sessions) HTTP() *HTTP

func (*Sessions) Sessions

func (q *Sessions) Sessions() []ed25519.PublicKey

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL