Documentation ¶
Index ¶
- Variables
- func GetVersion() version.Version
- type AppInfo
- func (*AppInfo) Descriptor() ([]byte, []int)deprecated
- func (x *AppInfo) GetBuildTime() string
- func (x *AppInfo) GetGitHash() string
- func (x *AppInfo) GetServiceDescription() string
- func (x *AppInfo) GetServiceDisplayName() string
- func (x *AppInfo) GetServiceId() string
- func (x *AppInfo) GetServiceName() string
- func (x *AppInfo) GetVersion() string
- func (*AppInfo) ProtoMessage()
- func (x *AppInfo) ProtoReflect() protoreflect.Message
- func (x *AppInfo) Reset()
- func (x *AppInfo) String() string
- type CompletedConfig
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version // NOTE: The $Format strings are replaced during 'git archive' thanks to the // companion .gitattributes file containing 'export-subst' in this same // directory. See also https://git-scm.com/docs/gitattributes Version = "v0.0.0-master+$Format:%h$" // git describe --long --tags --dirty --tags --always BuildTime = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ') GitHash = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) ServiceName = "" // 服务名称 ServiceDisplayName = "" // 服务全称 ServiceDescription = "" // 服务描述 ServiceId = "" // 服务实例ID )
View Source
var File_app_info_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type AppInfo ¶
type AppInfo struct { Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // 编译版本 GitHash string `protobuf:"bytes,2,opt,name=git_hash,json=gitHash,proto3" json:"git_hash,omitempty"` // 源码hash BuildTime string `protobuf:"bytes,3,opt,name=build_time,json=buildTime,proto3" json:"build_time,omitempty"` // 编译时间 ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` // 服务名称 ServiceDisplayName string `protobuf:"bytes,5,opt,name=service_display_name,json=serviceDisplayName,proto3" json:"service_display_name,omitempty"` // 服务全称 ServiceDescription string `protobuf:"bytes,6,opt,name=service_description,json=serviceDescription,proto3" json:"service_description,omitempty"` // 服务描述 ServiceId string `protobuf:"bytes,7,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` // 服务实例ID // contains filtered or unexported fields }
func (*AppInfo) Descriptor
deprecated
func (*AppInfo) GetBuildTime ¶
func (*AppInfo) GetGitHash ¶
func (*AppInfo) GetServiceDescription ¶
func (*AppInfo) GetServiceDisplayName ¶
func (*AppInfo) GetServiceId ¶
func (*AppInfo) GetServiceName ¶
func (*AppInfo) GetVersion ¶
func (*AppInfo) ProtoMessage ¶
func (*AppInfo) ProtoMessage()
func (*AppInfo) ProtoReflect ¶
func (x *AppInfo) ProtoReflect() protoreflect.Message
type CompletedConfig ¶
type CompletedConfig struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { GetViper func() *viper.Viper // If set, overrides params below Proto AppInfo Validator *validator.Validate }
func NewViperConfig ¶
NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.
Click to show internal directories.
Click to hide internal directories.