github

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Login string `json:"login"`
}

type Assignees

type Assignees struct {
	Nodes []User `json:"nodes"`
}

type Comment

type Comment struct {
	Author    Actor     `json:"author"`
	ID        string    `json:"id"`
	Body      string    `json:"body"`
	CreatedAt time.Time `json:"createdAt"`
}

type Comments

type Comments struct {
	Nodes []Comment `json:"comment"`
}

type Data

type Data struct {
	Repository `json:"repository"`
}

func (Data) UniqueLogins

func (idata Data) UniqueLogins() []string

type GitHub

type GitHub interface {
	// RepositoryID finds a respoitory metadata based on owner and name of the
	// repository.
	RepositoryData() (Repository, error)
	// MapUsers takes all login strings used in issues and searches GitHub for
	// IDs for the logins. It returns a map of logins used as keys, and IDs used
	// as values. If ID is not found, the value is empty string.
	MapUsers([]string) (map[string]string, error)
	// Creates issues for a repository. It assumes that the repository has no
	// issues.
	WriteIssues([]Issue, Repository, map[string]string) error
}

GitHub interface contains methods that are needed for creating issues for a repository.

type Issue

type Issue struct {
	Author    Actor      `json:"author"`
	ID        string     `json:"id,omitempty"`
	Number    int        `json:"number"`
	Title     string     `json:"title"`
	Body      string     `json:"body,omitempty"`
	URL       string     `json:"url"`
	Closed    bool       `json:"closed"`
	ClosedAt  *time.Time `json:"closedAt"`
	CreatedAt time.Time  `json:"createdAt"`
	Assignees `json:"assignees,omitempty"`
	Comments  `json:"comments,omitempty"`
	Labels    `json:"labels,omitempty"`
}

type Issues

type Issues struct {
	TotalCount int     `json:"totalCount"`
	Nodes      []Issue `json:"nodes"`
}

type Label

type Label struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Labels

type Labels struct {
	Nodes []Label `json:"nodes"`
}

type Repository

type Repository struct {
	ID     string `json:"id,omitempty"`
	Labels `json:"labels"`
	Issues `json:"issues,omitempty"`
}

type User

type User struct {
	ID    string `json:"id,omitempty"`
	Login string `json:"login"`
}

type UserData

type UserData struct {
	User `json:"user"`
}

Jump to

Keyboard shortcuts

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