config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapter

func Adapter(cfg *model.Bootstrap) (err error)

func CheckYamlFormat

func CheckYamlFormat(path string) bool

func GetAPIConf

func GetAPIConf() fc.APIConfig

GetAPIConf returns the initted api config

func GetBootstrap

func GetBootstrap() *model.Bootstrap

GetBootstrap get config global, need a better name

func GetDiscoveryType

func GetDiscoveryType(cfg *model.Bootstrap) (err error)

func GetFilterChain

func GetFilterChain(cfg *model.Bootstrap) (err error)

func GetHttpConfig

func GetHttpConfig(cfg *model.Bootstrap) (err error)

func GetLoadBalance

func GetLoadBalance(cfg *model.Bootstrap) (err error)

func GetProtocol

func GetProtocol(cfg *model.Bootstrap) (err error)

func Load

func Load(path string) *model.Bootstrap

Load config file and parse

func LoadAPIConfig

func LoadAPIConfig(metaConfig *model.APIMetaConfig) (*fc.APIConfig, error)

LoadAPIConfig load the api config from config center

func LoadAPIConfigFromFile

func LoadAPIConfigFromFile(path string) (*fc.APIConfig, error)

LoadAPIConfigFromFile load the api config from file

func LoadYAMLConfig

func LoadYAMLConfig(path string) *model.Bootstrap

LoadYAMLConfig YAMLConfigLoad config load yaml

func RegisterConfigListener

func RegisterConfigListener(li APIConfigListener)

RegisterConfigListener register APIConfigListener

func RegisterConfigLoadFunc

func RegisterConfigLoadFunc(f LoadFunc)

RegisterConfigLoadFunc can replace a new config load function instead of default

Types

type APIConfigListener

type APIConfigListener interface {
	APIConfigChange(apiConfig fc.APIConfig) bool // bool is return for interface implement is interesting
}

APIConfigListener defines api config listener interface

type LoadFunc

type LoadFunc func(path string) *model.Bootstrap

LoadFunc ConfigLoadFunc parse a input(usually file path) into a pixiu config

Jump to

Keyboard shortcuts

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