Add proxy flag for alternative proxy configuration

master
Bel LaPointe 2020-02-19 14:43:44 -07:00
parent 5cd83ac00b
commit a613a0e9cb
1 changed files with 4 additions and 0 deletions

View File

@ -15,9 +15,13 @@ func New() error {
as.Append(args.STRING, "port", "port to listen on", "33419") as.Append(args.STRING, "port", "port to listen on", "33419")
as.Append(args.STRING, "db", "database type code", storage.MAP.String()) as.Append(args.STRING, "db", "database type code", storage.MAP.String())
as.Append(args.STRING, "ns", "namespace", storage.DefaultNamespace) as.Append(args.STRING, "ns", "namespace", storage.DefaultNamespace)
as.Append(args.STRING, "proxy", "http proxy", "")
if err := as.Parse(); err != nil { if err := as.Parse(); err != nil {
return err return err
} }
if proxy := as.Get("proxy").GetString(); len(proxy) > 0 {
os.Setenv("http_proxy", proxy)
}
ctx, can := context.WithCancel(context.Background()) ctx, can := context.WithCancel(context.Background())
config = Config{ config = Config{
db: as.Get("db").GetString(), db: as.Get("db").GetString(),