config

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgoCDConfig

type ArgoCDConfig struct {
	URL      string `validate:"required"`
	Projects []string
	Selector string
	BasePath string `yaml:"base-path"`
}

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

type Check

type Check struct {
	Name     string `validate:"required"`
	Labels   map[string]string
	Operator string   `validate:"oneof='and' 'or' ''"`
	Rules    []string `validate:"required,min=1"`
}

func (Check) IsAND added in v0.0.9

func (c Check) IsAND() bool

type Config

type Config struct {
	HTTP      HTTPConfig      `validate:"omitempty"`
	Providers ProvidersConfig `validate:"omitempty"`
	Groups    []Group         `validate:"dive"`
	Checks    []Check         `validate:"dive"`
	Rules     []Rule          `validate:"dive"`
	Labels    []string        `validate:"dive"`
	Interval  int
	Git       GitConfig
}

func New

func New(path string) (*Config, []byte, error)

type FileRule

type FileRule struct {
	Path        string `validate:"required"`
	Contains    *types.Regexp
	NotContains *types.Regexp `yaml:"not-contains"`
	Exists      *bool
}

type GitConfig

type GitConfig struct {
	PrivateKey PrivateKey `yaml:"private-key" validate:"omitempty"`
	BasicAuth  BasicAuth  `yaml:"basic-auth"`
}

type GitlabConfig added in v0.0.9

type GitlabConfig struct {
	URL      string `validate:"required"`
	Token    string
	Topics   []string
	Search   string
	BasePath string `yaml:"base-path"`
}

type GrepRule added in v0.0.5

type GrepRule struct {
	Path         string `validate:"required"`
	Pattern      string `validate:"required"`
	Include      string
	Recursive    bool
	Match        bool
	SkipNotFound bool `yaml:"skip-not-found"`
}

type Group

type Group struct {
	Name   string   `validate:"required"`
	Checks []string `validate:"required,min=1"`
	When   []string
}

type HTTPConfig

type HTTPConfig struct {
	ExposeConfiguration bool   `yaml:"expose-configuration"`
	Host                string `validate:"required"`
	Port                uint32 `validate:"required,gt=1024,lt=65535"`
	WriteTimeout        int    `yaml:"write-timeout" validate:"gt=-1,lt=60"`
	ReadTimeout         int    `yaml:"read-timeout" validate:"gt=-1,lt=60"`
	ReadHeaderTimeout   int    `yaml:"read-header-timeout" validate:"gt=-1,lt=60"`
	CertPath            string `yaml:"cert-path" validate:"omitempty,file"`
	KeyPath             string `yaml:"key-path" validate:"omitempty,file"`
	CacertPath          string `yaml:"ca-cert-path" validate:"omitempty,file"`
	InsecureSkipVerify  bool   `yaml:"insecure-skip-verify"`
	ClientAuthType      string `` /* 153-byte string literal not displayed */
}

type PrivateKey

type PrivateKey struct {
	Path     string
	Password string
}

type ProjectRule added in v0.0.9

type ProjectRule struct {
	Names  []string
	Labels map[string]string
	Match  *bool
}

type ProvidersConfig

type ProvidersConfig struct {
	ArgoCD ArgoCDConfig      `validate:"omitempty"`
	Static []project.Project `validate:"omitempty,dive"`
	Gitlab GitlabConfig      `validate:"omitempty"`
}

type Rule

type Rule struct {
	Name    string        `validate:"required"`
	Files   []FileRule    `validate:"dive"`
	Grep    []GrepRule    `validate:"dive"`
	Project []ProjectRule `validate:"dive"`
	Simple  *bool
}

Jump to

Keyboard shortcuts

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