Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PrefetchWorkers is the number of workers that will be used to prefetch files. // To disable prefetch, set this to 0. PrefetchWorkers = 50 // ResolveRetries is the number of times to attempt resolving a key before giving up. ResolveRetries = 3 // ResolveTimeout is the timeout for resolving a key. ResolveTimeout = 20 * time.Millisecond )
Functions ¶
This section is empty.
Types ¶
type File ¶
type File interface { // Seek sets the current file offset. Seek(offset int64, whence int) (int64, error) // Fstat returns the size of the file. Fstat() (int64, error) // Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered. Read(p []byte) (n int, err error) // ReadAt reads len(p) bytes from the File starting at byte offset off. It returns the number of bytes read and the error, if any. ReadAt(buff []byte, off int64) (int, error) }
File is an abstraction for a file that can be read from this store. It is similar to os.File.
type FilesStore ¶
type FilesStore interface { // Key tries to find the cache key for the requested content or returns empty. Key(c context.Context) (key string, d digest.Digest, err error) // Open opens the requested file and starts prefetching it. It also returns the size of the file. Open(c context.Context) (File, error) // Subscribe returns a channel that will be notified when a blob is added to the store. Subscribe() chan string }
FilesStore describes a store for files.
func NewFilesStore ¶
NewFilesStore creates a new store.
Click to show internal directories.
Click to hide internal directories.