readers

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 21 Imported by: 1

Documentation

Overview

Package readers provides implementation for common reader types

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package readers provides implementation for common reader types

  • Copyright (c) 2018-2025, NVIDIA CORPORATION. All rights reserved.

Package readers provides implementation for common reader types

  • Copyright (c) 2024-2025, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	File = "file" // file reader
	SG   = "sg"   // sgl-based reader
	Rand = "rand" // random reader
)
View Source
const (
	DynamicNumFiles = math.MaxInt
)
View Source
const ExistingFileSize = -1 // reader type "file" only

Variables

This section is empty.

Functions

This section is empty.

Types

type Arch added in v1.4.1

type Arch struct {
	Mime    string // archive.ExtTar|ExtTgz|ExtTarGz|ExtZip|ExtTarLz4
	Prefix  string // optional prefix inside archive (e.g., "trunk-", "a/b/c/trunk-")
	MinSize int64  // min file size
	MaxSize int64  // max file size
	Seed    uint64 // optional seed for random works (otherwise, using mono-time)
	Num     int    // files per shard
	//
	// advanced options - each and every one can be omitted
	//
	Names     []string   // explicit in-archive names
	RecExt    string     // default ".txt"; see also extended comment below
	TarFormat tar.Format // to override cmn/archive default
	MaxLayers int        // upper bound for RandDir; default 5
	RandNames bool       // generate numeric-random names
	RandDir   bool       // add random dir layers
	// contains filtered or unexported fields
}

func (*Arch) Init added in v1.4.1

func (a *Arch) Init(objSize int64) error

validate Arch fields, normalize Mime, and fills defaults

type Arg added in v1.4.1

type Arg struct {
	SGL        *memsys.SGL // when Type == "sg"
	Arch       *Arch       // when the content is archive
	Type       string      // "file" | "sg" | "inmem" | "rand"
	Path, Name string      // when Type == "file"; path and name of file to be created if doesn't exist
	CksumType  string
	Size       int64
}

construction params

type Reader

type Reader interface {
	cos.ReadOpenCloser
	io.Seeker
	Reset()
	Cksum() *cos.Cksum
}

readers: interface and concrete types

func New added in v1.3.19

func New(a *Arg) (Reader, error)

func NewBytes added in v1.3.19

func NewBytes(buf []byte) Reader

Jump to

Keyboard shortcuts

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