config

package
v0.0.0-...-0d58064 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Targets  []string      `yaml:"targets" envconfig:"GORU_TARGETS"`
	Files    []string      `yaml:"files" envconfig:"GORU_FILES"`
	Follow   bool          `yaml:"follow" envconfig:"GORU_FOLLOW"`
	Interval time.Duration `yaml:"interval" envconfig:"GORU_INTERVAL"`
	Timeout  time.Duration `yaml:"timeout" envconfig:"GORU_TIMEOUT"`
	Mode     Mode          `yaml:"mode" envconfig:"GORU_MODE"`
	PProf    string        `yaml:"pprof" envconfig:"GORU_PPROF"`

	Web struct {
		Host    string `yaml:"host" envconfig:"GORU_WEB_HOST"`
		Port    int    `yaml:"port" envconfig:"GORU_WEB_PORT"`
		NoOpen  bool   `yaml:"no_open" envconfig:"GORU_WEB_NO_OPEN"`
		TLSCert string `yaml:"tls_cert" envconfig:"GORU_WEB_TLS_CERT"`
		TLSKey  string `yaml:"tls_key" envconfig:"GORU_WEB_TLS_KEY"`
	} `yaml:"web"`

	Log struct {
		Level string `yaml:"level" envconfig:"GORU_LOG_LEVEL"`
		JSON  bool   `yaml:"json" envconfig:"GORU_LOG_JSON"`
	} `yaml:"log"`

	ConfigFile string `yaml:"-"`
}

func New

func New() *Config

func (*Config) HasTUI

func (c *Config) HasTUI() bool

func (*Config) HasWeb

func (c *Config) HasWeb() bool

func (*Config) Load

func (c *Config) Load() error

func (*Config) Validate

func (c *Config) Validate() error

type Mode

type Mode string
const (
	ModeTUI  Mode = "tui"
	ModeWeb  Mode = "web"
	ModeBoth Mode = "both"
)

Jump to

Keyboard shortcuts

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