pullrequest

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToDisk

func ToDisk(r *Resource, path string) error

ToDisk converts a PullRequest object to an on-disk representation at the specified path. When written, the underlying Manifests

Types

type Handler

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

Handler handles interactions with the GitHub API.

func NewHandler

func NewHandler(logger *zap.SugaredLogger, client *scm.Client, repo string, pr int) *Handler

NewHandler initializes a new handler for interacting with SCM resources.

func NewSCMHandler

func NewSCMHandler(logger *zap.SugaredLogger, raw, provider, token string) (*Handler, error)

func (*Handler) Download

func (h *Handler) Download(ctx context.Context) (*Resource, error)

Download fetches and stores the desired pull request.

func (*Handler) Upload

func (h *Handler) Upload(ctx context.Context, r *Resource) error

Upload takes files stored on the filesystem and uploads new changes to GitHub.

type Manifest

type Manifest map[string]bool

Manifest is a list of sub-resources that exist within the PR resource to determine whether an item existed when the resource was initialized.

type Resource

type Resource struct {
	PR       *scm.PullRequest
	Statuses []*scm.Status
	Comments []*scm.Comment

	// Manifests contain data about the resource when it was written to disk.
	Manifests map[string]Manifest
}

Resource represents a complete SCM resource that should be recorded to disk.

func FromDisk

func FromDisk(path string) (*Resource, error)

FromDisk outputs a PullRequest object from an on-disk representation at the specified path.

Jump to

Keyboard shortcuts

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