generator

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirType

type DirType string
const (
	DirType_Sharded DirType = "sharded"
	DirType_Plain   DirType = "plain"
)

type Directory

type Directory struct {
	Type             DirType
	ShardBitwidth    int
	Name             string
	Multiplier       int
	RandomMultiplier bool
	Children         []Entity
}

func (Directory) Describe

func (d Directory) Describe(indent string) string

func (Directory) Generate

func (d Directory) Generate(lsys linking.LinkSystem, rndReader io.Reader) (unixfstestutil.DirEntry, error)

func (Directory) GetMultiplier

func (d Directory) GetMultiplier() int

func (Directory) GetName

func (d Directory) GetName() string

func (Directory) IsRandomMultiplier

func (d Directory) IsRandomMultiplier() bool

func (Directory) String

func (d Directory) String() string

type Entity

type Entity interface {
	GetName() string
	GetMultiplier() int
	IsRandomMultiplier() bool

	Generate(lsys linking.LinkSystem, rndReader io.Reader) (unixfstestutil.DirEntry, error)
	String() string
	Describe(indent string) string
}

func Parse

func Parse(str string) (Entity, error)

type ErrParse

type ErrParse struct {
	Pos int
	Err error
}

func (ErrParse) Error

func (e ErrParse) Error() string

type File

type File struct {
	Name             string
	Size             uint64
	RandomSize       bool
	ZeroContent      bool
	Multiplier       int
	RandomMultiplier bool
}

func (File) Describe

func (f File) Describe(indent string) string

func (File) Generate

func (f File) Generate(lsys linking.LinkSystem, rndReader io.Reader) (unixfstestutil.DirEntry, error)

Generate _one_ of the files described by this descriptor. If there are multiple files described by this descriptor, call this function multiple times.

func (File) GetMultiplier

func (f File) GetMultiplier() int

func (File) GetName

func (f File) GetName() string

func (File) IsRandomMultiplier

func (f File) IsRandomMultiplier() bool

func (File) String

func (f File) String() string

Jump to

Keyboard shortcuts

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