config

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RepoPath = "./data/repo"

RepoPath points to the actual storage

Functions

This section is empty.

Types

type Config

type Config struct {
	Title  string  `yaml:"title"`
	Domain string  `yaml:"domain"`
	Server *Server `yaml:"server"`
	Daemon *Daemon `yaml:"daemon"`
}

Config is a combination of all possible midgard configuration.

func Get

func Get() *Config

Get returns the whole midgard configuration

type Daemon

type Daemon struct {
	Addr   string `yaml:"addr"`
	Server string `yaml:"server"`
}

Daemon is the midgard daemon configuration

func D

func D() *Daemon

D returns the midgard daemon configuration

type Server

type Server struct {
	Addr  string `yaml:"addr"`
	Mode  string `yaml:"mode"`
	Store struct {
		Prefix string `yaml:"prefix"`
		Backup struct {
			Enable   bool   `yaml:"enable"`
			Interval int    `yaml:"interval"`
			Repo     string `yaml:"repo"`
		} `yaml:"backup"`
	} `yaml:"store"`
	Auth struct {
		User string `yaml:"user"`
		Pass string `yaml:"pass"`
	} `json:"auth"`
}

Server is the midgard server side configuration

func S

func S() *Server

S returns the midgard server configuration

Jump to

Keyboard shortcuts

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