config

package
v0.0.0-...-b8b2eb8 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParse = errors.New("failed to parse config")

Functions

This section is empty.

Types

type Config

type Config struct {
	Mode     string   `yaml:"mode"`
	Database Database `yaml:"database"`
	Logging  Logging  `yaml:"logging"`
	Storage  Storage  `yaml:"storage"`
	TLS      TLS      `yaml:"tls"`
	Token    Token    `yaml:"token"`
}

func Parse

func Parse(path string) (*Config, error)

type Database

type Database struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	DBName   string `yaml:"dbname"`
	SSLMode  string `yaml:"sslmode"`
}

type Logging

type Logging struct {
	File  string `yaml:"file"`
	Level int    `yaml:"level"`
}

type Storage

type Storage struct {
	RootDirectory  string `yaml:"root_dir"`
	TasksDirectory string `yaml:"templates_dir"`
	NotesDirectory string `yaml:"users_dir"`
}

type TLS

type TLS struct {
	ServerCertPath   string `yaml:"server_cert_path"`
	ServerKeyPath    string `yaml:"server_key_path"`
	ClientCARootPath string `yaml:"client_ca_root_path"`
}

type Token

type Token struct {
	Issuer   string `yaml:"issuer"`
	Audience string `yaml:"audience"`
	Secret   string `yaml:"secret"`
}

Jump to

Keyboard shortcuts

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