lib

package
v0.0.0-...-0e6f1c7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TIME_FORMAT_SEC = "2006-01-02 15:04:05"
	INDEX_TMPL      = "./html_tmpl/index.html"
	DETAIL_TMPL     = "./html_tmpl/detail.html"
	LOGIN_TMPL      = "./html_tmpl/login.html"

	COOKIE_NAME = "manage_token"
)
View Source
const (
	MAX_RECV_PER_TICK = 10
	CMD_CHAN_SIZE     = 10000
	MAX_SND_CMD_TICK  = 100
)

Variables

This section is empty.

Functions

func AfterReLoadConfig

func AfterReLoadConfig(pconfig *Config, old_config *FileConfig, new_config *FileConfig)

After ReLoad Config If Need Handle

func CommSet

func CommSet(pconfig *Config) bool

Comm Config Setting

func LocalSet

func LocalSet(pconfig *Config) bool

Local Proc Setting

func ParseAuth

func ParseAuth(pconfig *Config) bool

func ParseClientList

func ParseClientList(pconfig *Config) bool

parse FileConfig.ClientList --> Config.WatchMap

func RegReportCmd

func RegReportCmd(pconfig *Config)

register ReportCmd

func ServerExit

func ServerExit(pconfig *Config)

func ServerStart

func ServerStart(pconfig *Config)

Main Proc

Types

type AuthInfo

type AuthInfo struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	NameSpace  string
	ProcId     int
	ProcName   string
	ConfigFile string
	Daemon     bool
	FileConfig *FileConfig
	Comm       *comm.CommConfig

	WatchMap map[int]*WatchClient
	Name2Id  map[string]int
	Recver   *ReportRecver
	Panel    *PanelServ
	AuthMap  map[string]*AuthInfo
	TokenMap map[string]string
	CmdMap   map[string]bool //report_proto.go:Report Cmd
	// contains filtered or unexported fields
}

type FileConfig

type FileConfig struct {
	ListenAddr    string        `json:"listen_addr"` //listen report
	HttpAddr      string        `json:"http_addr"`   //listen http request
	LogFile       string        `json:"log_file"`
	ClientList    []interface{} `json:"client_list"`
	HeartTimeout  int           `json:"heart_timeout"`
	ReloadTimeout int           `json:"reload_timeout"`
	Auth          []string      `json:"auth"`        //name:pass etc.
	AuthExpire    int           `json:"auth_expire"` //expired seconds after auth
}

type PanelServ

type PanelServ struct {
	// contains filtered or unexported fields
}

func StartPanel

func StartPanel(pconfig *Config) *PanelServ

type PeerStat

type PeerStat struct {
	StartTime   time.Time
	HeartBeat   time.Time
	StopTime    time.Time
	ConnStr     string
	ConnNum     int
	CmdTime     time.Time //latest cmd time
	CmdStat     string    //refer CMD_STAT_XX
	CmdInfo     string
	MonitorInfo template.HTML //monitor info
	// contains filtered or unexported fields
}

type ReportRecver

type ReportRecver struct {
	// contains filtered or unexported fields
}

func StartRecver

func StartRecver(pconfig *Config) *ReportRecver

func (*ReportRecver) Close

func (precver *ReportRecver) Close()

type WatchClient

type WatchClient struct {
	ProcId   int
	ProcName string
	Stat     PeerStat
}

Jump to

Keyboard shortcuts

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