config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	AuthSrvPassword string `yaml:"-" json:"-" validate:"required"`
}

type BaseApp

type BaseApp struct {
	Name        string `env-required:"true" yaml:"name" env:"APP_NAME" json:"name" env-update:"true"`
	ProfileName string `env-required:"true" yaml:"profileName" json:"profileName" env:"PROFILE_NAME" env-update:"true"`
	ConfSrvURI  string `yaml:"confSrvURI" json:"confSrvURI" env:"CONF_SRV_URI" env-update:"true"`
	SecPath     string `yaml:"secPath" json:"secPath" env:"SEC_PATH" env-update:"true"`
}

type Config

type Config struct {
	App     `yaml:"app" json:"app" validate:"required"`
	BaseApp `yaml:"baseApp" json:"baseApp" validate:"required"`
	Crontab crontab.CronOpts   `yaml:"crontab" json:"crontab" validate:"required"`
	HTTP    httpserver.HTTP    `yaml:"http" json:"http" validate:"required"`
	Log     svclogger.Log      `yaml:"logger" json:"logger" validate:"required"`
	Storage storage.StorageCfg `yaml:"storage" json:"storage" validate:"required"`
	Version `json:"version"`
}

func NewConfig

func NewConfig() (*Config, error)

NewConfig initializes the configuration by reading environment variables and a YAML configuration file.

It returns an error if there is an issue reading the environment variables or the configuration file.

func (*Config) ReadBaseConfig

func (c *Config) ReadBaseConfig() error

func (*Config) ReadPwd

func (c *Config) ReadPwd() error

type Version

type Version struct {
	Version        string `json:"version"`
	BuildTimeStamp string `json:"buildTimeStamp,omitempty"`
	GitBranch      string `json:"gitBranch,omitempty"`
	GitHash        string `json:"gitHash,omitempty"`
}

func InitVersion

func InitVersion(aBuildNumber, aBuildTimeStamp, aGitBranch, aGitHash string) *Version

Jump to

Keyboard shortcuts

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