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 }
Click to show internal directories.
Click to hide internal directories.