common

package
v4.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMySQL

func ConnectMySQL(host string, port string, user string, pass string, dbName string) (*sqlx.DB, error)

func NewNetHttpServer

func NewNetHttpServer() *http.Server

func NewNetHttpServerMux

func NewNetHttpServerMux() *http.ServeMux

func TimeNowUTC

func TimeNowUTC() time.Time

func ValidateUsername

func ValidateUsername(text string) error

Types

type Env

type Env struct {
	AppEnv      string `env:"APP_ENV" envDefault:"development"`
	RESTPort    string `env:"REST_PORT" envDefault:"8080"`
	MySQLHost   string `env:"MYSQL_HOST" envDefault:"localhost"`
	MySQLPort   string `env:"MYSQL_PORT" envDefault:"3306"`
	MySQLUser   string `env:"MYSQL_USER" envDefault:""`
	MySQLPass   string `env:"MYSQL_PASS" envDefault:""`
	MySQLDBName string `env:"MYSQL_DB_NAME" envDefault:""`
}

func ParseEnv

func ParseEnv() (*Env, error)

Jump to

Keyboard shortcuts

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