config

package
v0.0.0-...-ec85eee Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtSigningKey = os.Getenv("JWT_SIGNING_KEY")

JwtSigningKey is a key used for signing jwt

Functions

func NewDB

func NewDB() (*sqlx.DB, error)

NewDB initialize database

func NewDsn

func NewDsn(dbConfig *DBConfig) string

NewDsn returns dsn string

func NewSendgridApiKey

func NewSendgridApiKey() string

NewSendgridApiKey returns sendgrid api key

func NewTestDB

func NewTestDB() (*sqlx.DB, error)

NewTestDB initialize database

func NewTwilioTokens

func NewTwilioTokens() (twilioAccountSid, twilioAuthToken, phoneNumber string)

NewTwilioTokens returns twilio account sid and auth token

Types

type DBConfig

type DBConfig struct {
	DBName   string `default:"go_echo_api_boilerplate_development" env:"DB_NAME"`
	Host     string `default:"db" env:"DB_HOST"`
	User     string `default:"mysql" env:"DB_USER"`
	Password string `default:"mysql" env:"DB_PASSWORD"`
	Port     string `default:"3306" env:"DB_PORT"`
}

DBConfig database config info

func NewDBConfig

func NewDBConfig() (*DBConfig, error)

NewDB returns database configuration struct

func NewTestDBConfig

func NewTestDBConfig() (*DBConfig, error)

NewTestDBConfig returns test db config

Jump to

Keyboard shortcuts

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