Documentation ¶
Overview ¶
Set is a modification of https://github.com/deckarep/golang-set The MIT License (MIT) Copyright (c) 2013 Ralph Caraveo (deckarep@gmail.com)
Index ¶
- Constants
- Variables
- func AllLocalObjectsChan() <-chan *Pointer
- func ClearTempObjects()
- func CloneFile(writer io.Writer, reader io.Reader) (bool, error)
- func ConvertCwdFilesRelativeToRepo(cwdchan <-chan string) (<-chan string, error)
- func ConvertRepoFilesRelativeToCwd(repochan <-chan string) (<-chan string, error)
- func CopyWithCallback(writer io.Writer, reader io.Reader, totalSize int64, cb CopyCallback) (int64, error)
- func DirExists(path string) bool
- func DoNTLMRequest(request *http.Request, retry bool) (*http.Response, error)
- func Download(oid string, size int64) (io.ReadCloser, int64, error)
- func DownloadLegacy(oid string) (io.ReadCloser, int64, error)
- func DownloadObject(obj *ObjectResource) (io.ReadCloser, int64, error)
- func EncodePointer(writer io.Writer, pointer *Pointer) (int, error)
- func Environ() []string
- func Error(err error) error
- func ErrorContext(err error) map[string]interface{}
- func ErrorDelContext(err error, key string)
- func ErrorGetContext(err error, key string) interface{}
- func ErrorSetContext(err error, key string, value interface{})
- func ErrorStack(err error) []byte
- func Errorf(err error, format string, args ...interface{}) error
- func FileExists(path string) bool
- func FileExistsOfSize(path string, sz int64) bool
- func FileOrDirExists(path string) (exists bool, isDir bool)
- func FilenamePassesIncludeExcludeFilter(filename string, includePaths, excludePaths []string) bool
- func GetInnerError(err error) error
- func InRepo() bool
- func InstallFilters(opt InstallOptions, passThrough bool) error
- func InstallHooks(force bool) error
- func IsAuthError(err error) bool
- func IsBadPointerKeyError(err error) bool
- func IsCleanPointerError(err error) bool
- func IsDownloadDeclinedError(err error) bool
- func IsFatalError(err error) bool
- func IsInvalidPointerError(err error) bool
- func IsInvalidRepoError(err error) bool
- func IsNotAPointerError(err error) bool
- func IsNotImplementedError(err error) bool
- func IsRetriableError(err error) bool
- func IsSmudgeError(err error) bool
- func IsWindows() bool
- func LocalMediaPath(sha string) (string, error)
- func LogHttpStats()
- func LogTransfer(key string, res *http.Response)
- func ObjectExistsOfSize(sha string, size int64) bool
- func ObjectUrl(endpoint Endpoint, oid string) (*url.URL, error)
- func PointerClean(reader io.Reader, fileName string, fileSize int64, cb CopyCallback) (*cleanedAsset, error)
- func PointerSmudge(writer io.Writer, ptr *Pointer, workingfile string, download bool, ...) error
- func PointerSmudgeObject(ptr *Pointer, obj *ObjectResource, cb CopyCallback) error
- func PointerSmudgeToFile(filename string, ptr *Pointer, download bool, cb CopyCallback) error
- func ResetTempDir() error
- func ResolveDirs()
- func ScanPreviousVersionsToChan(ref string, since time.Time) (chan *WrappedPointer, error)
- func ScanRefsToChan(refLeft, refRight string, opt *ScanRefsOptions) (<-chan *WrappedPointer, error)
- func ScanUnpushedToChan(remoteName string) (chan *WrappedPointer, error)
- func Stack() []byte
- func TempFile(prefix string) (*os.File, error)
- func UninstallFilters() error
- func UninstallHooks() error
- func UploadObject(o *ObjectResource, cb CopyCallback) error
- type Attribute
- type Batcher
- type ByPriority
- type CallbackReader
- type ClientError
- type Configuration
- func (c *Configuration) Access(operation string) string
- func (c *Configuration) AllGitConfig() map[string]string
- func (c *Configuration) BatchTransfer() bool
- func (c *Configuration) ConcurrentTransfers() int
- func (c *Configuration) Endpoint(operation string) Endpoint
- func (c *Configuration) EndpointAccess(e Endpoint) string
- func (c *Configuration) Extensions() map[string]Extension
- func (c *Configuration) FetchExcludePaths() []string
- func (c *Configuration) FetchIncludePaths() []string
- func (c *Configuration) FetchPruneConfig() *FetchPruneConfig
- func (c *Configuration) Getenv(key string) string
- func (c *Configuration) GetenvBool(key string, def bool) bool
- func (c *Configuration) GitConfig(key string) (string, bool)
- func (c *Configuration) GitConfigInt(key string, def int) int
- func (c *Configuration) GitProtocol() string
- func (c *Configuration) GitRemoteUrl(remote string, forpush bool) string
- func (c *Configuration) HttpClient() *HttpClient
- func (c *Configuration) NtlmAccess(operation string) bool
- func (c *Configuration) PrivateAccess(operation string) bool
- func (c *Configuration) RemoteEndpoint(remote, operation string) Endpoint
- func (c *Configuration) Remotes() []string
- func (c *Configuration) SetAccess(operation string, authType string)
- func (c *Configuration) SetEndpointAccess(e Endpoint, authType string)
- func (c *Configuration) SetManualEndpoint(e Endpoint)
- func (c *Configuration) Setenv(key, value string) error
- type CopyCallback
- type Creds
- type DownloadCheckable
- func (d *DownloadCheckable) Check() (*ObjectResource, error)
- func (d *DownloadCheckable) Name() string
- func (d *DownloadCheckable) Object() *ObjectResource
- func (d *DownloadCheckable) Oid() string
- func (d *DownloadCheckable) SetObject(o *ObjectResource)
- func (d *DownloadCheckable) Size() int64
- func (d *DownloadCheckable) Transfer(cb CopyCallback) error
- type Downloadable
- type Endpoint
- type Extension
- type FetchPruneConfig
- type Hook
- type HttpClient
- type InstallOptions
- type LogDiffDirection
- type ObjectError
- type ObjectResource
- type Platform
- type Pointer
- type PointerExtension
- type ProgressMeter
- type ScanRefsOptions
- type ScanningMode
- type Spinner
- type StringSet
- func (set StringSet) Add(i string) bool
- func (set StringSet) Cardinality() int
- func (set *StringSet) Clear()
- func (set StringSet) Clone() StringSet
- func (set StringSet) Contains(i string) bool
- func (set StringSet) ContainsAll(i ...string) bool
- func (set StringSet) Difference(other StringSet) StringSet
- func (set StringSet) Equal(other StringSet) bool
- func (set StringSet) Intersect(other StringSet) StringSet
- func (set StringSet) IsSubset(other StringSet) bool
- func (set StringSet) IsSuperset(other StringSet) bool
- func (set StringSet) Iter() <-chan string
- func (set StringSet) Remove(i string)
- func (set StringSet) SymmetricDifference(other StringSet) StringSet
- func (set StringSet) Union(other StringSet) StringSet
- type TransferQueue
- type Transferable
- type TreeBlob
- type Uploadable
- func (u *Uploadable) Check() (*ObjectResource, error)
- func (u *Uploadable) Name() string
- func (u *Uploadable) Object() *ObjectResource
- func (u *Uploadable) Oid() string
- func (u *Uploadable) SetObject(o *ObjectResource)
- func (u *Uploadable) Size() int64
- func (u *Uploadable) Transfer(cb CopyCallback) error
- type WrappedPointer
- func ScanIndex() ([]*WrappedPointer, error)
- func ScanPreviousVersions(ref string, since time.Time) ([]*WrappedPointer, error)
- func ScanRefs(refLeft, refRight string, opt *ScanRefsOptions) ([]*WrappedPointer, error)
- func ScanTree(ref string) ([]*WrappedPointer, error)
- func ScanUnpushed(remoteName string) ([]*WrappedPointer, error)
Constants ¶
const ( ScanRefsMode = ScanningMode(iota) // 0 - or default scan mode ScanAllMode = ScanningMode(iota) ScanLeftToRemoteMode = ScanningMode(iota) )
const ( LogDiffAdditions = LogDiffDirection('+') // include '+' diffs LogDiffDeletions = LogDiffDirection('-') // include '-' diffs )
const ( PlatformWindows = Platform(iota) PlatformLinux = Platform(iota) PlatformOSX = Platform(iota) PlatformOther = Platform(iota) // most likely a *nix variant e.g. freebsd PlatformUndetermined = Platform(iota) )
const (
BtrfsIocClone = C.BTRFS_IOC_CLONE
)
const EndpointUrlUnknown = "<unknown>"
const (
Version = "1.1.2"
)
Variables ¶
var ( Config = NewConfig() ShowConfigWarnings = false )
var ( LargeSizeThreshold = 5 * 1024 * 1024 TempDir = filepath.Join(os.TempDir(), "git-lfs") GitCommit string UserAgent string LocalWorkingDir string LocalGitDir string // parent of index / config / hooks etc LocalGitStorageDir string // parent of objects/lfs (may be same as LocalGitDir but may not) LocalMediaDir string // root of lfs objects LocalObjectTempDir string // where temporarily downloading objects are stored LocalLogDir string )
Functions ¶
func AllLocalObjectsChan ¶ added in v1.1.0
func AllLocalObjectsChan() <-chan *Pointer
AllLocalObjectsChan returns a channel of all the objects stored in the local LFS store 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
func ClearTempObjects ¶ added in v1.0.1
func ClearTempObjects()
func ConvertCwdFilesRelativeToRepo ¶ added in v0.6.0
Convert filenames expressed relative to the current directory to be relative to the repo root. Useful when calling git with arguments that requires them to be rooted but the user is in a subdir of their repo & expects to use relative args Pass in a channel which you will fill with relative files & receive a channel which will get results
func ConvertRepoFilesRelativeToCwd ¶ added in v0.6.0
Convert filenames expressed relative to the root of the repo relative to the current working dir. Useful when needing to calling git with results from a rooted command, but the user is in a subdir of their repo Pass in a channel which you will fill with relative files & receive a channel which will get results
func CopyWithCallback ¶
func DoNTLMRequest ¶ added in v1.1.0
func Download ¶
Download will attempt to download the object with the given oid. The batched API will be used, but if the server does not implement the batch operations it will fall back to the legacy API.
func DownloadLegacy ¶ added in v1.0.1
func DownloadLegacy(oid string) (io.ReadCloser, int64, error)
DownloadLegacy attempts to download the object for the given oid using the legacy API.
func DownloadObject ¶ added in v0.5.2
func DownloadObject(obj *ObjectResource) (io.ReadCloser, int64, error)
func EncodePointer ¶ added in v0.5.1
func ErrorContext ¶ added in v0.6.0
ErrorContext returns the context map for an error if it is a wrappedError. If it is not a wrappedError it will return an empty map.
func ErrorDelContext ¶ added in v0.6.0
ErrorDelContext removes a value from the error's context. If the error has not been wrapped, it does nothing.
func ErrorGetContext ¶ added in v0.6.0
ErrorGetContext gets a value from the error's context. If the error has not been wrapped, it returns an empty string.
func ErrorSetContext ¶ added in v0.6.0
ErrorSetContext sets a value in the error's context. If the error has not been wrapped, it does nothing.
func ErrorStack ¶ added in v0.6.0
ErrorStack returns the stack for an error if it is a wrappedError. If it is not a wrappedError it will return an empty byte slice.
func FileExists ¶ added in v0.6.0
FileExists determines if a file (NOT dir) exists.
func FileExistsOfSize ¶ added in v0.6.0
FileExistsOfSize determines if a file exists and is of a specific size.
func FileOrDirExists ¶ added in v0.6.0
FileOrDirExists determines if a file/dir exists, returns IsDir() results too.
func FilenamePassesIncludeExcludeFilter ¶ added in v0.6.0
Return whether a given filename passes the include / exclude path filters Only paths that are in includePaths and outside excludePaths are passed If includePaths is empty that filter always passes and the same with excludePaths Both path lists support wildcard matches
func GetInnerError ¶ added in v1.1.2
func InstallFilters ¶
func InstallFilters(opt InstallOptions, passThrough bool) error
InstallFilters installs filters necessary for git-lfs to process normal git operations. Currently, that list includes:
- smudge filter
- clean filter
An error will be returned if a filter is unable to be set, or if the required filters were not present.
func InstallHooks ¶
InstallHooks installs all hooks in the `hooks` var.
func IsAuthError ¶ added in v0.6.0
IsAuthError indicates the client provided a request with invalid or no authentication credentials when credentials are required (e.g. HTTP 401).
func IsBadPointerKeyError ¶ added in v1.0.0
IsBadPointerKeyError indicates that the parsed data has an invalid key.
func IsCleanPointerError ¶ added in v0.6.0
IsCleanPointerError indicates an error while cleaning a file.
func IsDownloadDeclinedError ¶ added in v0.6.0
IsDownloadDeclinedError indicates that the smudge operation should not download. TODO: I don't really like using errors to control that flow, it should be refactored.
func IsFatalError ¶ added in v0.6.0
IsFatalError indicates that the error is fatal and the process should exit immediately after handling the error.
func IsInvalidPointerError ¶ added in v0.6.0
IsInvalidPointerError indicates an attempt to parse data that was not a valid pointer.
func IsInvalidRepoError ¶ added in v0.6.0
IsInvalidRepoError indicates an operation was attempted from outside a git repository.
func IsNotAPointerError ¶ added in v0.6.0
IsNotAPointerError indicates the parsed data is not an LFS pointer.
func IsNotImplementedError ¶ added in v0.6.0
IsNotImplementedError indicates the client attempted to use a feature the server has not implemented (e.g. the batch endpoint).
func IsRetriableError ¶ added in v0.6.0
IsRetriableError indicates the low level transfer had an error but the caller may retry the operation.
func IsSmudgeError ¶ added in v0.6.0
IsSmudgeError indicates an error while smudging a files.
func IsWindows ¶ added in v0.6.0
func IsWindows() bool
Are we running on Windows? Need to handle some extra path shenanigans
func LocalMediaPath ¶
func LogHttpStats ¶ added in v0.5.2
func LogHttpStats()
LogHttpStats is intended to be called after all HTTP operations for the commmand have finished. It dumps k/v logs, one line per transfer into a log file with the current timestamp.
func LogTransfer ¶ added in v0.5.2
func ObjectExistsOfSize ¶ added in v0.6.0
func PointerClean ¶ added in v0.5.1
func PointerSmudge ¶ added in v0.5.1
func PointerSmudgeObject ¶ added in v0.5.2
func PointerSmudgeObject(ptr *Pointer, obj *ObjectResource, cb CopyCallback) error
PointerSmudgeObject uses a Pointer and ObjectResource to download the object to the media directory. It does not write the file to the working directory.
func PointerSmudgeToFile ¶ added in v0.6.0
func PointerSmudgeToFile(filename string, ptr *Pointer, download bool, cb CopyCallback) error
func ResetTempDir ¶
func ResetTempDir() error
func ResolveDirs ¶ added in v0.6.0
func ResolveDirs()
func ScanPreviousVersionsToChan ¶ added in v1.1.0
func ScanPreviousVersionsToChan(ref string, since time.Time) (chan *WrappedPointer, error)
ScanPreviousVersionsToChan scans changes reachable from ref (commit) back to since. Returns channel of pointers for *previous* versions that overlap that time. Does not include pointers which were still in use at ref (use ScanRefsToChan for that)
func ScanRefsToChan ¶ added in v0.6.0
func ScanRefsToChan(refLeft, refRight string, opt *ScanRefsOptions) (<-chan *WrappedPointer, error)
ScanRefsToChan takes a ref and returns a channel of WrappedPointer objects for all Git LFS pointers it finds for that ref. Reports unique oids once only, not multiple times if >1 file uses the same content
func ScanUnpushedToChan ¶ added in v1.1.0
func ScanUnpushedToChan(remoteName string) (chan *WrappedPointer, error)
ScanUnpushedToChan scans history for all LFS pointers which have been added but not pushed to the named remote. remoteName can be left blank to mean 'any remote' return progressively in a channel
func UninstallFilters ¶ added in v0.5.3
func UninstallFilters() error
UninstallFilters proxies into the Uninstall method on the Filters type to remove all installed filters.
func UninstallHooks ¶ added in v0.5.3
func UninstallHooks() error
UninstallHooks removes all hooks in range of the `hooks` var.
func UploadObject ¶ added in v0.5.2
func UploadObject(o *ObjectResource, cb CopyCallback) error
Types ¶
type Attribute ¶ added in v0.6.0
type Attribute struct { // The Section of an Attribute refers to the location at which all // properties are relative to. For example, for a Section with the value // "core", Git will produce something like: // // [core] // autocrlf = true // ... Section string // The Properties of an Attribute refer to all of the keys and values // that define that Attribute. Properties map[string]string }
Attribute wraps the structure and some operations of Git's conception of an "attribute", as defined here: http://git-scm.com/docs/gitattributes.
func (*Attribute) Install ¶ added in v0.6.0
func (a *Attribute) Install(opt InstallOptions) error
Install instructs Git to set all keys and values relative to the root location of this Attribute. For any particular key/value pair, if a matching key is already set, it will be overridden if it is either a) empty, or b) the `force` argument is passed as true. If an attribute is already set to a different value than what is given, and force is false, an error will be returned immediately, and the rest of the attributes will not be set.
type Batcher ¶ added in v0.6.0
type Batcher struct {
// contains filtered or unexported fields
}
Batcher provides a way to process a set of items in groups of n. Items can be added to the batcher from multiple goroutines and pulled off in groups when one of the following conditions occurs:
- The batch size is reached
- Exit() is called
When an Exit() occurs, the group may be smaller than the batch size.
func NewBatcher ¶ added in v0.6.0
NewBatcher creates a Batcher with the batchSize.
func (*Batcher) Add ¶ added in v0.6.0
func (b *Batcher) Add(t Transferable)
Add adds an item to the batcher. Add is safe to call from multiple goroutines.
func (*Batcher) Exit ¶ added in v0.6.0
func (b *Batcher) Exit()
Exit stops all batching and allows Next() to return. Calling Add() after calling Exit() will reset the batcher.
func (*Batcher) Next ¶ added in v0.6.0
func (b *Batcher) Next() []Transferable
Next will wait for the one of the above batch triggers to occur and return the accumulated batch.
type ByPriority ¶ added in v0.6.0
type ByPriority []*PointerExtension
func (ByPriority) Len ¶ added in v0.6.0
func (p ByPriority) Len() int
func (ByPriority) Less ¶ added in v0.6.0
func (p ByPriority) Less(i, j int) bool
func (ByPriority) Swap ¶ added in v0.6.0
func (p ByPriority) Swap(i, j int)
type CallbackReader ¶
type CallbackReader struct { C CopyCallback TotalSize int64 ReadSize int64 io.Reader }
type ClientError ¶
type ClientError struct { Message string `json:"message"` DocumentationUrl string `json:"documentation_url,omitempty"` RequestId string `json:"request_id,omitempty"` }
func (*ClientError) Error ¶
func (e *ClientError) Error() string
type Configuration ¶
type Configuration struct { CurrentRemote string // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig() *Configuration
func (*Configuration) Access ¶ added in v0.6.0
func (c *Configuration) Access(operation string) string
Access returns the access auth type.
func (*Configuration) AllGitConfig ¶ added in v0.6.0
func (c *Configuration) AllGitConfig() map[string]string
func (*Configuration) BatchTransfer ¶ added in v0.5.2
func (c *Configuration) BatchTransfer() bool
func (*Configuration) ConcurrentTransfers ¶ added in v0.5.2
func (c *Configuration) ConcurrentTransfers() int
func (*Configuration) Endpoint ¶
func (c *Configuration) Endpoint(operation string) Endpoint
func (*Configuration) EndpointAccess ¶ added in v0.6.0
func (c *Configuration) EndpointAccess(e Endpoint) string
func (*Configuration) Extensions ¶ added in v0.6.0
func (c *Configuration) Extensions() map[string]Extension
func (*Configuration) FetchExcludePaths ¶ added in v0.6.0
func (c *Configuration) FetchExcludePaths() []string
func (*Configuration) FetchIncludePaths ¶ added in v0.6.0
func (c *Configuration) FetchIncludePaths() []string
func (*Configuration) FetchPruneConfig ¶ added in v0.6.0
func (c *Configuration) FetchPruneConfig() *FetchPruneConfig
func (*Configuration) Getenv ¶ added in v0.5.2
func (c *Configuration) Getenv(key string) string
func (*Configuration) GetenvBool ¶ added in v0.5.2
func (c *Configuration) GetenvBool(key string, def bool) bool
GetenvBool parses a boolean environment variable and returns the result as a bool. If the environment variable is unset, empty, or if the parsing fails, the value of def (default) is returned instead.
func (*Configuration) GitConfigInt ¶ added in v1.1.1
func (c *Configuration) GitConfigInt(key string, def int) int
GitConfigInt parses a git config value and returns it as an integer.
func (*Configuration) GitProtocol ¶ added in v1.1.1
func (c *Configuration) GitProtocol() string
GitProtocol returns the protocol for the LFS API when converting from a git:// remote url.
func (*Configuration) GitRemoteUrl ¶ added in v1.1.1
func (c *Configuration) GitRemoteUrl(remote string, forpush bool) string
GitRemoteUrl returns the git clone/push url for a given remote (blank if not found) the forpush argument is to cater for separate remote.name.pushurl settings
func (*Configuration) HttpClient ¶
func (c *Configuration) HttpClient() *HttpClient
func (*Configuration) NtlmAccess ¶ added in v1.1.0
func (c *Configuration) NtlmAccess(operation string) bool
func (*Configuration) PrivateAccess ¶ added in v0.5.3
func (c *Configuration) PrivateAccess(operation string) bool
PrivateAccess will retrieve the access value and return true if the value is set to private. When a repo is marked as having private access, the http requests for the batch api will fetch the credentials before running, otherwise the request will run without credentials.
func (*Configuration) RemoteEndpoint ¶
func (c *Configuration) RemoteEndpoint(remote, operation string) Endpoint
func (*Configuration) Remotes ¶
func (c *Configuration) Remotes() []string
func (*Configuration) SetAccess ¶ added in v0.6.0
func (c *Configuration) SetAccess(operation string, authType string)
SetAccess will set the private access flag in .git/config.
func (*Configuration) SetEndpointAccess ¶ added in v0.6.0
func (c *Configuration) SetEndpointAccess(e Endpoint, authType string)
func (*Configuration) SetManualEndpoint ¶ added in v1.1.1
func (c *Configuration) SetManualEndpoint(e Endpoint)
Manually set an Endpoint to use instead of deriving from Git config
func (*Configuration) Setenv ¶ added in v0.5.3
func (c *Configuration) Setenv(key, value string) error
type CopyCallback ¶
func CopyCallbackFile ¶
type DownloadCheckable ¶ added in v0.6.0
type DownloadCheckable struct { Pointer *WrappedPointer // contains filtered or unexported fields }
The ability to check that a file can be downloaded
func NewDownloadCheckable ¶ added in v0.6.0
func NewDownloadCheckable(p *WrappedPointer) *DownloadCheckable
func (*DownloadCheckable) Check ¶ added in v0.6.0
func (d *DownloadCheckable) Check() (*ObjectResource, error)
func (*DownloadCheckable) Name ¶ added in v0.6.0
func (d *DownloadCheckable) Name() string
func (*DownloadCheckable) Object ¶ added in v0.6.0
func (d *DownloadCheckable) Object() *ObjectResource
func (*DownloadCheckable) Oid ¶ added in v0.6.0
func (d *DownloadCheckable) Oid() string
func (*DownloadCheckable) SetObject ¶ added in v0.6.0
func (d *DownloadCheckable) SetObject(o *ObjectResource)
func (*DownloadCheckable) Size ¶ added in v0.6.0
func (d *DownloadCheckable) Size() int64
func (*DownloadCheckable) Transfer ¶ added in v0.6.0
func (d *DownloadCheckable) Transfer(cb CopyCallback) error
type Downloadable ¶ added in v0.5.2
type Downloadable struct {
*DownloadCheckable
}
The ability to actually download
func NewDownloadable ¶ added in v0.5.2
func NewDownloadable(p *WrappedPointer) *Downloadable
func (*Downloadable) Transfer ¶ added in v0.5.2
func (d *Downloadable) Transfer(cb CopyCallback) error
type Endpoint ¶
An Endpoint describes how to access a Git LFS server.
func NewEndpoint ¶ added in v0.5.2
NewEndpoint initializes a new Endpoint for a given URL.
func NewEndpointFromCloneURL ¶ added in v0.5.2
NewEndpointFromCloneURL creates an Endpoint from a git clone URL by appending "[.git]/info/lfs".
func NewEndpointFromCloneURLWithConfig ¶ added in v1.1.1
func NewEndpointFromCloneURLWithConfig(url string, c *Configuration) Endpoint
NewEndpointFromCloneURLWithConfig creates an Endpoint from a git clone URL by appending "[.git]/info/lfs".
func NewEndpointWithConfig ¶ added in v1.1.1
func NewEndpointWithConfig(rawurl string, c *Configuration) Endpoint
NewEndpointWithConfig initializes a new Endpoint for a given URL.
type Extension ¶ added in v0.6.0
An Extension describes how to manipulate files during smudge and clean. Extensions are parsed from the Git config.
type FetchPruneConfig ¶ added in v0.6.0
type FetchPruneConfig struct { // The number of days prior to current date for which (local) refs other than HEAD // will be fetched with --recent (default 7, 0 = only fetch HEAD) FetchRecentRefsDays int // Makes the FetchRecentRefsDays option apply to remote refs from fetch source as well (default true) FetchRecentRefsIncludeRemotes bool // number of days prior to latest commit on a ref that we'll fetch previous // LFS changes too (default 0 = only fetch at ref) FetchRecentCommitsDays int // Whether to always fetch recent even without --recent FetchRecentAlways bool // Number of days added to FetchRecent*; data outside combined window will be // deleted when prune is run. (default 3) PruneOffsetDays int // Always verify with remote before pruning PruneVerifyRemoteAlways bool // Name of remote to check for unpushed and verify checks PruneRemoteName string }
FetchPruneConfig collects together the config options that control fetching and pruning
type Hook ¶ added in v0.6.0
A Hook represents a githook as described in http://git-scm.com/docs/githooks. Hooks have a type, which is the type of hook that they are, and a body, which represents the thing they will execute when invoked by Git.
func (*Hook) Install ¶ added in v0.6.0
Install installs this Git hook on disk, or upgrades it if it does exist, and is upgradeable. It will create a hooks directory relative to the local Git directory. It returns and halts at any errors, and returns nil if the operation was a success.
func (*Hook) Path ¶ added in v0.6.0
Path returns the desired (or actual, if installed) location where this hook should be installed, relative to the local Git directory.
type HttpClient ¶ added in v0.5.2
type InstallOptions ¶ added in v1.0.0
InstallOptions serves as an argument to Install().
type LogDiffDirection ¶ added in v0.6.0
type LogDiffDirection byte
When scanning diffs e.g. parseLogOutputToPointers, which direction of diff to include data from, i.e. '+' or '-'. Depending on what you're scanning for either might be useful
type ObjectError ¶ added in v1.1.1
func (*ObjectError) Error ¶ added in v1.1.1
func (e *ObjectError) Error() string
type ObjectResource ¶ added in v1.1.1
type ObjectResource struct { Oid string `json:"oid,omitempty"` Size int64 `json:"size"` Actions map[string]*linkRelation `json:"actions,omitempty"` Links map[string]*linkRelation `json:"_links,omitempty"` Error *ObjectError `json:"error,omitempty"` }
func Batch ¶ added in v0.5.2
func Batch(objects []*ObjectResource, operation string) ([]*ObjectResource, error)
func DownloadCheck ¶ added in v0.5.2
func DownloadCheck(oid string) (*ObjectResource, error)
func UploadCheck ¶ added in v0.5.2
func UploadCheck(oidPath string) (*ObjectResource, error)
func (*ObjectResource) NewRequest ¶ added in v1.1.1
func (o *ObjectResource) NewRequest(relation, method string) (*http.Request, error)
func (*ObjectResource) Rel ¶ added in v1.1.1
func (o *ObjectResource) Rel(name string) (*linkRelation, bool)
type Platform ¶ added in v0.6.0
type Platform int
func GetPlatform ¶ added in v0.6.0
func GetPlatform() Platform
type Pointer ¶ added in v0.5.1
type Pointer struct { Version string Oid string Size int64 OidType string Extensions []*PointerExtension }
func AllLocalObjects ¶ added in v1.1.0
func AllLocalObjects() []*Pointer
AllLocalObjects returns a slice of the the objects stored in the local LFS store This does not necessarily mean referenced by commits, just stored Note: reports final SHA only, extensions are ignored
func DecodePointerFromFile ¶ added in v0.6.0
func NewPointer ¶ added in v0.5.1
func NewPointer(oid string, size int64, exts []*PointerExtension) *Pointer
type PointerExtension ¶ added in v0.6.0
A PointerExtension is parsed from the Git LFS Pointer file.
func NewPointerExtension ¶ added in v0.6.0
func NewPointerExtension(name string, priority int, oid string) *PointerExtension
type ProgressMeter ¶ added in v0.6.0
type ProgressMeter struct {
// contains filtered or unexported fields
}
ProgressMeter provides a progress bar type output for the TransferQueue. It is given an estimated file count and size up front and tracks the number of files and bytes transferred as well as the number of files and bytes that get skipped because the transfer is unnecessary.
func NewProgressMeter ¶ added in v0.6.0
func NewProgressMeter(estFiles int, estBytes int64, dryRun bool) *ProgressMeter
NewProgressMeter creates a new ProgressMeter for the number and size of files given.
func (*ProgressMeter) Add ¶ added in v0.6.0
func (p *ProgressMeter) Add(name string)
Add tells the progress meter that a transferring file is being added to the TransferQueue.
func (*ProgressMeter) Finish ¶ added in v0.6.0
func (p *ProgressMeter) Finish()
Finish shuts down the ProgressMeter
func (*ProgressMeter) FinishTransfer ¶ added in v0.6.0
func (p *ProgressMeter) FinishTransfer(name string)
FinishTransfer increments the finished transfer count
func (*ProgressMeter) Skip ¶ added in v0.6.0
func (p *ProgressMeter) Skip(size int64)
Skip tells the progress meter that a file of size `size` is being skipped because the transfer is unnecessary.
func (*ProgressMeter) Start ¶ added in v0.6.0
func (p *ProgressMeter) Start()
func (*ProgressMeter) TransferBytes ¶ added in v0.6.0
func (p *ProgressMeter) TransferBytes(direction, name string, read, total int64, current int)
TransferBytes increments the number of bytes transferred
type ScanRefsOptions ¶ added in v0.5.3
type ScanRefsOptions struct { ScanMode ScanningMode RemoteName string SkipDeletedBlobs bool // contains filtered or unexported fields }
func NewScanRefsOptions ¶ added in v1.0.2
func NewScanRefsOptions() *ScanRefsOptions
func (*ScanRefsOptions) GetName ¶ added in v1.0.2
func (o *ScanRefsOptions) GetName(sha string) (string, bool)
func (*ScanRefsOptions) SetName ¶ added in v1.0.2
func (o *ScanRefsOptions) SetName(sha, name string)
type ScanningMode ¶ added in v0.6.0
type ScanningMode int
type Spinner ¶ added in v0.6.0
type Spinner struct {
// contains filtered or unexported fields
}
Indeterminate progress indicator 'spinner'
func NewSpinner ¶ added in v0.6.0
func NewSpinner() *Spinner
type StringSet ¶ added in v1.1.0
type StringSet map[string]struct{}
The primary type that represents a set
func NewStringSet ¶ added in v1.1.0
func NewStringSet() StringSet
Creates and returns a reference to an empty set.
func NewStringSetFromSlice ¶ added in v1.1.0
Creates and returns a reference to a set from an existing slice
func NewStringSetWithCapacity ¶ added in v1.1.0
Creates and returns a reference to an empty set with a capacity.
func (StringSet) Add ¶ added in v1.1.0
Adds an item to the current set if it doesn't already exist in the set.
func (StringSet) Cardinality ¶ added in v1.1.0
Cardinality returns how many items are currently in the set.
func (*StringSet) Clear ¶ added in v1.1.0
func (set *StringSet) Clear()
Clears the entire set to be the empty set.
func (StringSet) Clone ¶ added in v1.1.0
Returns a clone of the set. Does NOT clone the underlying elements.
func (StringSet) ContainsAll ¶ added in v1.1.0
Determines if the given items are all in the set
func (StringSet) Difference ¶ added in v1.1.0
Returns a new set with items in the current set but not in the other set
func (StringSet) Equal ¶ added in v1.1.0
Equal determines if two sets are equal to each other. If they both are the same size and have the same items they are considered equal. Order of items is not relevent for sets to be equal.
func (StringSet) Intersect ¶ added in v1.1.0
Returns a new set with items that exist only in both sets.
func (StringSet) IsSubset ¶ added in v1.1.0
Determines if every item in the other set is in this set.
func (StringSet) IsSuperset ¶ added in v1.1.0
Determines if every item of this set is in the other set.
func (StringSet) Iter ¶ added in v1.1.0
Iter() returns a channel of type string that you can range over.
func (StringSet) SymmetricDifference ¶ added in v1.1.0
Returns a new set with items in the current set or the other set but not in both.
type TransferQueue ¶ added in v0.5.2
type TransferQueue struct {
// contains filtered or unexported fields
}
TransferQueue provides a queue that will allow concurrent transfers.
func NewDownloadCheckQueue ¶ added in v0.6.0
func NewDownloadCheckQueue(files int, size int64, dryRun bool) *TransferQueue
NewDownloadCheckQueue builds a checking queue, allowing `workers` concurrent check operations.
func NewDownloadQueue ¶ added in v0.5.2
func NewDownloadQueue(files int, size int64, dryRun bool) *TransferQueue
NewDownloadQueue builds a DownloadQueue, allowing `workers` concurrent downloads.
func NewUploadQueue ¶ added in v0.5.1
func NewUploadQueue(files int, size int64, dryRun bool) *TransferQueue
NewUploadQueue builds an UploadQueue, allowing `workers` concurrent uploads.
func (*TransferQueue) Add ¶ added in v0.5.2
func (q *TransferQueue) Add(t Transferable)
Add adds a Transferable to the transfer queue.
func (*TransferQueue) Errors ¶ added in v0.5.2
func (q *TransferQueue) Errors() []error
Errors returns any errors encountered during transfer.
func (*TransferQueue) Wait ¶ added in v0.6.0
func (q *TransferQueue) Wait()
Wait waits for the queue to finish processing all transfers. Once Wait is called, Add will no longer add transferables to the queue. Any failed transfers will be automatically retried once.
func (*TransferQueue) Watch ¶ added in v0.5.2
func (q *TransferQueue) Watch() chan string
Watch returns a channel where the queue will write the OID of each transfer as it completes. The channel will be closed when the queue finishes processing.
type Transferable ¶ added in v0.5.2
type Transferable interface { Check() (*ObjectResource, error) Transfer(CopyCallback) error Object() *ObjectResource Oid() string Size() int64 Name() string SetObject(*ObjectResource) }
type TreeBlob ¶ added in v0.6.0
An entry from ls-tree or rev-list including a blob sha and tree path
type Uploadable ¶ added in v0.5.1
Uploadable describes a file that can be uploaded.
func NewUploadable ¶ added in v0.5.1
func NewUploadable(oid, filename string) (*Uploadable, error)
NewUploadable builds the Uploadable from the given information. "filename" can be empty if a raw object is pushed (see "object-id" flag in push command)/
func (*Uploadable) Check ¶ added in v0.5.2
func (u *Uploadable) Check() (*ObjectResource, error)
func (*Uploadable) Name ¶ added in v0.5.2
func (u *Uploadable) Name() string
func (*Uploadable) Object ¶ added in v0.5.2
func (u *Uploadable) Object() *ObjectResource
func (*Uploadable) Oid ¶ added in v0.5.2
func (u *Uploadable) Oid() string
func (*Uploadable) SetObject ¶ added in v0.5.2
func (u *Uploadable) SetObject(o *ObjectResource)
func (*Uploadable) Size ¶ added in v0.5.1
func (u *Uploadable) Size() int64
func (*Uploadable) Transfer ¶ added in v0.5.2
func (u *Uploadable) Transfer(cb CopyCallback) error
type WrappedPointer ¶ added in v0.5.2
type WrappedPointer struct { Sha1 string Name string SrcName string Size int64 Status string *Pointer }
WrappedPointer wraps a pointer.Pointer and provides the git sha1 and the file name associated with the object, taken from the rev-list output.
func ScanIndex ¶ added in v0.5.1
func ScanIndex() ([]*WrappedPointer, error)
ScanIndex returns a slice of WrappedPointer objects for all Git LFS pointers it finds in the index. Reports unique oids once only, not multiple times if >1 file uses the same content
func ScanPreviousVersions ¶ added in v0.6.0
func ScanPreviousVersions(ref string, since time.Time) ([]*WrappedPointer, error)
ScanPreviousVersions scans changes reachable from ref (commit) back to since. Returns pointers for *previous* versions that overlap that time. Does not return pointers which were still in use at ref (use ScanRef for that)
func ScanRefs ¶ added in v0.5.1
func ScanRefs(refLeft, refRight string, opt *ScanRefsOptions) ([]*WrappedPointer, error)
ScanRefs takes a ref and returns a slice of WrappedPointer objects for all Git LFS pointers it finds for that ref. Reports unique oids once only, not multiple times if >1 file uses the same content
func ScanTree ¶ added in v0.6.0
func ScanTree(ref string) ([]*WrappedPointer, error)
ScanTree takes a ref and returns a slice of WrappedPointer objects in the tree at that ref Differs from ScanRefs in that multiple files in the tree with the same content are all reported
func ScanUnpushed ¶ added in v0.6.0
func ScanUnpushed(remoteName string) ([]*WrappedPointer, error)
ScanUnpushed scans history for all LFS pointers which have been added but not pushed to the named remote. remoteName can be left blank to mean 'any remote'
Source Files ¶
- attribute.go
- batcher.go
- client.go
- config.go
- credentials.go
- download_queue.go
- endpoint.go
- errors.go
- extension.go
- hook.go
- http.go
- lfs.go
- localstorage.go
- ntlm.go
- pointer.go
- pointer_clean.go
- pointer_smudge.go
- progress_meter.go
- scanner.go
- setup.go
- ssh.go
- stringset.go
- transfer_queue.go
- upload_queue.go
- util.go
- util_linux.go