dayfile

package
v0.0.0-...-51c18a3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoDataToWrite = errors.New("no data to write")

Functions

This section is empty.

Types

type ArticleBlob

type ArticleBlob struct {
	Buf  *bytes.Buffer
	Temp *os.File
}

func NewArticleBlob

func NewArticleBlob() *ArticleBlob

func NewArticleBlobFromArray

func NewArticleBlobFromArray(arr []byte) *ArticleBlob

func NewArticleBlobFromBuffer

func NewArticleBlobFromBuffer(buf *bytes.Buffer) *ArticleBlob

func (*ArticleBlob) Dispose

func (ab *ArticleBlob) Dispose() error

func (*ArticleBlob) Size

func (ab *ArticleBlob) Size() int64

func (*ArticleBlob) Truncate

func (ab *ArticleBlob) Truncate() error

func (*ArticleBlob) Write

func (ab *ArticleBlob) Write(p []byte) (n int, err error)

func (*ArticleBlob) WriteTo

func (ab *ArticleBlob) WriteTo(dst io.Writer) (n int64, err error)

type ArticleBlobPool

type ArticleBlobPool interface {
	Borrow() *ArticleBlob
	Release(o *ArticleBlob)
}

func MemoryArticleBlobPool

func MemoryArticleBlobPool(n int) ArticleBlobPool

func TempfileArticleBlobPool

func TempfileArticleBlobPool(directory, prefix, postfix string, size int) ArticleBlobPool

type FixedBlobPool

type FixedBlobPool chan *ArticleBlob

func (FixedBlobPool) Borrow

func (f FixedBlobPool) Borrow() *ArticleBlob

func (FixedBlobPool) Release

func (f FixedBlobPool) Release(o *ArticleBlob)

type StorageFile

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

func (*StorageFile) ReadBlob

func (s *StorageFile) ReadBlob(offset, length int64) io.Reader

func (*StorageFile) StoreConcurrently

func (s *StorageFile) StoreConcurrently(a *ArticleBlob) (offset, length int64, err error)

type StorageFilePool

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

func (*StorageFilePool) Dayfile

func (s *StorageFilePool) Dayfile(db groupdb.DayID, create bool) *StorageFile

Jump to

Keyboard shortcuts

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