codehost

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

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

Go to latest
Published: Feb 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirtyWorkCopy = errors.New("dirty work copy")

ErrDirtyWorkCopy indicate work copy is dirty.

View Source
var ErrRecognizeRepo = errors.New("cannot recognize repository type")

ErrRecognizeRepo indicate failed to recognize repository type of given folder.

Functions

This section is empty.

Types

type ErrNotRepo

type ErrNotRepo struct {
	VCSType string
	Path    string
}

ErrNotRepo indicate given path is not repository of certain VCS.

func (*ErrNotRepo) Error

func (e *ErrNotRepo) Error() string

type GitRepo

type GitRepo struct {
	ModPath string
	// contains filtered or unexported fields
}

GitRepo represent code repo in git.

func NewGitRepo

func NewGitRepo(modPath string) (repo *GitRepo, err error)

NewGitRepo create new instance of GitRepo with given module path.

func (*GitRepo) CommitTime

func (repo *GitRepo) CommitTime() (commitTime time.Time, err error)

CommitTime get the commit time of current workcopy.

func (*GitRepo) PseudoVersion

func (repo *GitRepo) PseudoVersion() (pseudoVersion string, err error)

PseudoVersion generate pseudo version.

func (*GitRepo) Zip

func (repo *GitRepo) Zip(w io.Writer, modulePath, moduleVersion string) (err error)

Zip create module zip file.

type Repo

type Repo interface {
	// PseudoVersion generate pseudo version.
	PseudoVersion() (pseudoVersion string, err error)

	// CommitTime get the commit time of current workcopy.
	CommitTime() (commitTime time.Time, err error)

	// Zip create module zip file.
	Zip(w io.Writer, modulePath, moduleVersion string) (err error)
}

Repo defines interface of operations in VCS repository.

func NewRepo

func NewRepo(modFolderPath string) (repo Repo, err error)

NewRepo create a Repo base on given module folder path.

Jump to

Keyboard shortcuts

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