backend

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	io.ReaderAt
	io.WriterAt

	Size() (int64, error)
	Sync() error
}

type FileBackend

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

func NewFileBackend

func NewFileBackend(file *os.File) *FileBackend

func (*FileBackend) ReadAt

func (b *FileBackend) ReadAt(p []byte, off int64) (n int, err error)

func (*FileBackend) Size

func (b *FileBackend) Size() (int64, error)

func (*FileBackend) Sync

func (b *FileBackend) Sync() error

func (*FileBackend) WriteAt

func (b *FileBackend) WriteAt(p []byte, off int64) (n int, err error)

type MemoryBackend

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

func NewMemoryBackend

func NewMemoryBackend(memory []byte) *MemoryBackend

func (*MemoryBackend) ReadAt

func (b *MemoryBackend) ReadAt(p []byte, off int64) (n int, err error)

func (*MemoryBackend) Size

func (b *MemoryBackend) Size() (int64, error)

func (*MemoryBackend) Sync

func (b *MemoryBackend) Sync() error

func (*MemoryBackend) WriteAt

func (b *MemoryBackend) WriteAt(p []byte, off int64) (n int, err error)

Jump to

Keyboard shortcuts

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