validator

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Error     string `json:"error"`
	IsValid   bool   `json:"isValid"`
	Message   string `json:"message"`
	Timestamp int64  `json:"timestamp"`
}

func (Result) GithubFormat

func (r Result) GithubFormat() string

func (Result) Print

func (r Result) Print()

func (Result) String

func (r Result) String() string

func (Result) WriteToGithubOutput

func (r Result) WriteToGithubOutput()

type TimeWindow

type TimeWindow struct {
	CronExpression string        `yaml:"cronExpression"`
	Duration       time.Duration `yaml:"duration"`
	Name           string        `yaml:"name"`
	CronSchedule   cron.Schedule
}

func NewTimeWindows

func NewTimeWindows(config string) ([]*TimeWindow, error)

type Validator

type Validator struct {
	Allowed          []*TimeWindow
	Blocked          []*TimeWindow
	CommitMessage    string
	ForceValidRegexp *regexp.Regexp
}

func NewValidator

func NewValidator(allowedInput, blockedInput, forceValidRegexpInput, commitMessageInput *string) (*Validator, error)

func (*Validator) Validate

func (v *Validator) Validate(timestamp time.Time) Result

Jump to

Keyboard shortcuts

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