git

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Fetch(spec FetchSpec) (Repo, error)
}

func New

func New(log *zap.SugaredLogger) Client

type FetchSpec

type FetchSpec struct {
	URL         string
	SSHUrl      string
	Revision    string
	Path        string
	Depth       uint
	SSLVerify   bool
	CatalogName string
}

FetchSpec describes how to initialize and fetch from a Git repository.

type LocalRepo

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

func (LocalRepo) Head

func (r LocalRepo) Head() string

func (LocalRepo) ModifiedTime

func (r LocalRepo) ModifiedTime(path string) (time.Time, error)

ModifiedTime returns the modified (commited/changed) time of the file by querying the git history.

func (LocalRepo) Path

func (r LocalRepo) Path() string

func (LocalRepo) RelPath

func (r LocalRepo) RelPath(file string) (string, error)

RelPath returns the path of file relative to repo's path

type Repo

type Repo interface {
	Path() string
	Head() string
	ModifiedTime(path string) (time.Time, error)
	RelPath(path string) (string, error)
}

Jump to

Keyboard shortcuts

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