config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2025 License: MIT Imports: 2 Imported by: 0

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 JWTSettings

type JWTSettings struct {
	SigningKey string
	Issuer     string
	Expiration time.Duration
	Audience   []string
}

JWTSettings holds the configuration settings for JSON Web Tokens (JWT).

type LogFormat

type LogFormat string

LogFormat is a string type that represents the log format.

const (
	// LogFormatText represents the text log format.
	LogFormatText LogFormat = "text"
	// LogFormatJSON represents the JSON log format.
	LogFormatJSON LogFormat = "json"
)

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 ServerSettings

type ServerSettings struct {
	Address           string
	DatabaesEndpoints []string
	LogLevel          slog.Level
	LogFormat         LogFormat
	AuthSettings      *AuthSettings
}

ServerSettings is a struct that holds the server settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL