config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Banner struct {
	Enable bool   `yaml:"enable"`
	Type   string `yaml:"type"`
	File   string `yaml:"file"`
	Text   string `yaml:"text"`
}

Banner Config Banner

type Config

type Config struct {
	Server   *Server   `yaml:"server"`
	Banner   *Banner   `yaml:"banner"`
	Template *Template `yaml:"template"`
}

Config struct

func Default

func Default() *Config

Default Config

func (*Config) Unmarshal

func (yc *Config) Unmarshal(bytes []byte) error

Unmarshal yaml

type Server

type Server struct {
	Host              string        `yaml:"host"`
	Port              int           `yaml:"port"`
	TLS               *TLS          `yaml:"tls"`
	MaxHeaderSize     int           `yaml:"max_header_size"`
	ReadTimeout       time.Duration `yaml:"read_timeout"`
	ReadHeaderTimeout time.Duration `yaml:"read_header_timeout"`
	WriteTimeout      time.Duration `yaml:"write_timeout"`
	IdleTimeout       time.Duration `yaml:"idle_timeout"`
}

Server Config Server

type TLS

type TLS struct {
	Enable   bool   `yaml:"enable"`
	CertFile string `yaml:"cert_file"`
	KeyFile  string `yaml:"key_file"`
}

TLS Config TLS

type Template

type Template struct {
	Cache   bool   `yaml:"cache"`
	Root    string `yaml:"root"`
	Suffix  string `yaml:"suffix"`
	FuncMap t.FuncMap
}

Template Config Template

Jump to

Keyboard shortcuts

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