host

package
v0.0.0-...-3d4bac1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRepo

type BaseRepo struct {
	Host    Host
	ID      int
	Owner   string
	Name    string
	Private bool
}

BaseRepo is an implementation of Repo, should probably be only used for testing

func (*BaseRepo) GetHost

func (b *BaseRepo) GetHost() Host

GetHost returns the repo's host

func (*BaseRepo) GetID

func (b *BaseRepo) GetID() string

GetID returns the repo's ID

func (*BaseRepo) GetName

func (b *BaseRepo) GetName() string

GetName returns the repo's name

func (*BaseRepo) GetOwner

func (b *BaseRepo) GetOwner() string

GetOwner returns the repo's owner

func (*BaseRepo) IsPrivate

func (b *BaseRepo) IsPrivate() bool

IsPrivate indicates whether the repo is private of not

func (*BaseRepo) String

func (b *BaseRepo) String() string

type Host

type Host string

Host denotes supported hosts

const (
	// HostGitHub is github.com
	HostGitHub Host = "GITHUB"
	// HostGitLab is gitlab.com
	HostGitLab Host = "GITLAB"
	// HostBitbucket is bitbucket.org
	HostBitbucket Host = "BITBUCKET"
)

type Hosted

type Hosted interface {
	GetID() string
	GetHost() Host
}

Hosted defines a common interface for all host struct types

type Installation

type Installation interface {
	Hosted
	fmt.Stringer
}

Installation represents an app installation on a code host

func InstallationFromGitHub

func InstallationFromGitHub(i *github.Installation) Installation

InstallationFromGitHub wraps a github installation in an Installation

type Item

type Item struct {
	GitHubID int
	Number   int

	Author string
	Opened time.Time
	Closed *time.Time

	Type      ItemType
	Title     string
	Body      string
	Labels    []string
	Reactions ItemReactions

	Details map[string]interface{}
}

Item is a GitHub item due for indexing TODO: this needs to be better

func (*Item) WithGitHubLabels

func (i *Item) WithGitHubLabels(labels []github.Label)

WithGitHubLabels attaches given labels as strings to Item

func (*Item) WithGitHubReactions

func (i *Item) WithGitHubReactions(r *github.Reactions)

WithGitHubReactions sets reactions after stripping out unecessary things

type ItemReactions

type ItemReactions struct {
	Total    int
	Positive int
	Negative int
}

ItemReactions denotes reactions to an item

type ItemType

type ItemType string

ItemType denotes supported host item types

const (
	// ItemTypeIssue is an issue
	ItemTypeIssue ItemType = "ISSUE"
	// ItemTypePR is a pull request
	ItemTypePR ItemType = "PULL_REQUEST"
)

type Repo

type Repo interface {
	Hosted
	GetOwner() string
	GetName() string
	IsPrivate() bool
	fmt.Stringer
}

Repo represents a repository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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