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