configuration

package
v0.0.0-...-9135e14 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Model_dev     = "dev"
	Model_test    = "test"
	Model_product = "prod"
)

Variables

View Source
var (
	// BuildVersion = ""
	GitRev    = ""
	GitTag    = ""
	BuildTime = ""
	Version   = ""
)
View Source
var EnableRemoteLog = false

Functions

func GetRunModel

func GetRunModel() string

func GetServiceName

func GetServiceName() string

func InitConfiguration

func InitConfiguration(ctx context.Context, serviceInfo ServiceInfo)

func PrintVersionInfo

func PrintVersionInfo()

func RegisterOnConfigChange

func RegisterOnConfigChange(onConfigChange func())

func SetRunModel

func SetRunModel(runModel string)

func UnmarshalKeyFormJson

func UnmarshalKeyFormJson(key string, body interface{}) error

Types

type RPCService

type RPCService interface {
	GetRPCServiceInfo() ServiceInfo
	InitRPCService(ctx context.Context, grpcConn *grpc.ClientConn) error
}

type RemoteConfigProvide

type RemoteConfigProvide struct {
	Provider string `mapstructure:"provider,omitempty" json:"provider,omitempty"`
	Endpoint string `mapstructure:"endpoint,omitempty" json:"endpoint,omitempty"`
	Path     string `mapstructure:"path,omitempty" json:"path,omitempty"`
}

type ServiceInfo

type ServiceInfo struct {
	ServiceName string            `mapstructure:"service_name,omitempty" json:"service_name,omitempty"`
	Version     string            `mapstructure:"version,omitempty" json:"version,omitempty"`
	Descriptor  string            `mapstructure:"descriptor,omitempty" json:"descriptor,omitempty"`
	APIDefine   string            `mapstructure:"api_define,omitempty" json:"api_define,omitempty"`
	Metadata    map[string]string `mapstructure:"metadata,omitempty" json:"metadata,omitempty"`
	TargetUrl   string            `mapstructure:"target_url,omitempty" json:"target_url,omitempty"`
}

func GetServiceInfo

func GetServiceInfo() ServiceInfo

type ServiceRegisterInfo

type ServiceRegisterInfo struct {
	Info           ServiceInfo       `json:"info"`
	ServiceAddr    string            `json:"service_addr"`
	ManageEndpoint string            `json:"manage_endpoint"`
	Metadata       map[string]string `json:"metadata,omitempty"`
}

Jump to

Keyboard shortcuts

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