i2p

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

* i2p connector

Index

Constants

View Source
const DEFAULT_ADDRESS = "127.0.0.1:7656"

default address of i2p interface

View Source
const DEFAULT_KEYFILE = "xd-privkey.dat"

default path to private keys

View Source
const DEFAULT_NAME = "XD"

default i2p session name

View Source
const SigType = 7

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

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

implements net.Addr

func I2PAddr

func I2PAddr(addr string) Addr

func (Addr) Base32Addr

func (addr Addr) Base32Addr() (b32 Base32Addr)

compute base32 address

func (Addr) Network

func (a Addr) Network() string

func (Addr) String

func (a Addr) String() string

type Base32Addr

type Base32Addr [32]byte

i2p destination hash

func (Base32Addr) String

func (b32 Base32Addr) String() string

get string version

type I2PConn

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

tcp/i2p connection implements net.Conn

func (*I2PConn) Close

func (c *I2PConn) Close() error

implements net.Conn

func (*I2PConn) LocalAddr

func (c *I2PConn) LocalAddr() net.Addr

implements net.Conn

func (*I2PConn) Read

func (c *I2PConn) Read(d []byte) (n int, err error)

implements net.Conn

func (*I2PConn) RemoteAddr

func (c *I2PConn) RemoteAddr() net.Addr

implements net.Conn

func (*I2PConn) SetDeadline

func (c *I2PConn) SetDeadline(t time.Time) error

implements net.Conn

func (*I2PConn) SetReadDeadline

func (c *I2PConn) SetReadDeadline(t time.Time) error

implements net.Conn

func (*I2PConn) SetWriteDeadline

func (c *I2PConn) SetWriteDeadline(t time.Time) error

implements net.Conn

func (*I2PConn) Write

func (c *I2PConn) Write(d []byte) (n int, err error)

implements net.Conn

type I2PPacketConn

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

tcp/i2p connection implements net.Conn

func (*I2PPacketConn) Close

func (c *I2PPacketConn) Close() error

implements net.PacketConn

func (*I2PPacketConn) LocalAddr

func (c *I2PPacketConn) LocalAddr() net.Addr

implements net.PacketConn

func (*I2PPacketConn) ReadFrom

func (c *I2PPacketConn) ReadFrom(d []byte) (n int, from net.Addr, err error)

implements net.PacketConn

func (*I2PPacketConn) SetDeadline

func (c *I2PPacketConn) SetDeadline(t time.Time) error

implements net.PacketConn

func (*I2PPacketConn) SetReadDeadline

func (c *I2PPacketConn) SetReadDeadline(t time.Time) error

implements net.PacketConn

func (*I2PPacketConn) SetWriteDeadline

func (c *I2PPacketConn) SetWriteDeadline(t time.Time) error

implements net.PacketConn

func (*I2PPacketConn) WriteTo

func (c *I2PPacketConn) WriteTo(d []byte, to net.Addr) (n int, err error)

implements net.PacketConn

type Keyfile

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

a destination keypair file

func NewKeyfile

func NewKeyfile(f string) *Keyfile

create new keyfile given filepath

func (*Keyfile) Addr

func (k *Keyfile) Addr() Addr

func (*Keyfile) Load

func (k *Keyfile) Load() (err error)

load from filesystem

func (*Keyfile) Store

func (k *Keyfile) Store() (err error)

save to filesystem

type Session

type Session interface {

	// get session name
	Name() string
	// open a new control socket
	// does handshaske
	OpenControlSocket() (net.Conn, error)

	// get printable b32.i2p address
	B32Addr() string

	// implements network.Network
	Addr() net.Addr

	// implements net.PacketConn
	LocalAddr() net.Addr

	// implements network.Network
	ReadFrom([]byte) (int, net.Addr, error)

	// implements network.Network
	WriteTo([]byte, net.Addr) (int, error)

	// implements network.Network
	Accept() (net.Conn, error)

	// implements network.Session
	Lookup(name, port string) (net.Addr, error)

	// lookup an i2p address
	LookupI2P(name string) (Addr, error)

	// implements network.Network
	Dial(n, a string) (net.Conn, error)

	// dial out to a remote destination
	DialI2P(a Addr) (net.Conn, error)

	// open the session, generate keys, start up destination etc
	Open() error

	// close the session
	Close() error
}

i2p network session

func NewSession

func NewSession(name, addr, keyfile string, opts map[string]string) Session

create a new i2p session

Jump to

Keyboard shortcuts

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