ioutil

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSectionReader

func NewSectionReader(rd SectionReader, start, end int64) (*io.SectionReader, error)

Types

type Buffer

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

func NewBuffer

func NewBuffer(b []byte) *Buffer

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

func (*Buffer) Read

func (b *Buffer) Read(v []byte) (int, error)

func (*Buffer) ReadAt

func (b *Buffer) ReadAt(v []byte, off int64) (int, error)

func (*Buffer) Seek

func (b *Buffer) Seek(offset int64, whence int) (int64, error)

func (*Buffer) Write

func (b *Buffer) Write(v []byte) (int, error)

type SectionReader

type SectionReader interface {
	io.Reader
	io.ReaderAt
	io.Seeker
}

type SectionWriter

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

func NewSectionWriter

func NewSectionWriter(wr io.WriteSeeker, start, end int64) (*SectionWriter, error)

func (*SectionWriter) Seek

func (s *SectionWriter) Seek(offset int64, whence int) (int64, error)

func (*SectionWriter) Write

func (s *SectionWriter) Write(p []byte) (n int, err error)

type Segment

type Segment[V enumGet, U enumSet[V]] struct {
	// contains filtered or unexported fields
}

Segment is a segment of a file.

func (*Segment[V, U]) Offset

func (s *Segment[V, U]) Offset() int64

Offset returns the segment's offset.

func (*Segment[V, U]) Open

func (s *Segment[V, U]) Open() (SectionReader, error)

Open opens the segment for reading.

func (*Segment[V, U]) Size

func (s *Segment[V, U]) Size() int64

Size returns the segment's size.

func (*Segment[V, U]) Type

func (s *Segment[V, U]) Type() V

Type returns the segment's type.

type SegmentWriter

type SegmentWriter[V enumGet, U enumSet[V]] struct {
	// contains filtered or unexported fields
}

A SegmentWriter writes a section of a segmented file.

func (*SegmentWriter[V, U]) Close

func (w *SegmentWriter[V, U]) Close() error

Close closes the segment and finalizes its header.

func (*SegmentWriter[V, U]) Seek

func (w *SegmentWriter[V, U]) Seek(offset int64, whence int) (int64, error)

Seek seeks to an offset.

func (*SegmentWriter[V, U]) Type

func (s *SegmentWriter[V, U]) Type() V

Type returns the segment's type.

func (*SegmentWriter[V, U]) Write

func (w *SegmentWriter[V, U]) Write(p []byte) (n int, err error)

Write writes bytes.

type SegmentedReader

type SegmentedReader[V enumGet, U enumSet[V]] struct {
	// contains filtered or unexported fields
}

SegmentedReader reads a segmented file.

func NewSegmentedReader

func NewSegmentedReader[V enumGet, U enumSet[V]](file SectionReader) *SegmentedReader[V, U]

NewSegmentedReader returns a new segmented reader for the file.

func (*SegmentedReader[V, U]) Next

func (r *SegmentedReader[V, U]) Next() (*Segment[V, U], error)

Next finds the segment.

type SegmentedWriter

type SegmentedWriter[V enumGet, U enumSet[V]] struct {
	// contains filtered or unexported fields
}

SegmentedWriter writes a segmented file.

func NewSegmentedWriter

func NewSegmentedWriter[V enumGet, U enumSet[V]](w io.WriteSeeker) *SegmentedWriter[V, U]

NewSegmentedWriter returns a new segmented writer.

func (*SegmentedWriter[V, U]) Open

func (w *SegmentedWriter[V, U]) Open(typ V) (*SegmentWriter[V, U], error)

Open opens a segment.

Jump to

Keyboard shortcuts

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