supervisorxmlrpc

package module
v0.0.0-...-9577969 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

supervisorxmlrpc

golang xmlrpc lib for supervisor

GoDoc Build Status

Documentation

Index

Constants

View Source
const (
	MethodReadProcessStdoutLog string = "readProcessStdoutLog"
	MethodReadProcessStderrLog string = "readProcessStderrLog"
	MethodTailProcessStdoutLog string = "tailProcessStdoutLog"
	MethodTailProcessStderrLog string = "tailProcessStderrLog"
	MethodClearProcessLogs     string = "clearProcessLogs"
	MethodClearAllProcessLogs  string = "clearAllProcessLogs"
)
View Source
const (
	MethodGetProcessInfo      string = "getProcessInfo"
	MethodGetAllProcessInfo   string = "getAllProcessInfo"
	MethodStartProcess        string = "startProcess"
	MethodStartAllProcesses   string = "startAllProcesses"
	MethodStartProcessGroup   string = "startProcessGroup"
	MethodStopProcess         string = "stopProcess"
	MethodStopAllProcesses    string = "stopAllProcesses"
	MethodStopProcessGroup    string = "stopProcessGroup"
	MethodSignalProcess       string = "signalProcess"
	MethodSignalAllProcesses  string = "signalAllProcesses"
	MethodSignalProcessGroup  string = "signalProcessGroup"
	MethodSendProcessStdin    string = "sendProcessStdin"
	MethodSendRemoteCommEvent string = "sendRemoteCommEvent"
	MethodReloadConfig        string = "reloadConfig"
	MethodAddProcessGroup     string = "addProcessGroup"
	MethodRemoveProcessGroup  string = "removeProcessGroup"
)
View Source
const (
	DefaultSupervisorMethodPrefix string = "supervisor."
	DefaultSystemMethodPrefix     string = "system."
)
View Source
const (
	MethodGetAPIVersion        string = "getAPIVersion"
	MethodGetSupervisorVersion string = "getSupervisorVersion"
	MethodGetIdentification    string = "getIdentification"
	MethodGetState             string = "getState"
	MethodGetPID               string = "getPID"
	MethodReadLog              string = "readLog"
	MethodClearLog             string = "clearLog"
	MethodShutdown             string = "shutdown"
	MethodRestart              string = "restart"
)
View Source
const (
	StateCodeShutDown   int    = -1 // SHUTDOWN: Supervisor is in the process of shutting down.
	StateCodeRestarting int    = 0  // RESTARTING: Supervisor is in the process of restarting.
	StateCodeRunning    int    = 1  // RUNNING: Supervisor is working normally.
	StateCodeFAtal      int    = 2  // FATAL: Supervisor has experienced a serious error.
	StateNameShowdown   string = "SHUTDOWN"
	StateNameRestarting string = "RESTARTING"
	StateNameRunning    string = "RUNNING"
	StateNameFatal      string = "FATAL"
)
View Source
const (
	MethodListMethods     string = "listMethods"
	MethodMethodHelp      string = "methodHelp"
	MethodMethodSignature string = "methodSignature"
	MethodMulticall       string = "multicall"
)

Variables

This section is empty.

Functions

func AddProcessGroup

func AddProcessGroup(client *Client, name string) (bool, error)

func ClearLog

func ClearLog(client *Client) (bool, error)

func ClearProcessLogs

func ClearProcessLogs(client *Client, name string) (bool, error)

func GetAPIVersion

func GetAPIVersion(client *Client) (string, error)

func GetIdentification

func GetIdentification(client *Client) (string, error)

func GetPID

func GetPID(client *Client) (int, error)

func GetSupervisorMethod

func GetSupervisorMethod(method string) string

func GetSupervisorVersion

func GetSupervisorVersion(client *Client) (string, error)

func GetSystemMethod

func GetSystemMethod(method string) string

func ListMethods

func ListMethods(client *Client) ([]string, error)

func MethodHelp

func MethodHelp(client *Client, name string) (string, error)

func MethodSignature

func MethodSignature(client *Client, name string) ([]string, error)

func Multicall

func Multicall(client *Client, calls []MulticallParams) (ret []interface{}, err error)

func ReadLog

func ReadLog(client *Client, offset, length int) (string, error)

func ReadProcessStderrLog

func ReadProcessStderrLog(client *Client, name string, offset, length int) (string, error)

func ReadProcessStdoutLog

func ReadProcessStdoutLog(client *Client, name string, offset, length int) (string, error)

func ReloadConfig

func ReloadConfig(client *Client) ([]interface{}, error)

func RemoveProcessGroup

func RemoveProcessGroup(client *Client, name string) (bool, error)

func Restart

func Restart(client *Client) (bool, error)

func SendProcessStdin

func SendProcessStdin(client *Client, name, chars string) (bool, error)

func SendRemoteCommEvent

func SendRemoteCommEvent(client *Client, name, data string) (bool, error)

func Shutdown

func Shutdown(client *Client) (bool, error)

func SignalProcess

func SignalProcess(client *Client, name, signal string) (bool, error)

func StartProcess

func StartProcess(client *Client, name string, wait bool) (bool, error)

func StopProcess

func StopProcess(client *Client, name string, wait bool) (bool, error)

func TailProcessStderrLog

func TailProcessStderrLog(client *Client, name string, offset, length int) ([]interface{}, error)

func TailProcessStdoutLog

func TailProcessStdoutLog(client *Client, name string, offset, length int) ([]interface{}, error)

Types

type Client

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

func Connect

func Connect(server string) (*Client, error)

func (*Client) AddProcessGroup

func (c *Client) AddProcessGroup(name string) (bool, error)

func (*Client) CallBool

func (c *Client) CallBool(method string, args ...interface{}) (rst bool, err error)

func (*Client) CallInt

func (c *Client) CallInt(method string, args ...interface{}) (rst int, err error)

func (*Client) CallString

func (c *Client) CallString(method string, args ...interface{}) (rst string, err error)

func (*Client) CallStringList

func (c *Client) CallStringList(method string, args ...interface{}) (rst []string, err error)

func (*Client) CallStruct

func (c *Client) CallStruct(method string, v interface{}, args ...interface{}) (err error)

func (*Client) ClearAllProcessLogs

func (c *Client) ClearAllProcessLogs() (ret []ProcessInfoReturn, err error)

func (*Client) ClearLog

func (c *Client) ClearLog() (bool, error)

func (*Client) ClearProcessLogs

func (c *Client) ClearProcessLogs(name string) (bool, error)

func (*Client) GetAPIVersion

func (c *Client) GetAPIVersion() (string, error)

func (*Client) GetAllProcessInfo

func (c *Client) GetAllProcessInfo() (ret []ProcessInfoReturn, err error)

func (*Client) GetConnect

func (c *Client) GetConnect() *xmlrpc.Client

func (*Client) GetIdentification

func (c *Client) GetIdentification() (string, error)

func (*Client) GetPID

func (c *Client) GetPID() (int, error)

func (*Client) GetProcessInfo

func (c *Client) GetProcessInfo(name string) (ret *ProcessInfoReturn, err error)

func (*Client) GetServer

func (c *Client) GetServer() string

func (*Client) GetState

func (c *Client) GetState() (ret *GetStateReturn, err error)

func (*Client) GetSupervisorVersion

func (c *Client) GetSupervisorVersion() (string, error)

func (*Client) GetTransport

func (c *Client) GetTransport() http.RoundTripper

func (*Client) ListMethods

func (c *Client) ListMethods() ([]string, error)

func (*Client) MethodHelp

func (c *Client) MethodHelp(name string) (string, error)

func (*Client) MethodSignature

func (c *Client) MethodSignature(name string) ([]string, error)

func (*Client) Multicall

func (c *Client) Multicall(calls []MulticallParams) (ret []interface{}, err error)

func (*Client) ReadLog

func (c *Client) ReadLog(offset, length int) (string, error)

func (*Client) ReadProcessStderrLog

func (c *Client) ReadProcessStderrLog(name string, offset, length int) (string, error)

func (*Client) ReadProcessStdoutLog

func (c *Client) ReadProcessStdoutLog(name string, offset, length int) (string, error)

func (*Client) ReloadConfig

func (c *Client) ReloadConfig() (ret []interface{}, err error)

func (*Client) RemoveProcessGroup

func (c *Client) RemoveProcessGroup(name string) (bool, error)

func (*Client) Restart

func (c *Client) Restart() (bool, error)

func (*Client) SendProcessStdin

func (c *Client) SendProcessStdin(name, chars string) (bool, error)

func (*Client) SendRemoteCommEvent

func (c *Client) SendRemoteCommEvent(name, data string) (bool, error)

func (*Client) SetConnect

func (c *Client) SetConnect(connect *xmlrpc.Client)

func (*Client) SetServer

func (c *Client) SetServer(server string)

func (*Client) SetTransport

func (c *Client) SetTransport(transport http.RoundTripper)

func (*Client) Shutdown

func (c *Client) Shutdown() (bool, error)

func (*Client) SignalAllProcesses

func (c *Client) SignalAllProcesses(signal string) (ret []ProcessInfoReturn, err error)

func (*Client) SignalProcess

func (c *Client) SignalProcess(name, signal string) (bool, error)

func (*Client) SignalProcessGroup

func (c *Client) SignalProcessGroup(name, signal string) (ret []ProcessInfoReturn, err error)

func (*Client) StartAllProcesses

func (c *Client) StartAllProcesses(wait bool) (ret []ProcessInfoReturn, err error)

func (*Client) StartProcess

func (c *Client) StartProcess(name string, wait bool) (bool, error)

func (*Client) StartProcessGroup

func (c *Client) StartProcessGroup(group string, wait bool) (ret []ProcessInfoReturn, err error)

func (*Client) StopAllProcesses

func (c *Client) StopAllProcesses(wait bool) (ret []ProcessInfoReturn, err error)

func (*Client) StopProcess

func (c *Client) StopProcess(name string, wait bool) (bool, error)

func (*Client) StopProcessGroup

func (c *Client) StopProcessGroup(group string, wait bool) (ret []ProcessInfoReturn, err error)

func (*Client) TailProcessStderrLog

func (c *Client) TailProcessStderrLog(name string, offset, length int) (ret []interface{}, err error)

func (*Client) TailProcessStdoutLog

func (c *Client) TailProcessStdoutLog(name string, offset, length int) (ret []interface{}, err error)

type GetStateReturn

type GetStateReturn struct {
	StateCode int    `xmlrpc:"statecode"`
	StateName string `xmlrpc:"statename"`
}

func GetState

func GetState(client *Client) (*GetStateReturn, error)

type LoggingApiInterface

type LoggingApiInterface interface {
	ReadProcessStdoutLog(string, int, int) (string, error)
	TailProcessStdoutLog(string, int, int) (string, error)
	ReadProcessStderrLog(string, int, int) ([]interface{}, error)
	TailProcessStderrLog(string, int, int) (string, error)
	ClearProcessLogs(string) (bool, error)
	ClearAllProcessLogs() ([]ProcessInfoReturn, error)
}

type MulticallParams

type MulticallParams struct {
	MethodName string        `xmlrpc:"methodName"`
	Params     []interface{} `xmlrpc:"params"`
}

type MulticallReturnFailure

type MulticallReturnFailure struct {
	FaultCode   int    `xmlrpc:"faultCode"`
	FaultString string `xmlrpc:"faultString"`
}

TODO

type ProcessApiInterface

type ProcessApiInterface interface {
	GetProcessInfo(string) (ProcessInfoReturn, error)
	GetAllProcessInfo() ([]ProcessInfoReturn, error)
	StartProcess(string, bool) (bool, error)
	StartAllProcesses(bool) ([]ProcessInfoReturn, error)
	StartProcessGroup(string, bool) ([]ProcessInfoReturn, error)
	StopProcess(string, bool) (bool, error)
	StopAllProcesses(bool) ([]ProcessInfoReturn, error)
	StopProcessGroup(string, bool) ([]ProcessInfoReturn, error)
	SignalProcess(string, string) (bool, error)
	SignalProcessGroup(string, string) ([]ProcessInfoReturn, error)
	SignalAllProcesses(string) ([]ProcessInfoReturn, error)
	SendProcessStdin(string, string) (bool, error)
	SendRemoteCommEvent(string, string) (bool, error)
	ReloadConfig() ([]interface{}, error)
	AddProcessGroup(string) (bool, error)
	RemoveProcessGroup(string) (bool, error)
}

type ProcessInfoReturn

type ProcessInfoReturn struct {
	Name          string `xmlrpc:"name"`
	Group         string `xmlrpc:"group"`
	Description   string `xmlrpc:"description"`
	Start         int    `xmlrpc:"start"`
	Stop          int    `xmlrpc:"stop"`
	Now           int    `xmlrpc:"now"`
	State         int    `xmlrpc:"state"`
	StateName     string `xmlrpc:"statename"`
	Status        int    `xmlrpc:"status"`
	SpawnErr      string `xmlrpc:"spawnerr"`
	ExitStatus    int    `xmlrpc:"exitstatus"`
	LogFile       string `xmlrpc:"logfile"`
	StdoutLogFile string `xmlrpc:"stdout_logfile"`
	StderrLogFile string `xmlrpc:"stderr_logfile"`
	Pid           int    `xmlrpc:"pid"`
}

func ClearAllProcessLogs

func ClearAllProcessLogs(client *Client) ([]ProcessInfoReturn, error)

func GetAllProcessInfo

func GetAllProcessInfo(client *Client) ([]ProcessInfoReturn, error)

func GetProcessInfo

func GetProcessInfo(client *Client, name string) (*ProcessInfoReturn, error)

func SignalAllProcesses

func SignalAllProcesses(client *Client, signal string) ([]ProcessInfoReturn, error)

func SignalProcessGroup

func SignalProcessGroup(client *Client, name, signal string) ([]ProcessInfoReturn, error)

func StartAllProcesses

func StartAllProcesses(client *Client, wait bool) ([]ProcessInfoReturn, error)

func StartProcessGroup

func StartProcessGroup(client *Client, group string, wait bool) ([]ProcessInfoReturn, error)

func StopAllProcesses

func StopAllProcesses(client *Client, wait bool) ([]ProcessInfoReturn, error)

func StopProcessGroup

func StopProcessGroup(client *Client, group string, wait bool) ([]ProcessInfoReturn, error)

type StatusApiInterface

type StatusApiInterface interface {
	GetAPIVersion() (string, error)
	GetSupervisorVersion() (string, error)
	GetIdentification() (string, error)
	GetState() (GetStateReturn, error)
	GetPID() (int, error)
	ReadLog(int, int) (string, error)
	ClearLog() (bool, error)
	Shutdown() (bool, error)
	Restart() (bool, error)
}

type SystemApiInterface

type SystemApiInterface interface {
	ListMethods() ([]string, error)
	MethodHelp(string) ([]string, error)
	MethodSignature(string) ([]string, error)
	Multicall([]MulticallParams) ([]interface{}, error)
}

Jump to

Keyboard shortcuts

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