config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	ServerCfg ServerConfig  `json:"server"`
	Logging   LoggingConfig `json:"logging"`
}

type AppenderConfig added in v0.1.3

type AppenderConfig struct {
	Type        AppenderType       `json:"type"`
	Enabled     bool               `json:"enabled"`
	Level       string             `json:"level"`
	Destination *DestinationConfig `json:"destination"`
}

type AppenderType added in v0.1.3

type AppenderType string
const (
	RollingFile AppenderType = "rolling_file"
	Console                  = "console"
)

type DestinationConfig added in v0.1.3

type DestinationConfig struct {
	File       AppenderType `json:"file"`
	BufferSize int          `json:"buffer_size"`
	MaxSize    int          `json:"max_size"`
	MaxAge     int          `json:"max_age"`
	MaxBackups int          `json:"max_backups"`
	LocalTime  bool         `json:"local_time"`
}

type LoggingConfig added in v0.1.3

type LoggingConfig struct {
	Level          string           `json:"level"`
	Appenders      []AppenderConfig `json:"appenders"`
	ConsoleOutHTTP bool             `json:"http_console_out"`
	LogHTTP        bool             `json:"http_log"`
}

type Schema

type Schema string
const (
	HTTP  Schema = "http"
	HTTPS Schema = "https"
)

type SecurityConfig

type SecurityConfig struct {
	CertificateFile string `json:"certificate_file" example:"./certificates/server.crt"`
	KeyFile         string `json:"key_file" example:"./certificates/server.key"`
}

type ServerConfig

type ServerConfig struct {
	Schema   Schema         `json:"schema" example:"http or https"`
	Address  string         `json:"address" example:"127.0.0.1 or mydomain.com"`
	Port     int            `json:"port" example:"8080"`
	Security SecurityConfig `json:"security"`
}

Jump to

Keyboard shortcuts

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