configure

package
v0.0.0-...-3961de6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Indexes = []mongo.IndexRef{
	{
		Collection: mongo.CollectionNameEmoteSets,
		Index: mongo.IndexModel{
			Keys: bson.M{"num_id": 1},
			Options: &options.IndexOptions{
				Unique: utils.BoolPointer(true),
			},
		},
	},
	{
		Collection: mongo.CollectionNameEmoteSets,
		Index: mongo.IndexModel{
			Keys: bson.M{"emote_ids": 1},
		},
	},
}

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"`
	WebsiteURL string `mapstructure:"website_url" json:"website_url"`
	NodeName   string `mapstructure:"node_name" json:"node_name"`
	CdnURL     string `mapstructure:"cdn_url" json:"cdn_url"`

	Redis struct {
		URI      string `mapstructure:"uri" json:"uri"`
		Username string `mapstructure:"username" json:"username"`
		Password string `mapstructure:"password" json:"password"`
		Database int    `mapstructure:"db" json:"db"`
	} `mapstructure:"redis" json:"redis"`

	Mongo struct {
		URI string `mapstructure:"uri" json:"uri"`
		DB  string `mapstructure:"db" json:"db"`
	} `mapstructure:"mongo" json:"mongo"`

	Http struct {
		URI                string `mapstructure:"uri" json:"uri"`
		Type               string `mapstructure:"type" json:"type"`
		OauthRedirectURI   string `mapstructure:"oauth_redirect_uri" json:"oauth_redirect_uri"`
		QuotaDefaultLimit  int32  `mapstructure:"quota_default_limit" json:"quota_default_limit"`
		QuotaMaxBadQueries int64  `mapstructure:"quota_max_bad_queries" json:"quota_max_bad_queries"`
	} `mapstructure:"http" json:"http"`

	Auth struct {
		Secret string `mapstructure:"secret" json:"secret"`

		Platforms []struct {
			Name    string `mapstructure:"name" json:"name"`
			Enabled bool   `mapstructure:"enabled" json:"enabled"`
		} `mapstructure:"platforms" json:"platforms"`
	} `mapstructure:"auth" json:"auth"`

	Credentials struct {
		JWTSecret string `mapstructure:"jwt_secret" json:"jwt_secret"`
	} `mapstructure:"credentials" json:"credentials"`
}

func New

func New() *Config

Jump to

Keyboard shortcuts

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