MCPcopy
hub / github.com/git-lfs/git-lfs / Adapter

Interface Adapter

tq/transfer.go:235–253  ·  view source on GitHub ↗

Adapter is implemented by types which can upload and/or download LFS file content to a remote store. Each Adapter accepts one or more requests which it may schedule and parallelise in whatever way it chooses, clients of this interface will receive notifications of progress and completion asynchronou

Source from the content-addressed store, hash-verified

233// This is so that the orchestration remains core & standard but Adapter
234// can be changed to physically transfer to different hosts with less code.
235type Adapter interface {
236 // Name returns the name of this adapter, which is the same for all instances
237 // of this type of adapter
238 Name() string
239 // Direction returns whether this instance is an upload or download instance
240 // Adapter instances can only be one or the other, although the same
241 // type may be instantiated for each direction
242 Direction() Direction
243 // Begin a new batch of uploads or downloads. Call this first, followed by one
244 // or more Add calls. The passed in callback will receive updates on progress.
245 Begin(cfg AdapterConfig, cb ProgressCallback) error
246 // Add queues a download/upload, which will complete asynchronously and
247 // notify the callbacks given to Begin()
248 Add(transfers ...*Transfer) (results <-chan TransferResult)
249 // Indicate that all transfers have been scheduled and resources can be released
250 // once the queued items have completed.
251 // This call blocks until all items have been processed
252 End()
253}
254
255// Result of a transfer returned through CompletionChannel()
256type TransferResult struct {

Callers 24

CheckCloneFileSupportedFunction · 0.65
collectFastWalkResultsFunction · 0.65
TestSetWriteFlagFunction · 0.65
WalkMethod · 0.65
TempFileFunction · 0.65
CheckCloneFileSupportedFunction · 0.65
SpoolFunction · 0.65
CheckCloneFileSupportedFunction · 0.65
TestBasicAdapterExistsFunction · 0.65
ensureAdapterBegunMethod · 0.65

Implementers 2

adapterBasetq/adapterbase.go
testAdaptertq/transfer_test.go

Calls

no outgoing calls

Tested by

no test coverage detected