gitfs

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: BSD-3-Clause Imports: 16 Imported by: 1

README

Package gitfs presents a file tree downloaded from a remote Git repo as an in-memory fs.FS. See the API reference.

Documentation

Overview

Package gitfs presents a file tree downloaded from a remote Git repo as an in-memory fs.FS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash [20]byte

A Hash is a SHA-1 Hash identifying a particular Git object.

func (Hash) String

func (h Hash) String() string

type Repo

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

A Repo is a connection to a remote repository served over HTTP or HTTPS.

func NewRepo

func NewRepo(url string) (*Repo, error)

NewRepo connects to a Git repository at the given http:// or https:// URL.

func (*Repo) Clone

func (r *Repo) Clone(ref string) (Hash, fs.FS, error)

Clone resolves the given ref to a hash and returns the corresponding fs.FS.

func (*Repo) CloneHash

func (r *Repo) CloneHash(h Hash) (fs.FS, error)

CloneHash returns the fs.FS for the given hash.

func (*Repo) Resolve

func (r *Repo) Resolve(ref string) (Hash, error)

Resolve looks up the given ref and returns the corresponding Hash.

Jump to

Keyboard shortcuts

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