engine

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 23 Imported by: 3

Documentation

Overview

Package engine provides implementations of the git engine client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gitlab

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

Gitlab implements Interface for Gitlab.

func NewGitlab

func NewGitlab(token, baseURL, version string) (*Gitlab, error)

NewGitlab returns a new Gitlab service.

func (*Gitlab) Approve added in v0.17.0

func (g *Gitlab) Approve(ctx context.Context, projectID string, number int) error

Approve approves a pull request.

func (*Gitlab) GetCurrentUser

func (g *Gitlab) GetCurrentUser(ctx context.Context) (git.User, error)

GetCurrentUser returns the current user.

func (*Gitlab) ListPullRequests

func (g *Gitlab) ListPullRequests(ctx context.Context, req ListPRsRequest) ([]git.PullRequest, error)

ListPullRequests lists pull requests.

type Interface

type Interface interface {
	// ListPullRequests lists pull requests.
	ListPullRequests(ctx context.Context, req ListPRsRequest) ([]git.PullRequest, error)
	// GetCurrentUser returns the current user.
	GetCurrentUser(ctx context.Context) (git.User, error)
	// Approve approves the pull request.
	Approve(ctx context.Context, projectID string, number int) error
}

Interface defines methods each git engine client should implement.

type InterfaceWithTracing

type InterfaceWithTracing struct {
	Interface
	// contains filtered or unexported fields
}

InterfaceWithTracing implements Interface interface instrumented with opentracing spans

func NewInterfaceWithTracing

func NewInterfaceWithTracing(base Interface, instance string, spanDecorator ...func(span trace.Span, params, results map[string]interface{})) InterfaceWithTracing

NewInterfaceWithTracing returns InterfaceWithTracing

func (InterfaceWithTracing) Approve added in v0.17.0

func (_d InterfaceWithTracing) Approve(ctx context.Context, projectID string, number int) (err error)

Approve implements Interface

func (InterfaceWithTracing) GetCurrentUser

func (_d InterfaceWithTracing) GetCurrentUser(ctx context.Context) (u1 git.User, err error)

GetCurrentUser implements Interface

func (InterfaceWithTracing) ListPullRequests

func (_d InterfaceWithTracing) ListPullRequests(ctx context.Context, req ListPRsRequest) (pa1 []git.PullRequest, err error)

ListPullRequests implements Interface

type ListPRsRequest

type ListPRsRequest struct {
	State      git.State
	Labels     misc.Filter[string]
	Sort       misc.Sort
	Pagination misc.Pagination
}

ListPRsRequest is a request to list pull requests. Bools with pointers are used to specify whether to include (true) or exclude (false) pull requests with a specific state. If a pointer is nil, pull requests with the corresponding state are not filtered.

Jump to

Keyboard shortcuts

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