Documentation ¶
Overview ¶
Package libstore implements a subset of the nix libstore API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryCacheReader ¶
type BinaryCacheReader interface { FileExists(ctx context.Context, path string) (bool, error) GetFile(ctx context.Context, path string) (io.ReadCloser, error) URL() string }
BinaryCacheReader represents a read-only binary cache store
func NewBinaryCacheReader ¶
func NewBinaryCacheReader(ctx context.Context, storeURL string) (BinaryCacheReader, error)
NewBinaryCacheReader parses the storeURL and returns the proper store reader for it.
type GCSBinaryCacheStore ¶
type GCSBinaryCacheStore struct {
// contains filtered or unexported fields
}
GCSBinaryCacheStore ...
func NewGCSBinaryCacheStore ¶
NewGCSBinaryCacheStore --
func (GCSBinaryCacheStore) FileExists ¶
FileExists returns true if the file is already in the store. err is used for transient issues like networking errors.
func (GCSBinaryCacheStore) GetFile ¶
func (c GCSBinaryCacheStore) GetFile(ctx context.Context, path string) (io.ReadCloser, error)
GetFile returns a file stream from the store if the file exists
func (GCSBinaryCacheStore) URL ¶
func (c GCSBinaryCacheStore) URL() string
URL returns the store URI
type HTTPBinaryCacheStore ¶
type HTTPBinaryCacheStore struct {
// contains filtered or unexported fields
}
HTTPBinaryCacheStore ...
func DefaultCache ¶
func DefaultCache() HTTPBinaryCacheStore
DefaultCache points to our beloved https://cache.nixos.org
func NewHTTPBinaryCacheStore ¶
func NewHTTPBinaryCacheStore(u *url.URL) HTTPBinaryCacheStore
NewHTTPBinaryCacheStore ---
func (HTTPBinaryCacheStore) FileExists ¶
FileExists returns true if the file is already in the store. err is used for transient issues like networking errors.
func (HTTPBinaryCacheStore) GetFile ¶
func (c HTTPBinaryCacheStore) GetFile(ctx context.Context, path string) (io.ReadCloser, error)
GetFile returns a file stream from the store if the file exists
func (HTTPBinaryCacheStore) URL ¶
func (c HTTPBinaryCacheStore) URL() string
URL returns the store URI
type NarInfo ¶
type NarInfo struct { StorePath string URL string Compression string FileHash string FileSize int NarHash string NarSize int References []string Deriver string System string Signatures []string CA string }
NarInfo represent the nar-info format, packed as a struct
func ParseNarInfo ¶
ParseNarInfo parses the buffer
TODO: parse the FileHash and NarHash to make sure they are valid TODO: validate that the StorePath is valid TODO: validate the references to be valid store paths after being appended to store.storeDir TODO: validate the same for the deriver
func (NarInfo) ContentType ¶
ContentType returns the mime content type of the object
type S3BinaryCacheStore ¶
type S3BinaryCacheStore struct { BucketName string Client *s3.S3 // contains filtered or unexported fields }
func NewS3BinaryCacheStore ¶
func NewS3BinaryCacheStore(u *url.URL) (*S3BinaryCacheStore, error)
func (*S3BinaryCacheStore) FileExists ¶
func (*S3BinaryCacheStore) GetFile ¶
func (c *S3BinaryCacheStore) GetFile(ctx context.Context, path string) (io.ReadCloser, error)