Documentation ¶
Index ¶
- Variables
- func ArchiveLogFile() error
- func ClearLogFile() error
- func GetAppBranch() (string, error)
- func GetAppSHA() (string, error)
- func GetBaseSHA() (string, error)
- func GetRemoteBranchSHA(branch string) (string, error)
- func GetTag() (string, error)
- func IsAppUpToDate() (bool, error)
- func RemoteUpdate() error
- func Round(f float64) int
- func StatToSeconds(stat string) (float64, error)
- func TimeAgo(passedTime time.Time) string
- func ToggleDebug()
- func UpdateApp() (bool, error)
- type LogEntry
- type Ref
Constants ¶
This section is empty.
Variables ¶
var AppPath string
AppPath contains the app path of the env
var GoPath string
GoPath contains the gopath of the env
var Log = logrus.New()
Log creates a new logrus instance that can be exported and used throughout the project
var LogFile string
LogFile contains the fully qualified log file location
var LogPath string
LogPath contains the path to store the logs
var ReleaseVersion string
ReleaseVersion contains the git tag version
Functions ¶
func ArchiveLogFile ¶
func ArchiveLogFile() error
ArchiveLogFile creates a backup of the current log in the logs directory, creates a new log file, and writes to the new log
func GetAppBranch ¶
GetAppBranch returns the current branch name
func GetBaseSHA ¶
GetBaseSHA returns the current base SHA location http://stackoverflow.com/questions/3258243/check-if-pull-needed-in-git
func GetRemoteBranchSHA ¶
GetRemoteBranchSHA returns the commit SHA of the remote branch from github
func GetTag ¶
GetTag returns the current tag https://git-scm.com/book/en/v2/Git-Basics-Tagging
func IsAppUpToDate ¶
IsAppUpToDate checks to see if the local status of the git tree is up to date with the remote
func StatToSeconds ¶
StatToSeconds takes in a beego stat param (e.g 20.40us or 15.20ms) and returns the time in seconds
func TimeAgo ¶
TimeAgo returns the rounded form of amount of time elapsed between now and the passed time
func ToggleDebug ¶
func ToggleDebug()
ToggleDebug toggles the debug level on or off depending on the current state
Types ¶
type LogEntry ¶
type LogEntry struct { Level string `json:"level"` Message string `json:"msg"` Time time.Time `json:"time"` }
LogEntry contains information unmarshalled from logrus that was logged to a file {"level":"error","msg":"Test","time":"2016-04-10T12:05:30-04:00"}
func ParseLogFile ¶
func ParseLogFile() []LogEntry
ParseLogFile parses the locally stored flat log file that was logged to by logrus