configure

package
v0.0.0-...-a65505b Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindEnvs

func BindEnvs(config *viper.Viper, iface interface{}, parts ...string)

Types

type Config

type Config struct {
	Level      string `mapstructure:"level" json:"level"`
	ConfigFile string `mapstructure:"config" json:"config"`
	NoHeader   bool   `mapstructure:"noheader" json:"noheader"`

	Redis struct {
		Username   string   `mapstructure:"username" json:"username"`
		Password   string   `mapstructure:"password" json:"password"`
		MasterName string   `mapstructure:"master_name" json:"master_name"`
		Addresses  []string `mapstructure:"addresses" json:"addresses"`
		Database   int      `mapstructure:"database" json:"database"`
		Sentinel   bool     `mapstructure:"sentinel" json:"sentinel"`
	} `mapstructure:"redis" json:"redis"`

	Mongo struct {
		URI      string `mapstructure:"uri" json:"uri"`
		Database string `mapstructure:"database" json:"database"`
		Direct   bool   `mapstructure:"direct" json:"direct"`
	} `mapstructure:"mongo" json:"mongo"`

	Twitch struct {
		ClientID      string `mapstructure:"client_id" json:"client_id"`
		ClientSecret  string `mapstructure:"client_secret" json:"client_secret"`
		RedirectURI   string `mapstructure:"redirect_uri" json:"redirect_uri"`
		WebhookSecret string `mapstructure:"webhook_secret" json:"webhook_secret"`
	} `mapstructure:"twitch" json:"twitch"`

	Frontend struct {
		CookieSecure bool   `mapstructure:"cookie_secure" json:"cookie_secure"`
		CookieDomain string `mapstructure:"cookie_domain" json:"cookie_domain"`
		WebsiteURL   string `mapstructure:"website_url" json:"website_url"`
	} `mapstructure:"frontend" json:"frontend"`

	API struct {
		Bind string `mapstructure:"bind" json:"bind"`
	} `mapstructure:"api" json:"api"`

	Health struct {
		Enabled bool   `mapstructure:"enabled" json:"enabled"`
		Bind    string `mapstructure:"bind" json:"bind"`
	} `mapstructure:"health" json:"health"`
}

func New

func New() *Config

Jump to

Keyboard shortcuts

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