config

package
v0.0.0-...-c470439 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 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 Config

type Config struct {
	Server   ServerConfig   `json:"server"`
	Database PostgresConfig `json:"database"`
	Mailgun  MailgunConfig  `json:"mailgun"`
	Dropbox  DropboxConfig  `json:"dropbox"`
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfig

func LoadConfig(configRequired bool) Config

type DropboxConfig

type DropboxConfig struct {
	ID          string `json:"id"`
	Secret      string `json:"secret"`
	AuthURL     string `json:"auth_url"`
	TokenURL    string `json:"token_url"`
	RedirectURL string `json:"redirect_url"`
}

type MailgunConfig

type MailgunConfig struct {
	APIKey       string `json:"api_key"`
	PublicAPIKey string `json:"public_api_key"`
	Domain       string `json:"domain"`
}

type PostgresConfig

type PostgresConfig struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	Name     string `json:"name"`
}

func DefaultPostgresConfig

func DefaultPostgresConfig() PostgresConfig

func (PostgresConfig) ConnectionInfo

func (c PostgresConfig) ConnectionInfo() string

func (PostgresConfig) Dialect

func (c PostgresConfig) Dialect() string

type ServerConfig

type ServerConfig struct {
	Port    int    `json:"port"`
	Env     string `json:"env"`
	Pepper  string `json:"pepper"`
	HMACKey string `json:"hmac_key"`
}

func DefaultServerConfig

func DefaultServerConfig() ServerConfig

func (ServerConfig) IsProduction

func (c ServerConfig) IsProduction() bool

Jump to

Keyboard shortcuts

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