setup

package
v0.0.0-...-0bb43ab Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplicationName string

ApplicationName is the currently running program

Functions

func Application

func Application(app string)

Application sets up global variables

func CheckOnce

func CheckOnce(port int) bool

CheckOnce returns true if the given port is busy, false otherwise.

func EnvironmentConfig

func EnvironmentConfig()

EnvironmentConfig loads the .env file for the whole program. Use os.Getenv("LABEL_NAME") to access.

func FuncName

func FuncName() string

FuncName returns the calling function's name

func LogCommon

func LogCommon(err error) *log.Entry

LogCommon returns a logger containing the optional error, application, and function name of the caller.

func Logger

func Logger(file *os.File)

Logger configures the logrus package used by whole program.

func Once

func Once(port int) error

Once binds to the given port on localhost and does nothing forever. Useful for when we want a single instances of an app at a time.

func Redis

func Redis() *redis.Client

Redis sets up a connection to a Redis server specified by the .env config.

func SQL

func SQL() *sqlx.DB

SQL initalizes a database connection based off .env file connection parameters

Types

This section is empty.

Jump to

Keyboard shortcuts

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