appinfo

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

func GetVersion

func GetVersion() version.Version

GetVersion ...

func NewAppInfo added in v0.0.56

func NewAppInfo(ctx context.Context, config *Config) error

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) Descriptor() ([]byte, []int)

Deprecated: Use AppInfo.ProtoReflect.Descriptor instead.

func (*AppInfo) GetBuildTime

func (x *AppInfo) GetBuildTime() string

func (*AppInfo) GetGitHash

func (x *AppInfo) GetGitHash() string

func (*AppInfo) GetServiceDescription

func (x *AppInfo) GetServiceDescription() string

func (*AppInfo) GetServiceDisplayName

func (x *AppInfo) GetServiceDisplayName() string

func (*AppInfo) GetServiceId

func (x *AppInfo) GetServiceId() string

func (*AppInfo) GetServiceName

func (x *AppInfo) GetServiceName() string

func (*AppInfo) GetVersion

func (x *AppInfo) GetVersion() string

func (*AppInfo) ProtoMessage

func (*AppInfo) ProtoMessage()

func (*AppInfo) ProtoReflect

func (x *AppInfo) ProtoReflect() protoreflect.Message

func (*AppInfo) Reset

func (x *AppInfo) Reset()

func (*AppInfo) String

func (x *AppInfo) String() string

type CompletedConfig

type CompletedConfig struct {
	// contains filtered or unexported fields
}

func (CompletedConfig) Apply

func (c CompletedConfig) Apply() error

Apply creates a new server which logically combines the handling chain with the passed server. name is used to differentiate for logging. The handler chain in particular can be difficult as it starts delgating.

func (CompletedConfig) Validate added in v0.0.44

func (c CompletedConfig) Validate() error

Validate checks Config.

type Config

type Config struct {
	Proto     AppInfo
	Validator *validator.Validate
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with the default values

func NewViperConfig

func NewViperConfig(v *viper.Viper, keys ...string) *Config

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.

Directories

Path Synopsis
Package verflag defines utility functions to handle command line flags related to version of Kubernetes.
Package verflag defines utility functions to handle command line flags related to version of Kubernetes.

Jump to

Keyboard shortcuts

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