forge

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSourceFileOnly = errors.New("source is for files only")
)

Functions

This section is empty.

Types

type Commit

type Commit struct {
	Author    User
	Message   string
	SHA       string
	URL       string
	Time      time.Time
	Additions int
	Deletions int
	Verified  bool
}

Commit is a git commit from a forge API

type File added in v0.0.2

type File struct {
	Contents string
	URL      string
}

File is a forge file

type GitHub

type GitHub struct {
	Client *github.Client
}

GitHub is a forge implementation for https://github.com

func (*GitHub) Commit

func (g *GitHub) Commit(sha string) (*Commit, error)

Commit returns a Commit from GitHub

func (*GitHub) File added in v0.0.2

func (g *GitHub) File(path, branch string) (*File, error)

File returns a File from GitHub

func (*GitHub) Image

func (g *GitHub) Image() string

Image returns the Gitea image on GitHub

func (*GitHub) Issue

func (g *GitHub) Issue(num int) (*Issue, error)

Issue returns an Issue from GitHub

func (g *GitHub) ReplaceIssueLinks(in string) string

ReplaceIssueLinks replaces issue short-links with markdown

type Gitea

type Gitea struct {
	Client *gitea.Client
}

Gitea is a forge implementation for https://gitea.com

func (*Gitea) Commit

func (g *Gitea) Commit(sha string) (*Commit, error)

Commit returns a Commit from Gitea

func (*Gitea) File added in v0.0.2

func (g *Gitea) File(path, branch string) (*File, error)

File returns a File from Gitea

func (*Gitea) Image

func (g *Gitea) Image() string

Image returns the Gitea image on GitHub

func (*Gitea) Issue

func (g *Gitea) Issue(num int) (*Issue, error)

Issue returns an Issue from Gitea

func (g *Gitea) ReplaceIssueLinks(in string) string

ReplaceIssueLinks replaces issue short-links with markdown

type Issue

type Issue struct {
	User        User
	Title       string
	URL         string
	Body        string
	Labels      []string
	State       string
	Created     time.Time
	Closed      time.Time
	Comments    int
	PullRequest *PullRequest
}

Issue is a forge issue

type PullRequest added in v0.0.5

type PullRequest struct {
	CanMerge bool
	Base     string
	Head     string
	Diff     string
	Patch    string
}

PullRequest is a forge pull request

type User

type User struct {
	Username string
	URL      string
	Image    string
}

User is a forge user

Jump to

Keyboard shortcuts

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