config

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider(ctx *core.Context) error

Types

type ConfigMap

type ConfigMap struct {
	Debug     bool            `hcl:"debug"`
	Env       string          `hcl:"env"`
	Timezone  string          `hcl:"timezone"`
	Redis     RedisConfig     `hcl:"redis,block"`
	DB        DBConfig        `hcl:"db,block"`
	Oauth     OauthConfig     `hcl:"oauth,block"`
	S3        S3Config        `hcl:"s3,block"`
	Sentry    SentryConfig    `hcl:"sentry,block"`
	JWT       JWTConfig       `hcl:"jwt,block"`
	Recaptcha RecaptchaConfig `hcl:"recaptcha,block"`
}

func LoadFile

func LoadFile(filename string) (c *ConfigMap, err error)

type DBConfig

type DBConfig struct {
	Name       string `hcl:"name"`
	Host       string `hcl:"host"`
	Port       int    `hcl:"port"`
	User       string `hcl:"user"`
	Pass       string `hcl:"pass"`
	AuthSource string `hcl:"auth_source"`
}

type JWTConfig

type JWTConfig struct {
	AccessToken  JWTToken `hcl:"access_token,block"`
	RefreshToken JWTToken `hcl:"refresh_token,block"`
}

type JWTExpiresAt

type JWTExpiresAt struct {
	Type  string `hcl:"type"`
	Value int    `hcl:"value"`
}

type JWTToken

type JWTToken struct {
	Secret    string       `hcl:"secret"`
	ExpiresAt JWTExpiresAt `hcl:"expires_at,block"`
}

func (JWTToken) GetExpireDuration

func (t JWTToken) GetExpireDuration() time.Duration

func (JWTToken) GetSecretAtBytes

func (t JWTToken) GetSecretAtBytes() []byte

type OauthClient

type OauthClient struct {
	Enabled      bool   `hcl:"enabled"`
	ClientID     string `hcl:"client_id"`
	ClientSecret string `hcl:"client_secret"`
	AuthUri      string `hcl:"auth_uri"`
	TokenUri     string `hcl:"token_uri"`
	RedirectUri  string `hcl:"redirect_uri"`
}

type OauthConfig

type OauthConfig struct {
	RegistrationByOauth bool        `hcl:"registration_by_oauth"`
	Google              OauthClient `hcl:"google,block"`
	Spotify             OauthClient `hcl:"spotify,block"`
}

type RecaptchaConfig

type RecaptchaConfig struct {
	Enabled bool   `hcl:"enabled"`
	Type    string `hcl:"type"`
	Secret  string `hcl:"secret"`
}

type RedisConfig

type RedisConfig struct {
	Cluster      bool     `hcl:"cluster"`
	MasterName   string   `hcl:"master_name"`
	Addr         string   `hcl:"addr"`
	Sentinels    []string `hcl:"sentinels"`
	Pass         string   `hcl:"pass"`
	SentinelPass string   `hcl:"sentinel_pass"`
}

type S3Config

type S3Config struct {
	Endpoint  string `hcl:"endpoint"`
	AccessKey string `hcl:"access_key"`
	SecretKey string `hcl:"secret_key"`
}

type SentryConfig

type SentryConfig struct {
	Enabled bool   `hcl:"enabled"`
	Dsn     string `hcl:"dsn"`
}

Jump to

Keyboard shortcuts

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