config

package
v0.0.0-...-0314968 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTemplateConfig

func InitTemplateConfig(templateConfigPath string) error

func StartTemplateConfigWatcher

func StartTemplateConfigWatcher(configPath string) error

Types

type AppConfig

type AppConfig struct {
	// Server configuration
	Port               int       `koanf:"port"`
	TemplateConfigPath string    `koanf:"template_config_path"`
	Postgres           *PGConfig `koanf:"postgres"`
	Version            string    `koanf:"_"`
}

func (*AppConfig) ReadEnv

func (config *AppConfig) ReadEnv() error

func (*AppConfig) Validate

func (config *AppConfig) Validate() error

type PGConfig

type PGConfig struct {
	Host     string `koanf:"host"`
	Port     int    `koanf:"port"`
	User     string `koanf:"user"`
	Password string `koanf:"password"`
	Database string `koanf:"db"`
}

func (*PGConfig) GetDSN

func (pgConfig *PGConfig) GetDSN() string

type Template

type Template struct {
	ID                 string                `yaml:"id,omitempty"`
	Path               string                `yaml:"path,omitempty"`
	Type               domain.TemplateType   `yaml:"type,omitempty"`
	SupportedProviders []domain.ProviderType `yaml:"supported_providers"`
}

type TemplateConfig

type TemplateConfig struct {
	Templates []Template `yaml:"templates"`
}

func (*TemplateConfig) ReadYAML

func (config *TemplateConfig) ReadYAML(configPath string) error

func (*TemplateConfig) Validate

func (tc *TemplateConfig) Validate() error

type TemplateConfigFactory

type TemplateConfigFactory interface {
	GetTemplateConfig() *TemplateConfig
}

func NewTemplateConfigFactory

func NewTemplateConfigFactory() TemplateConfigFactory

Jump to

Keyboard shortcuts

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