project

package
v0.0.0-...-6a85243 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package project models a git repository of Go source code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Files    []PathDiff `json:"files"`
	Packages []PathDiff `json:"packages"`
	// contains filtered or unexported fields
}

A Diff identifies the files and packages modified since the base commit. Recursive diffs also include packages that depend on modified code.

func (Diff) String

func (d Diff) String() string

type PathDiff

type PathDiff struct {
	Status Status `json:"status"`
	Path   string `json:"path"`
}

A PathDiff describes the state of a single file relative to a previous commit.

type Project

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

A Project represents a git repository of Go source code.

func New

func New(logger *hhlog.Logger, r *git.Repository) (*Project, error)

New constructs a project.

func (*Project) All

func (p *Project) All() (Diff, error)

All identifies all the files and packages in the project.

func (*Project) Diff

func (p *Project) Diff(since string) (Diff, error)

Diff identifies the files and packages directly modified since the supplied commitish.

func (*Project) Exec

func (p *Project) Exec(cmd string, args ...string) error

Exec executes a command, sending the output directly to standard out and standard error.

func (*Project) RecursiveDiff

func (p *Project) RecursiveDiff(since string) (Diff, error)

RecursiveDiff identifies the files and packages directly modified since the supplied commitish, along with any packages that depend on modified code.

func (*Project) Root

func (p *Project) Root() string

Root returns the Go import path of the project's root package.

type Status

type Status uint8

Status describes the state of a file or package relative to a previous commit.

const (
	StatusUnknown Status = iota
	StatusUnchanged
	StatusModified
	StatusDeleted
)

Relative to a previous commit, each file or package is either unchanged, modified, or deleted.

func (Status) MarshalText

func (s Status) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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