cloudflare/cloudflared

Public

mirrored from https://github.com/cloudflare/cloudflaredAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2019.9.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

cmd/cloudflared/buildinfo/build_info.go

28lines · modecode

1package buildinfo
2
3import (
4 "runtime"
5
6 "github.com/sirupsen/logrus"
7)
8
9type BuildInfo struct {
10 GoOS string `json:"go_os"`
11 GoVersion string `json:"go_version"`
12 GoArch string `json:"go_arch"`
13 CloudflaredVersion string `json:"cloudflared_version"`
14}
15
16func GetBuildInfo(cloudflaredVersion string) *BuildInfo {
17 return &BuildInfo{
18 GoOS: runtime.GOOS,
19 GoVersion: runtime.Version(),
20 GoArch: runtime.GOARCH,
21 CloudflaredVersion: cloudflaredVersion,
22 }
23}
24
25func (bi *BuildInfo) Log(logger *logrus.Logger) {
26 logger.Infof("Version %s", bi.CloudflaredVersion)
27 logger.Infof("GOOS: %s, GOVersion: %s, GoArch: %s", bi.GoOS, bi.GoVersion, bi.GoArch)
28}
29