libstore

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

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 (c FileBinaryCacheStore) FileExists(ctx context.Context, p string) (bool, error)

func (FileBinaryCacheStore) GetFile

func (FileBinaryCacheStore) URL

func (c FileBinaryCacheStore) URL() string

type GCSBinaryCacheStore

type GCSBinaryCacheStore struct {
	// contains filtered or unexported fields
}

GCSBinaryCacheStore ...

func NewGCSBinaryCacheStore

func NewGCSBinaryCacheStore(ctx context.Context, u *url.URL) (*GCSBinaryCacheStore, error)

NewGCSBinaryCacheStore --

func (GCSBinaryCacheStore) FileExists

func (c GCSBinaryCacheStore) FileExists(ctx context.Context, path string) (bool, error)

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

func (c HTTPBinaryCacheStore) FileExists(ctx context.Context, path string) (bool, error)

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 (c *S3BinaryCacheStore) FileExists(ctx context.Context, path string) (bool, error)

func (*S3BinaryCacheStore) GetFile

func (c *S3BinaryCacheStore) GetFile(ctx context.Context, path string) (io.ReadCloser, error)

func (S3BinaryCacheStore) URL

func (c S3BinaryCacheStore) URL() string

URL returns the store URI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL