fileprovider

package
v3.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FIRSTREAD = 3459

This is the size of a maximal size cblock + header

View Source
const NUMFILES = 256

Variables

This section is empty.

Functions

This section is empty.

Types

type FileProviderSegment

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

func (*FileProviderSegment) BaseAddress

func (seg *FileProviderSegment) BaseAddress() uint64

Returns the address of the first free word in the segment when it was locked

func (*FileProviderSegment) Flush

func (seg *FileProviderSegment) Flush()

Block until all writes are complete, not

func (*FileProviderSegment) Unlock

func (seg *FileProviderSegment) Unlock()

Unlocks the segment for the StorageProvider to give to other consumers Implies a flush

func (*FileProviderSegment) Write

func (seg *FileProviderSegment) Write(uuid []byte, address uint64, data []byte) (uint64, error)

Writes a slice to the segment, returns immediately Returns nil if op is OK, otherwise ErrNoSpace or ErrInvalidArgument It is up to the implementer to work out how to report no space immediately The uint64 rv is the address to be used for the next write

type FileStorageProvider

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

func (*FileStorageProvider) CreateDatabase

func (sp *FileStorageProvider) CreateDatabase(opts map[string]string) error

Called to create the database for the first time

func (*FileStorageProvider) Initialize

func (sp *FileStorageProvider) Initialize(opts map[string]string)

Called at startup

func (*FileStorageProvider) LockSegment

func (sp *FileStorageProvider) LockSegment(uuid []byte) bprovider.Segment

Lock a segment, or block until a segment can be locked Returns a Segment struct

func (*FileStorageProvider) Read

func (sp *FileStorageProvider) Read(uuid []byte, address uint64, buffer []byte) []byte

Jump to

Keyboard shortcuts

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