repos

package
v0.0.0-...-42e5483 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RateCommit  = RateUnit("commit")
	RateDay     = RateUnit("day")
	RateWeek    = RateUnit("week")
	RateMonth   = RateUnit("month")
	RateQuarter = RateUnit("quarter")
	RateYear    = RateUnit("year")
)

Variables

This section is empty.

Functions

func FilterCommitsByStep

func FilterCommitsByStep(commits []types.CommitInfo, rate SamplingRate, limit int) []types.SampleInfo

func SortCommitByDateDecr

func SortCommitByDateDecr(commits []types.CommitInfo) []types.CommitInfo

Types

type ExternalTool

type ExternalTool struct {
	IsDefault bool
	// contains filtered or unexported fields
}

func NewExternalTool

func NewExternalTool(rawCmd string) ExternalTool

func (*ExternalTool) BuildCmd

func (tool *ExternalTool) BuildCmd(repoPath string, name ProjectName, commit types.CommitInfo, rate SamplingRate, sample types.SampleInfo) *exec.Cmd

type ProjectName

type ProjectName string

ProjectName identifies the project being analysed

func (*ProjectName) String

func (p *ProjectName) String() string

type RateUnit

type RateUnit string

RateUnit defines a rate unit

type Repository

type Repository interface {
	// Name returns the (short) name of the repository
	Name() ProjectName
	// GetAbsPath returns the absolute path to the repository root folder
	GetAbsPath() string
	// SampleWithCmd runs a sampling operation with the given tool and sampling list
	SampleWithCmd(tool ExternalTool, rate SamplingRate, commits []types.CommitInfo, samples []types.SampleInfo, p core.Progress) error
	// ExtractCommits extract information about all the commits in the repository
	ExtractCommits() ([]types.CommitInfo, error)
	// HasLocalModifications returns true if the repository has local modification (inclusind non versioned files)
	HasLocalModifications() (bool, error)
}

Repository interface is used to manipulate a source code repository versioned under a particular CVS

type SamplingRate

type SamplingRate struct {
	Value int
	Unit  RateUnit
}

SamplingRate defines a rate to be used for taking regular samples of a repository

func DecodeSamplingRate

func DecodeSamplingRate(text string) (SamplingRate, error)

DecodeSamplingRate decodes a sampling rate from a given text

func (*SamplingRate) String

func (rate *SamplingRate) String() string

Directories

Path Synopsis
vcs

Jump to

Keyboard shortcuts

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