Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSendMessage = errors.New("error sending message to the agent")
ErrSendMessage is returned by the ShutDown function when there were any error trying to send a message to the agent.
Functions ¶
This section is empty.
Types ¶
type Pusher ¶
type Pusher struct {
// contains filtered or unexported fields
}
Pusher communicate state changes to agent by performing http calls
func NewPusher ¶
func NewPusher(config PusherConfig, checkID string, logger *log.Entry) *Pusher
NewPusher Creates a new push component that can be used to inform the agent state changes of the check by using http rest calls.
func (*Pusher) Shutdown ¶
Shutdown signals the pusher to stop accepting messages and wait for the pending messages to be send.
func (*Pusher) UpdateState ¶
func (p *Pusher) UpdateState(state interface{})
UpdateState sends a update state message to an agent by calling the rest api the agent must expose. Note that the function doesn't return any kind of error, that's because a Pusher is expected to handle error in sending push messages by it's own. WARN: Calling this method after calling ShutDown method will cause the program to panic.
type PusherConfig ¶
type PusherConfig struct { AgentAddr string `toml:"AgentEndpoint"` BufferLen int `toml:"BufferLen"` }
PusherConfig holds the configuration needed by a RestPusher to send push notifications to the agent