package runtime import "github.com/sirupsen/logrus" type Config struct { Offline bool } type Option func(c *Config) func New(opts ...Option) *Config { conf := &Config{Offline: false} for _, optFunc := range opts { optFunc(conf) } return conf } func WithOffline(offline bool) Option { return func(c *Config) { if offline { logrus.Debugf("runtime config: attempting to run in offline mode") } c.Offline = offline } }