Documentation ¶
Index ¶
- func GarlicOptions(s []string) func(*GarlicTCPTransport) error
- func KeysPath(s string) func(*GarlicTCPTransport) error
- func LocalPeerID(p peer.ID) func(*GarlicTCPTransport) error
- func NewGarlicTCPTransport(host, port, pass string, keysPath string, onlyGarlic bool, options []string) (tpt.Transport, error)
- func NewGarlicTCPTransportPeer(id peer.ID, host, port, pass string, keysPath string, onlyGarlic bool, ...) (tpt.Transport, error)
- func OnlyGarlic(b bool) func(*GarlicTCPTransport) error
- func SAMHost(s string) func(*GarlicTCPTransport) error
- func SAMPass(s string) func(*GarlicTCPTransport) error
- func SAMPort(s string) func(*GarlicTCPTransport) error
- type GarlicTCPTransport
- func (t *GarlicTCPTransport) CanDial(m ma.Multiaddr) bool
- func (t *GarlicTCPTransport) CanDialI2P(m ma.Multiaddr) bool
- func (t *GarlicTCPTransport) Dial(c context.Context, m ma.Multiaddr, p peer.ID) (tpt.Conn, error)
- func (t *GarlicTCPTransport) Listen(addr ma.Multiaddr) (tpt.Listener, error)
- func (t *GarlicTCPTransport) ListenI2P() (*i2ptcpconn.GarlicTCPConn, error)
- func (t *GarlicTCPTransport) Matches(a ma.Multiaddr) bool
- func (t *GarlicTCPTransport) MatchesI2P(a ma.Multiaddr) bool
- func (t *GarlicTCPTransport) PrintOptions() []string
- func (t *GarlicTCPTransport) Protocols() []int
- func (t *GarlicTCPTransport) Proxy() bool
- func (t *GarlicTCPTransport) SAMAddress() string
- func (t *GarlicTCPTransport) SAMHost() string
- func (t *GarlicTCPTransport) SAMPort() string
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GarlicOptions ¶
func GarlicOptions(s []string) func(*GarlicTCPTransport) error
func KeysPath ¶
func KeysPath(s string) func(*GarlicTCPTransport) error
KeysPath sets the path to the keys, if no keys are present, they will be generated.
func LocalPeerID ¶
func LocalPeerID(p peer.ID) func(*GarlicTCPTransport) error
func NewGarlicTCPTransport ¶
func NewGarlicTCPTransport(host, port, pass string, keysPath string, onlyGarlic bool, options []string) (tpt.Transport, error)
NewGarlicTransport initializes a GarlicTransport for libp2p
func NewGarlicTCPTransportPeer ¶
func NewGarlicTCPTransportPeer(id peer.ID, host, port, pass string, keysPath string, onlyGarlic bool, options []string) (tpt.Transport, error)
NewGarlicTransportPeer initializes a GarlicTransport for libp2p with a local peer.ID
func OnlyGarlic ¶
func OnlyGarlic(b bool) func(*GarlicTCPTransport) error
func SAMHost ¶
func SAMHost(s string) func(*GarlicTCPTransport) error
SAMHost sets the host of the SAM Bridge to use
func SAMPass ¶
func SAMPass(s string) func(*GarlicTCPTransport) error
SAMPass sets the password to use when authenticating to the SAM bridge. It's ignored for now, and will return an error if it recieves a non-empty string.
func SAMPort ¶
func SAMPort(s string) func(*GarlicTCPTransport) error
SAMPort sets the port of the SAM bridge to use
Types ¶
type GarlicTCPTransport ¶
type GarlicTCPTransport struct { i2ptcpconn.GarlicTCPConn HostSAM string PortSAM string PassSAM string // contains filtered or unexported fields }
GarlicTCPTransport is a libp2p interface to an i2p TCP-like tunnel created via the SAM bridge
func NewGarlicTCPTransportFromOptions ¶
func NewGarlicTCPTransportFromOptions(opts ...func(*GarlicTCPTransport) error) (*GarlicTCPTransport, error)
func (*GarlicTCPTransport) CanDial ¶
func (t *GarlicTCPTransport) CanDial(m ma.Multiaddr) bool
CanDial implements transport.CanDial
func (*GarlicTCPTransport) CanDialI2P ¶
func (t *GarlicTCPTransport) CanDialI2P(m ma.Multiaddr) bool
CanDialI2P is a special CanDial function that only returns true if it's an i2p address.
func (*GarlicTCPTransport) Listen ¶
Listen implements a connection, but addr is IGNORED here, it's drawn from the transport keys
func (*GarlicTCPTransport) ListenI2P ¶
func (t *GarlicTCPTransport) ListenI2P() (*i2ptcpconn.GarlicTCPConn, error)
ListenI2P is like Listen, but it returns the GarlicTCPConn and doesn't require a multiaddr
func (*GarlicTCPTransport) Matches ¶
func (t *GarlicTCPTransport) Matches(a ma.Multiaddr) bool
Matches returns true if the address is a valid garlic TCP multiaddr
func (*GarlicTCPTransport) MatchesI2P ¶
func (t *GarlicTCPTransport) MatchesI2P(a ma.Multiaddr) bool
Matches returns true if the address is a valid garlic TCP multiaddr
func (*GarlicTCPTransport) PrintOptions ¶
func (t *GarlicTCPTransport) PrintOptions() []string
func (*GarlicTCPTransport) Protocols ¶
func (t *GarlicTCPTransport) Protocols() []int
Protocols need only return this I think
func (*GarlicTCPTransport) Proxy ¶
func (t *GarlicTCPTransport) Proxy() bool
Proxy always returns false, we're using the SAM bridge to make our requests
func (*GarlicTCPTransport) SAMAddress ¶
func (t *GarlicTCPTransport) SAMAddress() string
func (*GarlicTCPTransport) SAMHost ¶
func (t *GarlicTCPTransport) SAMHost() string
func (*GarlicTCPTransport) SAMPort ¶
func (t *GarlicTCPTransport) SAMPort() string