Documentation ¶
Index ¶
- func NewService(host, port, book, samhost, samport string, subs []string, useh bool)
- func Service()
- func SetClientHost(s string) func(*Client) error
- func SetClientPort(s string) func(*Client) error
- func SetClientPortInt(s int) func(*Client) error
- func SetClientVerbose(s bool) func(*Client) error
- func SetJumpHelperAddressBookPath(s string) func(*JumpHelper) error
- func SetJumpHelperHost(s string) func(*JumpHelper) error
- func SetJumpHelperPort(s string) func(*JumpHelper) error
- func SetJumpHelperPortInt(s int) func(*JumpHelper) error
- func SetJumpHelperSubscription(s []string) func(*JumpHelper) error
- func SetJumpHelperUseHelper(s bool) func(*JumpHelper) error
- func SetJumpHelperVerbosity(s bool) func(*JumpHelper) error
- func SetServerAddressBookPath(s string) func(*Server) error
- func SetServerBase32(s string) func(*Server) error
- func SetServerBase64(s string) func(*Server) error
- func SetServerBurst(s int) func(*Server) error
- func SetServerDifficulty(s int) func(*Server) error
- func SetServerEnableListing(s bool) func(*Server) error
- func SetServerHost(s string) func(*Server) error
- func SetServerJumpHelperHost(s string) func(*Server) error
- func SetServerJumpHelperPort(s string) func(*Server) error
- func SetServerJumpHelperPortInt(s int) func(*Server) error
- func SetServerJumpHelperVerbosity(s bool) func(*Server) error
- func SetServerPort(s string) func(*Server) error
- func SetServerPortInt(s int) func(*Server) error
- func SetServerRate(s int) func(*Server) error
- func SetServerSubscription(s []string) func(*Server) error
- func SetServerUseHelper(s bool) func(*Server) error
- func SetaddresslistAddressBookPath(s string) func(*addresslist) error
- func SetaddresslistHost(s string) func(*addresslist) error
- func SetaddresslistPort(s string) func(*addresslist) error
- func SetaddresslistPortInt(s int) func(*addresslist) error
- type Client
- func (c *Client) Check(s string) (bool, error)
- func (c *Client) Jump(s string) (string, error)
- func (c *Client) Log(s string) string
- func (c *Client) Register(input, domain, base64 string) (string, error)
- func (c *Client) Request(s string) (string, error)
- func (c *Client) Signup(domain, base64 string) (string, error)
- type ClientOption
- type JumpHelper
- type JumpHelperOption
- type Server
- func (s *Server) HandleAccount(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleBase32(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleBase64(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleExists(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleJump(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleListing(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleLookup(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleProof(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandlePush(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleRecv(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleReflect32(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleReflect64(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleReflectBoth(w http.ResponseWriter, r *http.Request)
- func (s *Server) HandleReflectHeaders(w http.ResponseWriter, r *http.Request)
- func (s *Server) NewMux() (*http.ServeMux, error)
- func (s *Server) Rate() rate.Limit
- func (s *Server) Serve()
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
NewService quickly generates a service with host, port, book strings and fires off a goroutine
func SetClientHost ¶
SetClientHost sets the host of the Server to connect to
func SetClientPort ¶
SetClientPort sets the port of the Server to connect to
func SetClientPortInt ¶
SetClientPortInt sets the port of the Server to connect to with an int
func SetClientVerbose ¶
SetClientVerbose sets the verbosity of the client
func SetJumpHelperAddressBookPath ¶
func SetJumpHelperAddressBookPath(s string) func(*JumpHelper) error
SetJumpHelperAddressBookPath sets the host of the JumpHelper client's SAM bridge
func SetJumpHelperHost ¶
func SetJumpHelperHost(s string) func(*JumpHelper) error
SetJumpHelperHost sets the host of the JumpHelper client's SAM bridge
func SetJumpHelperPort ¶
func SetJumpHelperPort(s string) func(*JumpHelper) error
SetJumpHelperPort sets the port of the JumpHelper client's SAM bridge
func SetJumpHelperPortInt ¶
func SetJumpHelperPortInt(s int) func(*JumpHelper) error
SetJumpHelperPortInt sets the port of the JumpHelper client's SAM bridge with an int
func SetJumpHelperSubscription ¶
func SetJumpHelperSubscription(s []string) func(*JumpHelper) error
SetJumpHelperSubscription sets the subscription list slice contents
func SetJumpHelperUseHelper ¶
func SetJumpHelperUseHelper(s bool) func(*JumpHelper) error
SetJumpHelperUseHelper sets the host of the JumpHelper client's SAM bridge
func SetJumpHelperVerbosity ¶
func SetJumpHelperVerbosity(s bool) func(*JumpHelper) error
SetJumpHelperVerbosity sets the verbosity for the server
func SetServerAddressBookPath ¶
SetServerAddressBookPath sets the host of the Server client's SAM bridge
func SetServerBase32 ¶
SetServerBase32 sets the host of the Server client's SAM bridge
func SetServerBase64 ¶
SetServerBase64 sets the host of the Server client's SAM bridge
func SetServerBurst ¶
SetServerBurst sets the host of the Server client's SAM bridge
func SetServerDifficulty ¶
SetServerDifficulty sets the host of the Server client's SAM bridge
func SetServerEnableListing ¶
SetServerEnableListing Allows the server to export a list of addresses to others
func SetServerHost ¶
SetServerHost sets the host of the Server client's SAM bridge
func SetServerJumpHelperHost ¶
SetServerJumpHelperHost sets the host of the Jumphelper Server sync client's SAM bridge
func SetServerJumpHelperPort ¶
SetServerJumpHelperPort sets the port of the Jumphelper Server sync client's SAM bridge
func SetServerJumpHelperPortInt ¶
SetServerJumpHelperPortInt sets the port of the Jumphelper Server sync client's SAM bridge with an int
func SetServerJumpHelperVerbosity ¶
SetServerJumpHelperVerbosity sets the verbosity for the server
func SetServerPort ¶
SetServerPort sets the port of the Server client's SAM bridge
func SetServerPortInt ¶
SetServerPortInt sets the port of the Server client's SAM bridge with an int
func SetServerRate ¶
SetServerRate sets the host of the Server client's SAM bridge
func SetServerSubscription ¶
SetServerSubscription sets the subscription list slice contents
func SetServerUseHelper ¶
SetServerUseHelper sets the host of the Server client's SAM bridge
func SetaddresslistAddressBookPath ¶
SetaddresslistAddressBookPath sets the host of the addresslist client's SAM bridge
func SetaddresslistHost ¶
SetaddresslistHost sets the host of the addresslist client's SAM bridge
func SetaddresslistPort ¶
SetaddresslistPort sets the port of the addresslist client's SAM bridge
func SetaddresslistPortInt ¶
SetaddresslistPortInt sets the port of the addresslist client's SAM bridge with an int
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a HTTP client that makes jumphelper requests
func NewClientFromOptions ¶
NewClientFromOptions creates a new jumphelper client from functional arguments
type JumpHelper ¶
type JumpHelper struct { TrustedAddressBook *addresslist // contains filtered or unexported fields }
JumpHelper is a struct that prioritizes i2p address sources
func NewJumpHelper ¶
func NewJumpHelper(addressBookPath, host, port string, subs []string, use bool) (*JumpHelper, error)
NewJumpHelper creates a new JumpHelper object
func NewJumpHelperFromOptions ¶
func NewJumpHelperFromOptions(opts ...func(*JumpHelper) error) (*JumpHelper, error)
NewJumpHelperFromOptions creates a new JumpHelper object
func (*JumpHelper) CheckAddressBook ¶
func (j *JumpHelper) CheckAddressBook(pk string) bool
CheckAddressBook returns true if an address is present, false if not
func (*JumpHelper) LoadAddressBook ¶
func (j *JumpHelper) LoadAddressBook() error
LoadAddressBook loads an addressbook in csv(name, b32) format
func (*JumpHelper) SearchAddressBook ¶
func (j *JumpHelper) SearchAddressBook(pk string) []string
SearchAddressBook finds a (name, b32) pair in the addressbook, or returns nil of one is not found
func (*JumpHelper) Subs ¶
func (j *JumpHelper) Subs() []string
Subs Lists all the known address pairs
func (*JumpHelper) Vote ¶
func (j *JumpHelper) Vote(pk string) int
Vote returns true if an address is present, false if not
type JumpHelperOption ¶
type JumpHelperOption func(*JumpHelper) error
JumpHelperOption is a jumphelper option
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a TCP service that responds to addressbook requests
func NewServer ¶
func NewServer(host, port, book, samhost, samport string, subs []string, useh, verbose, share bool, base32 string) (*Server, error)
NewServer creates a new Server that answers jump-related queries
func NewServerFromOptions ¶
NewServerFromOptions creates a new Server that answers jump-related queries
func (*Server) HandleAccount ¶
func (s *Server) HandleAccount(w http.ResponseWriter, r *http.Request)
HandleAccount emits a problem for proof-of-work on the client
func (*Server) HandleBase32 ¶
func (s *Server) HandleBase32(w http.ResponseWriter, r *http.Request)
HandleBase32 lists all synced remote jumphelper urls.
func (*Server) HandleBase64 ¶
func (s *Server) HandleBase64(w http.ResponseWriter, r *http.Request)
HandleBase64 lists all synced remote jumphelper urls.
func (*Server) HandleExists ¶
func (s *Server) HandleExists(w http.ResponseWriter, r *http.Request)
HandleExists prints true:address if an antecedent URL exists in the addressbook, false if not
func (*Server) HandleJump ¶
func (s *Server) HandleJump(w http.ResponseWriter, r *http.Request)
HandleJump redirects to a base64 URL like a traditional jump service.
func (*Server) HandleListing ¶
func (s *Server) HandleListing(w http.ResponseWriter, r *http.Request)
HandleListing lists all synced remote jumphelper urls.
func (*Server) HandleLookup ¶
func (s *Server) HandleLookup(w http.ResponseWriter, r *http.Request)
HandleLookup redirects to a b32.i2p URL instead of behaving like a traditional jump service.
func (*Server) HandleProof ¶
func (s *Server) HandleProof(w http.ResponseWriter, r *http.Request)
HandleProof emits a problem for proof-of-work on the client
func (*Server) HandlePush ¶
func (s *Server) HandlePush(w http.ResponseWriter, r *http.Request)
HandlePush creates a signed list of addresses and pushes it to a requested URL
func (*Server) HandleRecv ¶
func (s *Server) HandleRecv(w http.ResponseWriter, r *http.Request)
HandleRecv recieves a signed list of URL's from another server's HandlePush
func (*Server) HandleReflect32 ¶
func (s *Server) HandleReflect32(w http.ResponseWriter, r *http.Request)
HandleReflect32 replies back with the base32 of the client requesting it
func (*Server) HandleReflect64 ¶
func (s *Server) HandleReflect64(w http.ResponseWriter, r *http.Request)
HandleReflect64 replies back with the base64 of the client requesting it
func (*Server) HandleReflectBoth ¶
func (s *Server) HandleReflectBoth(w http.ResponseWriter, r *http.Request)
HandleReflectBoth replies back with both the base32 and base64 of the client requesting it
func (*Server) HandleReflectHeaders ¶
func (s *Server) HandleReflectHeaders(w http.ResponseWriter, r *http.Request)