Documentation ¶
Overview ¶
Package check handles check and broker management
Index ¶
- Constants
- type API
- type Check
- func (c *Check) CheckMeta() (*Meta, error)
- func (c *Check) CheckPeriod() (uint, error)
- func (c *Check) EnableNewMetrics(m *cgm.Metrics) error
- func (c *Check) FetchBrokerConfig() error
- func (c *Check) FetchCheckConfig() error
- func (c *Check) FindPrimaryBrokerInstance(cfgs *ReverseConfigs) (string, error)
- func (c *Check) GetReverseConfigs() (*ReverseConfigs, error)
- func (c *Check) RefreshReverseConfig() error
- type ErrInvalidOwner
- type ErrNoOwnerFound
- type ErrNotActive
- type Meta
- type ReverseConfig
- type ReverseConfigs
Constants ¶
const ( StatusActive = "active" PrimaryCheckIndex = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { CreateCheckBundle(cfg *apiclient.CheckBundle) (*apiclient.CheckBundle, error) FetchBroker(cid apiclient.CIDType) (*apiclient.Broker, error) FetchBrokers() (*[]apiclient.Broker, error) FetchCheck(cid apiclient.CIDType) (*apiclient.Check, error) FetchCheckBundle(cid apiclient.CIDType) (*apiclient.CheckBundle, error) FetchCheckBundleMetrics(cid apiclient.CIDType) (*apiclient.CheckBundleMetrics, error) Get(url string) ([]byte, error) SearchCheckBundles(searchCriteria *apiclient.SearchQueryType, filterCriteria *apiclient.SearchFilterType) (*[]apiclient.CheckBundle, error) UpdateCheckBundle(cfg *apiclient.CheckBundle) (*apiclient.CheckBundle, error) UpdateCheckBundleMetrics(cfg *apiclient.CheckBundleMetrics) (*apiclient.CheckBundleMetrics, error) }
API interface abstraction of circonus api (for mocking)
type Check ¶
Check exposes the check bundle management interface
func (*Check) CheckMeta ¶ added in v0.16.1
CheckMeta returns check id, check bundle id, and check uuid
func (*Check) CheckPeriod ¶ added in v1.0.0
CheckPeriod returns check bundle period (intetrval between when broker should make request)
func (*Check) EnableNewMetrics ¶
EnableNewMetrics updates the check bundle enabling any new metrics
func (*Check) FetchBrokerConfig ¶ added in v1.0.0
FetchBrokerConfig re-loads the broker using the API
func (*Check) FetchCheckConfig ¶ added in v1.0.0
FetchCheckConfig re-loads the check using the API
func (*Check) FindPrimaryBrokerInstance ¶ added in v1.0.0
func (c *Check) FindPrimaryBrokerInstance(cfgs *ReverseConfigs) (string, error)
FindPrimaryBrokerInstance will walk through reverse urls to locate the instance in a broker cluster which is the current check owner. Returns the instance cn or error.
func (*Check) GetReverseConfigs ¶ added in v1.0.0
func (c *Check) GetReverseConfigs() (*ReverseConfigs, error)
GetReverseConfigs returns the reverse connection configuration(s) to use for the check
func (*Check) RefreshReverseConfig ¶ added in v1.0.0
RefreshReverseConfig refreshes the check, broker and broker tls configurations
type ErrInvalidOwner ¶ added in v1.0.0
func (*ErrInvalidOwner) Error ¶ added in v1.0.0
func (e *ErrInvalidOwner) Error() string
type ErrNoOwnerFound ¶ added in v1.0.0
func (*ErrNoOwnerFound) Error ¶ added in v1.0.0
func (e *ErrNoOwnerFound) Error() string
type ErrNotActive ¶ added in v1.0.0
func (*ErrNotActive) Error ¶ added in v1.0.0
func (e *ErrNotActive) Error() string
type ReverseConfig ¶
type ReverseConfig struct { CN string BrokerAddr *net.TCPAddr BrokerID string ReverseURL *url.URL TLSConfig *tls.Config }
ReverseConfig contains the reverse configuration for the check
type ReverseConfigs ¶ added in v1.0.0
type ReverseConfigs map[string]ReverseConfig