i2pgateconfig

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// DefaultPathName is the default config dir name
	DefaultPathName = ".ipfs"
	// DefaultPathRoot is the path to the default config dir location.
	DefaultPathRoot = "~/" + DefaultPathName
	// DefaultConfigFile is the filename of the configuration file
	DefaultConfigFile = "i2pconfig"
	// EnvDir is the environment variable used to change the path root.
	EnvDir = "IPFS_PATH"
)

Variables

This section is empty.

Functions

func AddressHTTP

func AddressHTTP(addr string, cfg interface{}) error

func AddressRPC

func AddressRPC(addr string, cfg interface{}) error

func AddressSwarm

func AddressSwarm(addr string, cfg interface{}) error

func AddressesBootstrap

func AddressesBootstrap(addr []string, cfg interface{}) error

func Filename

func Filename(ipfs_path string) (string, error)

Filename returns the correct path to the config file for consumption by other parts of the application

func ListenerBase32

func ListenerBase32(addr string, cfg interface{}) error

func ListenerBase32RPC

func ListenerBase32RPC(addr string, cfg interface{}) error

func ListenerBase32Swarm

func ListenerBase32Swarm(addr string, cfg interface{}) error

func ListenerBase64

func ListenerBase64(addr string, cfg interface{}) error

func ListenerBase64RPC

func ListenerBase64RPC(addr string, cfg interface{}) error

func ListenerBase64Swarm

func ListenerBase64Swarm(addr string, cfg interface{}) error

func Path

func Path(configroot, extension string) (string, error)

func PathRoot

func PathRoot() (string, error)

PathRoot returns the default configuration root directory

func Unquote

func Unquote(s string) string

Types

type Config

type Config struct {
	SAMHost                            string
	SAMPort                            string
	TunName                            string
	AddressRPC                         string
	AddressHTTP                        string
	AddressSwarm                       string
	EncryptLeaseSet                    bool
	EncryptedLeaseSetKey               string
	EncryptedLeaseSetPrivateKey        string
	EncryptedLeaseSetPrivateSigningKey string
	InAllowZeroHop                     bool
	OutAllowZeroHop                    bool
	InLength                           int
	OutLength                          int
	InQuantity                         int
	OutQuantity                        int
	InVariance                         int
	OutVariance                        int
	InBackupQuantity                   int
	OutBackupQuantity                  int
	UseCompression                     bool
	FastRecieve                        bool
	ReduceIdle                         bool
	ReduceIdleTime                     int
	ReduceIdleQuantity                 int
	CloseIdle                          bool
	CloseIdleTime                      int
	AccessListType                     string
	AccessList                         []string
	MessageReliability                 string
	OnlyI2P                            bool
	ListenerBase32                     string
	ListenerBase64                     string
	ListenerSK                         string
	ListenerBase32RPC                  string
	ListenerBase64RPC                  string
	ListenerSKRPC                      string
	ListenerBase32Swarm                string
	ListenerBase64Swarm                string
	ListenerSKSwarm                    string
	I2PBootstrapAddresses              []string
}

Config is a struct very alike the one used to configure IPFS which is used to create, load, and access i2p configurations.

func ConfigAt

func ConfigAt(ipfs_path string) (*Config, error)

ConfigAt loads an i2p gateway plugin from the IPFS_PATH directory. It's a file intended to be as similar to the IPFS config as possible.

func Init

func Init(out io.Writer) (*Config, error)

func Load

func Load(filename string) (*Config, error)

Load reads a config file, or if one does not exist, initializes one.

func (*Config) BootstrapAddresses

func (c *Config) BootstrapAddresses() []string

func (*Config) HTTPHost

func (c *Config) HTTPHost() (string, error)

HTTPHost returns the string representation of the IPFS gateway host only

func (*Config) HTTPPort

func (c *Config) HTTPPort() (string, error)

HTTPPort returns the string representation of the IPFS gateway port only

func (*Config) HostSAM

func (c *Config) HostSAM() string

func (*Config) MaTargetHTTP

func (c *Config) MaTargetHTTP() (ma.Multiaddr, error)

func (*Config) MaTargetRPC

func (c *Config) MaTargetRPC() (ma.Multiaddr, error)

func (*Config) MaTargetSwarm

func (c *Config) MaTargetSwarm() (ma.Multiaddr, error)

func (*Config) PortSAM

func (c *Config) PortSAM() string

func (*Config) Print

func (c *Config) Print() []string

Print returns and prints a formatted list of configured tunnel settings.

func (*Config) RPCHost

func (c *Config) RPCHost() (string, error)

RPCHost returns the string representation of the RPC gateway host only

func (*Config) RPCPort

func (c *Config) RPCPort() (string, error)

RPCPort returns the string representation of the RPC gateway port only

func (*Config) SAMAddr

func (c *Config) SAMAddr() string

func (*Config) SAMMultiaddr

func (c *Config) SAMMultiaddr() (ma.Multiaddr, error)

func (*Config) Save

func (cfg *Config) Save(ipfs_path string) (*Config, error)

Save writes a config file.

func (*Config) SwarmHost

func (c *Config) SwarmHost() (string, error)

func (*Config) SwarmPort

func (c *Config) SwarmPort() (string, error)

func (*Config) TargetHTTP

func (c *Config) TargetHTTP() string

TargetHTTP returns the string representation of the IPFS gateway in host:port form(not a multiaddr)

func (*Config) TargetRPC

func (c *Config) TargetRPC() string

TargetRPC returns the string representation of the RPC gateway in host:port form(not a multiaddr)

func (*Config) TargetSwarm

func (c *Config) TargetSwarm() string

Jump to

Keyboard shortcuts

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