lipsum

package
v0.0.0-...-c967b49 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
	TB = 1024 * GB
)

Export the standard file sizes

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {

	// Word returns the next word from the lorem ipsum dictionary.
	Word() string

	// WordN returns the next word padded/trimmed to length n from the lorem ipsum dictionary
	WordN(n int) string

	/* Sentence returns a random length sentence (collection of words separated by a single space).
	Each word is chosen from the lorem ipsum dictionary. */
	Sentence() string

	// SentenceN returns a sentence consisting of n words from the lorem ipsum dictionary.
	SentenceN(n int) string

	/* Paragraph returns a random length paragraph (collection of sentences separated by the
	period).*/
	Paragraph() string

	// ParagraphN returns a paragraph of n sentences.
	ParagraphN(n int) string
}

Generator is the primary interface that exposes the different generators for word, sentence and paragraph.

func NewGenerator

func NewGenerator(threadSafe bool) (Generator, error)

NewGenerator returns a new instance of Generator. This Generator instance's Thread-Safety is controlled via the threadSafe parameter.

type Input

type Input struct {
	File  string
	Size  int
	Count int
	// contains filtered or unexported fields
}

Input struct encapsulates the input parameters of command line

func (*Input) GenerateOut

func (inp *Input) GenerateOut() error

GenerateOut generates the output files for the given Input parameters.

func (*Input) Validate

func (inp *Input) Validate() error

Validate the input parameters and return error in case of validation failure.

Jump to

Keyboard shortcuts

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