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 FileBinaryCacheStore ¶
type FileBinaryCacheStore struct {
// contains filtered or unexported fields
}
func NewFileBinaryCacheStore ¶
func NewFileBinaryCacheStore(u *url.URL) FileBinaryCacheStore
func (FileBinaryCacheStore) FileExists ¶
func (FileBinaryCacheStore) GetFile ¶
func (c FileBinaryCacheStore) GetFile(ctx context.Context, p string) (io.ReadCloser, error)
func (FileBinaryCacheStore) URL ¶
func (c FileBinaryCacheStore) URL() string
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 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)