config

package module
v0.0.0-...-89831eb Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 9 Imported by: 2

README

OreCast config module

The OreCast config module contains configurations for all OreCast services.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Info

func Info() string

func Init

func Init()

Types

type Authz

type Authz struct {
	WebServer
	Encryption

	DBUri        string `mapstructure:"dburi"` // database URI
	ClientId     string `mapstructure:"client_id"`
	ClientSecret string `mapstructure:"client_secret"`
	Domain       string `mapstructure:"domain"`
	TokenExpires int64  `mapstructure:token_expires` // expiration of token
}

Authz represents authz service configuration

type DataBookkeeping

type DataBookkeeping struct {
	WebServer

	DBFile             string `mapstructure:"dbfile"`               // dbs db file with secrets
	MaxDBConnections   int    `mapstructure:"max_db_connections"`   // maximum number of DB connections
	MaxIdleConnections int    `mapstructure:"max_idle_connections"` // maximum number of idle connections
}

DataBookkeeping represents data-bookkeeping service configuration

type DataManagement

type DataManagement struct {
	WebServer
}

DataManagement represents data-management service configuration

type Discovery

type Discovery struct {
	WebServer
	MongoDB
	Encryption
}

Discovery represents discovery service configuration

type Encryption

type Encryption struct {
	Secret string `mapstructure:"secret"`
	Cipher string `mapstructure:"cipher"`
}

Encryption represents encryption configuration parameters

type Frontend

type Frontend struct {
	WebServer

	// OAuth parts
	OAuth []OAuthRecord `mapstructure:"oauth"` // oauth configurations

	// captcha parts
	CaptchaSecretKey string `mapstructure:"captchaSecretKey"` // re-captcha secret key
	CaptchaPublicKey string `mapstructure:"captchaPublicKey"` // re-captcha public key
	CaptchaVerifyUrl string `mapstructure:"captchaVerifyUrl"` // re-captcha verify url

	// cookies parts
	UserCookieExpires int64 `mapstructure:"user_cookie_expires"` // expiration of user cookie
}

Frontend stores frontend configuration parameters

type MetaData

type MetaData struct {
	WebServer
	MongoDB
}

MetaData represents metadata service configuration

type MongoDB

type MongoDB struct {
	DBName string `mapstructure:"dbname"` // database name
	DBColl string `mapstructure:"dbcoll"` // database collection
	DBUri  string `mapstructure:"dburi"`  // database URI
}

MongoDB represents MongoDB parameters

type OAuthRecord

type OAuthRecord struct {
	Provider     string `mapstructure:"provider"`      // name of the provider
	ClientID     string `mapstructure:"client_id"`     // client id
	ClientSecret string `mapstructure:"client_secret"` // client secret
}

OAuthRecord defines OAuth provider's credentials

type OreCastConfig

OreCastConfig represents orecast configuration

var Config *OreCastConfig

Config represnets orecast configuration

func ParseConfig

func ParseConfig(cfile string) (OreCastConfig, error)

type Services

type Services struct {
	FrontendURL        string `mapstructure:"frontend_url"`
	DiscoveryURL       string `mapstructure:"discovery_url"`
	MetaDataURL        string `mapstructure:"metadata_url"`
	DataManagementURL  string `mapstructure:"datamanagement_url"`
	DataBookkeepingURL string `mapstructure:"databookkeeping_url"`
	AuthzURL           string `mapstructure:"authz_url"`
}

Services represents orecast services

type WebServer

type WebServer struct {
	Base      string `mapstructure:"base"`       // base URL
	LogFile   string `mapstructure:"log_file"`   // server log file
	Port      int    `mapstructure:"port"`       // server port number
	Verbose   int    `mapstructure:"verbose"`    // verbose output
	StaticDir string `mapstructure:"static_dir"` // speficy static dir location

	// middleware server parts
	LimiterPeriod string `mapstructure:"rate"` // limiter rate value

	// proxy parts
	XForwardedHost      string `mapstructure:"X-Forwarded-Host"`       // X-Forwarded-Host field of HTTP request
	XContentTypeOptions string `mapstructure:"X-Content-Type-Options"` // X-Content-Type-Options option

	// TLS server parts
	RootCAs     string   `mapstructure:"rootCAs"`      // server Root CAs path
	ServerCrt   string   `mapstructure:"server_cert"`  // server certificate
	ServerKey   string   `mapstructure:"server_key"`   // server certificate
	DomainNames []string `mapstructure:"domain_names"` // LetsEncrypt domain names
}

WebServer represents common web server configuration

Jump to

Keyboard shortcuts

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