pkg

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 NewK8sClient

func NewK8sClient() (*kubernetes.Clientset, 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"`
	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:"-"`
	CheckCanary *v1.Canary    `json:"-"`
}

func (Check) GetDescription

func (c Check) GetDescription() 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
	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"`
	SSL            []v1.SSLCheck            `yaml:"ssl,omitempty" json:"ssl,omitempty"`
	ICMP           []v1.ICMPCheck           `yaml:"icmp,omitempty" json:"icmp,omitempty"`
	Postgres       []v1.PostgresCheck       `yaml:"postgres,omitempty" json:"postgres,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 StructTemplater added in v0.11.0

type StructTemplater struct {
	Values map[string]string
}

func (StructTemplater) Struct added in v0.11.0

func (w StructTemplater) Struct(reflect.Value) error

this func is required to fulfil the reflectwalk.StructWalker interface

func (StructTemplater) StructField added in v0.11.0

func (w StructTemplater) StructField(f reflect.StructField, v reflect.Value) error

func (StructTemplater) Template added in v0.11.0

func (w StructTemplater) Template(val string) string

type URL

type URL struct {
	IP     string
	Port   int
	Host   string
	Scheme string
	Path   string
}

URL information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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