Add torrent addr to config
parent
0640e065fa
commit
47284c1106
|
|
@ -10,20 +10,24 @@ import (
|
||||||
|
|
||||||
const cdbpath = "DBPath"
|
const cdbpath = "DBPath"
|
||||||
const port = "port"
|
const port = "port"
|
||||||
|
const toraddr = "toraddr"
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
DBPath string
|
DBPath string
|
||||||
Port string
|
Port string
|
||||||
|
TorAddr string
|
||||||
}
|
}
|
||||||
|
|
||||||
func New() *Config {
|
func New() *Config {
|
||||||
lookups := make(map[string]*string)
|
lookups := make(map[string]*string)
|
||||||
add(cdbpath, path.Join(os.Getenv("MNT"), "db.db"), lookups)
|
add(cdbpath, path.Join(os.Getenv("MNT"), "db.db"), lookups)
|
||||||
add(port, ":9101", lookups)
|
add(port, ":9101", lookups)
|
||||||
|
add(toraddr, "http://192.168.0.86:9091/transmission/rpc", lookups)
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
return &Config{
|
return &Config{
|
||||||
DBPath: *lookups[cdbpath],
|
DBPath: *lookups[cdbpath],
|
||||||
Port: *lookups[port],
|
Port: *lookups[port],
|
||||||
|
TorAddr: *lookups[toraddr],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue