fix: improved offline support

Closes coop-cloud/organising#471.
This commit is contained in:
2023-07-26 08:16:07 +02:00
parent ab64eb2e8d
commit 3dc5662821
49 changed files with 455 additions and 375 deletions

28
pkg/runtime/config.go Normal file
View File

@ -0,0 +1,28 @@
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
}
}