client

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeepAlive

type KeepAlive struct {
	Handler    string    `json:"handler,omitempty"`
	Handlers   *[]string `json:"handlers,omitempty"`
	Thresholds *struct {
		Warning  int `json:"warning,omitempty"`
		Critical int `json:"critical,omitempty"`
	} `json:"thresholds,omitempty"`
}

type KeepAliveResponse

type KeepAliveResponse struct {
	ClientInfo    SensuClientInfo `json:"-"`
	KeepAliveConf KeepAlive       `json:"-"`
	Timestamp     int64           `json:"timestamp"`
	Version       string          `json:"version"`
}

func (*KeepAliveResponse) Marshal

func (k *KeepAliveResponse) Marshal() ([]byte, error)

Marshal collects and flattens client & keepalive data and converts to []byte

type SensuClient

type SensuClient struct {
	Config    SensuConfig
	Transport transport.Transport
}

func NewSensuClient

func NewSensuClient(confFile string) (SensuClient, error)

NewSensuClient create a new client based on the confFile

func (*SensuClient) Deregister

func (c *SensuClient) Deregister(client string) error

Deregister remove a client (or source for proxy clients) in sensu via the http api.

func (*SensuClient) PostCheckResult

func (c *SensuClient) PostCheckResult(result check.CheckResult) error

PostCheckResult send out a check result to rabbitmq @todo buffer sending? This might be bad as timestamps & keepalives could be affected

func (*SensuClient) Start

func (c *SensuClient) Start(stopCh chan struct{})

Start starts the client & underlying transport

func (*SensuClient) StartKeepalive

func (c *SensuClient) StartKeepalive(stopCh chan struct{})

StartKeepalive starts the keepalive heartbeats for sens8 itself which registers it in sensu

type SensuClientConfig

type SensuClientConfig struct {
	SensuClientInfo
	Keepalive KeepAlive `json:"keepalive,omitempty"`
}

type SensuClientInfo

type SensuClientInfo struct {
	Name           string             `json:"name"`
	Address        string             `json:"address"`
	Subscriptions  []string           `json:"subscriptions"`
	Deregister     *bool              `json:"deregister"`
	Deregistration *SensuRegistration `json:"deregistration"`
	Registration   *SensuRegistration `json:"registration"`
	// contains filtered or unexported fields
}

type SensuConfig

type SensuConfig struct {
	RawClient         map[string]interface{}      `json:"client,omitempty"`
	ClientConfig      SensuClientConfig           `json:"-"`
	RabbitMQTransport []*rabbitmq.TransportConfig `json:"rabbitmq,omitempty"`
	Defaults          map[string]interface{}      `json:"defaults,omitempty"`
}

type SensuRegistration

type SensuRegistration struct {
	Handler string `json:"handler"`
}

Jump to

Keyboard shortcuts

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