lorem

package module
v0.0.0-...-50e5b61 Latest Latest
Warning

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

Go to latest
Published: May 1, 2017 License: BSD-3-Clause Imports: 4 Imported by: 4

README

Generate lorem ipsum for your project.

=============

Usage

import "lorem"

Ranged generators

These will generate a string with a variable number of elements specified by a range you provide

// generate a word with at least min letters and at most max letters.
Word(min, max int) string  

// generate a sentence with at least min words and at most max words.
Sentence(min, max int) string

// generate a paragraph with at least min sentences and at most max sentences.
Paragraph(min, max int) string

Convenience functions

Generate some commonly occuring tidbits

Host() string
Email() string
Url() string

Documentation

Overview

Package randomdata implements a bunch of simple ways to generate (pseudo) random data

Index

Constants

View Source
const (
	Male         int = 0
	Female       int = 1
	RandomGender int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lorem

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

func New

func New() *Lorem

func (*Lorem) Email

func (self *Lorem) Email() string

Email

func (*Lorem) FirstName

func (self *Lorem) FirstName(gender int) string

Returns a random first name, gender decides the gender of the name

func (*Lorem) FullName

func (self *Lorem) FullName(gender int) string

Returns a combinaton of FirstName LastName randomized, gender decides the gender of the name

func (*Lorem) Host

func (self *Lorem) Host() string

Host

func (*Lorem) LastName

func (self *Lorem) LastName() string

Returns a random last name

func (*Lorem) Paragraph

func (self *Lorem) Paragraph(min, max int) string

func (*Lorem) Sentence

func (self *Lorem) Sentence(min, max int) string

Generate a sentence with a specified range of words.

func (*Lorem) Url

func (self *Lorem) Url() string

Generate a random URL

func (*Lorem) Word

func (self *Lorem) Word(min, max int) string

Generate a word in a specfied range of letters.

Jump to

Keyboard shortcuts

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