config

package
v0.0.0-...-c34a4ac Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintDefaultConfig

func PrintDefaultConfig()

Types

type Common

type Common struct {
	StateFile              string `yaml:"state_file"`
	HistoryPastLimitString string `yaml:"history_limit"`
	LogLevel               string `yaml:"log_level"`
	LeaksFile              string `yaml:"leaks_file"`
	ScanIntervalString     string `yaml:"scan_interval"`
	PatternsPath           string `yaml:"patterns_path"`
	FiltresPath            string `yaml:"filters_path"`
	Workers                int    `yaml:"workers"`
	HistoryPastLimit       time.Time
	ScanInterval           time.Duration
}

type Config

type Config struct {
	Common   *Common   `yaml:"common"`
	Inspect  []Inspect `yaml:"inspect"`
	Patterns []Pattern `yaml:"patterns"`
	Filters  []Pattern `yaml:"filters"`
	SMTP     *SMTP     `yaml:"smtp"`
	WebHook  *WebHook  `yaml:"webhook"`
}

func LoadConfig

func LoadConfig(configLocation string) (*Config, error)

type Inspect

type Inspect struct {
	Type       string   `yaml:"type"`
	Paths      []string `yaml:"paths"`
	URL        string   `yaml:"url"`
	Token      string   `yaml:"token"`
	TrimPrefix string   `yaml:"trim_prefix"`
	TrimSuffix string   `yaml:"trim_suffix"`
	WorkDir    string   `yaml:"work_dir"`
	Users      []string `yaml:"users"`
	Repos      []string `yaml:"repos"`
	Orgs       []string `yaml:"orgs"`
}

type Pattern

type Pattern struct {
	Name    string `yaml:"name"`
	File    string `yaml:"file"`
	Content string `yaml:"content"`
}

type SMTP

type SMTP struct {
	Enable       bool   `yaml:"enable"`
	From         string `yaml:"mail_from"`
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	TLS          bool   `yaml:"tls"`
	Username     string `yaml:"username"`
	Password     string `yaml:"password"`
	Recipient    string `yaml:"recipient"`
	SentToAuthor bool   `yaml:"sent_to_autor"`
	Delay        string `yaml:"delay"`
}

type WebHook

type WebHook struct {
	Enable  bool              `yaml:"enable"`
	Method  string            `yaml:"method"`
	URL     string            `yaml:"url"`
	Headers map[string]string `yaml:"headers"`
}

Jump to

Keyboard shortcuts

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