ghservice

package
v0.0.0-...-a196a74 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ConfigHome = ".ike-prow/"

ConfigHome is a directory to keep prow configuration files

Variables

This section is empty.

Functions

func NewRepositoryChangeForPR

func NewRepositoryChangeForPR(pr *gogh.PullRequest) scm.RepositoryChange

NewRepositoryChangeForPR creates a RepositoryChange instance for hte given pull request

Types

type CommentService

type CommentService struct {
	Client ghclient.Client
	Issue  scm.RepositoryIssue
}

CommentService is a struct managing issue or pull request comments

func NewCommentService

func NewCommentService(client ghclient.Client, comment *gogh.IssueCommentEvent) *CommentService

NewCommentService creates an instance of GitHub CommentService with information retrieved from the given IssueCommentEvents

func (*CommentService) AddComment

func (s *CommentService) AddComment(commentMsg *string) error

AddComment adds a comment message to the issue

func (*CommentService) EditComment

func (s *CommentService) EditComment(commentID int64, commentMsg *string) error

EditComment edits an already existing comment message

type IssueCommentsLazyLoader

type IssueCommentsLazyLoader struct {
	Client ghclient.Client
	Issue  scm.RepositoryIssue
	// contains filtered or unexported fields
}

IssueCommentsLazyLoader represents a lazy loader of issue comments - is loaded when needed and only once

func NewIssueCommentsLazyLoader

func NewIssueCommentsLazyLoader(client ghclient.Client, pr *gogh.PullRequest) *IssueCommentsLazyLoader

NewIssueCommentsLazyLoader creates a new instance of IssueCommentsLazyLoader with information retrieved from the given pull request

func (*IssueCommentsLazyLoader) Load

Load loads list of issue comments - if not already retrieved from GH then it gets it and stores, then it uses this stored instance for every future call

type LoadableConfig

type LoadableConfig struct {
	PluginName string
	Change     scm.RepositoryChange
	BaseConfig *config.PluginConfiguration
}

LoadableConfig holds information about the plugin name, repository change and pointer to base config

func (*LoadableConfig) Sources

func (l *LoadableConfig) Sources() []config.Source

Sources provides default loading strategies for a plugin looking it up in the .ike-prow directory of the repository for a given revision. Two files are expected to be found there plugin-name.yml or plugin-name.yaml (in that order)

type PullRequestLazyLoader

type PullRequestLazyLoader struct {
	Client ghclient.Client
	RepoOwner,
	RepoName string
	Number int
	// contains filtered or unexported fields
}

PullRequestLazyLoader represents a lazy loader of pull request information - is loaded when needed and only once

func NewPullRequestLazyLoaderFromComment

func NewPullRequestLazyLoaderFromComment(client ghclient.Client, comment *gogh.IssueCommentEvent) *PullRequestLazyLoader

NewPullRequestLazyLoaderFromComment creates a new instance of PullRequestLazyLoader with information retrieved from the given IssueCommentEvent

func NewPullRequestLazyLoaderWithPR

func NewPullRequestLazyLoaderWithPR(client ghclient.Client, pullRequest *gogh.PullRequest) *PullRequestLazyLoader

NewPullRequestLazyLoaderWithPR creates a new instance of PullRequestLazyLoader with the given already loaded gogh.PullRequest instance

func (*PullRequestLazyLoader) Load

Load loads information about pull request - if not already retrieved from GH then it gets it and stores, then it uses this stored instance

type RawFileService

type RawFileService struct {
	Change scm.RepositoryChange
}

RawFileService encapsulates retrieval of files in the given GitHub repository change

func (*RawFileService) GetRawFileURL

func (s *RawFileService) GetRawFileURL(path string) string

GetRawFileURL creates a url to the given path related to the GitHub repository change

func (*RawFileService) GetRelativePath

func (s *RawFileService) GetRelativePath(path string, useBlob bool) string

GetRelativePath creates repository specific relative path

Jump to

Keyboard shortcuts

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