commenter

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbuseRateLimitError

type AbuseRateLimitError struct {
	BackoffInSeconds int
	// contains filtered or unexported fields
}

AbuseRateLimitError return when the GitHub abuse rate limit is hit

func (AbuseRateLimitError) Error

func (e AbuseRateLimitError) Error() string

type CommentAlreadyWrittenError

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

CommentAlreadyWrittenError returned when the error can't be written as it already exists

func (CommentAlreadyWrittenError) Error

type CommentNotValidError

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

CommentNotValidError returned when the comment is for a file or line not in the pr

func (CommentNotValidError) Error

func (e CommentNotValidError) Error() string

type Commenter

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

Commenter is the main commenter struct

func NewCommenter

func NewCommenter(input ConnectorInput) (*Commenter, error)

NewCommenter creates a Commenter for updating PR with comments

func (*Commenter) WriteGeneralComment

func (c *Commenter) WriteGeneralComment(comment string) error

func (*Commenter) WriteLineComment

func (c *Commenter) WriteLineComment(file, comment string, line int) error

WriteLineComment writes a single review line on a file of the github PR

func (*Commenter) WriteMultiLineComment

func (c *Commenter) WriteMultiLineComment(file, comment string, startLine, endLine int) error

WriteMultiLineComment writes a multiline review on a file in the github PR

type ConnectorInput

type ConnectorInput struct {
	Enterprise *EnterpriseConnectorInput // Optional
	Token      string                    // Required
	Repo       string                    // Required
	Owner      string                    // Required
	PRNumber   int                       // Required
}

type EnterpriseConnectorInput

type EnterpriseConnectorInput struct {
	BaseURL   string
	UploadURL string
}

type PrDoesNotExistError

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

PrDoesNotExistError returned when the PR can't be found, either as 401 or not existing

func (PrDoesNotExistError) Error

func (e PrDoesNotExistError) Error() string

Jump to

Keyboard shortcuts

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