Help us shape the future of Go! Take the 2026 Go Developer Survey

settings

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.8.0

type Config struct {

	// Server settings
	Server

	// Request settings
	Request

	// Logger settings
	Logger *slog.Logger
}

Config is a struct that holds the application settings

func Load

func Load(st ...Config) (*Config, error)

type Request added in v0.8.0

type Request struct {

	// AllowUnknownFields will set the behavior for unknown fields in the Request body,
	// resulting in a 400 Bad Request response if a field is present that cannot be
	// mapped to the model struct.
	AllowUnknownFields enums.AllowOrNot `default:"Disallow"`

	// LogRequestBody will determine if the Request body will be logged
	// If set to "disabled", the Request body will not be logged, which is also the default
	LogRequestBody enums.EnableDisable `default:"Disabled"`

	// RequestIdMode determines how the Request ID will be handled
	RequestIdMode enums.RequestIdMode `default:"AcceptFromHeader"`
}

Request holds the Config for the Request processing

type Server added in v0.8.0

type Server struct {

	// Host is the host the server will listen on
	Host string `default:"0.0.0.0"`

	// Addr is the address the server will listen on
	Port int `default:"9999"`
}

Server holds the Config for the application server

Jump to

Keyboard shortcuts

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