Documentation ¶
Overview ¶
Package gitfs presents a file tree downloaded from a remote Git repo as an in-memory fs.FS.
Index ¶
- type DirEntry
- type Hash
- type ObjType
- type Ref
- type Repo
- func (r *Repo) Clone(ctx context.Context, ref string) (Hash, fs.FS, error)
- func (r *Repo) CloneHash(ctx context.Context, h Hash) (fs.FS, []byte, error)
- func (r *Repo) Handshake(ctx context.Context) error
- func (r *Repo) Refs(ctx context.Context, prefixes ...string) ([]Ref, error)
- func (r *Repo) Resolve(ctx context.Context, ref string) (Hash, error)
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.
type ObjType ¶
type ObjType int
An ObjType is an object type indicator. The values are the ones used in Git pack encoding (https://git-scm.com/docs/pack-format#_object_types).
type Ref ¶
type Ref struct { Name string // "refs/heads/main", "refs/tags/v1.0.0", "HEAD" Hash Hash // hexadecimal hash }
A Ref is a single Git reference, like refs/heads/main, refs/tags/v1.0.0, or HEAD.
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 (*Repo) Handshake ¶
Handshake runs the initial Git opening Handshake, learning the capabilities of the server. See https://git-scm.com/docs/protocol-v2#_initial_client_request.
func (*Repo) Refs ¶
Refs executes an ls-Refs command on the remote server to look up Refs with the given prefixes. See https://git-scm.com/docs/protocol-v2#_ls_refs.