localstorage

package
v2.3.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package localstorage handles LFS content stored locally NOTE: Subject to change, do not rely on this package from outside git-lfs source

Index

Constants

This section is empty.

Variables

View Source
var (
	TempDir = filepath.Join(os.TempDir(), "git-lfs")
)

Functions

func InitStorage

func InitStorage() error

func InitStorageOrFail

func InitStorageOrFail()

func ResetTempDir

func ResetTempDir() error

func ResolveDirs

func ResolveDirs()

func TempFile

func TempFile(prefix string) (*os.File, error)

Types

type LocalStorage

type LocalStorage struct {
	RootDir string
	TempDir string
}

LocalStorage manages the locally stored LFS objects for a repository.

func NewStorage

func NewStorage(storageDir, tempDir string) (*LocalStorage, error)

func Objects

func Objects() *LocalStorage

func (*LocalStorage) AllObjects

func (s *LocalStorage) AllObjects() []Object

AllObjects returns a slice of the the objects stored in this LocalStorage object. This does not necessarily mean referenced by commits, just stored. Note: reports final SHA only, extensions are ignored.

func (*LocalStorage) BuildObjectPath

func (s *LocalStorage) BuildObjectPath(oid string) (string, error)

func (*LocalStorage) ClearTempObjects

func (s *LocalStorage) ClearTempObjects() error

func (*LocalStorage) ObjectPath

func (s *LocalStorage) ObjectPath(oid string) string

func (*LocalStorage) ScanObjectsChan

func (s *LocalStorage) ScanObjectsChan() <-chan Object

ScanObjectsChan returns a channel of all the objects stored in this LocalStorage object. This does not necessarily mean referenced by commits, just stored. You should not alter the store until this channel is closed. Note: reports final SHA only, extensions are ignored.

type Object

type Object struct {
	Oid  string
	Size int64
}

Object represents a locally stored LFS object.

Jump to

Keyboard shortcuts

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