config

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONFIG string = "/etc/susetelemetry/server.cfg"

Default server config path

View Source
const DEF_AUTH_DURATION string = "1w"

default duration, in days of an auth token

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

API server config

type AuthConfig

type AuthConfig struct {
	// should not be printed
	Secret string `yaml:"secret"`
	// duration that tokens will be valid for
	Duration string `yaml:"duration"`
	// issuer name
	Issuer string `yaml:"issuer"`
}

func (*AuthConfig) String

func (ac *AuthConfig) String() string

type Config

type Config struct {
	API APIConfig `yaml:"api"`
	// database config settings
	DataBases struct {
		Telemetry   DBConfig `yaml:"telemetry"`
		Operational DBConfig `yaml:"operational"`
	} `yaml:"dbs"`
	// logging config settings
	Logging config.LogConfig `yaml:"logging"`
	// authentication config settings
	Auth AuthConfig `yaml:"auth"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(cfgFile string) *Config

func (*Config) Load

func (cfg *Config) Load() error

func (*Config) Path

func (cfg *Config) Path() string

type DBConfig

type DBConfig struct {
	Driver string `yaml:"driver"`
	Params string `yaml:"params"`
}

func (*DBConfig) Valid

func (d *DBConfig) Valid() error

type PQLConfig

type PQLConfig struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Name     string `yaml:"name"`
	SSLMode  string `yaml:"sslmode"`
	Cert     string `yaml:"cert"`
}

Jump to

Keyboard shortcuts

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