event

package
v0.0.0-...-031edd7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParseHeader  = errors.New("解析Header失败")
	ErrParsePayload = errors.New("解析Payload失败")
)

Functions

This section is empty.

Types

type Fields

type Fields map[string]string

Fields

type Header struct {
	Ver        string
	Server     string
	Serial     int
	Pool       string
	PoolSerial int
	EventName  string // 事件名称
	Len        int    // Payload长度
}

Header Supervisord触发事件时会先发送Header,根据Header中len字段去读取Payload

func ParseHeader

func ParseHeader(header string) (*Header, error)

type Message

type Message struct {
	Header  *Header
	Payload *Payload
}

Message 消息格式

func (*Message) String

func (msg *Message) String() string

type Payload

type Payload struct {
	Ip          string
	ProcessName string // 进程名称
	GroupName   string // 进程组名称
	FromState   string
	Expected    int
	Pid         int
}

Payload

func ParsePayload

func ParsePayload(payload string) (*Payload, error)

Jump to

Keyboard shortcuts

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