git

package
v0.0.0-...-3d4bac1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadOpts

type DownloadOpts struct {
	AccessToken string
	Depth       int
}

DownloadOpts denotes options for downloading a repo

type Host

type Host string

Host denotes supported git hosts

const (
	// HostGitHub is https://github.com
	HostGitHub Host = "github.com"

	// HostGitLab is https://gitlab.com
	HostGitLab Host = "gitlab.com"
)

type Manager

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

Manager handles repo management

func NewManager

func NewManager(l *zap.SugaredLogger, opts ManagerOpts) *Manager

NewManager instantiates a new manager

func (*Manager) Download

func (m *Manager) Download(ctx context.Context, remote string, opts DownloadOpts) (*Repository, error)

Download downloads the given repository

func (*Manager) Load

func (m *Manager) Load(ctx context.Context, remote string) (*Repository, error)

Load loads a downloaded repository - TODO: deprecate in favour of just using Donwload(), to unify depth management

type ManagerOpts

type ManagerOpts struct {
	Workdir string
}

ManagerOpts denotes options for the manager

type Repository

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

Repository represents a managed repository, cloned for analysis

func (*Repository) Dir

func (r *Repository) Dir() string

Dir gets where this repository is stored

func (*Repository) GitRepo

func (r *Repository) GitRepo() *gogit.Repository

GitRepo returns the underlying go-git repository

func (*Repository) Host

func (r *Repository) Host() (Host, error)

Host gets the code host of this repository

func (*Repository) Name

func (r *Repository) Name() (string, error)

Name gets the repository name

Jump to

Keyboard shortcuts

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