bundle

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive = "active"
)

Variables

View Source
var ErrUninitialized = errors.New("uninitialized check bundle")

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 Bundle

type Bundle struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Bundle exposes the check bundle management interface

func New

func New(client API) (*Bundle, error)

func (*Bundle) CID

func (cb *Bundle) CID() (string, error)

CID returns the check bundle cid

func (*Bundle) CheckCID

func (cb *Bundle) CheckCID(idx uint) (string, error)

CheckCID returns the check cid at the passed index within the check bundle's checks array or an error if bundle not initialized

func (*Bundle) Period

func (cb *Bundle) Period() (uint, error)

Period returns check bundle period (intetrval between when broker should make requests)

func (*Bundle) Refresh

func (cb *Bundle) Refresh() error

Refresh re-loads the check bundle using the API (sets metric states if check bundle is managed)

func (*Bundle) SubmissionURL added in v1.1.0

func (cb *Bundle) SubmissionURL() (string, error)

SubmissionURL returns the submission url (derived from mtev_reverse)

type ErrNotActive

type ErrNotActive struct {
	Err      string
	Checks   string
	BundleID string
	Status   string
}

func (*ErrNotActive) Error

func (e *ErrNotActive) Error() string

type MetricFilterFile added in v1.0.8

type MetricFilterFile struct {
	Filters [][]string `json:"metric_filters"`
}

Jump to

Keyboard shortcuts

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