Documentation
¶
Overview ¶
Package metadatastore contains some datastructures that are part of a binary cache.
Index ¶
- func ParseNarinfo(narinfo *narinfo.NarInfo) (*PathInfo, *NarMeta, error)
- func RenderNarinfo(pathInfo *PathInfo, narMeta *NarMeta, compressionType string) (string, error)
- type FileStore
- func (fs *FileStore) Close() error
- func (fs *FileStore) DropAll(ctx context.Context) error
- func (fs *FileStore) GetNarMeta(ctx context.Context, narHash []byte) (*NarMeta, error)
- func (fs *FileStore) GetPathInfo(ctx context.Context, outputHash []byte) (*PathInfo, error)
- func (fs *FileStore) PutNarMeta(ctx context.Context, narMeta *NarMeta) error
- func (fs *FileStore) PutPathInfo(ctx context.Context, pathinfo *PathInfo) error
- type MemoryStore
- func (ms *MemoryStore) Close() error
- func (ms *MemoryStore) DropAll(ctx context.Context) error
- func (ms *MemoryStore) GetNarMeta(ctx context.Context, narHash []byte) (*NarMeta, error)
- func (ms *MemoryStore) GetPathInfo(ctx context.Context, outputHash []byte) (*PathInfo, error)
- func (ms *MemoryStore) PutNarMeta(ctx context.Context, narMeta *NarMeta) error
- func (ms *MemoryStore) PutPathInfo(ctx context.Context, pathinfo *PathInfo) error
- type MetadataStore
- type NarMeta
- type PathInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseNarinfo ¶
ParseNarinfo parses a narinfo.NarInfo struct and returns a PathInfo and NarMeta struct, or an error.
Types ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func (*FileStore) GetNarMeta ¶
func (*FileStore) GetPathInfo ¶
func (*FileStore) PutNarMeta ¶
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (*MemoryStore) Close ¶
func (ms *MemoryStore) Close() error
func (*MemoryStore) GetNarMeta ¶
func (*MemoryStore) GetPathInfo ¶
func (*MemoryStore) PutNarMeta ¶
func (ms *MemoryStore) PutNarMeta(ctx context.Context, narMeta *NarMeta) error
func (*MemoryStore) PutPathInfo ¶
func (ms *MemoryStore) PutPathInfo(ctx context.Context, pathinfo *PathInfo) error
type MetadataStore ¶
type MetadataStore interface { GetPathInfo(ctx context.Context, outputHash []byte) (*PathInfo, error) PutPathInfo(ctx context.Context, pathInfo *PathInfo) error // TODO: once we have reference scanning, it shouldn't be possible to mutate existing NarMetas GetNarMeta(ctx context.Context, narHash []byte) (*NarMeta, error) PutNarMeta(ctx context.Context, narMeta *NarMeta) error DropAll(ctx context.Context) error io.Closer }
type NarMeta ¶
type NarMeta struct { NarHash []byte Size uint64 References [][]byte // this refers to multiple PathInfo.OutputHash ReferencesStr []string // we still keep the strings around, so we don't need to look up all other PathInfo objects }
Click to show internal directories.
Click to hide internal directories.