plugin

package
v0.0.0-...-b8b49be Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommentMarker                            = "<!-- RELNOTE_PREDICTION -->"
	KindBugLabel                             = "kind/bug"
	TruePrediction          PredictionResult = 0.6
	PredctionResultExcluded PredictionResult = -1.0
)

Variables

This section is empty.

Functions

func HelpProvider

func HelpProvider([]config.OrgRepo) (*pluginhelp.PluginHelp, error)

HelpProvider constructs the PluginHelp for this plugin that takes into account enabled repositories. helpProvider defines the type for function that construct the PluginHelp for plugins.

Types

type Client

type Client interface {
	AddLabel(number int, label string) error
	BotUser() (*github.User, error)
	CreateComment(number int, comment string) error
	DeleteComment(number int) error
	EditComment(id int, comment string) error
	GetIssueLabels(number int) ([]github.Label, error)
	ListIssueComments(number int) ([]github.IssueComment, error)
	RemoveLabel(number int, label string) error
}

type Plugin

type Plugin interface {
	HandleIssueEvent(*github.IssueEvent) error
	HandlePullRequestEvent(*github.PullRequestEvent) error
	SetPredictor(Predictor)
	SetClient(Client)
}

func New

func New(log *logrus.Entry, ghc github.Client) Plugin

New creates a new plugin instance.

type PredictionResult

type PredictionResult float64

type Predictor

type Predictor interface {
	Predict(url, input string) (PredictionResult, error)
}

func NewPredictor

func NewPredictor(log *logrus.Entry) Predictor

NewPredictor creates a new predictor instance.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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