refstore

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package refstore provides interfaces for reference storage backends.

Index

Constants

This section is empty.

Variables

View Source
var ErrReferenceNotFound = errors.New("refstore: reference not found")

ErrReferenceNotFound indicates that a reference does not exist in a backend. TODO: Interface error? Just like object not found in objectstore.

Functions

func ShortenName

func ShortenName(name string, all []string) string

ShortenName returns the shortest unambiguous shorthand for name among all.

all must contain full reference names visible to the shortening scope.

Types

type Store

type Store interface {
	// Resolve resolves a reference name to either a symbolic or detached ref.
	//
	// Implementations should return value forms (ref.Detached or ref.Symbolic),
	// not pointer forms.
	// If the reference does not exist, implementations should return
	// ErrReferenceNotFound.
	Resolve(name string) (ref.Ref, error)
	// ResolveFully resolves a reference name to a detached object ID.
	//
	// Implementations may use backend-local lookup semantics for symbolic hops.
	// Callers that need cross-backend symbolic resolution (for example in a
	// chain of stores) should prefer repeatedly calling Resolve.
	//
	// ResolveFully resolves symbolic references only. It does not imply peeling
	// annotated tag objects.
	ResolveFully(name string) (ref.Detached, error)
	// List returns references matching pattern.
	//
	// The exact pattern language is backend-defined.
	List(pattern string) ([]ref.Ref, error)
	// Shorten returns the shortest unambiguous shorthand for a full
	// reference name within this store's visible namespace.
	//
	// If name does not exist in this store, implementations should return
	// ErrReferenceNotFound.
	Shorten(name string) (string, error)
	// Close releases resources associated with the store.
	Close() error
}

Store reads Git references.

Directories

Path Synopsis
Package chain provides a wrapper reference storage backend to query a chain of backends.
Package chain provides a wrapper reference storage backend to query a chain of backends.
Package loose provides a loose ref backend (refs/...
Package loose provides a loose ref backend (refs/...
Package packed provides a packed refs backend.
Package packed provides a packed refs backend.
Package reftable provides an experimental reftable backend.
Package reftable provides an experimental reftable backend.

Jump to

Keyboard shortcuts

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