em_file_random

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameByNodeId

func NameByNodeId(nodeId int64) string

func NewGeneratedFile

func NewGeneratedFile(nodeId int64, opts Opts) em_file.File

func SizeByNodeId

func SizeByNodeId(nodeId int64, opts Opts) int64

func TimeByNodeId

func TimeByNodeId(nodeId int64, opts Opts) time.Time

Types

type Generator

type Generator interface {
	Generate(opt ...Opt) (root em_file.Folder)

	Update(root em_file.Folder, r *rand.Rand)
}

func NewPoissonTree

func NewPoissonTree() Generator

type Opt

type Opt func(o Opts) Opts

func Depth

func Depth(max int) Opt

func FileDate

func FileDate(min, max time.Time) Opt

func FileSize

func FileSize(min, max int64) Opt

func NumDescendant

func NumDescendant(maxFilesInFolder, maxFoldersInFolder int) Opt

func NumFiles

func NumFiles(files int) Opt

func Seed

func Seed(seed int64) Opt

type Opts

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

func Default

func Default() Opts

func (Opts) Apply

func (z Opts) Apply(opt []Opt) Opts

Jump to

Keyboard shortcuts

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