backend

package
v0.0.0-...-e61ee7f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1"

Version is the git-lfs-transfer protocol version number.

Variables

View Source
var Capabilities = []string{
	"version=" + Version,
	"locking",
}

Capabilities is a list of Git LFS capabilities supported by this package.

View Source
var ErrMissingID = fmt.Errorf("%w: missing id arg", transfer.ErrMissingData)

Functions

func New

func New(ctx context.Context, repo, op, token string, logger transfer.Logger) (transfer.Backend, error)

Types

type GiteaBackend

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

GiteaBackend is an adapter between git-lfs-transfer library and Gitea's internal LFS API

func (*GiteaBackend) Batch

func (g *GiteaBackend) Batch(_ string, pointers []transfer.BatchItem, args transfer.Args) ([]transfer.BatchItem, error)

Batch implements transfer.Backend

func (*GiteaBackend) Download

func (g *GiteaBackend) Download(oid string, args transfer.Args) (io.ReadCloser, int64, error)

Download implements transfer.Backend. The returned reader must be closed by the caller.

func (*GiteaBackend) LockBackend

func (g *GiteaBackend) LockBackend(_ transfer.Args) transfer.LockBackend

LockBackend implements transfer.Backend.

func (*GiteaBackend) Upload

func (g *GiteaBackend) Upload(oid string, size int64, r io.Reader, args transfer.Args) error

StartUpload implements transfer.Backend.

func (*GiteaBackend) Verify

func (g *GiteaBackend) Verify(oid string, size int64, args transfer.Args) (transfer.Status, error)

Verify implements transfer.Backend.

Jump to

Keyboard shortcuts

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