checker

package
v0.0.0-...-674ee69 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InconclusiveResult = CheckResult{
	Pass:       false,
	Confidence: 0,
}

Functions

func Bool2int

func Bool2int(b bool) int

Types

type CheckFn

type CheckFn func(Checker) CheckResult

func MultiCheck

func MultiCheck(fns ...CheckFn) CheckFn

type CheckResult

type CheckResult struct {
	Pass        bool
	Details     []string
	Confidence  int
	ShouldRetry bool
	Error       error
}

func ProportionalResult

func ProportionalResult(numerator int, denominator int, threshold float32) CheckResult

func RetryResult

func RetryResult(err error) CheckResult

type Checker

type Checker struct {
	Ctx         context.Context
	Client      *github.Client
	HttpClient  *http.Client
	Owner, Repo string
	Logf        func(s string, f ...interface{})
}

type NamedCheck

type NamedCheck struct {
	Name string
	Fn   CheckFn
}

type Runner

type Runner struct {
	Checker Checker
}

func (*Runner) Run

func (r *Runner) Run(f CheckFn) CheckResult

Jump to

Keyboard shortcuts

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