settings

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEnvProfile       = "dev"
	DefaultHTTPPort         = "8080"
	DefaultSecureJSONPrefix = ")]}',\n"
	ProfilePrefix           = "env."
)

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	PhysicalPathMode       bool
	PackagedMode           bool
	ServerHeaderEnabled    bool
	RequestIDEnabled       bool
	SSLEnabled             bool
	LetsEncryptEnabled     bool
	GzipEnabled            bool
	SecureHeadersEnabled   bool
	AccessLogEnabled       bool
	StaticAccessLogEnabled bool
	DumpLogEnabled         bool
	Initialized            bool
	HotReload              bool
	HotReloadEnabled       bool
	AuthSchemeExists       bool
	Redirect               bool
	Pid                    int
	HTTPMaxHdrBytes        int
	ImportPath             string
	BaseDir                string
	VirtualBaseDir         string
	Type                   string
	EnvProfile             string
	SSLCert                string
	SSLKey                 string
	ServerHeader           string
	RequestIDHeaderKey     string
	SecureJSONPrefix       string
	ShutdownGraceTimeStr   string
	DefaultContentType     string
	HotReloadSignalStr     string
	HTTPReadTimeout        time.Duration
	HTTPWriteTimeout       time.Duration
	ShutdownGraceTimeout   time.Duration
	Autocert               *autocert.Manager
	// contains filtered or unexported fields
}

Settings represents parsed and inferred config values for the application.

func (*Settings) HotReloadSignal

func (s *Settings) HotReloadSignal() os.Signal

HotReloadSignal method returns type `os.Signal` based on config `runtime.config_hotreload.signal`. Default signal value is `SIGHUP`.

Note: `SIGUSR1`, `SIGUSR2` is not applicable to Windows OS.

func (*Settings) Refresh

func (s *Settings) Refresh(cfg *config.Config) error

Refresh method to parse/infer config values and populate settings instance.

func (*Settings) SetImportPath

func (s *Settings) SetImportPath(args []string)

SetImportPath method process import path and sets it into settings instance.

Jump to

Keyboard shortcuts

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