reporter

package
v0.1.0-alpha.28 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package reporter provides check result reporting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

type GitHub struct {
	// contains filtered or unexported fields
}

GitHub is a reporter that summarizes policy statuses as GitHub statuses.

func NewGitHubReporter

func NewGitHubReporter() (*GitHub, error)

NewGitHubReporter returns a reporter that posts policy checks as status checks on a pull request.

func (*GitHub) SetStatus

func (gh *GitHub) SetStatus(state, policy, check, message string) error

SetStatus sets the status of a GitHub check.

Valid statuses are "error", "failure", "pending", "success".

type Noop

type Noop struct{}

Noop is a reporter that does nothing.

func (*Noop) SetStatus

func (n *Noop) SetStatus(_, _, _, _ string) error

SetStatus is a noop func.

type Reporter

type Reporter interface {
	SetStatus(string, string, string, string) error
}

Reporter describes a hook for sending summarized results to a remote API.

Jump to

Keyboard shortcuts

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