config

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: Apache-2.0 Imports: 2 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	AppID            string `json:"appId"`
	Cluster          string `json:"cluster"`
	NamespaceName    string `json:"namespaceName"`
	IP               string `json:"ip"`
	NextTryConnTime  int64  `json:"-"`
	IsBackupConfig   bool   `default:"true" json:"isBackupConfig"`
	BackupConfigPath string `json:"backupConfigPath"`
	Secret           string `json:"secret"`
}

AppConfig 配置文件

func (*AppConfig) GetBackupConfigPath

func (a *AppConfig) GetBackupConfigPath() string

GetBackupConfigPath GetBackupConfigPath

func (*AppConfig) GetHost

func (a *AppConfig) GetHost() string

GetHost GetHost

func (*AppConfig) GetIsBackupConfig

func (a *AppConfig) GetIsBackupConfig() bool

GetIsBackupConfig whether backup config after fetch config from apollo false : no true : yes (default)

func (*AppConfig) IsConnectDirectly

func (a *AppConfig) IsConnectDirectly() bool

IsConnectDirectly is connect by ip directly false : no true : yes

func (*AppConfig) SetNextTryConnTime

func (a *AppConfig) SetNextTryConnTime(nextTryConnectPeriod int64)

SetNextTryConnTime if this connect is fail will set this time

type File

type File interface {
	Load(fileName string, unmarshal func([]byte) (interface{}, error)) (interface{}, error)

	Write(content interface{}, configPath string) error
}

File 读写配置文件

type ServerInfo

type ServerInfo struct {
	AppName     string `json:"appName"`
	InstanceID  string `json:"instanceId"`
	HomepageURL string `json:"homepageUrl"`
	IsDown      bool   `json:"-"`
}

ServerInfo 服务器信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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