configutil

package
v0.0.25 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CONFIG_METHOD_LOCAL  = "local"
	CONFIG_METHOD_CONSUL = "consul"
)

Variables

This section is empty.

Functions

func AppConfig

func AppConfig(bootstrap *configpb.Bootstrap) *configpb.App

func ClusterServiceApis added in v0.0.10

func ClusterServiceApis(bootstrap *configpb.Bootstrap) []*configpb.ClusterServiceApi

func ConsulConfig

func ConsulConfig(bootstrap *configpb.Bootstrap) *configpb.Consul

func CurrentPath

func CurrentPath() string

func EtcdConfig

func EtcdConfig(bootstrap *configpb.Bootstrap) *configpb.Etcd

func GRPCConfig

func GRPCConfig(bootstrap *configpb.Bootstrap) *configpb.Server_GRPC

func HTTPConfig

func HTTPConfig(bootstrap *configpb.Bootstrap) *configpb.Server_HTTP

func JaegerConfig

func JaegerConfig(bootstrap *configpb.Bootstrap) *configpb.Jaeger

func Loading

func Loading(filePath string, loadingOpts ...Option) (*configpb.Bootstrap, error)

func LoadingConfigFromConsul

func LoadingConfigFromConsul(consulClient *consulapi.Client, appConfig *configpb.App, loadingOpts ...Option) (*configpb.Bootstrap, error)

LoadingConfigFromConsul 从consul中加载配置 首先:读取服务base配置 然后:读取本服务配置 最后:使用本服务配置 覆盖 base 配置

func LoadingFile

func LoadingFile(filePath string, loadingOpts ...Option) (*configpb.Bootstrap, error)

func LogConfig

func LogConfig(bootstrap *configpb.Bootstrap) *configpb.Log

func LogConsoleConfig

func LogConsoleConfig(bootstrap *configpb.Bootstrap) *configpb.Log_Console

func LogFileConfig

func LogFileConfig(bootstrap *configpb.Bootstrap) *configpb.Log_File

func MergeConfig

func MergeConfig(first, second proto.Message)

MergeConfig 合并配置;后面的覆盖前面的 Merge merges src into dst, which must be a message with the same descriptor.

func MongoConfig added in v0.0.4

func MongoConfig(bootstrap *configpb.Bootstrap) *configpb.Mongo

func MysqlConfig

func MysqlConfig(bootstrap *configpb.Bootstrap) *configpb.MySQL

func PostgresConfig

func PostgresConfig(bootstrap *configpb.Bootstrap) *configpb.PSQL

func RabbitmqConfig

func RabbitmqConfig(bootstrap *configpb.Bootstrap) *configpb.Rabbitmq

func RedisConfig

func RedisConfig(bootstrap *configpb.Bootstrap) *configpb.Redis

func ServiceEncryptConfig

func ServiceEncryptConfig(bootstrap *configpb.Bootstrap) *configpb.Encrypt_ServiceEncrypt

func SettingCaptchaConfig

func SettingCaptchaConfig(bootstrap *configpb.Bootstrap) *configpb.Setting_Captcha

func SettingConfig

func SettingConfig(bootstrap *configpb.Bootstrap) *configpb.Setting

func SettingLoginConfig

func SettingLoginConfig(bootstrap *configpb.Bootstrap) *configpb.Setting_Login

func SnowflakeConfig

func SnowflakeConfig(bootstrap *configpb.Bootstrap) *configpb.Snowflake

func ThirdPartyApis

func ThirdPartyApis(bootstrap *configpb.Bootstrap) []*configpb.ThirdPartyApi

func ToConsulConfig

func ToConsulConfig(cfg *configpb.Consul) *consulpkg.Config

ToConsulConfig ...

func TokenEncryptConfig

func TokenEncryptConfig(bootstrap *configpb.Bootstrap) *configpb.Encrypt_TokenEncrypt

func TransferEncryptConfig

func TransferEncryptConfig(bootstrap *configpb.Bootstrap) *configpb.Encrypt_TransferEncrypt

func Watch

func Watch(filePaths ...string) error

Watch 按需Watch配置

Types

type Option

type Option func(*options)

Option is config option.

func WithOtherConfig

func WithOtherConfig(configs ...proto.Message) Option

Jump to

Keyboard shortcuts

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