filestore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2014 License: Apache-2.0 Imports: 4 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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