dii2pmain

package
v0.0.0-...-bc8fae0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetHost

func SetHost(s string) func(*SamList) error

SetHost sets the host of the client's SAM bridge

func SetIdleConns

func SetIdleConns(s int) func(*SamList) error

SetIdleConns set's the max idle connections per host

func SetInBackups

func SetInBackups(s int) func(*SamList) error

SetInBackups set's the inbound backup tunnel quantity

func SetInQuantity

func SetInQuantity(s int) func(*SamList) error

SetInQuantity set's the inbound tunnel quantity

func SetInitAddress

func SetInitAddress(s string) func(*SamList) error

SetInitAddress tells the client to retrieve an URL before any other URL

func SetKeepAlives

func SetKeepAlives(s bool) func(*SamList) error

SetKeepAlives tells the client whether or not to allow keepalives

func SetLifespan

func SetLifespan(s int) func(*SamList) error

SetLifespan set's the time before an inactive client is torn down

func SetOutBackups

func SetOutBackups(s int) func(*SamList) error

SetOutBackups set's the outbound backup tunnel quantity

func SetOutQuantity

func SetOutQuantity(s int) func(*SamList) error

SetOutQuantity set's the outbound tunnel quantity

func SetPort

func SetPort(v string) func(*SamList) error

SetPort sets the port of the client's SAM bridge

func SetPortInt

func SetPortInt(v int) func(*SamList) error

SetPortInt sets the port of the client's SAM bridge

func SetSamHTTPHost

func SetSamHTTPHost(s string) func(*SamHTTP) error

SetSamHTTPHost sets the host of the client's SAM bridge

func SetSamHTTPIdleQuantity

func SetSamHTTPIdleQuantity(s int) func(*SamHTTP) error

SetSamHTTPIdleQuantity set's the outbound tunnel quantity

func SetSamHTTPInBackupQuantity

func SetSamHTTPInBackupQuantity(s int) func(*SamHTTP) error

SetSamHTTPInBackupQuantity set's the inbound tunnel quantity

func SetSamHTTPInQuantity

func SetSamHTTPInQuantity(s int) func(*SamHTTP) error

SetSamHTTPInQuantity set's the inbound tunnel quantity

func SetSamHTTPKeepAlives

func SetSamHTTPKeepAlives(s bool) func(*SamHTTP) error

SetSamHTTPKeepAlives tells the SamHTTP connection whether to accept keepAlives

func SetSamHTTPLifespan

func SetSamHTTPLifespan(s int) func(*SamHTTP) error

SetSamHTTPLifespan set's the time before an inactive SamHTTP client is torn down

func SetSamHTTPOutBackupQuantity

func SetSamHTTPOutBackupQuantity(s int) func(*SamHTTP) error

SetSamHTTPOutBackupQuantity set's the outbound tunnel quantity

func SetSamHTTPOutQuantity

func SetSamHTTPOutQuantity(s int) func(*SamHTTP) error

SetSamHTTPOutQuantity set's the outbound tunnel quantity

func SetSamHTTPPort

func SetSamHTTPPort(v string) func(*SamHTTP) error

SetSamHTTPPort sets the port of the client's SAM bridge

func SetSamHTTPPortInt

func SetSamHTTPPortInt(v int) func(*SamHTTP) error

SetSamHTTPPortInt sets the port of the client's SAM bridge

func SetSamHTTPRequest

func SetSamHTTPRequest(s string) func(*SamHTTP) error

SetSamHTTPRequest sets the initial request URL for the SamHTTP connection

func SetSamHTTPTimeout

func SetSamHTTPTimeout(s int) func(*SamHTTP) error

SetSamHTTPTimeout sets the timeout of the SamHTTP connection

func SetSamHTTPTunLength

func SetSamHTTPTunLength(s int) func(*SamHTTP) error

SetSamHTTPTunLength set's the symmetric inbound and outbound tunnel lengths

func SetTimeout

func SetTimeout(s int) func(*SamList) error

SetTimeout set's the client timeout

func SetTunLength

func SetTunLength(s int) func(*SamList) error

SetTunLength set's the symmetric inbound and outbound tunnel lengths

Types

type ClientOption

type ClientOption func(*SamList) error

ClientOption is a SamList option

type ConnectOption

type ConnectOption func(*SamHTTP) error

ConnectOption is a SamHTTP option

type SamHTTP

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

SamHTTP is an HTTP proxy which requests resources from the i2p network using the same unique destination

func NewSamHTTPFromOptions

func NewSamHTTPFromOptions(opts ...func(*SamHTTP) error) (SamHTTP, error)

NewSamHTTPFromOptions creates a new SamHTTP connection manager for a single eepSite

func (*SamHTTP) CleanupClient

func (samConn *SamHTTP) CleanupClient()

CleanupClient completely tears down a SamHTTP client

func (*SamHTTP) Dial

func (samConn *SamHTTP) Dial(network, addr string) (net.Conn, error)

Dial is a custom Dialer function that allows us to keep the same i2p destination on a per-eepSite basis

func (*SamHTTP) ScannerText

func (samConn *SamHTTP) ScannerText() (string, error)

type SamList

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

SamList is a manager which guarantee's unique destinations for websites retrieved over the SAM bridge

func CreateSamList

func CreateSamList(opts ...func(*SamList) error) (*SamList, error)

CreateSamList initializes a SamList

func (*SamList) CleanupClient

func (samStack *SamList) CleanupClient()

CleanupClient tears down all SamList members

func (*SamList) CopyRequest

func (samStack *SamList) CopyRequest(request *http.Request, response *http.Response, directory string) *http.Response

func (*SamList) ReadDelete

func (samStack *SamList) ReadDelete() bool

ReadDelete closes the SamList

func (*SamList) ReadRequest

func (samStack *SamList) ReadRequest()

ReadRequest checks the pipes for new URLs to request

func (*SamList) SendClientRequestHTTP

func (samStack *SamList) SendClientRequestHTTP(request *http.Request) (*http.Client, string)

func (*SamList) WriteResponses

func (samStack *SamList) WriteResponses()

WriteResponses writes the responses to the pipes

type SamURL

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

SamURL manages the recieve pipes for SamHTTP request targets

func NewSamURL

func NewSamURL(requestdir string) SamURL

NewSamURL instantiates a SamURL

func NewSamURLHTTP

func NewSamURLHTTP(request *http.Request) SamURL

NewSamURLHTTP instantiates a SamURL

func (*SamURL) CleanupDirectory

func (subURL *SamURL) CleanupDirectory()

func (*SamURL) CreateDirectory

func (subURL *SamURL) CreateDirectory(requestdir string)

func (*SamURL) ScannerText

func (subURL *SamURL) ScannerText() (string, error)

Jump to

Keyboard shortcuts

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