engine

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package engine defines interfaces each supported repository provider should implement. Includes default implementation with github.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Github

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

Github implements Interface with github API below it.

func NewGithub

func NewGithub(owner, name, basicAuthUsername, basicAuthPassword string, httpCl http.Client) (*Github, error)

NewGithub makes new instance of Github.

func (*Github) Compare

func (g *Github) Compare(ctx context.Context, fromSHA, toSHA string) (store.CommitsComparison, error)

Compare two commits by their SHA.

func (*Github) HeadCommit

func (g *Github) HeadCommit(_ context.Context) (string, error)

HeadCommit returns the alias of the oldest commit in the repository

func (*Github) ListPRsOfCommit

func (g *Github) ListPRsOfCommit(ctx context.Context, sha string) ([]store.PullRequest, error)

ListPRsOfCommit returns pull requests associated with commit by the given SHA.

func (*Github) ListTags

func (g *Github) ListTags(ctx context.Context) ([]store.Tag, error)

ListTags returns all tags of the repository.

type Interface

type Interface interface {
	// Compare returns comparison between two commits,
	// given by their SHA.
	Compare(ctx context.Context, fromSHA, toSHA string) (store.CommitsComparison, error)
	// ListPRsOfCommit returns pull/merge requests
	// associated with the commit, given by its SHA.
	ListPRsOfCommit(ctx context.Context, sha string) ([]store.PullRequest, error)
	// ListTags returns tags of the repository in descending order of creation.
	ListTags(ctx context.Context) ([]store.Tag, error)
	// HeadCommit returns the SHA or alias of the oldest commit in the repository
	HeadCommit(ctx context.Context) (string, error)
}

Interface defines methods to retrieve information about repository.

Jump to

Keyboard shortcuts

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