github

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCheckRun

func CreateCheckRun(
	ctx context.Context,
	client *http.Client,
	token string,
	repo *common.Repository,
	sha,
	status,
	name,
	title,
	summary string,
) (string, error)

func DeleteRef

func DeleteRef(ctx context.Context, client *http.Client, token, refNodeID string) error

func GetConfig

func GetConfig(
	ctx context.Context,
	client *http.Client,
	token string,
	repository *common.Repository,
	sha string,
) ([]byte, error)

func GetLatestBaseCommitSha

func GetLatestBaseCommitSha(ctx context.Context, client *http.Client, token string, repo *common.Repository) (string, error)

func GetPullRequestsThatAreOpenAndHaveOneOfTheseLabels

func GetPullRequestsThatAreOpenAndHaveOneOfTheseLabels(
	ctx context.Context,
	client *http.Client,
	token string,
	repository *common.Repository,
	labels []string,
) ([]common.PullRequest, error)

func MergePullRequest

func MergePullRequest(
	ctx context.Context,
	client *http.Client,
	token,
	pullRequestID,
	expectedHeadOid,
	mergeStrategy,
	commitHeadline string,
) error

func UpdateCheckRun

func UpdateCheckRun(
	ctx context.Context,
	client *http.Client,
	token string,
	repo *common.Repository,
	checkRunID,
	status,
	name,
	title,
	summary string,
) (string, error)

func UpdatePullRequest

func UpdatePullRequest(
	ctx context.Context,
	client *http.Client,
	token string,
	pullRequestID,
	expectedHeadSha string,
) error

Types

type AccessToken

type AccessToken struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

func GetAccessToken

func GetAccessToken(
	ctx context.Context,
	client *http.Client,
	appID int64,
	privateKey []byte,
	repository *common.Repository,
	installationID int64,
) (*AccessToken, error)

type GraphQLError added in v0.1.3

type GraphQLError struct {
	Type    string `json:"type"`
	Path    string `json:"path"`
	Message string `json:"message"`
}

func (GraphQLError) String added in v0.1.3

func (g GraphQLError) String() string

type GraphQLErrors added in v0.1.2

type GraphQLErrors []GraphQLError

func (GraphQLErrors) Error added in v0.1.2

func (g GraphQLErrors) Error() string

func (GraphQLErrors) GetMessages added in v0.1.3

func (g GraphQLErrors) GetMessages() string

type PullRequestDetails

type PullRequestDetails struct {
	AheadBy        int
	ApprovedBy     []string
	Author         string
	BaseRefName    string
	CheckStates    map[string]string
	HasConflicts   bool
	HeadRefID      string
	HeadRefName    string
	ID             string
	IsMergeable    bool
	Labels         []string
	LastCommitSha  string
	LastCommitTime time.Time
	State          string
	Title          string
}

func GetPullRequestDetails

func GetPullRequestDetails(
	ctx context.Context,
	client *http.Client,
	token string,
	repo *common.Repository,
	number int64,
) (*PullRequestDetails, error)

type ResponseError

type ResponseError struct {
	Message            string
	ActualStatusCode   int
	ExpectedStatusCode int
	Body               string
	NextError          error
}

func (*ResponseError) Error

func (e *ResponseError) Error() string

func (*ResponseError) MarshalZerologObject

func (e *ResponseError) MarshalZerologObject(ev *zerolog.Event)

Jump to

Keyboard shortcuts

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