source

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	*git.Repository
	// contains filtered or unexported fields
}

func Git

func Git(ctx context.Context, opts ...RepositoryOption) (*Repository, error)

func (*Repository) Path

func (r *Repository) Path() string

Path returns the temporary path where the repository was cloned to.

func (*Repository) Ref

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

Ref returns the git reference(https://git-scm.com/book/en/v2/Git-Internals-Git-References) that was used to clone this repository. It is unlikely that a valid cloned repo returns an error here as it's asking for the Head, which will point at the reference used, but if it does happen, it means the repository is in an unknown state and can't be used to generate an image

type RepositoryOption

type RepositoryOption func(*Repository) error

func WithAuth

func WithAuth(path string, credentials *config.Credentials) RepositoryOption

func WithDepth

func WithDepth(depth *int) RepositoryOption

func WithPath

func WithPath(path string) RepositoryOption

func WithRef

func WithRef(ref string) RepositoryOption

func WithURL

func WithURL(url string) RepositoryOption

type RepositoryOpts

type RepositoryOpts struct {
	Path string
	Host string
	Ref  string

	Credential *secrets.Credentials
}

Jump to

Keyboard shortcuts

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