Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ProjectName is the name of the project. ProjectName = "DXClusterGoAPI" // ProjectGitHubURL is the GitHub repository URL. ProjectGitHubURL = "https://github.com/user00265/dxclustergoapi" // BuildVersion represents the semantic version of the build. // This should be set via ldflags with a semver tag (e.g., v1.0.0). // If not set, it defaults to "unknown". BuildVersion = "unknown" // GitCommit represents the short Git commit hash. // This should be set via ldflags with the git commit hash. GitCommit = "unknown" )
These variables are populated at build time using ldflags. Example: go build -ldflags "-X 'github.com/user00265/dxclustergoapi/internal/version.GitCommit=f80cf83' -X 'github.com/user00265/dxclustergoapi/internal/version.BuildVersion=1.0.0'" ...
View Source
var ProjectVersion = func() string { if BuildVersion != "unknown" && GitCommit != "unknown" { return fmt.Sprintf("%s+%s", strings.TrimPrefix(BuildVersion, "v"), GitCommit[:7]) } return "unknown" }()
ProjectVersion constructs the full project version string. If BuildVersion is a valid semver and GitCommit is available, it's "vX.Y.Z+COMMIT". Otherwise, it's just "unknown".
View Source
var UserAgent = fmt.Sprintf("%s/%s (+%s)", ProjectName, ProjectVersion, ProjectGitHubURL)
UserAgent is the full User-Agent string to be used in HTTP requests.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.