apollo

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

* Apollo配置初始化、监听配置变动、获取配置

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoolValue

func GetBoolValue(key string, defaultValue bool) bool

GetBoolValue get config as bool

func GetFloatValue

func GetFloatValue(key string, defaultV float64) float64

GetFloatValue get config as float

func GetIntValue

func GetIntValue(key string, defaultValue int) int

GetIntValue get config as int

func GetStringValue

func GetStringValue(key, defaultValue string) string

GetStringValue get config as string

func Init

func Init(conf Conf) error

Init

func ListenChangeEvent

func ListenChangeEvent() <-chan *agollo.ChangeEvent

ListenApolloChangeEvent listen apollo config change event

Types

type Conf

type Conf struct {
	// application id
	AppId string `json:"appId"`

	// apollo cluster
	Cluster string `json:"cluster"`

	// apollo application
	Namespace string `json:"namespaceName"`

	// server address ex:127.0.0.1:8080
	Ip string `json:"ip"`

	// apolloConfig.json path
	BackupConfigPath string `json:"backup_config_path"`
}

Conf apollo config

Jump to

Keyboard shortcuts

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