Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface {
// Trigger hooks
Trigger(evt *Event) error
// Serves events now
Serve() error
// Attach a job life cycle controller
Attach(ctl lcm.Controller)
}
Agent is designed to handle the hook events with reasonable numbers of concurrent threads
type Client ¶
type Client interface {
// SendEvent send the event to the subscribed parties
SendEvent(evt *Event) error
}
Client for handling the hook events
type Event ¶
type Event struct {
URL string `json:"url"`
Message string `json:"message"` // meaningful text for event
Data *job.StatusChange `json:"data"` // generic data
Timestamp int64 `json:"timestamp"` // Use as time threshold of discarding the event (unit: second)
}
Event contains the hook URL and the data
func (*Event) Deserialize ¶
Deserialize the bytes to event
Click to show internal directories.
Click to hide internal directories.