config

package
v0.0.0-...-9928b23 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(cfg *ServerConfig) error

Types

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DBName   string `yaml:"dbname"`
}

type OauthConfig

type OauthConfig struct {
	TenantID     string `yaml:"tenant_id"`
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
}

type ServerConfig

type ServerConfig struct {
	Host  string         `yaml:"host"`
	Port  int            `yaml:"port"`
	Oauth OauthConfig    `yaml:"oauth"`
	DB    DatabaseConfig `yaml:"database"`
}

func LoadEnvironment

func LoadEnvironment(cfg *ServerConfig) *ServerConfig

func LoadFile

func LoadFile(configPath string) (*ServerConfig, error)

Load loads the configuration from the given path If the path is empty, it will load the default configuration file from /etc/hpcadmin-server/config.yaml

Jump to

Keyboard shortcuts

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