lfs

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0, BSD-3-Clause, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PointerMIME = "text/vnd.git-lfs"
)

Variables

View Source
var (
	EmptyObjectSHA256 = hex.EncodeToString(sha256.New().Sum(nil))
)

Functions

func EncodePointer

func EncodePointer(writer io.Writer, pointer *Pointer) (int, error)

func EncodeSimple

func EncodeSimple(oid string, size int64) string

func IsBadPointerKeyError

func IsBadPointerKeyError(err error) bool

func IsNewNotAPointerError

func IsNewNotAPointerError(err error) bool

func NewBadPointerKeyError

func NewBadPointerKeyError(message string) error

func NewNotAPointerError

func NewNotAPointerError(message string) error

Types

type ByPriority

type ByPriority []*PointerExtension

func (ByPriority) Len

func (p ByPriority) Len() int

func (ByPriority) Less

func (p ByPriority) Less(i, j int) bool

func (ByPriority) Swap

func (p ByPriority) Swap(i, j int)

type Pointer

type Pointer struct {
	Version    string
	Oid        string
	Size       int64
	OidType    string
	Extensions []*PointerExtension
	Canonical  bool
}

func Decode

func Decode(buf []byte) (*Pointer, error)

func DecodeFrom

func DecodeFrom(reader io.Reader) (*Pointer, io.Reader, error)

DecodeFrom decodes an *lfs.Pointer from the given io.Reader, "reader". If the pointer encoded in the reader could successfully be read and decoded, it will be returned with a nil error.

If the pointer could not be decoded, an io.Reader containing the entire blob's data will be returned, along with a parse error.

func DecodePointer

func DecodePointer(reader io.Reader) (*Pointer, error)

func DecodePointerFromBlob

func DecodePointerFromBlob(b *gitobj.Blob) (*Pointer, error)

func EmptyPointer

func EmptyPointer() *Pointer

func NewPointer

func NewPointer(oid string, size int64, exts []*PointerExtension) *Pointer

func (*Pointer) Encode

func (p *Pointer) Encode(writer io.Writer) (int, error)

func (*Pointer) Encoded

func (p *Pointer) Encoded() string

type PointerExtension

type PointerExtension struct {
	Name     string
	Priority int
	Oid      string
	OidType  string
}

A PointerExtension is parsed from the Git LFS Pointer file.

func NewPointerExtension

func NewPointerExtension(name string, priority int, oid string) *PointerExtension

Jump to

Keyboard shortcuts

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