randomtext

package module
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 5 Imported by: 0

README

Randomtext

Build Status Go Reference Go Report Card Downloads Latest release

Command line random text generator

Usage

$ randomtext -h
Usage of randomtext:
  -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 Intel 64-bit architecture are available for

Extract 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL