repo

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package repo provides handling git repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRepoNameFromUrl

func GetRepoNameFromUrl(url string) string

Types

type FileEntry

type FileEntry struct {
	Blob string
	Path string
	Size int64
}

type GitFile added in v0.4.0

type GitFile struct {
	Locations map[string]GitFileLocation
	Size      int64
}

type GitFileLocation added in v0.4.0

type GitFileLocation struct {
	Branches []string
	Tags     []string
}

type GitRepo

type GitRepo struct {
	Organization string
	Project      string
	Repository   string
	Path         string

	Config *config.Config
	// contains filtered or unexported fields
}

func NewGitRepo

func NewGitRepo(organization string, projectName string, repoName string, repoPath string, config *config.Config) (*GitRepo, error)

func (*GitRepo) DetectBlobContentType

func (r *GitRepo) DetectBlobContentType(blob string) (string, []byte, error)

func (*GitRepo) ExistsInCommit added in v0.4.0

func (r *GitRepo) ExistsInCommit(commitId string, filePath string, blobId string) (bool, error)

func (*GitRepo) FetchAll

func (r *GitRepo) FetchAll() error

func (*GitRepo) FilterBlob

func (r *GitRepo) FilterBlob(blobId string, encoding string, filter func(line string) bool, before int, after int) []util.TextPreview

func (*GitRepo) GetBlobContent

func (r *GitRepo) GetBlobContent(blob string) ([]byte, error)

func (*GitRepo) GetBlobSize

func (r *GitRepo) GetBlobSize(blob string) (int64, error)

func (*GitRepo) GetBranchCommitID

func (r *GitRepo) GetBranchCommitID(name string) (string, error)

func (*GitRepo) GetBranches

func (r *GitRepo) GetBranches() ([]string, error)

func (*GitRepo) GetContainsBranches added in v0.4.0

func (r *GitRepo) GetContainsBranches(commitId string) ([]string, error)

func (*GitRepo) GetDiffEntriesIterator

func (r *GitRepo) GetDiffEntriesIterator(from string, to string, callback func(fileEntry FileEntry, status string)) error

func (*GitRepo) GetDiffFileEntriesMap added in v0.4.0

func (r *GitRepo) GetDiffFileEntriesMap(branchesMap map[string][2]string, tagsMap map[string][2]string) (map[string]GitFile, map[string]GitFile, error)

func (*GitRepo) GetDiffList

func (r *GitRepo) GetDiffList(from string, to string) ([]FileEntry, []FileEntry, error)

func (*GitRepo) GetFileEntries

func (r *GitRepo) GetFileEntries(commitId string) ([]FileEntry, error)

func (*GitRepo) GetFileEntriesIterator

func (r *GitRepo) GetFileEntriesIterator(commitId string, callback func(fileEntry FileEntry)) error

func (*GitRepo) GetFileEntriesMap added in v0.4.0

func (r *GitRepo) GetFileEntriesMap(branchesMap map[string]string, tagsMap map[string]string) (map[string]GitFile, error)

GetFileEntriesMap collects all file entries on the specified branches and tags. It returns as GitFiles map with the blob key. The branchesMap's key is branch name, and the value is commitId. The tagsMap's key is tag name, and the value is commitId.

func (*GitRepo) GetFileEntriesMapByRefs added in v0.4.0

func (r *GitRepo) GetFileEntriesMapByRefs(includeBranches []string, includeTags []string, excludeBranches []string, excludeTags []string) (map[string]GitFile, error)

func (*GitRepo) GetLatestCommitIdsMap added in v0.4.0

func (r *GitRepo) GetLatestCommitIdsMap() (config.BrancheIndexedMap, config.TagIndexedMap, error)

func (*GitRepo) GetTags added in v0.4.0

func (r *GitRepo) GetTags() ([]string, error)

type GitRepoReader

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

func NewGitRepoReader

func NewGitRepoReader(config *config.Config) *GitRepoReader

func (*GitRepoReader) CloneGitRepo

func (r *GitRepoReader) CloneGitRepo(organization string, project string, url string) (*GitRepo, error)

func (*GitRepoReader) GetGitRepo

func (r *GitRepoReader) GetGitRepo(organization string, project string, repoName string) (*GitRepo, error)

type Source

type Source struct {
	Offset  int    `json:"offset"`
	Preview string `json:"preview"`
	Hits    []int  `json:"hits"`
}

Jump to

Keyboard shortcuts

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