config

package
v0.0.0-...-9625d7e Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig()

InitConfig initialize configuration

func InitPluginConfig

func InitPluginConfig()

InitPluginConfig initialize plugins configuration

func UpdateConfig

func UpdateConfig(configBytes []byte) (success bool)

UpdateConfig update ces config

Types

type CESConfig

type CESConfig struct {
	Enable            bool
	Endpoint          string
	EnableProcessList []HbProcess `json:"enable_processes"`
	SpecifiedProcList []string    `json:"specified_procs"`
	EnablePlugin      bool
	ExternalService   string
}

CESConfig is the type for heartbeat response

func GetConfig

func GetConfig() *CESConfig

GetConfig get wrapper

func ReadConfig

func ReadConfig() (*CESConfig, error)

ReadConfig Read the config from conf.json

func ReloadConfig

func ReloadConfig() *CESConfig

ReloadConfig reload config to support hot load config file

type EachPluginConfig

type EachPluginConfig struct {
	Path              string `json:"path"`
	Crontime          int    `json:"crontime"`
	Type              string `json:"type"`
	MaxTimeoutProcNum int    `json:"max_timeout_proc_num"`
}

EachPluginConfig is the type for each plugin config

func GetCustomMonitorPluginConfig

func GetCustomMonitorPluginConfig() []*EachPluginConfig

GetCustomMonitorPluginConfig ...

func GetDefaultPluginConfig

func GetDefaultPluginConfig() []*EachPluginConfig

GetDefaultPluginConfig ...

func GetEventPluginConfig

func GetEventPluginConfig() []*EachPluginConfig

GetEventPluginConfig ...

type HbProcess

type HbProcess struct {
	Pname string `json:"name"`
	Pid   int32  `json:"pid"`
}

HbProcess is the type for enable process info which used in heartbeat response

type PluginConfig

type PluginConfig struct {
	Plugins []*EachPluginConfig `json:"plugins"`
}

PluginConfig is the type for plugins config file

func GetPluginConfig

func GetPluginConfig() *PluginConfig

GetPluginConfig get wrapper

func ReadPluginConfig

func ReadPluginConfig() (*PluginConfig, error)

ReadPluginConfig Read the config from ../plugins/conf.json

Jump to

Keyboard shortcuts

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