config

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 6 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 {
	ListenAddr     string             `flag:"listen-addr" desc:"HTTP listen address" default:":8080"`
	PasswdFile     string             `flag:"passwd-file" desc:"Password file for basic HTTP authentication" default:".htpasswd"`
	TruststoreFile string             `flag:"truststore-file" desc:"Truststore used by HTTP signature verifier (.pem or .p12)"`
	Hook           HookConfig         `flag:"hook"`
	Log            LogConfig          `flag:"log"`
	Notification   NotificationConfig `flag:"notification"`
	Static         StaticConfig       `flag:"static"`
	TLS            TLSConfig          `flag:"tls"`
	OldConfig      `flag:""`
}

Config store root configuration

func (*Config) ManageDeprecatedFlags added in v1.19.0

func (c *Config) ManageDeprecatedFlags(prefix string)

ManageDeprecatedFlags manage legacy configuration

func (*Config) Validate added in v1.13.0

func (c *Config) Validate() error

Validate the configuration

type HookConfig added in v1.19.0

type HookConfig struct {
	DefaultExt string `flag:"default-ext" desc:"Default extension for hook scripts" default:"sh"`
	Timeout    int    `flag:"timeout" desc:"Maximum hook execution time in second" default:"10"`
	ScriptsDir string `flag:"scripts" desc:"Scripts location" default:"scripts"`
	LogDir     string `flag:"log-dir" desc:"Hook execution logs location" default:""`
	Workers    int    `flag:"workers" desc:"Number of workers to start" default:"2"`
}

HookConfig store Hook execution configuration

type LogConfig added in v1.19.0

type LogConfig struct {
	Level   string   `flag:"level" desc:"Log level (debug, info, warn or error)" default:"info"`
	Format  string   `flag:"format" desc:"Log format (json or text)" default:"text"`
	Modules []string `flag:"modules" desc:"Logging modules to activate (http,hook)" default:""`
}

LogConfig store logger configuration

type NotificationConfig added in v1.19.0

type NotificationConfig struct {
	URI string `flag:"uri" desc:"Notification URI"`
}

NotificationConfig store notification configuration

type OldConfig added in v1.19.0

type OldConfig struct {
	NbWorkers int    `flag:"nb-workers" desc:"Number of workers to start [DEPRECATED]" default:"2"`
	Scripts   string `flag:"scripts" desc:"Scripts location [DEPRECATED]" default:"scripts"`
}

OldConfig contain global configuration

type StaticConfig added in v1.19.0

type StaticConfig struct {
	Dir  string `flag:"dir" desc:"Static file directory to serve on /static path" default:""`
	Path string `flag:"path" desc:"Path to serve static file directory" default:"/static"`
}

StaticConfig store static assets configuration

type TLSConfig added in v1.19.0

type TLSConfig struct {
	Enabled  bool   `flag:"enabled" desc:"Enable TLS" default:"false"`
	CertFile string `flag:"cert-file" desc:"TLS certificate file (unused if ACME used)" default:"server.pem"`
	KeyFile  string `flag:"key-file" desc:"TLS key file (unused if ACME used)" default:"server.key"`
	Domain   string `flag:"domain" desc:"TLS domain name used by ACME"`
}

TLSConfig store TLS configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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