config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config   *Config
	DB       *gorm.DB
	NextMail time.Time
}

App holds the application configuration and is passed to the handlers

type Config

type Config struct {
	Server struct {
		Name string `yaml:"name,omitempty"`
		Host string `yaml:"host"`
		Port int    `yaml:"port"`
	} `yaml:"server"`
	Dirs struct {
		Templates string `yaml:"templates"`
		Static    string `yaml:"static"`
	} `yaml:"dirs"`
	Auth struct {
		Username string `yaml:"username"`
		Password string `yaml:"password"`
	}
	Mail struct {
		Host     string   `yaml:"host"`
		Port     int      `yaml:"port"`
		Username string   `yaml:"username"`
		Password string   `yaml:"password"`
		TLS      bool     `yaml:"tls"`
		From     string   `yaml:"from"`
		To       []string `yaml:"to"`
		Subject  string   `yaml:"subject"`
	}
}

Config struct holds the configuration for the application

func Read

func Read(s string) (*Config, error)

Read reads a YAML config file and returns a Config struct

Jump to

Keyboard shortcuts

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