filestore

package
v0.5.2-pre3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package filestore provides local file uploads and downloads for cookbook uploading and downloading. All access to the files is through the checksum, rather than the file name.

If config.Config.LocalFstoreDir is != "", the content of the files will be stored in that directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHashes added in v0.5.0

func DeleteHashes(file_hashes []string)

Delete all the checksum hashes given from the filestore.

func GetList

func GetList() []string

Get a list of files that have been uploaded.

Types

type FileStore

type FileStore struct {
	Chksum string
	Data   *[]byte
}

An individual file in the filestore. Note that there is no actual name for the file used, but it is identified by the file's checksum. The file's data is stored as a pointer to an array of bytes.

func AllFilestores added in v0.5.2

func AllFilestores() []*FileStore

All file checksums and their contents, for exporting.

func Get

func Get(chksum string) (*FileStore, error)

func New

func New(chksum string, data io.ReadCloser, data_length int64) (*FileStore, error)

Create a new filestore item with the given checksum, io.ReadCloser holding the file's data, and the length of the file. If the file data's checksum does not match the provided checksum an error will be trhown.

func (*FileStore) Delete

func (f *FileStore) Delete() error

func (*FileStore) Save

func (f *FileStore) Save() error

Jump to

Keyboard shortcuts

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