Documentation
¶
Index ¶
- func ContainerPathArgument() string
- func DebugArgument() bool
- func ExpandTilde(path string) string
- func FileExists(filename string) bool
- func GetFileContentType(file *os.File) (string, error)
- func HeartbeatClient(clientCert string, clientKey string, serverCA string) (*http.Client, error)
- func InitializeGlobalLogger(logfile string, console bool)
- func LatestVersion(organisation string, repository string) (string, error)
- func Middleware(traceLogger *zerolog.Logger) func(next http.Handler) http.Handler
- func NewRollingFile(file string) (io.Writer, error)
- func RespondCode(w http.ResponseWriter, code int)
- func RespondError(w http.ResponseWriter, code int, message string)
- func RespondFile(w http.ResponseWriter, file *os.File)
- func RespondJSON(w http.ResponseWriter, status int, payload interface{})
- func RespondString(w http.ResponseWriter, code int, message string)
- func RunUpdate(currentVersion string, organisation string, repository string, ...) (string, error)
- func SendHeartbeat(client *http.Client, endpoint string, serviceKey string, beat *Heartbeat) error
- func TraceLogger(logfile string) *zerolog.Logger
- func UnauthorizedResponse(w http.ResponseWriter)
- type Heartbeat
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerPathArgument ¶ added in v0.0.6
func ContainerPathArgument() string
Checks if the binary was executed with the --container="/path/to/container" argument and returns the specified path or an empty string.
func DebugArgument ¶ added in v0.0.7
func DebugArgument() bool
Checks if the binary was executed with the --debug argument.
func ExpandTilde ¶ added in v0.0.7
ExpandTilde expands a leading tilde (~) to the user's home directory who runs the binary.
func FileExists ¶
Checks if a file exists and isn't a directory. see: https://golangcode.com/check-if-a-file-exists/
func HeartbeatClient ¶
func InitializeGlobalLogger ¶
func LatestVersion ¶ added in v0.0.2
func RespondCode ¶
func RespondCode(w http.ResponseWriter, code int)
func RespondError ¶
func RespondError(w http.ResponseWriter, code int, message string)
func RespondFile ¶ added in v0.0.10
func RespondFile(w http.ResponseWriter, file *os.File)
respondFile makes the response with payload as json format
func RespondJSON ¶
func RespondJSON(w http.ResponseWriter, status int, payload interface{})
func RespondString ¶
func RespondString(w http.ResponseWriter, code int, message string)
func SendHeartbeat ¶
func TraceLogger ¶
func UnauthorizedResponse ¶ added in v0.0.3
func UnauthorizedResponse(w http.ResponseWriter)
Types ¶
Click to show internal directories.
Click to hide internal directories.