dbcommon

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFormatAndOptions

func ReadFormatAndOptions(sr StorageSeqReader) (FileFormat, FormatOptions, error)

func WriteFormatAndOptions

func WriteFormatAndOptions(sw StorageSeqWriter, format FileFormat, options FormatOptions) error

Types

type ChapterDetails

type ChapterDetails struct {
	// [1..)
	Index   int
	Options uint32
	// [0..2024]
	Type uint16
}

type FileFormat

type FileFormat uint16

type FormatOptions

type FormatOptions uint64

type PayloadBuilder

type PayloadBuilder interface {
	AddPrelude(bytes []byte, pos StorageEntryPosition) error
	AddConclude(bytes []byte, pos StorageEntryPosition, totalCount uint32) error
	AddChapter(bytes []byte, pos StorageEntryPosition, details ChapterDetails) error
	NeedsNextChapter() bool

	Finished() error
	Failed(error) error
}

type PayloadFactory

type PayloadFactory interface {
	CreatePayloadBuilder(format FileFormat, sr StorageSeqReader) PayloadBuilder
}

type PayloadWriter

type PayloadWriter interface {
	io.Closer
	WritePrelude(bytes []byte, concludeMaxLength int) (StorageEntryPosition, error)
	WriteConclude(bytes []byte) (StorageEntryPosition, error)
	WriteChapter(bytes []byte, details ChapterDetails) (StorageEntryPosition, error)
}

type ReadConfig

type ReadConfig struct {
	ReadAllEntries bool
	AlwaysCopy     bool
}

type StorageBlockReader

type StorageBlockReader interface {
	io.ReaderAt
	io.Closer
	ReadAtMapped(n int64, off int64) ([]byte, error)
}

type StorageEntryPosition

type StorageEntryPosition struct {
	StorageOffset int64
	ByteOffset    int
}

type StorageSeqReader

type StorageSeqReader interface {
	io.ByteReader
	io.Reader
	io.Seeker
	CanSeek() bool
	CanReadMapped() bool
	Offset() int64
	ReadMapped(n int64) ([]byte, error)
}

type StorageSeqWriter

type StorageSeqWriter interface {
	io.ByteWriter
	io.Writer
	Offset() int64
}

Jump to

Keyboard shortcuts

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