pkg

package
v0.38.41 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterName added in v0.11.3

func GetClusterName(config *rest.Config) string

func GetKubeconfig

func GetKubeconfig() string

func NewK8sClient

func NewK8sClient() (*kubernetes.Clientset, error)

func NewKommonsClient added in v0.17.0

func NewKommonsClient() (*kommons.Client, error)

func ParseConfig

func ParseConfig(configfile string) ([]v1.Canary, error)

ParseConfig : Read config file

Types

type Check

type Check struct {
	Key          string            `json:"key"`
	Type         string            `json:"type"`
	Name         string            `json:"name"`
	Namespace    string            `json:"namespace"`
	Labels       map[string]string `json:"labels"`
	RunnerLabels map[string]string `json:"runnerLabels"`
	CanaryName   string            `json:"canaryName"`
	Description  string            `json:"description"`
	Endpoint     string            `json:"endpoint"`
	Uptime       Uptime            `json:"uptime"`
	Latency      Latency           `json:"latency"`
	Statuses     []CheckStatus     `json:"checkStatuses" mapstructure:"-"`
	Interval     uint64            `json:"interval"`
	Schedule     string            `json:"schedule"`
	Owner        string            `json:"owner"`
	Severity     string            `json:"severity"`
	Icon         string            `json:"icon"`
	DisplayType  string            `json:"displayType"`
	CheckCanary  *v1.Canary        `json:"-"`
}

func FromV1 added in v0.33.1

func FromV1(check v1.Canary, ext external.Check, statuses ...CheckStatus) Check

func (Check) GetDescription

func (c Check) GetDescription() string

func (Check) GetName added in v0.16.0

func (c Check) GetName() string

func (Check) GetNamespace added in v0.16.0

func (c Check) GetNamespace() string

func (Check) ID added in v0.16.0

func (c Check) ID() string

func (Check) ToString added in v0.11.0

func (c Check) ToString() string

type CheckResult

type CheckResult struct {
	Start       time.Time
	Pass        bool
	Invalid     bool
	Detail      interface{}
	Data        map[string]interface{}
	Duration    int64
	Description string
	DisplayType string
	Message     string
	Error       string
	Metrics     []Metric
	// Check is the configuration
	Check  external.Check
	Canary v1.Canary
}

func Fail added in v0.32.1

func Fail(check external.Check, canary v1.Canary) *CheckResult

func SetupError added in v0.38.25

func SetupError(canary v1.Canary, err error) []*CheckResult

func Success added in v0.32.1

func Success(check external.Check, canary v1.Canary) *CheckResult

func (*CheckResult) AddData added in v0.38.4

func (result *CheckResult) AddData(data map[string]interface{}) *CheckResult

func (*CheckResult) AddDetails added in v0.38.0

func (result *CheckResult) AddDetails(detail interface{}) *CheckResult

func (*CheckResult) AddMetric added in v0.38.4

func (result *CheckResult) AddMetric(metric Metric) *CheckResult

func (*CheckResult) ErrorMessage added in v0.32.1

func (result *CheckResult) ErrorMessage(err error) *CheckResult

func (*CheckResult) Failf added in v0.38.4

func (result *CheckResult) Failf(message string, args ...interface{}) *CheckResult

func (CheckResult) GetDescription added in v0.11.4

func (result CheckResult) GetDescription() string

func (*CheckResult) GetDuration added in v0.38.19

func (result *CheckResult) GetDuration() int64

func (*CheckResult) ResultDescription added in v0.32.1

func (result *CheckResult) ResultDescription(description string) *CheckResult

func (*CheckResult) ResultMessage added in v0.32.1

func (result *CheckResult) ResultMessage(message string, args ...interface{}) *CheckResult

func (*CheckResult) StartTime added in v0.32.1

func (result *CheckResult) StartTime(start time.Time) *CheckResult

func (CheckResult) String

func (result CheckResult) String() string

func (*CheckResult) TextResults added in v0.32.1

func (result *CheckResult) TextResults(textResults bool) *CheckResult

type CheckStatus added in v0.11.0

type CheckStatus struct {
	Status   bool        `json:"status"`
	Invalid  bool        `json:"invalid"`
	Time     string      `json:"time"`
	Duration int         `json:"duration"`
	Message  string      `json:"message"`
	Error    string      `json:"error,omitempty"`
	Detail   interface{} `json:"-"`
}

func FromResult added in v0.36.0

func FromResult(result CheckResult) CheckStatus

type Checker

type Checker interface {
	CheckArgs(args map[string]interface{}) *CheckResult
}

type Checks added in v0.11.0

type Checks []Check

func (Checks) Len added in v0.11.0

func (c Checks) Len() int

func (Checks) Less added in v0.11.0

func (c Checks) Less(i, j int) bool

func (Checks) Swap added in v0.11.0

func (c Checks) Swap(i, j int)

type Config

type Config struct {
	HTTP           []v1.HTTPCheck           `yaml:"http,omitempty" json:"http,omitempty"`
	DNS            []v1.DNSCheck            `yaml:"dns,omitempty" json:"dns,omitempty"`
	ContainerdPull []v1.ContainerdPullCheck `yaml:"containerdPull,omitempty" json:"containerdPull,omitempty"`
	ContainerdPush []v1.ContainerdPushCheck `yaml:"containerdPush,omitempty" json:"containerdPush,omitempty"`
	DockerPull     []v1.DockerPullCheck     `yaml:"docker,omitempty" json:"docker,omitempty"`
	DockerPush     []v1.DockerPushCheck     `yaml:"dockerPush,omitempty" json:"dockerPush,omitempty"`
	S3             []v1.S3Check             `yaml:"s3,omitempty" json:"s3,omitempty"`
	S3Bucket       []v1.S3BucketCheck       `yaml:"s3Bucket,omitempty" json:"s3Bucket,omitempty"`
	TCP            []v1.TCPCheck            `yaml:"tcp,omitempty" json:"tcp,omitempty"`
	Pod            []v1.PodCheck            `yaml:"pod,omitempty" json:"pod,omitempty"`
	LDAP           []v1.LDAPCheck           `yaml:"ldap,omitempty" json:"ldap,omitempty"`
	ICMP           []v1.ICMPCheck           `yaml:"icmp,omitempty" json:"icmp,omitempty"`
	Postgres       []v1.PostgresCheck       `yaml:"postgres,omitempty" json:"postgres,omitempty"`
	Mssql          []v1.MssqlCheck          `yaml:"mssql,omitempty" json:"mssql,omitempty"`
	Redis          []v1.RedisCheck          `yaml:"redis,omitempty" json:"redis,omitempty"`
	Helm           []v1.HelmCheck           `yaml:"helm,omitempty" json:"helm,omitempty"`
	Namespace      []v1.NamespaceCheck      `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	Interval       metav1.Duration          `yaml:"-" json:"interval,omitempty"`
}

type Endpoint

type Endpoint struct {
	String string
}

func (Endpoint) GetEndpoint

func (e Endpoint) GetEndpoint() string

type JSONTime added in v0.11.0

type JSONTime time.Time

func (JSONTime) MarshalJSON added in v0.11.0

func (t JSONTime) MarshalJSON() ([]byte, error)

func (*JSONTime) UnmarshalJSON added in v0.11.0

func (t *JSONTime) UnmarshalJSON(b []byte) error

type Latency added in v0.37.0

type Latency struct {
	Percentile99 float64 `json:"p99,omitempty"`
	Percentile97 float64 `json:"p97,omitempty"`
	Percentile95 float64 `json:"p95,omitempty"`
	Rolling1H    float64 `json:"rolling1h"`
}

func (Latency) String added in v0.37.0

func (l Latency) String() string

type Metric

type Metric struct {
	Name   string
	Type   MetricType
	Labels map[string]string
	Value  float64
}

func (Metric) String

func (m Metric) String() string

type MetricType

type MetricType string

type URL

type URL struct {
	IP       string
	Port     int
	Host     string
	Scheme   string
	Path     string
	Username string
	Password string
	Method   string
	Headers  map[string]string
	Body     string
}

URL information

type Uptime added in v0.37.0

type Uptime struct {
	Passed int     `json:"passed"`
	Failed int     `json:"failed"`
	P100   float64 `json:"p100,omitempty"`
}

func (Uptime) String added in v0.37.0

func (u Uptime) String() string

Directories

Path Synopsis
clients
aws
gcp

Jump to

Keyboard shortcuts

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