Documentation ¶
Index ¶
- Variables
- func AuthFailed(w http.ResponseWriter, r *http.Request)
- func CheckUpdate(version string) error
- func ConfigInit()
- func DoUpgrade(version string) error
- func FindSemaphore() string
- func GetIntParam(name string, w http.ResponseWriter, r *http.Request) (int, error)
- func LogError(err error)
- func LogErrorWithFields(err error, fields log.Fields)
- func LogPanic(err error)
- func LogPanicWithFields(err error, fields log.Fields)
- func LogWarning(err error)
- func LogWarningWithFields(err error, fields log.Fields)
- func NewConfig() *configType
- func ScanErrorChecker(n int, err error)
- func SendMail(emailHost, mailSender, mailRecipient string, mail bytes.Buffer) error
Constants ¶
This section is empty.
Variables ¶
var Config *configType
Config exposes the application configuration storage for use in the application
var Cookie *securecookie.SecureCookie
Cookie is a runtime generated secure cookie used for authentication
var InteractiveSetup bool
InteractiveSetup indicates that the cli should perform interactive setup mode
var Migration bool
Migration indicates that the user wishes to run database migrations, deprecated
var UpdateAvailable *github.RepositoryRelease
UpdateAvailable contains the full repository information for the latest release of Semaphore
var Upgrade bool
Upgrade indicates that we should perform an upgrade action
var WebHostURL *url.URL
WebHostURL is the public route to the semaphore server
Functions ¶
func AuthFailed ¶
func AuthFailed(w http.ResponseWriter, r *http.Request)
AuthFailed write a status unauthorized header unless it is an XHR request TODO - never called!
func CheckUpdate ¶ added in v2.0.3
CheckUpdate uses the github client to check for new tags in the semaphore repo
func ConfigInit ¶ added in v2.5.0
func ConfigInit()
ConfigInit reads in cli flags, and switches actions appropriately on them
func DoUpgrade ¶ added in v2.0.3
DoUpgrade checks for an update, and if available downloads the binary and installs it
func FindSemaphore ¶ added in v2.0.3
func FindSemaphore() string
FindSemaphore looks in the PATH for the semaphore variable if not found it will attempt to find the absolute path of the first os argument, the semaphore command, and return it
func GetIntParam ¶
GetIntParam fetches a parameter from the route variables as an integer redirects to a 404 or writes bad request state depending on error state
func LogError ¶ added in v2.5.0
func LogError(err error)
LogError logs an error with arbitrary field if error
func LogErrorWithFields ¶ added in v2.5.0
LogErrorWithFields logs a error with added field context if error
func LogPanic ¶ added in v2.5.0
func LogPanic(err error)
LogPanic logs and panics with arbitrary field if error
func LogPanicWithFields ¶ added in v2.5.0
LogPanicWithFields logs and panics with added field context if error
func LogWarning ¶ added in v2.5.0
func LogWarning(err error)
LogWarning logs a warning with arbitrary field if error
func LogWarningWithFields ¶ added in v2.5.0
LogWarningWithFields logs a warning with added field context if error
func NewConfig ¶
func NewConfig() *configType
NewConfig returns a reference to a new blank configType nolint: golint
func ScanErrorChecker ¶ added in v2.5.0
ScanErrorChecker deals with errors encountered while scanning lines since we do not fail on these errors currently we can simply note them and move on
Types ¶
This section is empty.