git

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Get content from remote GIT repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

Repo represents the GIT repository to clone/pull from.

func New

func New(url, reference, token, dir string, log logr.Logger) (*Repo, error)

New creates a local environment at dir to Get data from a GIT repo at url/reference. Argument reference can be master, refs/heads/my-branch etc, see https://git-scm.com/docs/git-show-ref

func (*Repo) Get

func (r *Repo) Get() error

Get (clone or pull) the contents of the remote repo.

func (*Repo) Name

func (r *Repo) Name() string

Name is the fully qualified name of the repo in alphanumerical chars. It includes a hash of the repo URL and Ref. The last url path element is included verbatim.

func (*Repo) Remove

func (r *Repo) Remove() error

Remove removes the temporary directory that contains the cloned repository.

func (*Repo) RepoDir

func (r *Repo) RepoDir() string

RepoDir returns the absolute path to the repo root.

func (*Repo) SHAlocal

func (r *Repo) SHAlocal() (string, error)

SHAlocal returns the SHA of the last commit to the local repo.

func (*Repo) SHAremote

func (r *Repo) SHAremote() (string, error)

SHAremote returns the SHA of the last commit to the remote repo.

func (*Repo) Update

func (r *Repo) Update() error

Update refreshes the repo to the latest commit.

Jump to

Keyboard shortcuts

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