i2p

package
v0.0.0-...-afc8e46 Latest Latest
Warning

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

Go to latest
Published: May 7, 2017 License: MIT Imports: 12 Imported by: 12

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Base32Addr

type Base32Addr [32]byte

i2p destination hash

func (Base32Addr) String

func (b32 Base32Addr) String() string

get string version

type I2PAddr

type I2PAddr string

implements net.Addr

func (I2PAddr) Base32Addr

func (a I2PAddr) Base32Addr() (b32 Base32Addr)

compute base32 address

func (I2PAddr) Network

func (a I2PAddr) Network() string

func (I2PAddr) String

func (a I2PAddr) String() string

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 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() I2PAddr

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 network.Network
	Accept() (net.Conn, error)

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

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

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

	// dial out to a remote destination
	DialI2P(a I2PAddr) (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) Session

create a new i2p session

Jump to

Keyboard shortcuts

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