readers

package
v1.3.22 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package readers provides implementation for common reader types

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

Index

Constants

View Source
const (
	// TypeFile defines the name for file reader
	TypeFile = "file"
	// TypeSG defines the name for sg reader
	TypeSG = "sg"
	// TypeRand defines the name for rand reader
	TypeRand = "rand"
	// TypeTar defines the name for random TAR reader
	TypeTar = "tar"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Params added in v1.3.19

type Params struct {
	Type       string      // file | sg | inmem | rand
	SGL        *memsys.SGL // When Type == sg
	Path, Name string      // When Type == file; path and name of file to be created (if not already existing)
	Size       int64
}

(aisloader only)

type Reader

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

func New added in v1.3.19

func New(p Params, cksumType string) (Reader, error)

func NewBytes added in v1.3.19

func NewBytes(buf []byte) Reader

func NewExistingFile added in v1.3.19

func NewExistingFile(fn, cksumType string) (Reader, error)

NewExistingFile opens an existing file, reads it to compute checksum, and returns a new reader. NOTE: Caller responsible for closing.

func NewRand added in v1.3.19

func NewRand(size int64, cksumType string) (Reader, error)

func NewRandFile added in v1.3.19

func NewRandFile(filepath, name string, size int64, cksumType string) (Reader, error)

creates/opens the file, populates it with random data, and returns a new fileReader NOTE: Caller is responsible for closing.

func NewSG added in v1.3.19

func NewSG(sgl *memsys.SGL, size int64, cksumType string) (Reader, error)

Jump to

Keyboard shortcuts

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