config

package
v0.0.0-...-bac1ed6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config defines the customization/configuration of the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Sec            Security           `yaml:"security"`
	DB             Database           `yaml:"database"`
	Log            LogConfig          `yaml:"logging"`
	Cookies        ApplicationCookies `yaml:"cookies"`
	Cors           CorsSettings       `yaml:"cors"`
	ErrorPath      string             `yaml:"errorPath"`
	Environment    string             `yaml:"environment"`
	FaviconPath    string             `yaml:"faviconUploadPath"`
	DefaultFavicon string             `yaml:"defaultFavicon"`
}

AppConfig holds the application configuration

func GetSettings

func GetSettings(r io.Reader) (*AppConfig, error)

GetSettings returns application configuration values

type ApplicationCookies

type ApplicationCookies struct {
	Domain string `yaml:"domain"`
	Path   string `yaml:"path"`
	Secure bool   `yaml:"secure"`
	Prefix string `yaml:"prefix"`
}

ApplicationCookies defines values for cookies

type Claim

type Claim struct {
	Name  string   `yaml:"name"`
	URL   string   `yaml:"url"`
	Roles []string `yaml:"roles"`
}

Claim defines the required claims

type CorsSettings

type CorsSettings struct {
	AllowedOrigins   []string `yaml:"origins"`
	AllowedMethods   []string `yaml:"methods"`
	AllowedHeaders   []string `yaml:"headers"`
	AllowCredentials bool     `yaml:"credentials"`
	MaxAge           int      `yaml:"maxAge"`
}

CorsSettings specifies the used settings

type Database

type Database struct {
	ConnStr string `yaml:"connectionString"`
	Dialect string `yaml:"dialect"`
}

Database defines the connection string

type LogConfig

type LogConfig struct {
	FilePath    string `yaml:"filePath"`
	RequestPath string `yaml:"requestPath"`
	LogLevel    string `yaml:"logLevel"`
}

LogConfig is used to define settings for the logging process

type Security

type Security struct {
	JwtIssuer     string `yaml:"jwtIssuer"`
	JwtSecret     string `yaml:"jwtSecret"`
	CookieName    string `yaml:"cookieName"`
	LoginRedirect string `yaml:"loginRedirect"`
	Claim         Claim  `yaml:"claim"`
	CacheDuration string `yaml:"cacheDuration"`
}

Security settings for the application

Jump to

Keyboard shortcuts

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