Documentation
¶
Overview ¶
Package config provides the configuration for the opampcommander application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminSettings ¶
type AdminSettings struct {
// Username is the username for the admin user.
Username string
// Password is the password for the admin user.
Password string
// Email is the email address for the admin user.
// This is used in jwt claims.
Email string
}
AdminSettings holds the configuration settings for admin authentication. This is used for basic authentication of the admin user.
type AuthSettings ¶
type AuthSettings struct {
// JWTSettings holds the configuration settings for JSON Web Tokens (JWT).
JWTSettings JWTSettings
// AdminSettings holds the configuration settings for admin authentication.
AdminSettings AdminSettings
// OAuthSettings holds the configuration settings for OAuth2 authentication.
OAuthSettings *OAuthSettings
}
AuthSettings holds the authentication settings for the application.
type DatabaseSettings ¶ added in v0.1.6
type DatabaseSettings struct {
Type DatabaseType
Endpoints []string
}
DatabaseSettings holds the settings for database connections.
type DatabaseType ¶ added in v0.1.6
type DatabaseType string
DatabaseType represents the type of database to be used.
const ( // DatabaseTypeEtcd represents an etcd database. DatabaseTypeEtcd DatabaseType = "etcd" )
type JWTSettings ¶
type JWTSettings struct {
SigningKey string
Issuer string
Expiration time.Duration
Audience []string
}
JWTSettings holds the configuration settings for JSON Web Tokens (JWT).
type LogSettings ¶ added in v0.1.6
type LogSettings struct {
// Enabled indicates whether logging is enabled.
Enabled bool
// Level specifies the log level.
Level slog.Level
// Format specifies the log format (e.g., text or json).
Format LogFormat
}
LogSettings holds the settings for logging. It only supports stdout/stderr logging for now.
type MetricSettings ¶ added in v0.1.6
type MetricSettings struct {
// Enabled indicates whether metrics collection is enabled.
Enabled bool
// Type specifies the type of metrics to be used.
Type MetricType
// Endpoint specifies the endpoint for metrics collection.
// When using Prometheus, this is the endpoint to expose metrics.
// When using OpenTelemetry, this is the endpoint to send metrics to.
// It should be a valid URL or URI.
Endpoint string
}
MetricSettings holds the settings for metrics collection.
type MetricType ¶ added in v0.1.6
type MetricType string
MetricType represents the type of metrics to be used.
const ( // MetricTypePrometheus represents Prometheus metrics. MetricTypePrometheus MetricType = "prometheus" // MetricTypeOTel represents OpenTelemetry metrics. MetricTypeOTel MetricType = "otel" )
type OAuthSettings ¶
type OAuthSettings struct {
// ClientID is the OAuth2 client ID for GitHub authentication.
ClientID string
// Secret is the OAuth2 client secret for GitHub authentication.
Secret string
// CallbackURL is the URL to which GitHub will redirect after authentication.
CallbackURL string
// JWTSettings holds the JWT configuration settings.
// This is used for the state parameter in OAuth2 authentication.
JWTSettings JWTSettings
}
OAuthSettings holds the configuration settings for GitHub OAuth2 authentication.
type ObservabilitySettings ¶ added in v0.1.6
type ObservabilitySettings struct {
// ServiceName is the name of the service for which observability is configured.
// It used for naming traces, metrics, and logs.
ServiceName string
Metric MetricSettings
Log LogSettings
Trace TraceSettings
}
ObservabilitySettings holds the settings for observability features.
type ServerSettings ¶
type ServerSettings struct {
Address string
DatabaseSettings DatabaseSettings
AuthSettings AuthSettings
ObservabilitySettings ObservabilitySettings
}
ServerSettings is a struct that holds the server settings.
func (*ServerSettings) String ¶ added in v0.1.3
func (s *ServerSettings) String() string
String returns a JSON representation of the ServerSettings struct. It is used for logging and debugging purposes.
type TraceSettings ¶ added in v0.1.6
type TraceSettings struct {
// Enabled indicates whether tracing is enabled.
Enabled bool
// Endpoint specifies the endpoint for tracing.
Endpoint string
}
TraceSettings holds the settings for tracing.