config

package
v0.0.0-...-3e848aa Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAndSetServerConfig

func LoadAndSetServerConfig(cfgName, defaultPath string, serverCfg *Server) error

Types

type Cookie struct {
	Name   string         `env:"NAME" toml:"name"`
	MaxAge ltoml.Duration `env:"MAX_AGE" toml:"max-age"`
}

type Database

type Database struct {
	Type  string `env:"TYPE" toml:"type"`
	DSN   string `env:"DSN" toml:"dsn"`
	Debug bool   `env:"DEBUG" toml:"debug"`
}

type HTTP

type HTTP struct {
	Port         uint16         `env:"PORT" toml:"port"`
	IdleTimeout  ltoml.Duration `env:"IDLE_TIMEOUT" toml:"idle-timeout"`
	WriteTimeout ltoml.Duration `env:"WRITE_TIMEOUT" toml:"write-timeout"`
	ReadTimeout  ltoml.Duration `env:"READ_TIMEOUT" toml:"read-timeout"`
}

HTTP represents an HTTP level configuration of server.

type Server

type Server struct {
	Migration    bool            `envPrefix:"LINSIGHT_MIGRATION" toml:"migration"`
	Database     *Database       `envPrefix:"LINSIGHT_DATABASE_" toml:"database"`
	HTTP         *HTTP           `envPrefix:"LINSIGHT_HTTP_" toml:"http"`
	Cookie       *Cookie         `envPrefix:"LINSIGHT_COOKIE_" toml:"cookie"`
	Provisioning string          `envPrefix:"LINSIGHT_PROVISIONING" toml:"provisioning"`
	Logger       *logger.Setting `envPrefix:"LINSIGHT_LOGGER_" toml:"logger"`
}

func NewDefaultServer

func NewDefaultServer() *Server

Jump to

Keyboard shortcuts

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