ghissue

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 7 Imported by: 0

README

AtomicGo | ghissue

Latest Release Tests Coverage Unit test count Issues


Get The Module | Documentation | Contributing | Code of Conduct


AtomicGo


-----------------------------------------------------------------------------------------------------

go get atomicgo.dev/ghissue


-----------------------------------------------------------------------------------------------------

Description

Package ghissue enables your users to submit issues to GitHub directly.

Demo Video

Example:

repo := ghissue.NewRepository("atomicgo", "ghissue")
// [...]
err := errors.New("This is an error")
repo.CreateErrorReport(err) // Only creates an error report if the error is not nil

Usage

var ErrOpenBrowser = errors.New("failed to open browser")

ErrOpenBrowser is the error returned when opening the browser fails.

type Issue
type Issue struct {
	Repository Repository
	Title      string
	Body       string
}

Issue is a GitHub issue.

func NewIssue
func NewIssue(repo Repository, title, body string) Issue

NewIssue creates a new issue.

func (Issue) GetCreateURL
func (issue Issue) GetCreateURL() string

GetCreateURL returns the URL to create an issue.

func (Issue) Open
func (issue Issue) Open() error

Open opens the "create issue" menu on GitHub in the browser.

type Repository
type Repository struct {
	Owner string
	Name  string
}

Repository is a GitHub repository.

func NewRepository
func NewRepository(owner, name string) Repository

NewRepository creates a new Repository from an owner and repository name.

func (Repository) CreateErrorReport
func (repo Repository) CreateErrorReport(err error) error

CreateErrorReport creates a new issue on GitHub with a detailed error report including the stack trace.

Example:

		repo := ghissue.NewRepository("atomicgo", "ghissue")
     // [...]
     err := errors.New("This is an error")
		repo.CreateErrorReport(err)
func (Repository) NewIssue
func (repo Repository) NewIssue(title, body string) Issue

NewIssue creates a new issue with a title and body.

func (Repository) String
func (repo Repository) String() string

String returns the string representation of the repository.


AtomicGo.dev  ·  with ❤️ by @MarvinJWendt | MarvinJWendt.com

Documentation

Overview

Package ghissue enables your users to submit issues to GitHub directly.

![Demo Video](https://raw.githubusercontent.com/atomicgo/ghissue/main/demo.gif)

Example:

repo := ghissue.NewRepository("atomicgo", "ghissue")
// [...]
err := errors.New("This is an error")
repo.CreateErrorReport(err) // Only creates an error report if the error is not nil

Index

Constants

This section is empty.

Variables

View Source
var ErrOpenBrowser = errors.New("failed to open browser")

ErrOpenBrowser is the error returned when opening the browser fails.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	Repository Repository
	Title      string
	Body       string
}

Issue is a GitHub issue.

func NewIssue

func NewIssue(repo Repository, title, body string) Issue

NewIssue creates a new issue.

func (Issue) GetCreateURL

func (issue Issue) GetCreateURL() string

GetCreateURL returns the URL to create an issue.

func (Issue) Open

func (issue Issue) Open() error

Open opens the "create issue" menu on GitHub in the browser.

type Repository

type Repository struct {
	Owner string
	Name  string
}

Repository is a GitHub repository.

func NewRepository

func NewRepository(owner, name string) Repository

NewRepository creates a new Repository from an owner and repository name.

func (Repository) CreateErrorReport

func (repo Repository) CreateErrorReport(err error) error

CreateErrorReport creates a new issue on GitHub with a detailed error report including the stack trace.

Example:

		repo := ghissue.NewRepository("atomicgo", "ghissue")
     // [...]
     err := errors.New("This is an error")
		repo.CreateErrorReport(err)

func (Repository) NewIssue

func (repo Repository) NewIssue(title, body string) Issue

NewIssue creates a new issue with a title and body.

func (Repository) String

func (repo Repository) String() string

String returns the string representation of the repository.

Jump to

Keyboard shortcuts

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