file

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	CertFile string `yaml:"certfile"`
	KeyFile  string `yaml:"keyfile"`
}

type Config

type Config struct {
	Addr   string
	Level  slog.Level
	Routes []handler.Route
	TLS    *tls.Config
}

func ReadConfig

func ReadConfig(filename string) (*Config, error)

type Route

type Route struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
}

type Routes

type Routes struct {
	Static []Route `yaml:"static"`
	Proxy  []Route `yaml:"proxy"`
}

func (Routes) Get

func (r Routes) Get() ([]handler.Route, error)

type TLS

type TLS struct {
	Certificates []Certificate `yaml:"certificates"`
}

func (TLS) GetConfig

func (h TLS) GetConfig() (*tls.Config, error)

type YAML

type YAML struct {
	Listen string     `yaml:"listen"`
	Level  slog.Level `yaml:"loglevel"`
	Routes Routes     `yaml:"routes"`
	TLS    TLS        `yaml:"tls"`
}

Jump to

Keyboard shortcuts

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