base

package
v0.0.0-...-27b3b18 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHostnameLookup means hostname lookup error.
	ErrHostnameLookup = errors.New("base: hostname lookup error")
)

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Identifier string `env:"IDENTIFIER"`
	Cores      int    `env:"CORES"`
	Threads    int    `env:"THREADS"`
	Scans      *scan.Cfg
	Secrets    *secret.Cfg
	Acts       *act.Cfg
	Database   *db.Cfg
	Log        *logger.Cfg
	// contains filtered or unexported fields
}

Cfg represents base cfg. It also references secondary cfgs such as secrets, actions, etc.

func Mock

func Mock(paths *path.Paths, dir string) (*Cfg, error)

Mock mocks a cfg.

func New

func New(paths *path.Paths) *Cfg

New returns a new base cfg from given paths.

func (*Cfg) Load

func (cfg *Cfg) Load() error

Load reads the cfg from toml path.

func (*Cfg) Path

func (cfg *Cfg) Path() string

Path returns a given cfg's toml path.

func (*Cfg) Validate

func (cfg *Cfg) Validate() error

Validate validates cfg var values beyond toml concrete types.

Jump to

Keyboard shortcuts

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