Documentation ¶
Index ¶
- Constants
- func Dump(config *Config, w io.Writer) error
- func ServiceProvider(config *Config) service.Provider
- func WithConfig(ctx context.Context, conf *Config) context.Context
- func WithEnvironment(conf *Config) error
- type ARPWatcherConfig
- type AppConfig
- type CaptivePortalConfig
- type ClockSyncConfig
- type Config
- type ContactConfig
- type DataConfig
- type GatewayCacheConfig
- type GatewayClientConfig
- type GatewayRemoteClientConfig
- type GatewayServerConfig
- type HTTPConfig
- type JobConfig
- type LogConfig
- type MarketClientConfig
- type MemberCardConfig
- type SentryConfig
- type ThemeConfig
- type TunnelClientConfig
- type TunnelRemoteClientConfig
- type TunnelServerConfig
Constants ¶
View Source
const ServiceName service.Name = "config"
Variables ¶
This section is empty.
Functions ¶
func ServiceProvider ¶
func WithEnvironment ¶
Types ¶
type ARPWatcherConfig ¶
type ARPWatcherConfig struct { RouterIP string `yaml:"routerIp"` RouterNetwork string `yaml:"routerNetwork"` HostIP string `yaml:"hostIp"` NIC string `yaml:"nic"` OfflineDeadline time.Duration `yaml:"offlineDeadline"` ProbeInterval time.Duration `yaml:"probeInterval"` PurgeDeadline time.Duration `yaml:"purgeDeadline"` }
type CaptivePortalConfig ¶
type CaptivePortalConfig struct { Enabled bool `yaml:"enabled" env:"ARCAD_CAPTIVE_PORTAL_ENABLED"` RedirectURL string `yaml:"redirectUrl" env:"ARCAD_CAPTIVE_PORTAL_REDIRECT_URL"` ARPWatcher []ARPWatcherConfig `yaml:"arpWatchers"` }
type ClockSyncConfig ¶
type Config ¶
type Config struct { Debug bool `yaml:"debug" env:"ARCAD_DEBUG"` HTTP HTTPConfig `yaml:"http"` Contact ContactConfig `yaml:"contact"` App AppConfig `yaml:"app"` Data DataConfig `yaml:"data"` MemberCard MemberCardConfig `yaml:"memberCard"` Job JobConfig `yaml:"job"` Log LogConfig `yaml:"log"` Sentry SentryConfig `yaml:"sentry"` Theme ThemeConfig `yaml:"theme"` ClockSync ClockSyncConfig `yaml:"clockSync"` CaptivePortal CaptivePortalConfig `yaml:"captivePortal"` GatewayServer GatewayServerConfig `yaml:"gatewayServer"` GatewayClient GatewayClientConfig `yaml:"gatewayClient"` TunnelServer TunnelServerConfig `yaml:"tunnelServer"` TunnelClient TunnelClientConfig `yaml:"tunnelClient"` MarketClient MarketClientConfig `yaml:"marketClient"` Plugins map[string]map[string]interface{} `yaml:"plugins"` }
func FromContext ¶
FromContext retrieves the config service in the given context.
func MustContext ¶
MustContext retrieves the config service in the given context or panic otherwise.
func NewDefault ¶
func NewDefault() *Config
func NewFromFile ¶
NewFromFile retrieves the configuration from the given file
type ContactConfig ¶
type DataConfig ¶
type DataConfig struct {
DBPath string `yaml:"dbPath" env:"ARCAD_DATA_DB_PATH"`
}
type GatewayCacheConfig ¶
type GatewayCacheConfig struct { Enabled bool `yaml:"enabled" env:"ARCAD_GATEWAY_SERVER_CACHE_ENABLED"` MaxSize int64 `yaml:"maxSize" env:"ARCAD_GATEWAY_SERVER_CACHE_MAX_SIZE"` TTL time.Duration `yaml:"ttl" env:"ARCAD_GATEWAY_SERVER_CACHE_TTL"` RefreshTimeout time.Duration `yaml:"refreshTimeout" env:"ARCAD_GATEWAY_SERVER_CACHE_REFRESH_TIMEOUT"` }
type GatewayClientConfig ¶
type GatewayClientConfig struct { ServerAddress string `yaml:"serverAddress" env:"ARCAD_GATEWAY_CLIENT_SERVER_ADDRESS"` ID string `yaml:"id" env:"ARCAD_GATEWAY_CLIENT_ID"` Secret string `yaml:"secret" env:"ARCAD_GATEWAY_CLIENT_SECRET"` BackoffBaseDelay time.Duration `yaml:"backoffBaseDelay" env:"ARCAD_GATEWAY_CLIENT_BACKOFF_BASE_DELAY"` BackoffFactor float32 `yaml:"backoffFactor" env:"ARCAD_GATEWAY_CLIENT_BACKOFF_FACTOR"` }
type GatewayServerConfig ¶
type GatewayServerConfig struct { TunnelAddress string `yaml:"tunnelAddress" env:"ARCAD_GATEWAY_SERVER_TUNNEL_ADDRESS"` HTTPAddress string `yaml:"httpAddress" env:"ARCAD_GATEWAY_SERVER_HTTP_ADDRESS"` ProxyTargetURL string `yaml:"proxyTargetUrl" env:"ARCAD_GATEWAY_SERVER_PROXY_TARGET_URL"` MatchRegExp string `yaml:"matchRegExp" env:"ARCAD_GATEWAY_SERVER_MATCH_REGEXP"` Cache GatewayCacheConfig `yaml:"cache"` Clients []GatewayRemoteClientConfig `yaml:"clients"` }
type HTTPConfig ¶
type HTTPConfig struct { Address string `yaml:"address" env:"ARCAD_HTTP_ADDRESS"` TemplateDir string `yaml:"templateDir" env:"ARCAD_HTTP_TEMPLATE_DIR"` PublicDir string `yaml:"publicDir" env:"ARCAD_HTTP_PUBLIC_DIR"` CookieAuthenticationKey string `yaml:"cookieAuthenticationKey" env:"ARCAD_HTTP_COOKIE_AUTHENTICATION_KEY"` CookieEncryptionKey string `yaml:"cookieEncryptionKey" env:"ARCAD_HTTP_COOKIE_ENCRYPTION_KEY"` CookieMaxAge int `yaml:"cookieMaxAge" env:"ARCAD_HTTP_COOKIE_MAX_AGE"` }
type JobConfig ¶
type JobConfig struct {
CleanupSpec string `yaml:"cleanupSpec" env:"ARCAD_JOB_CLEANUP_SPEC"`
}
type MarketClientConfig ¶
type MarketClientConfig struct { MarketURL string `yaml:"marketUrl" env:"ARCAD_MARKET_CLIENT_MARKET_URL"` IPFSGatewayURL string `yaml:"ipfsGatewayUrl" env:"ARCAD_MARKET_CLIENT_IPFS_GATEWAY_URL"` Timeout time.Duration `yaml:"timeout" env:"ARCAD_MARKET_CLIENT_TIMEOUT"` RetryMax int `yaml:"retryMax" env:"ARCAD_MARKET_CLIENT_RETRY_MAX"` AppsDir string `yaml:"appsDir" env:"ARCAD_MARKET_CLIENT_APPS_DIR"` }
type MemberCardConfig ¶
type MemberCardConfig struct { SigningKeyPath string `yaml:"signingKeyPath" env:"ARCAD_MEMBER_CARD_SIGNING_KEY_PATH"` LayoutPath string `yaml:"layoutPath" env:"ARCAD_MEMBER_CARD_LAYOUT_PATH"` FontPath string `yaml:"fontPath" env:"ARCAD_MEMBER_CARD_FONT_PATH"` NicknameFontSize float64 `yaml:"nicknameFontSize" env:"ARCAD_MEMBER_CARD_NICKNAME_FONT_SIZE"` NicknameAnchorX float64 `yaml:"nicknameAnchorX" env:"ARCAD_MEMBER_CARD_NICKNAME_ANCHOR_X"` NicknameAnchorY float64 `yaml:"nicknameAnchorY" env:"ARCAD_MEMBER_CARD_NICKNAME_ANCHOR_Y"` NicknameLineSpacing float64 `yaml:"nicknameLineSpacing" env:"ARCAD_MEMBER_CARD_NICKNAME_LINE_SPACING"` }
type SentryConfig ¶
type ThemeConfig ¶
type ThemeConfig struct {
Path string `yaml:"path" env:"ARCAD_THEME_PATH"`
}
func (*ThemeConfig) EmptyPath ¶
func (c *ThemeConfig) EmptyPath() bool
func (*ThemeConfig) ThemedDirectories ¶
func (c *ThemeConfig) ThemedDirectories(themeSubDir string, dirs ...string) []string
ThemedDirectories returns a slice of directories with the theme subdirectory appended if a theme is defined in the configuration.
type TunnelClientConfig ¶
type TunnelClientConfig struct { ServerAddress string `yaml:"serverAddress" env:"ARCAD_TUNNEL_CLIENT_SERVER_ADDRESS"` ID string `yaml:"id" env:"ARCAD_TUNNEL_CLIENT_ID"` Secret string `yaml:"secret" env:"ARCAD_TUNNEL_CLIENT_SECRET"` BackoffBaseDelay time.Duration `yaml:"backoffBaseDelay" env:"ARCAD_TUNNEL_CLIENT_BACKOFF_BASE_DELAY"` BackoffFactor float32 `yaml:"backoffFactor" env:"ARCAD_TUNNEL_CLIENT_BACKOFF_FACTOR"` }
type TunnelServerConfig ¶
type TunnelServerConfig struct { TunnelAddress string `yaml:"tunnelAddress" env:"ARCAD_TUNNEL_SERVER_TUNNEL_ADDRESS"` ProxyTargetAddress string `yaml:"proxyTargetAddress" env:"ARCAD_TUNNEL_SERVER_PROXY_TARGET_ADDRESS"` Clients []TunnelRemoteClientConfig `yaml:"clients"` SocketDir string `yaml:"socketDir" env:"ARCAD_TUNNEL_SERVER_SOCKET_DIR"` SocketFilenamePattern string `yaml:"socketFilenamePattern" env:"ARCAD_TUNNEL_SERVER_SOCKET_FILENAME_PATTERN"` }
Click to show internal directories.
Click to hide internal directories.