config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("config",
	fx.Provide(
		Load,
	),
)
View Source
var TestModule = fx.Module("config_test",
	fx.Provide(
		LoadTestConfig,
	),
)

Functions

This section is empty.

Types

type CloudProvider

type CloudProvider struct {
	Hetzner Hetzner `yaml:"hetzner"`
}

type Config

type Config struct {
	Listen string `default:":8000" yaml:"listen"`
	Mode   string `default:"debug" yaml:"mode"`

	Directories   Directories   `yaml:"directories"`
	Database      Database      `yaml:"database"`
	RabbitMQ      RabbitMQ      `yaml:"rabbitmq"`
	Notifications Notifications `yaml:"notifications"`
	CloudProvider CloudProvider `yaml:"cloudProvider"`
}

func LoadTestConfig

func LoadTestConfig() (*Config, error)

type Database

type Database struct {
	Host       string `default:"localhost" yaml:"host"`
	Port       int    `default:"5432" yaml:"port"`
	User       string `default:"genesis" yaml:"user"`
	Password   string `yaml:"password"`
	Name       string `default:"genesis" yaml:"name"`
	SSLEnabled bool   `default:"false" yaml:"sslEnabled"`
}

type Directories

type Directories struct {
	DataDir string `default:"/koor/clients" yaml:"dataDir"`
}

func (*Directories) ChartsDir

func (c *Directories) ChartsDir() string

func (*Directories) ClientsDir

func (c *Directories) ClientsDir() string

func (*Directories) TemplatesDir

func (c *Directories) TemplatesDir() string

type EmailNotifications

type EmailNotifications struct {
	Token string `yaml:"token"`

	From    string `yaml:"from"`
	ReplyTo string `yaml:"replyTo"`
}

type Hetzner

type Hetzner struct {
	Token string `yaml:"token"`
}

type NotificationType

type NotificationType string
const (
	NotificationTypeNoop  NotificationType = "noop"
	NotificationTypeEmail NotificationType = "email"
)

type Notifications

type Notifications struct {
	Type NotificationType `default:"noop" yaml:"type"`

	Email EmailNotifications `yaml:"email"`
}

type RabbitMQ

type RabbitMQ struct {
	Host     string `default:"localhost" yaml:"host"`
	Port     int    `default:"4369" yaml:"port"`
	User     string `default:"genesis" yaml:"user"`
	Password string `yaml:"password"`
}

type Result

type Result struct {
	fx.Out

	Config *Config
}

func Load

func Load() (Result, error)

Jump to

Keyboard shortcuts

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