local

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LocalBackendLockVersion is the version of the local backend.
	LocalBackendLockVersion = "v1"
)

Variables

This section is empty.

Functions

func NewLocalBackendLock

func NewLocalBackendLock(root, pathName string, time *time.Time, ownerName string) transfer.Lock

NewLocalBackendLock creates a new local backend lock.

func NewLockBackend

func NewLockBackend(backend transfer.Backend, lockPath string) transfer.LockBackend

NewLockBackend creates a new local lock backend.

Types

type LocalBackend

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

LocalBackend is a local Git LFS backend.

func New

func New(lfsPath string, umask os.FileMode, timestamp *time.Time) *LocalBackend

New creates a new local backend. lfsPath should be a `.git/lfs` directory.

func (*LocalBackend) Batch

Batch implements main.Backend

func (*LocalBackend) Download

func (l *LocalBackend) Download(oid transfer.Oid, args ...string) (fs.File, error)

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

func (*LocalBackend) FinishUpload

func (l *LocalBackend) FinishUpload(state interface{}, args ...string) error

FinishUpload implements main.Backend.

func (*LocalBackend) FixPermissions

func (l *LocalBackend) FixPermissions(path string) (transfer.Status, error)

FixPermissions fixes the permissions of the file at the given path.

func (*LocalBackend) LockBackend

func (l *LocalBackend) LockBackend() transfer.LockBackend

LockBackend implements main.Backend.

func (*LocalBackend) StartUpload

func (l *LocalBackend) StartUpload(oid transfer.Oid, r io.Reader, args ...string) (interface{}, error)

StartUpload implements main.Backend. The returned temp file should be closed.

func (*LocalBackend) Verify

func (l *LocalBackend) Verify(oid transfer.Oid, args map[string]string) (transfer.Status, error)

Verify implements main.Backend.

type LockFile

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

LockFile is a local backend lock file.

func NewLockFile

func NewLockFile(path string) (*LockFile, error)

NewLockFile creates a new lock file.

func (*LockFile) Close

func (l *LockFile) Close() error

Close closes the lock file.

func (*LockFile) Persist

func (l *LockFile) Persist() error

Persist persists the lock file.

func (*LockFile) Remove

func (l *LockFile) Remove() error

Remove removes the lock file.

func (*LockFile) Write

func (l *LockFile) Write(data []byte) (int, error)

Write writes the given data to the lock file.

type UploadState

type UploadState struct {
	Oid      transfer.Oid
	TempFile *os.File
}

UploadState is a state for an upload.

Jump to

Keyboard shortcuts

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