Files
opencloud/settings/pkg/config/config.go
2021-10-22 13:27:31 +02:00

90 lines
1.6 KiB
Go

package config
import "context"
// Log defines the available logging configuration.
type Log struct {
Level string
Pretty bool
Color bool
File string
}
// Debug defines the available debug configuration.
type Debug struct {
Addr string
Token string
Pprof bool
Zpages bool
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string
AllowedMethods []string
AllowedHeaders []string
AllowCredentials bool
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Namespace string
Root string
CacheTTL int
CORS CORS
}
// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string
Namespace string
}
// Service provides configuration options for the service
type Service struct {
Name string
Version string
DataPath string
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool
Type string
Endpoint string
Collector string
Service string
}
// Asset undocumented
type Asset struct {
Path string
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string
}
// Config combines all available configuration parts.
type Config struct {
File string
Service Service
Log Log
Debug Debug
HTTP HTTP
GRPC GRPC
Tracing Tracing
Asset Asset
TokenManager TokenManager
Context context.Context
Supervised bool
}
// New initializes a new configuration with or without defaults.
func New() *Config {
return &Config{}
}