Documentation ¶
Overview ¶
*
configuration loader/saver
Index ¶
Constants ¶
View Source
const DefaultEnableGnutella = false
DefaultEnableGnutella says if should we enable gnutella by default
View Source
const DefaultOpentrackerFilename = "trackers.ini"
View Source
const DefaultRPCAddr = "127.0.0.1:1776"
View Source
const DefaultRPCAuth = "0"
View Source
const DefaultRPCHost = "127.0.0.1"
View Source
const DefaultTorrentQueueSize = 0
View Source
const DisableI2PByDefault = false
View Source
const DisableLokinetByDefault = true
View Source
const EnvI2PAddress = "XD_I2P_ADDRESS"
EnvI2PAddress is the name of the environmental variable to set the i2p address for XD
View Source
const EnvLogLevel = "XD_LOG_LEVEL"
View Source
const EnvLogPProf = "XD_PPROF"
View Source
const EnvOpenTracker = "XD_OPENTRACKER_URL"
View Source
const EnvRPCAddr = "XD_RPC_ADDRESS"
View Source
const EnvRPCHost = "XD_RPC_HOST"
View Source
const EnvRootDir = "XD_HOME"
EnvRootDir is the name of the environmental variable to set the root storage directory at runtime
Variables ¶
View Source
var DefaultOpenTrackers = map[string]string{
"dg-opentracker": "http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/a",
"chudo-opentracker": "http://swhb5i7wcjcohmus3gbt3w6du6pmvl3isdvxvepuhdxxkfbzao6q.b32.i2p/a",
"r4sas-opentracker": "http://punzipidirfqspstvzpj6gb4tkuykqp6quurj6e23bgxcxhdoe7q.b32.i2p/a",
"thebland-opentracker": "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a",
"skank-opentracker": "http://by7luzwhx733fhc5ug2o75dcaunblq2ztlshzd7qvptaoa73nqua.b32.i2p/a",
}
TODO: idk if these are the right names but the URL are correct
Functions ¶
This section is empty.
Types ¶
type BittorrentConfig ¶
type BittorrentConfig struct { DHT bool PEX bool OpenTrackers TrackerConfig PieceWindowSize int Swarms int TorrentQueueSize int }
func (*BittorrentConfig) CreateSwarm ¶
func (*BittorrentConfig) Load ¶
func (c *BittorrentConfig) Load(s *configparser.Section) error
func (*BittorrentConfig) LoadEnv ¶
func (cfg *BittorrentConfig) LoadEnv()
func (*BittorrentConfig) Save ¶
func (c *BittorrentConfig) Save(s *configparser.Section) error
type Config ¶
type Config struct { LokiNet LokiNetConfig I2P I2PConfig Storage StorageConfig RPC RPCConfig Log LogConfig Bittorrent BittorrentConfig Gnutella G2Config }
type Configurable ¶
type Configurable interface { Load(s *configparser.Section) error Save(c *configparser.Section) error LoadEnv() }
Configurable interface for entity serializable to/from config parser section
type G2Config ¶
type G2Config struct {
// contains filtered or unexported fields
}
func (*G2Config) CreateSwarm ¶
type I2PConfig ¶
type I2PConfig struct { Addr string Keyfile string Name string I2CPOptions map[string]string Disabled bool // contains filtered or unexported fields }
func (*I2PConfig) CreateSession ¶
create an i2p session from this config
type LokiNetConfig ¶
func (*LokiNetConfig) CreateSession ¶
func (cfg *LokiNetConfig) CreateSession() (*inet.Session, error)
create a network session from this config
func (*LokiNetConfig) Load ¶
func (cfg *LokiNetConfig) Load(section *configparser.Section) error
func (*LokiNetConfig) LoadEnv ¶
func (cfg *LokiNetConfig) LoadEnv()
func (*LokiNetConfig) Save ¶
func (cfg *LokiNetConfig) Save(s *configparser.Section) error
type RPCConfig ¶
type SFTPConfig ¶
type SFTPConfig struct { Enabled bool Username string Hostname string Keyfile string RemotePubkey string Port int }
func (*SFTPConfig) Load ¶
func (cfg *SFTPConfig) Load(s *configparser.Section) error
func (*SFTPConfig) LoadEnv ¶
func (cfg *SFTPConfig) LoadEnv()
func (*SFTPConfig) Save ¶
func (cfg *SFTPConfig) Save(s *configparser.Section) error
func (*SFTPConfig) ToFS ¶
func (cfg *SFTPConfig) ToFS() fs.Driver
type StorageConfig ¶
type StorageConfig struct { // downloads directory Downloads string // completed directory Completed string // metadata directory Meta string // root directory Root string // number of io threads Workers int // number of buffered iops when using pooled io IOPBufferSize int // sftp config SFTP SFTPConfig }
func (*StorageConfig) CreateStorage ¶
func (cfg *StorageConfig) CreateStorage() storage.Storage
func (*StorageConfig) Load ¶
func (cfg *StorageConfig) Load(s *configparser.Section) error
func (*StorageConfig) LoadEnv ¶
func (cfg *StorageConfig) LoadEnv()
func (*StorageConfig) Save ¶
func (cfg *StorageConfig) Save(s *configparser.Section) error
type TrackerConfig ¶
func (*TrackerConfig) Load ¶
func (c *TrackerConfig) Load() (err error)
func (*TrackerConfig) Save ¶
func (c *TrackerConfig) Save() (err error)
Click to show internal directories.
Click to hide internal directories.