structs

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfigStatus

type AgentConfigStatus struct {
	Hostname              string `json:"hostname"`
	IP                    string `json:"ip"`
	AppName               string `json:"app_name"`
	Env                   string `json:"env"`
	Directory             string `json:"directory"`
	Environment           string `json:"environment"`
	Command               string `json:"command"`
	User                  string `json:"user"`
	Autostart             string `json:"autostart"`
	Autorestart           string `json:"autorestart"`
	Startsecs             string `json:"startsecs"`
	StdoutLogfile         string `json:"stdout_logfile"`
	StdoutLogfileMaxbytes string `json:"stdout_logfile_maxbytes"`
	StdoutLogfileBackups  string `json:"stdout_logfile_backups"`
	StdoutCaptureMaxbytes string `json:"stdout_capture_maxbytes"`
	StderrLogfile         string `json:"stderr_logfile"`
	StderrLogfileMaxbytes string `json:"stderr_logfile_maxbytes"`
	StderrLogfileBackups  string `json:"stderr_logfile_backups"`
	Stopsignal            string `json:"stopsignal"`
}

AgentConfigStatus ...

type AppConfiguration

type AppConfiguration struct {
	Content   string     `json:"content"`
	Resources []Resource `json:"resources"`
	Metadata  Metadata   `json:"metadata"`
}

AppConfiguration ...

type ConfKey

type ConfKey struct {
	Prefix   string `json:"prefix"`
	Hostname string `json:"hostname"`
	AppName  string `json:"app_name"`
	EnvName  string `json:"env_name"`
	Rest     string `json:"rest"`
	FileName string `json:"file_name"`
	Port     string `json:"port"`
}

ConfKey 存储配置的key字段 for instance

func ParserConfKey

func ParserConfKey(key string) (keyData ConfKey, err error)

ParserConfKey parse conf key

func (*ConfKey) CheckValid

func (c *ConfKey) CheckValid() error

CheckValid check valid

type ConfNode

type ConfNode struct {
	AppName       string            `json:"appName" toml:"appName"`             // 应用名称
	AppEnvi       string            `json:"appEnvi" toml:"appEnvi"`             // 应用部署环境
	IP            string            `json:"ip" toml:"ip"`                       // 应用部署机器ip
	Port          string            `json:"port" toml:"port"`                   // 应用部署机器port
	FileName      string            `json:"file_name" toml:"file_name"`         // 应用部署配置文件名称
	Configuration *AppConfiguration `json:"configuration" toml:"configuration"` // 应用部署配置具体信息
}

ConfNode confuNode 主要代表部署在应用机器上的应用的具体配置信息

type ConfReport

type ConfReport struct {
	FileName   string `json:"file_name"`
	MD5        string `json:"md5"`
	Hostname   string `json:"hostname"`
	Env        string `json:"env"`
	Timestamp  int64  `json:"timestamp"`
	IP         string `json:"ip"`
	HealthPort string `json:"health_port"`
}

ConfReport {"file_name":"config-live.toml","md5":"0f07572ba1212a75d8b5a0167c5507c2","hostname":"xxx.live.unp","env":"live","timestamp":1560477493}

func (*ConfReport) JSONString

func (c *ConfReport) JSONString() string

JSONString json

type ConfValue

type ConfValue struct {
	Content  string   `json:"content"`
	Metadata MetaData `json:"metadata"`
}

ConfValue {"content":"","metadata":{"timestamp":1560354378,"version":"v1","format":"toml"}}

func ParserConfValue

func ParserConfValue(value string) (valueData ConfValue, err error)

ParserConfValue ...

func (*ConfValue) CheckValid

func (c *ConfValue) CheckValid() error

CheckValid ...

type ContentNode

type ContentNode struct {
	Content string `json:"content"` // 应用部署配置内容
	Version int64  `json:"version"` // 应用部署配置版本
}

ContentNode ...

type DubboInfo

type DubboInfo struct {
	Namespace string            `json:"namespace" toml:"namespace"`
	Name      string            `json:"name" toml:"name"`
	Labels    map[string]string `json:"labels" toml:"labels"`
	Methods   []string          `json:"methods" toml:"methods"`
}

DubboInfo ...

type MetaData

type MetaData struct {
	Timestamp int64    `json:"timestamp"`
	Version   string   `json:"version"`
	Format    string   `json:"format"`
	Paths     []string `json:"paths"`
}

MetaData ...

type Metadata

type Metadata struct {
	Format    string `json:"format"`    // Content encoding format: toml/yaml/json
	Timestamp int64  `json:"timestamp"` //
	Version   string `json:"version"`
	FileName  string `json:"file_name"` // fileName: config-live/config-trunk
	Encoded   bool   `json:"encoded"`   // content :Whether the encryption
	AppName   string `json:"app_name" toml:"app_name" `
}

Metadata ...

type NginxConfExt

type NginxConfExt struct {
	Name   string                     `json:"name"`
	Status string                     `json:"status"`
	Block  parser.NginxConfigureBlock `json:"block"`
}

type ProcessStatus

type ProcessStatus struct {
	User    string `json:"user"`
	PID     string `json:"pid"`
	CPU     string `json:"cpu"`
	MEM     string `json:"mem"`
	VSZ     string `json:"vsz"`
	RSS     string `json:"rss"`
	TTY     string `json:"tty"`
	Stat    string `json:"stat"`
	Start   string `json:"start"`
	Time    string `json:"time"`
	Command string `json:"command"`
}

ProcessStatus ...

func (*ProcessStatus) Unwrap

func (ps *ProcessStatus) Unwrap() *ProgramExt

Unwrap ...

type Program

type Program struct {
	PID   string   `json:"pid" toml:"pid" `
	State string   `json:"state" toml:"state" `
	Time  string   `json:"time" toml:"time" `
	Name  string   `json:"app_name" toml:"app_name" `
	Path  []string `json:"path" toml:"path" `
	Args  []string `json:"args" toml:"args" `
}

Program ...

type ProgramExt

type ProgramExt struct {
	Status       string   `json:"status" toml:"status"`
	FileName     string   `json:"file_name" toml:"file_name"` // profile name
	FilePath     string   `json:"file_path" toml:"file_path"` // profile path
	Manager      string   `json:"manager" toml:"manager"`     // systemd|supervisor
	ProgramName  string   `json:"program" toml:"program"`     // programName eg: xxx
	StartCommand string   `json:"start_command" toml:"start_command"`
	Environments []string `json:"environments" toml:"environments"` // environment variable
	User         string   `json:"user" toml:"user"`                 // user account name
	Directory    string   `json:"directory" toml:"directory"`       // execution dir
	Restart      bool     `json:"restart" toml:"restart"`           // restart policy
	RestartSec   int      `json:"restart_sec" toml:"restart_sec"`   // start interval
	ConfData     string   `json:"conf_data" toml:"conf_data"`       // configuration data
	Config       string   `json:"config" toml:"config"`             // profile name used for specific configuration
}

ProgramExt the ext of the program, mainly scan the systemd or supervisor config of the app

func (*ProgramExt) UUID

func (pe *ProgramExt) UUID() string

UUID the unique uuid of program

type RegInfo

type RegInfo struct {
	Name     string               `json:"name" toml:"name"`
	Scheme   string               `json:"scheme" toml:"scheme"`
	Address  string               `json:"address" toml:"address"`
	Labels   map[string]string    `json:"labels" toml:"labels"`
	Services map[string]DubboInfo `json:"services" toml:"services"`
}

RegInfo ...

type RegNode

type RegNode struct {
	ServiceNode

	LastCheckTime *atomic.Int64
	NextCheckTime *atomic.Int64
	Disable       *atomic.Bool
	// contains filtered or unexported fields
}

RegNode 检查点

func NewRegNode

func NewRegNode(node ServiceNode) *RegNode

NewRegNode ...

func (RegNode) Address

func (n RegNode) Address() string

Address reg addr

type Resource

type Resource struct {
}

Resource ...

type Result

type Result int

Result ...

var FailResult Result = 2

FailResult ...

var SuccessResult Result = 1

SuccessResult ...

type ServiceConf

type ServiceConf struct {
	Content   string     `json:"content"`
	Resources []Resource `json:"resources"`
	Metadata  struct {
		Format    string `json:"format"`    // content编码格式: toml/yaml/json
		Timestamp int64  `json:"timestamp"` //
		Version   string `json:"version"`
		FileName  string `json:"file_name"` // 文件名称 config-live/config-trunk
		Encoded   bool   `json:"encoded"`   // content是否加密
		AppName   string `json:"app_name" toml:"app_name" `
	} `json:"metadata"`
}

ServiceConf ...

type ServiceNode

type ServiceNode struct {
	AppName       string                    `json:"appName" toml:"appName"`
	Schema        string                    `json:"schema" toml:"schema"`
	IP            string                    `json:"ip" toml:"ip"`
	Port          string                    `json:"port" toml:"port"`
	Methods       []string                  `json:"methods" toml:"methods"`
	Env           string                    `json:"env" toml:"env"`
	RegInfo       RegInfo                   `json:"regInfo" toml:"regInfo"`
	Configuration *ServiceNodeConfiguration `json:"configuration" toml:"configuration"`
}

ServiceNode ...

func (*ServiceNode) Address

func (sn *ServiceNode) Address() string

Address ...

func (*ServiceNode) Key

func (sn *ServiceNode) Key() string

Key ...

type ServiceNodeConfiguration

type ServiceNodeConfiguration struct {
}

ServiceNodeConfiguration ...

type Status

type Status int

Status ...

var (
	// Unregistered ...
	Unregistered Status = 1
	// Registered ...
	Registered Status = 2
)

Jump to

Keyboard shortcuts

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