supervisor

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSupervisorDir = "/etc/supervisor/conf.d"

DefaultSupervisorDir ...

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir    string `json:"dir"`    // 配置中心supervisor具体配置路径
	Enable bool   `json:"enable"` // 是否开启开插件
}

Config ...

func DefaultConfig

func DefaultConfig() Config

DefaultConfig return default config

func RawConfig

func RawConfig(key string) *Config

RawConfig ...

func StdConfig

func StdConfig(key string) *Config

StdConfig 返回标准配置信息

func (*Config) Build

func (c *Config) Build() *Scanner

Build new a instance

type Program

type Program struct {
	Directory             string `ini:"directory"`
	Environment           string `ini:"environment"`
	Command               string `ini:"command"`
	User                  string `ini:"user"`
	Autostart             bool   `ini:"autostart"`
	Autorestart           bool   `ini:"autorestart"`
	Startsecs             int    `ini:"startsecs"`
	StdoutLogfile         string `ini:"stdout_logfile"`
	StdoutLogfileMaxbytes string `ini:"stdout_logfile_maxbytes"`
	StdoutLogfileBackups  int    `ini:"stdout_logfile_backups"`
	StdoutCaptureMaxbytes string `ini:"stdout_capture_maxbytes"`
	StderrLogfile         string `ini:"stderr_logfile"`
	StderrLogfileMaxbytes string `ini:"stderr_logfile_maxbytes"`
	StderrLogfileBackups  int    `ini:"stderr_logfile_backups"`
	Stopsignal            string `ini:"stopsignal"`
	Config                string `ini:"-"`
}

Program ...

type ProgramExt

type ProgramExt struct {
	Manager  string `json:"manager" toml:"manager"` // systemd|supervisor
	Status   string `json:"status" toml:"status"`
	*Program `json:"program" toml:"program"`
	Content  string `json:"content" toml:"content"`
	FileName string `json:"file_name" toml:"file_name"`
	FilePath string `json:"file_path" toml:"file_path"`
	AppName  string `json:"app_name" toml:"app_name"`
}

ProgramExt ...

func (*ProgramExt) Unwrap

func (program *ProgramExt) Unwrap() *structs.ProgramExt

Unwrap ...

type Scanner

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

Scanner supervisor sacnner

func (*Scanner) C

func (s *Scanner) C() <-chan *ProgramExt

C consume the chan program

func (*Scanner) GetStatus

func (s *Scanner) GetStatus(appName string) ([]structs.AgentConfigStatus, error)

GetStatus ...

func (*Scanner) ListPrograms

func (s *Scanner) ListPrograms() (tasks map[string]*ProgramExt, err error)

ListPrograms list the supervisor list

func (*Scanner) ProcessStatus

func (s *Scanner) ProcessStatus() (processList []structs.ProcessStatus, err error)

ProcessStatus ...

func (*Scanner) Show

func (s *Scanner) Show() map[string]interface{}

Show ...

func (*Scanner) Start

func (s *Scanner) Start() error

Start ...

Jump to

Keyboard shortcuts

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