Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPathMustBeAbsolute is returned if the given path to New was not absolute. ErrPathMustBeAbsolute = errors.New("path must be absolute") // ErrPathMustExist is returned if the given path to New did not exist. ErrPathMustExist = errors.New("path must exist") // ErrPathMustBeADirectory is returned if the given path to New is not a directory. ErrPathMustBeADirectory = errors.New("path must be a directory") // ErrPathMustBeWritable is returned if the given path to New is not writable. ErrPathMustBeWritable = errors.New("path must be writable") // ErrHostnameRequired is returned if the given hostName to New is not given. ErrHostnameRequired = errors.New("hostName is required") // ErrHostnameMustNotContainScheme is returned if the given hostName to New contained a scheme. ErrHostnameMustNotContainScheme = errors.New("hostName must not contain scheme") // ErrHostnameNotValid is returned if the given hostName to New is not valid. ErrHostnameNotValid = errors.New("hostName is not valid") // ErrHostnameMustNotContainPath is returned if the given hostName to New contained a path. ErrHostnameMustNotContainPath = errors.New("hostName must not contain a path") // ErrNotFound is returned if the nar or narinfo were not found. ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache represents the main cache service.
func (*Cache) GetNar ¶
GetNarInfo returns the nar given a hash and compression from the store. If the nar is not found in the store, it's pulled from an upstream, stored in the stored and finally returned. NOTE: It's the caller responsibility to close the body.
func (*Cache) GetNarInfo ¶
GetNarInfo returns the narInfo given a hash from the store. If the narInfo is not found in the store, it's pulled from an upstream, stored in the stored and finally returned.
Click to show internal directories.
Click to hide internal directories.