config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetC4GHKey

func GetC4GHKey() (*[32]byte, error)

GetC4GHKey reads and decrypts and returns the c4gh key

Types

type AppConfig

type AppConfig struct {
	// Hostname for this web app
	// Optional. Default value localhost
	Host string

	// Port number for this web app
	// Optional. Default value 8080
	Port int

	// Logging level
	// Optional. Default value debug
	// Possible values error, fatal, info, panic, warn, trace, debug
	LogLevel string

	// TLS server certificate for HTTPS
	// Optional. Defaults to empty
	TLSCert string

	// TLS server certificate key for HTTPS
	// Optional. Defaults to empty
	TLSKey string

	// Stores the Crypt4GH private key if the two configs above are set
	// Unconfigurable. Depends on Crypt4GHKeyFile and Crypt4GHPassFile
	Crypt4GHKey *[32]byte

	// Path to POSIX Archive, prepended to database file name
	// Optional.
	ArchivePath string
}

type ConfigMap

type ConfigMap struct {
	App  AppConfig
	DB   DatabaseConfig
	OIDC OIDCConfig
}

ConfigMap stores all different configs

var Config ConfigMap

Config is a global configuration value store

func NewConfig

func NewConfig() (*ConfigMap, error)

NewConfig populates ConfigMap with data

type DatabaseConfig

type DatabaseConfig struct {
	// Database hostname
	// Optional. Default value localhost
	Host string

	// Database port number
	// Optional. Default value 5432
	Port int

	// Database username
	// Optional. Default value lega_out
	User string

	// Database password for username
	// Optional. Default value lega_out
	Password string

	// Database name
	// Optional. Default value lega
	Database string

	// TLS CA cert for database connection
	// Optional.
	CACert string

	// CA cert for database connection
	// Optional.
	SslMode string

	// TLS Certificate for database connection
	// Optional.
	ClientCert string

	// TLS Key for database connection
	// Optional.
	ClientKey string
}

type OIDCConfig

type OIDCConfig struct {
	// OIDC OP configuration URL /.well-known/openid-configuration
	// Mandatory.
	ConfigurationURL string
}

Jump to

Keyboard shortcuts

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