Documentation
¶
Index ¶
- func UnmarshalJSON(b []byte) (influxdb.Check, error)
- type Base
- func (b *Base) ClearPrivateData()
- func (b Base) GetCRUDLog() influxdb.CRUDLog
- func (b *Base) GetDescription() string
- func (b Base) GetID() influxdb.ID
- func (b *Base) GetName() string
- func (b Base) GetOrgID() influxdb.ID
- func (b Base) GetOwnerID() influxdb.ID
- func (b Base) GetTaskID() influxdb.ID
- func (b *Base) SetDescription(description string)
- func (b *Base) SetID(id influxdb.ID)
- func (b *Base) SetName(name string)
- func (b *Base) SetOrgID(id influxdb.ID)
- func (b *Base) SetOwnerID(id influxdb.ID)
- func (b *Base) SetTaskID(id influxdb.ID)
- func (b Base) Valid(lang influxdb.FluxLanguageService) error
- type Custom
- func (c *Custom) ClearPrivateData()
- func (c Custom) GenerateFlux(lang influxdb.FluxLanguageService) (string, error)
- func (c *Custom) GetCRUDLog() influxdb.CRUDLog
- func (c *Custom) GetDescription() string
- func (c *Custom) GetID() influxdb.ID
- func (c *Custom) GetName() string
- func (c *Custom) GetOrgID() influxdb.ID
- func (c *Custom) GetOwnerID() influxdb.ID
- func (c *Custom) GetTaskID() influxdb.ID
- func (c Custom) MarshalJSON() ([]byte, error)
- func (c *Custom) SetCreatedAt(now time.Time)
- func (c *Custom) SetDescription(description string)
- func (c *Custom) SetID(id influxdb.ID)
- func (c *Custom) SetName(name string)
- func (c *Custom) SetOrgID(id influxdb.ID)
- func (c *Custom) SetOwnerID(id influxdb.ID)
- func (c *Custom) SetTaskID(id influxdb.ID)
- func (c *Custom) SetUpdatedAt(now time.Time)
- func (c Custom) Type() string
- func (c *Custom) Valid(lang influxdb.FluxLanguageService) error
- type Deadman
- type Greater
- type Lesser
- type Range
- type Threshold
- func (t Threshold) GenerateFlux(lang influxdb.FluxLanguageService) (string, error)
- func (t Threshold) GenerateFluxAST(lang influxdb.FluxLanguageService) (*ast.Package, error)
- func (t Threshold) MarshalJSON() ([]byte, error)
- func (t Threshold) Type() string
- func (t *Threshold) UnmarshalJSON(b []byte) error
- func (t Threshold) Valid(lang influxdb.FluxLanguageService) error
- type ThresholdConfig
- type ThresholdConfigBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct {
ID influxdb.ID `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
OwnerID influxdb.ID `json:"ownerID,omitempty"`
OrgID influxdb.ID `json:"orgID,omitempty"`
Query influxdb.DashboardQuery `json:"query"`
// Care should be taken to prevent TaskID from being exposed publicly.
TaskID influxdb.ID `json:"taskID,omitempty"`
// } todo: separate these
// NonCustomCheckBase will embed inside non-custom checks.
// type NonCustomCheckBase struct {
StatusMessageTemplate string `json:"statusMessageTemplate"`
Cron string `json:"cron,omitempty"`
Every *notification.Duration `json:"every,omitempty"`
// Offset represents a delay before execution.
// It gets marshalled from a string duration, i.e.: "10s" is 10 seconds
Offset *notification.Duration `json:"offset,omitempty"`
Tags []influxdb.Tag `json:"tags"`
influxdb.CRUDLog
}
Base will embed inside a check.
func (*Base) ClearPrivateData ¶
func (b *Base) ClearPrivateData()
ClearPrivateData remove any data that we don't want to be exposed publicly.
func (Base) GetCRUDLog ¶
GetCRUDLog implements influxdb.Getter interface.
func (*Base) GetDescription ¶
GetDescription implements influxdb.Getter interface.
func (Base) GetOwnerID ¶
GetOwnerID gets the ownerID associated with a Base.
func (*Base) SetDescription ¶
SetDescription implements influxdb.Updator interface.
func (*Base) SetOwnerID ¶
SetOwnerID sets the taskID for a check.
type Custom ¶
type Custom struct {
ID influxdb.ID `json:"id,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
OwnerID influxdb.ID `json:"ownerID,omitempty"`
OrgID influxdb.ID `json:"orgID,omitempty"`
Query influxdb.DashboardQuery `json:"query"`
TaskID influxdb.ID `json:"taskID,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Custom is the custom check.
func (*Custom) ClearPrivateData ¶
func (c *Custom) ClearPrivateData()
ClearPrivateData remove any data that we don't want to be exposed publicly.
func (Custom) GenerateFlux ¶
func (c Custom) GenerateFlux(lang influxdb.FluxLanguageService) (string, error)
GenerateFlux returns the check query text directly
func (*Custom) GetDescription ¶
GetDescription is GetDescription
func (*Custom) GetOwnerID ¶
GetOwnerID gets the ownerID associated with a Check.
func (Custom) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (*Custom) SetCreatedAt ¶
SetCreatedAt sets the creation time for a check
func (*Custom) SetDescription ¶
SetDescription is SetDescription
func (*Custom) SetOwnerID ¶
SetOwnerID sets the taskID for a check.
func (*Custom) SetUpdatedAt ¶
SetUpdatedAt sets the update time for a check
type Deadman ¶
type Deadman struct {
Base
TimeSince *notification.Duration `json:"timeSince,omitempty"`
StaleTime *notification.Duration `json:"staleTime,omitempty"`
// If only zero values reported since time, trigger alert.
// TODO(desa): Is this implemented in Flux?
ReportZero bool `json:"reportZero"`
Level notification.CheckLevel `json:"level"`
}
Deadman is the deadman check.
func (Deadman) GenerateFlux ¶
func (c Deadman) GenerateFlux(lang influxdb.FluxLanguageService) (string, error)
GenerateFlux returns a flux script for the Deadman provided.
func (Deadman) GenerateFluxAST ¶
GenerateFluxAST returns a flux AST for the deadman provided. If there are any errors in the flux that the user provided the function will return an error for each error found when the script is parsed.
func (Deadman) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Greater ¶
type Greater struct {
ThresholdConfigBase
Value float64 `json:"value"`
}
Greater threshold type.
func (Greater) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Lesser ¶
type Lesser struct {
ThresholdConfigBase
Value float64 `json:"value"`
}
Lesser threshold type.
func (Lesser) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Range ¶
type Range struct {
ThresholdConfigBase
Min float64 `json:"min,omitempty"`
Max float64 `json:"max,omitempty"`
Within bool `json:"within"`
}
Range threshold type.
func (Range) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Threshold ¶
type Threshold struct {
Base
Thresholds []ThresholdConfig `json:"thresholds"`
}
Threshold is the threshold check.
func (Threshold) GenerateFlux ¶
func (t Threshold) GenerateFlux(lang influxdb.FluxLanguageService) (string, error)
GenerateFlux returns a flux script for the threshold provided. If there are any errors in the flux that the user provided the function will return an error for each error found when the script is parsed.
func (Threshold) GenerateFluxAST ¶
GenerateFluxAST returns a flux AST for the threshold provided. If there are any errors in the flux that the user provided the function will return an error for each error found when the script is parsed.
func (Threshold) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (*Threshold) UnmarshalJSON ¶
UnmarshalJSON implement json.Unmarshaler interface.
type ThresholdConfig ¶
type ThresholdConfig interface {
MarshalJSON() ([]byte, error)
Valid() error
Type() string
GetLevel() notification.CheckLevel
// contains filtered or unexported methods
}
ThresholdConfig is the base of all threshold config.
type ThresholdConfigBase ¶
type ThresholdConfigBase struct {
// If true, only alert if all values meet threshold.
AllValues bool `json:"allValues"`
Level notification.CheckLevel `json:"level"`
}
ThresholdConfigBase is the base of all threshold config.
func (ThresholdConfigBase) GetLevel ¶
func (b ThresholdConfigBase) GetLevel() notification.CheckLevel
GetLevel return the check level.
func (ThresholdConfigBase) Valid ¶
func (b ThresholdConfigBase) Valid() error
Valid returns error if something is invalid.