diff --git a/alter/vpnhole.go b/alter/vpnhole.go new file mode 100644 index 0000000000000000000000000000000000000000..ee34461ab28518b7acbcef3a7566902571b260bd --- /dev/null +++ b/alter/vpnhole.go @@ -0,0 +1,35 @@ +package alter + +import ( + "fmt" +) + +var ErrShutdown = fmt.Errorf("vpnhole was shutdown gracefully") + +type Config struct { + Addr string + SubscriptionsFilename string + Upstream string + Start func() error + Stop func() error +} + +func (c Config) String() string { + return fmt.Sprintf("Config{Addr: %s, SubscriptionsFilename: %s, Upstream: %s}", c.Addr, c.SubscriptionsFilename, c.Upstream) +} + +// parse the flags and return the config struct with the values +func ParseFlags() Config { + return Config{ + Addr: ":53", + SubscriptionsFilename: "subs.list", + Upstream: "1.1.1.1:53", + + Start: func() error { + return nil + }, + Stop: func() error { + return nil + }, + } +}