health

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Created by guoxin in 2024/4/8 17:52

Index

Constants

This section is empty.

Variables

View Source
var (
	//CurrentVersion current version
	CurrentVersion = "v1"
	// GitCommit current git commit hash
	GitCommit = ""
	// GitBranch current git branch
	GitBranch = ""
	// BuildDateTime compile datetime
	BuildDateTime = ""
	// StartTime start time
	StartTime = time.Now().Format(time.RFC3339)
)

将如下代码添加到Makefile中 VERSION=v1.0.0 DATETIME=$(shell date +"%Y-%m-%dT%H:%M:%S%z") GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD) GIT_COMMIT = $(shell git log --pretty=format:'%h' -n 1)

LOCALCONF_HOME=chainmaker.org/chainmaker/opennet/did-gateway GOLDFLAGS += -X "${LOCALCONF_HOME}.CurrentVersion=${VERSION}" GOLDFLAGS += -X "${LOCALCONF_HOME}.BuildDateTime=${DATETIME}" GOLDFLAGS += -X "${LOCALCONF_HOME}.GitBranch=${GIT_BRANCH}" GOLDFLAGS += -X "${LOCALCONF_HOME}.GitCommit=${GIT_COMMIT}"

Functions

func GetRouteByPathWithParams

func GetRouteByPathWithParams(path, version, name, gitCommit, gitBranch, buildTime string) []zerorest.Route

func GetRouteWithParams

func GetRouteWithParams(version, name, gitCommit, gitBranch, buildTime string) []zerorest.Route

在 health 包中的函数中增加一个接收参数的函数

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL