config

package
v0.0.0-...-72d948e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultEmailConfig = EmailConfig{
		Enabled:  false,
		Subject:  "kube-conformity",
		Template: "mailtemplate.html",
		Port:     24,
		From:     "no-reply@kube-conformity.com",
	}
)

Functions

func ConstructHeadersString

func ConstructHeadersString(headers map[string]string) string

Types

type Config

type Config struct {
	Interval                       time.Duration                          `yaml:"interval"`
	PodRulesLabelsFilledIn         []rules.PodRuleLabelsFilledIn          `yaml:"pod_rules_labels_filled_in"`
	PodRulesLimitsFilledIn         []rules.PodRuleLimitsFilledIn          `yaml:"pod_rules_limits_filled_in"`
	PodRulesRequestsFilledIn       []rules.PodRuleRequestsFilledIn        `yaml:"pod_rules_requests_filled_in"`
	DeploymentRuleReplicasMinimum  []rules.DeploymentRuleReplicasMinimum  `yaml:"deployment_rules_replicas_minimum"`
	StatefulSetRuleReplicasMinimum []rules.StatefulSetRuleReplicasMinimum `yaml:"stateful_set_rules_replicas_minimum"`
	EmailConfig                    EmailConfig                            `yaml:"email_config"`
}

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type EmailConfig

type EmailConfig struct {
	Enabled      bool   `yaml:"enabled"`
	To           string `yaml:"to"`
	From         string `yaml:"from"`
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	Subject      string `yaml:"subject"`
	AuthUsername string `yaml:"auth_username"`
	AuthPassword string `yaml:"auth_password"`
	AuthIdentity string `yaml:"auth_identity"`
	Template     string `yaml:"template"`
}

func (EmailConfig) ConstructEmailBody

func (emailConfig EmailConfig) ConstructEmailBody(podRuleResults []rules.PodRuleResult, deploymentResults []rules.DeploymentRuleResult) ([]byte, error)

func (EmailConfig) GetMailHeaders

func (emailConfig EmailConfig) GetMailHeaders() map[string]string

func (EmailConfig) RenderTemplate

func (emailConfig EmailConfig) RenderTemplate(podRuleResults []rules.PodRuleResult, deploymentResults []rules.DeploymentRuleResult) (string, error)

func (EmailConfig) SendMail

func (emailConfig EmailConfig) SendMail(podRuleResults []rules.PodRuleResult, deploymentRuleResults []rules.DeploymentRuleResult) error

func (*EmailConfig) UnmarshalYAML

func (emailConfig *EmailConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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