randomtext

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 5 Imported by: 1

README

Randomtext

Build Status Go Reference Go Report Card Downloads Latest release

Command line random text generator

Usage

$ randomtext -h
Usage of randomtext:
  -profile string
    	Type of profile - cpu,mem
  -size string
    	Size of generated random text in KB, MB, GB, TB (default "1MB")
  -type string
    	Type of text to be generated - chars, words, zeros (default "chars")
Examples
  • Generate 1 KB random characters
    • randomtext --size=1KB | pv > output.txt
  • Generate 100MB random words
    • randomtext --size=100MB --type=words | pv > output.txt
  • Generate 1GB of zeros
    • randomtext --size=1GB --type=zeros | pv > output.txt

Source of words. The above commands use pv for pipeline visualization only.

Use cases

  • Testing the capacity of code editors/IDEs
  • Generate logs to generate load for log forwarders like fluent bit

Installation

Mac OSX

$ brew install kishaningithub/tap/randomtext

Other platforms

Prebuilt binaries for various platforms are available in the releases page. Download it, Extract it and add the binary in your $PATH

Development

To build

make build

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Characters string
View Source
var Words string

Functions

func CharGenerator

func CharGenerator() func() string

CharGenerator returns a function that generates random chars

func Generate

func Generate(sizeInBytes int, generate func() string, writer io.Writer)

Generate text of given type for a given size and writes it to the given writer

func WordGenerator

func WordGenerator() func() string

WordGenerator returns random words

func ZeroGenerator

func ZeroGenerator() func() string

ZeroGenerator returns a function that generates zeros

Types

This section is empty.

Directories

Path Synopsis
cmd
randomtext command

Jump to

Keyboard shortcuts

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