config

package
v0.0.0-...-483a452 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 3 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 {
	Name        string `env:"APP_NAME" required:"true"`
	Description string `env:"APP_DESCRIPTION" required:"true"`
	Version     string `env:"APP_VERSION" required:"true"`

	Server struct {
		Host string `env:"SERVER_HOST" envDefault:"localhost"`
		Port int    `env:"SERVER_PORT" envDefault:"8080"`

		ReadTimeout  time.Duration `env:"SERVER_READ_TIMEOUT" envDefault:"10s"`
		WriteTimeout time.Duration `env:"SERVER_WRITE_TIMEOUT" envDefault:"10s"`
		IdleTimeout  time.Duration `env:"SERVER_IDLE_TIMEOUT" envDefault:"120s"`
	}

	Heartbeat struct {
		TTL      time.Duration `env:"HEARTBEAT_TTL" envDefault:"10s"`
		Interval time.Duration `env:"HEARTBEAT_INTERVAL" envDefault:"5s"`
	}

	Mattermost struct {
		URL     string        `env:"MATTERMOST_URL"`
		Timeout time.Duration `env:"MATTERMOST_TIMEOUT" envDefault:"10s"`
		Debug   bool          `env:"MATTERMOST_DEBUG" envDefault:"false"`
		Token   string        `env:"MATTERMOST_TOKEN"`
		Webhook string        `env:"MATTERMOST_WEBHOOK_URL" required:"true"`
		Channel string        `env:"MATTERMOST_CHANNEL"`
	}

	IMAP struct {
		Host string `env:"IMAP_HOST" required:"true"`
		Port int    `env:"IMAP_PORT" envDefault:"993"`
		User string `env:"IMAP_USER" required:"true"`
		Pass string `env:"IMAP_PASS" required:"true"`
	}

	Cron struct {
		Interval string `env:"CRON_INTERVAL" envDefault:"* * * * *"`
	}
}

func Load

func Load(l *zerolog.Logger, paths ...string) (*Config, error)

Jump to

Keyboard shortcuts

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