Documentation
¶
Index ¶
- Variables
- func ReadFromReader(ctx context.Context, rd io.Reader) ([]types.Value, error)
- func ReadValueFile(ctx context.Context, filepath string) ([]types.Value, error)
- func WritePrimitiveValueFile(ctx context.Context, filepath string, values ...types.Value) error
- func WriteToWriter(ctx context.Context, wr io.Writer, store *FileValueStore, ...) error
- func WriteValueFile(ctx context.Context, filepath string, store *FileValueStore, ...) (err error)
- type FileValueStore
- func (f *FileValueStore) Close() error
- func (f *FileValueStore) Commit(ctx context.Context, current, last hash.Hash) (bool, error)
- func (f *FileValueStore) Format() *types.NomsBinFormat
- func (f *FileValueStore) Get(ctx context.Context, h hash.Hash) (chunks.Chunk, error)
- func (f *FileValueStore) GetMany(ctx context.Context, hashes hash.HashSet, ...) error
- func (f *FileValueStore) Has(ctx context.Context, h hash.Hash) (bool, error)
- func (f *FileValueStore) HasMany(ctx context.Context, hashes hash.HashSet) (absent hash.HashSet, err error)
- func (f *FileValueStore) Put(ctx context.Context, c chunks.Chunk) error
- func (f *FileValueStore) ReadManyValues(ctx context.Context, hashes hash.HashSlice) (types.ValueSlice, error)
- func (f *FileValueStore) ReadValue(ctx context.Context, h hash.Hash) (types.Value, error)
- func (f *FileValueStore) Rebase(ctx context.Context) error
- func (f *FileValueStore) Root(ctx context.Context) (hash.Hash, error)
- func (f *FileValueStore) Stats() interface{}
- func (f *FileValueStore) StatsSummary() string
- func (f *FileValueStore) Version() string
- func (f *FileValueStore) WriteValue(ctx context.Context, v types.Value) (types.Ref, error)
Constants ¶
This section is empty.
Variables ¶
var ErrCorruptNVF = errors.New("nvf file is corrupt")
ErrCorruptNVF is the error used when the file being read is corrupt
Functions ¶
func ReadFromReader ¶
ReadFromReader reads from the provided reader which should provided access to data in the value file format and returns the values
func ReadValueFile ¶
ReadValueFile reads from the provided file and returns the values stored in the file
func WritePrimitiveValueFile ¶
WritePrimitiveValueFile writes values to the filepath provided
func WriteToWriter ¶
func WriteToWriter(ctx context.Context, wr io.Writer, store *FileValueStore, values ...types.Value) error
WriteToWriter writes the values out to the provided writer in the value file format
func WriteValueFile ¶
func WriteValueFile(ctx context.Context, filepath string, store *FileValueStore, values ...types.Value) (err error)
WriteValueFile writes the values stored in the *FileValueStore to the filepath provided
Types ¶
type FileValueStore ¶
type FileValueStore struct {
// contains filtered or unexported fields
}
FileValueStore implements a trivial in memory chunks.ChunkStore and types.ValueReadWriter in order to allow easy serialization / deserialization of noms data to and from a file
func NewFileValueStore ¶
func NewFileValueStore(nbf *types.NomsBinFormat) (*FileValueStore, error)
NewFileValueStore creates a new FileValueStore
func (*FileValueStore) Format ¶
func (f *FileValueStore) Format() *types.NomsBinFormat
Gets the NomsBinaryFormat for the Store
func (*FileValueStore) GetMany ¶
func (f *FileValueStore) GetMany(ctx context.Context, hashes hash.HashSet, found func(context.Context, *chunks.Chunk)) error
GetMany gets chunks by their hashes. Chunks that are found are written to the channel.
func (*FileValueStore) HasMany ¶
func (f *FileValueStore) HasMany(ctx context.Context, hashes hash.HashSet) (absent hash.HashSet, err error)
HasMany returns the set of hashes that are absent from the store
func (*FileValueStore) ReadManyValues ¶
func (f *FileValueStore) ReadManyValues(ctx context.Context, hashes hash.HashSlice) (types.ValueSlice, error)
ReadManyValues reads and decodes Values indicated by |hashes| from lvs and returns the found Values in the same order. Any non-present Values will be represented by nil.
func (*FileValueStore) Rebase ¶
func (f *FileValueStore) Rebase(ctx context.Context) error
Rebase brings this ChunkStore into sync with the persistent storage's current root. Has no impact here
func (*FileValueStore) Stats ¶
func (f *FileValueStore) Stats() interface{}
Stats doesn't do anything
func (*FileValueStore) StatsSummary ¶
func (f *FileValueStore) StatsSummary() string
StatsSummary doesn't do anything
func (*FileValueStore) Version ¶
func (f *FileValueStore) Version() string
Version returns the nbf version string
func (*FileValueStore) WriteValue ¶
WriteValue adds a value to the store