git

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct {
	URL       string
	Directory string
	// contains filtered or unexported fields
}

func NewGit

func NewGit(directory, url string, opts *Options) (*Git, error)

func (*Git) Clone

func (g *Git) Clone(branch string) error

Clone runs git clone with depth 1

func (*Git) Ensure

func (g *Git) Ensure(commit string) error

Ensure runs git clone, clean DIRTY contents and fetch the latest commit

func (*Git) Head

func (g *Git) Head(branch string) (string, error)

Head runs git clone on directory(if not exist), reset dirty content and return the HEAD commit

func (*Git) LsRemote

func (g *Git) LsRemote(branch string, commit string) (string, error)

LsRemote runs ls-remote on git repo and returns the HEAD commit SHA

func (*Git) Update

func (g *Git) Update(branch string) (string, error)

Update updates git repo if remote sha has changed

type Options

type Options struct {
	Credential        *corev1.Secret
	CABundle          []byte
	InsecureTLSVerify bool
	Headers           map[string]string
}

Jump to

Keyboard shortcuts

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