config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 55

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFileName = ".kubewatch.yaml"

ConfigFileName stores file of config

Functions

This section is empty.

Types

type Config

type Config struct {
	Handler Handler `json:"handler"`
	//Reason   []string `json:"reason"`
	Resource Resource `json:"resource"`
	// for watching specific namespace, leave it empty for watching all.
	// this config is ignored when watching namespaces
	Namespace string `json:"namespace,omitempty"`
}

Config struct contains kubewatch configuration

func New

func New() (*Config, error)

New creates new config object

func (*Config) CheckMissingResourceEnvvars

func (c *Config) CheckMissingResourceEnvvars()

CheckMissingResourceEnvvars will read the environment for equivalent config variables to set

func (*Config) Load

func (c *Config) Load() error

Load loads configuration from config file

func (*Config) Write

func (c *Config) Write() error

type Flock added in v0.0.4

type Flock struct {
	Url string `json:"url"`
}

Flock contains flock configuration

type Handler

type Handler struct {
	Slack      Slack      `json:"slack"`
	Hipchat    Hipchat    `json:"hipchat"`
	Mattermost Mattermost `json:"mattermost"`
	Flock      Flock      `json:"flock"`
	Webhook    Webhook    `json:"webhook"`
	MSTeams    MSTeams    `json:"msteams"`
	SMTP       SMTP       `json:"smtp"`
}

Handler contains handler configuration

type Hipchat added in v0.0.4

type Hipchat struct {
	Token string `json:"token"`
	Room  string `json:"room"`
	Url   string `json:"url"`
}

Hipchat contains hipchat configuration

type MSTeams added in v0.1.0

type MSTeams struct {
	WebhookURL string `json:"webhookurl"`
}

MSTeams contains MSTeams configuration

type Mattermost added in v0.0.4

type Mattermost struct {
	Channel  string `json:"room"`
	Url      string `json:"url"`
	Username string `json:"username"`
}

Mattermost contains mattermost configuration

type Resource

type Resource struct {
	Deployment            bool `json:"deployment"`
	ReplicationController bool `json:"rc"`
	ReplicaSet            bool `json:"rs"`
	DaemonSet             bool `json:"ds"`
	Services              bool `json:"svc"`
	Pod                   bool `json:"po"`
	Job                   bool `json:"job"`
	Node                  bool `json:"node"`
	ClusterRole           bool `json:"clusterrole"`
	ServiceAccount        bool `json:"sa"`
	PersistentVolume      bool `json:"pv"`
	Namespace             bool `json:"ns"`
	Secret                bool `json:"secret"`
	ConfigMap             bool `json:"configmap"`
	Ingress               bool `json:"ing"`
}

Resource contains resource configuration

type SMTP added in v0.1.0

type SMTP struct {
	To         string            `json:"to" yaml:"to,omitempty"`
	From       string            `json:"from" yaml:"from,omitempty"`
	Hello      string            `json:"hello" yaml:"hello,omitempty"`
	Smarthost  string            `json:"smarthost" yaml:"smarthost,omitempty"`
	Subject    string            `json:"subject" yaml:"subject,omitempty"`
	Headers    map[string]string `json:"headers" yaml:"headers,omitempty"`
	Auth       SMTPAuth          `json:"auth" yaml:"auth,omitempty"`
	RequireTLS bool              `json:"requireTLS" yaml:"requireTLS"`
}

SMTP contains SMTP configuration.

type SMTPAuth added in v0.1.0

type SMTPAuth struct {
	Username string `json:"username" yaml:"username,omitempty"`
	Password string `json:"password" yaml:"password,omitempty"`
	Secret   string `json:"secret" yaml:"secret,omitempty"`
	Identity string `json:"identity" yaml:"identity,omitempty"`
}

type Slack

type Slack struct {
	Token   string `json:"token"`
	Channel string `json:"channel"`
	Title   string `json:"title"`
}

Slack contains slack configuration

type Webhook added in v0.0.4

type Webhook struct {
	Url string `json:"url"`
}

Webhook contains webhook configuration

Jump to

Keyboard shortcuts

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