pkg

package
v0.32.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RunnerLabels map[string]string = make(map[string]string)

Functions

func ApplyTemplates

func ApplyTemplates(config v1.CanarySpec) v1.CanarySpec

func GetClusterName added in v0.11.3

func GetClusterName(config *rest.Config) string

func GetKubeconfig

func GetKubeconfig() string

func LoadLabels added in v0.32.0

func LoadLabels(path string) map[string]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.CanarySpec

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       string            `json:"uptime"`
	Latency      string            `json:"latency"`
	Statuses     []CheckStatus     `json:"checkStatuses" mapstructure:"-"`
	Interval     uint64            `json:"interval"`
	Schedule     string            `json:"schedule"`
	Owner        string            `json:"owner"`
	Severity     string            `json:"severity"`
	IconURL      string            `json:"iconURL"`
	DisplayType  string            `json:"displayType"`
	CheckCanary  *v1.Canary        `json:"-"`
}

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 {
	Pass        bool
	Invalid     bool
	Duration    int64
	Description string
	DisplayType string
	Message     string
	Metrics     []Metric
	// Check is the configuration
	Check external.Check
}

func (CheckResult) GetDescription added in v0.11.4

func (c CheckResult) GetDescription() string

func (CheckResult) String

func (c CheckResult) String() string

type CheckStatus added in v0.11.0

type CheckStatus struct {
	Status   bool     `json:"status"`
	Invalid  bool     `json:"invalid"`
	Time     JSONTime `json:"time"`
	Duration int      `json:"duration"`
	Message  string   `json:"message"`
}

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 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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