proto

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MMapProtoReader

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

func NewMMapProtoReaderWithPath

func NewMMapProtoReaderWithPath(path string) (*MMapProtoReader, error)

func (*MMapProtoReader) Close

func (r *MMapProtoReader) Close() error

func (*MMapProtoReader) Open

func (r *MMapProtoReader) Open() error

func (*MMapProtoReader) ReadNextAt

func (r *MMapProtoReader) ReadNextAt(record proto.Message, offset uint64) (proto.Message, error)

type ReadAtI

type ReadAtI interface {
	recordio.OpenClosableI
	// Reads the next record at the given offset into the passed message record, EOF error when it reaches the end signalled by (nil, io.EOF), implementation must be thread-safe
	ReadNextAt(record proto.Message, offset uint64) (proto.Message, error)
}

this type is thread-safe

type Reader

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

func NewProtoReaderWithFile

func NewProtoReaderWithFile(file *os.File) (*Reader, error)

func NewProtoReaderWithPath

func NewProtoReaderWithPath(path string) (*Reader, error)

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Open

func (r *Reader) Open() error

func (*Reader) ReadNext

func (r *Reader) ReadNext(record proto.Message) (proto.Message, error)

func (*Reader) SkipNext

func (r *Reader) SkipNext() error

type ReaderI

type ReaderI interface {
	recordio.OpenClosableI
	// Reads the next record into the passed message record, EOF error when it reaches the end signalled by (nil, io.EOF)
	ReadNext(record proto.Message) (proto.Message, error)
	// skips the next record, EOF error when it reaches the end signalled by io.EOF as the error
	SkipNext() error
}

type Writer

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

func NewWriter

func NewWriter(writerOptions ...WriterOption) (*Writer, error)

create a new writer with the given options. Either Path or File must be supplied, compression is optional and turned off by default.

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Open

func (w *Writer) Open() error

func (*Writer) Size

func (w *Writer) Size() uint64

func (*Writer) Write

func (w *Writer) Write(record proto.Message) (uint64, error)

func (*Writer) WriteSync

func (w *Writer) WriteSync(record proto.Message) (uint64, error)

type WriterI

type WriterI interface {
	recordio.OpenClosableI
	recordio.SizeI
	// Appends a record, returns the current offset this item was written to
	Write(record proto.Message) (uint64, error)
	// Appends a record and forces a disk sync, returns the current offset this item was written to
	WriteSync(record proto.Message) (uint64, error)
}

type WriterOption

type WriterOption func(*WriterOptions)

func CompressionType

func CompressionType(p int) WriterOption

func File

func File(p *os.File) WriterOption

func Path

func Path(p string) WriterOption

type WriterOptions

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

Jump to

Keyboard shortcuts

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