config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DConfig string

Functions

func Init

func Init()

Types

type Config

type Config struct {
	ServerMap `toml:"ServerMap"`
	Log       `toml:"Log"`
	Gemini    `toml:"Gemini"`
	TLS       `toml:"TLS"`
}

type Gemini

type Gemini struct {
	DefaultLang     string
	AutoRedirect    bool
	AutoRedirectUrl string
	File            []struct {
		Router string `toml:"Router"`
		Path   string `toml:"Path"`
	} `toml:"File"`
	Dir []struct {
		Router        string `toml:"Router"`
		Path          string `toml:"Path"`
		Index         string `toml:"Index"`
		AutoCatalogue bool   `toml:"AutoCatalogue"`
	} `toml:"Dir"`
	Proxy []struct {
		Router    string `toml:"Router"`
		Method    string `toml:"Method"`
		URL       string `toml:"URL"`
		MetaField string `toml:"MetaField"`
		BodyField string `toml:"BodyField"`
	} `toml:"Proxy"`
}

func ProvideGemini

func ProvideGemini() Gemini

type Log

type Log struct {
	Level       string
	ToStd       bool
	LogRotate   bool
	Development bool
	Sampling    bool
	Rotate      Rotate
}

func ProvideLog

func ProvideLog() Log

type Rotate

type Rotate struct {
	Filename   []string
	MaxSize    int
	MaxAge     int
	MaxBackups int
}

type Server

type Server struct {
	Port    string `toml:"Port"`
	Timeout int    `toml:"Timeout"`
}

func ProvideServer

func ProvideServer(serverName string) Server

type ServerMap

type ServerMap map[string]Server

type TLS

type TLS struct {
	CertFile string
	KeyFile  string
}

func ProvideTLS

func ProvideTLS() TLS

Jump to

Keyboard shortcuts

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