config

package
v0.0.0-...-dad66ff Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	TTL        time.Duration `env-required:"true" yaml:"ttl" env:"ACCESS_TOKEN_TTL"`
	SigningKey string        `env-required:"true" yaml:"signing_key" env:"ACCESS_TOKEN_SIGNING_KEY"`
}

type App

type App struct {
	Name    string `env-required:"true" yaml:"name"    env:"APP_NAME"`
	Version string `env-required:"true" yaml:"version" env:"APP_VERSION"`
}

type CSRFToken

type CSRFToken struct {
	TTL       time.Duration `env-required:"true" yaml:"ttl" env:"CSRF_TOKEN_TTL"`
	CookieKey string        `env-required:"true" yaml:"cookie_key" env:"CSRF_TOKEN_COOKIE_KEY"`
	HeaderKey string        `env-required:"true" yaml:"header_key" env:"CSRF_TOKEN_HEADER_KEY"`
}

type Cache

type Cache struct {
	TTL time.Duration `env-required:"true" yaml:"ttl" env:"CACHE_TTL"`
}

type Config

type Config struct {
	App         `yaml:"app"`
	HTTP        `yaml:"http"`
	Log         `yaml:"logger"`
	PG          `yaml:"postgres"`
	MongoDB     `yaml:"mongodb"`
	Cache       `yaml:"cache"`
	Redis       `yaml:"redis"`
	SocialAuth  `yaml:"social_auth"`
	Session     `yaml:"session"`
	AccessToken `yaml:"access_token"`
	CSRFToken   `yaml:"csrf_token"`
}

type HTTP

type HTTP struct {
	Port             string `env-required:"true" yaml:"port" env:"HTTP_PORT"`
	CORSAllowOrigins string `env-required:"true" yaml:"cors_allow_origins" env:"CORS_ALLOW_ORIGINS"`
}

type Log

type Log struct {
	Level string `env-required:"true" yaml:"log_level" env:"LOG_LEVEL"`
}

type MongoDB

type MongoDB struct {
	URI      string `env-required:"true" env:"MONGO_URI"`
	Username string `env-required:"true" env:"MONGO_USER"`
	Password string `env-required:"true" env:"MONGO_PASS"`
	Database string `env-required:"true" yaml:"database" env:"MONGO_DATABASE"`
}

type PG

type PG struct {
	PoolMax int    `env-required:"true" yaml:"pool_max" env:"PG_POOL_MAX"`
	URL     string `env-required:"true" env:"PG_URL"`
}

type Redis

type Redis struct {
	Addr     string `env-required:"true" env:"REDIS_ADDR"`
	Password string `env-required:"true" env:"REDIS_PASSWORD"`
}

type Session

type Session struct {
	TTL            time.Duration `env-required:"true" yaml:"ttl" env:"SESSION_TTL"`
	CookieKey      string        `env-required:"true" yaml:"cookie_key" env:"SESSION_COOKIE_KEY"`
	CookieDomain   string        `yaml:"cookie_domain" env:"SESSION_COOKIE_DOMAIN"`
	CookieSecure   bool          `yaml:"cookie_secure" env:"SESSION_COOKIE_SECURE"`
	CookieHTTPOnly bool          `yaml:"cookie_httponly" env:"SESSION_COOKIE_HTTPONLY"`
}

type SocialAuth

type SocialAuth struct {
	GitHubClientID     string `yaml:"github_client_id" env-required:"true" env:"GH_CLIENT_ID"`
	GitHubClientSecret string `env-required:"true" env:"GH_CLIENT_SECRET"`
	GitHubScope        string `yaml:"github_scope" env-required:"true" env:"GH_SCOPE"`

	GoogleClientID     string `yaml:"google_client_id" env-required:"true" env:"GOOGLE_CLIENT_ID"`
	GoogleClientSecret string `env-required:"true" env:"GOOGLE_CLIENT_SECRET"`
	GoogleScope        string `yaml:"google_scope" env-required:"true" env:"GOOGLE_SCOPE"`
}

func (*SocialAuth) ClientIDs

func (sa *SocialAuth) ClientIDs() map[string]string

func (*SocialAuth) ClientSecrets

func (sa *SocialAuth) ClientSecrets() map[string]string

func (*SocialAuth) Endpoints

func (sa *SocialAuth) Endpoints() map[string]oauth2.Endpoint

func (*SocialAuth) Scopes

func (sa *SocialAuth) Scopes() map[string]string

Jump to

Keyboard shortcuts

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