github

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CheckStatusCompleted represents a completed check
	CheckStatusCompleted CheckStatus = "completed"
	// CheckStatusInProgress represents a currently running check
	CheckStatusInProgress CheckStatus = "in_progress"

	// CheckConclusionSuccess means the check was successful
	CheckConclusionSuccess CheckConclusion = "success"
	// CheckConclusionFailure means the check failed
	CheckConclusionFailure CheckConclusion = "failure"
	// CheckConclusionNeutral means the check completed with info, but did not fail
	CheckConclusionNeutral CheckConclusion = "neutral"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider interface {
	GetToken(r Repo, perms map[string]string) (string, error)
}

AuthProvider handles getting a GitHub token for the given permissions

func NewAuthProvider

func NewAuthProvider(c ConfigProvider) AuthProvider

NewAuthProvider creates an auth provider from the given environment

type CheckClient

type CheckClient interface {
	CreateCheck(CheckRun) error
}

CheckClient is an interface to GitHub's API

func NewCheckClient

func NewCheckClient(token string, repo Repo) CheckClient

NewCheckClient creates a GitHub API client for creating checks

type CheckConclusion

type CheckConclusion string

CheckConclusion represents the conclusion of a check (success, failure)

type CheckRun

type CheckRun struct {
	Name       string          `json:"name"`
	HeadSHA    string          `json:"head_sha"`
	Status     CheckStatus     `json:"status"`
	Conclusion CheckConclusion `json:"conclusion,omitempty"`
	DetailsURL string          `json:"details_url,omitempty"`
	Output     parser.Result   `json:"output,omitempty"`
}

CheckRun represents the results (intermediate or complete) of a check run

type CheckStatus

type CheckStatus string

CheckStatus represents the status of a check (ongoing, completed)

type ConfigProvider

type ConfigProvider interface {
	GetString(string) string
}

ConfigProvider is an interface over *viper.Viper

type Repo

type Repo interface {
	Name() string
	Owner() string
}

Repo is a general interface for a GitHub repository

Jump to

Keyboard shortcuts

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