config

package
v0.0.0-...-f011ba4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApolloConfig

func ApolloConfig() *apollo.ApolloConfig

func ParseApolloConfig

func ParseApolloConfig[K string, V any](configJson string, p func(map[K]V), configName string) bool

func RegisterApolloListener

func RegisterApolloListener(f func(*storage.ChangeEvent))

Types

type Config

type Config interface {
	ServerName() string
	ServerPort() int
	ServiceRpcHeaderName() string
	GetServiceConfig(serviceName string) *ServiceConfig
	GetSignKey(serviceConfig *ServiceConfig) string
	GetSignKeyByName(name string) string
	GetEncryptKey(serviceConfig *ServiceConfig) string
	GetEncryptKeyByName(name string) string
	GetTimeoutConfigByName(name string, uri string) int

	HttpClientMaxIdleConns() int
	HttpClientMaxIdleConnsPerHost() int
	FastHttpEnable() bool
}

func LoadApolloConfig

func LoadApolloConfig(appId string, namespace string, cluster string, address string, logger logger.Logger) Config

func LoadYamlConfig

func LoadYamlConfig(configBytes []byte) Config

type EncryptKeyConfig

type EncryptKeyConfig map[string]string

type ServiceConfig

type ServiceConfig struct {
	EncryptKeyName    string `json:"encrypt.key.name"`
	SignKeyName       string `json:"sign.key.name"`
	EncryptEnable     bool   `json:"encrypt.enable"`
	SignEnable        bool   `json:"sign.enable"`
	CompressEnable    bool   `json:"compress.enable"`
	CompressAlgorithm int32  `json:"compress.algorithm"`
}

type ServiceTimeoutConfig

type ServiceTimeoutConfig struct {
	Timeout int `json:"timeout"`
}

type SignKeyConfig

type SignKeyConfig map[string]string

Jump to

Keyboard shortcuts

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