randy

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 1 Imported by: 0

README

randy

Package randy provides a simple way to generate random data.

Usage

package main

import (
	"log"
	"randy"
)

func main() {
	name, err := randy.Name();
	if err != nil {
		log.Fatal(err.Error());
	}

	println(name);
}
Output:
Craig

Documentation

Overview

Package randy provides a simple way to generate random data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Color

func Color() (string, error)

Generates a color name. Example: `red`, `green`, etc

func ColorHex

func ColorHex() (string, error)

Generates a color in hexadecimal format. Example: `#220022`

func Email

func Email() (string, error)

Generates an email. Generated emails can contain numbers and periods. The IDs use the name database as reference.

func EmailWithProvider

func EmailWithProvider(provider string) (string, error)

Generates an email with the given provider. `provider` refers to a custom domain. Example: `gmail.com`

func FemaleName

func FemaleName() (string, error)

Generates a female name.

func Ipv4

func Ipv4() (string, error)

Generates an IPv4 address.

func Ipv4WithCustomOctets

func Ipv4WithCustomOctets(formatString string) (string, error)

Generates an IPv4 address with custom octets set. `fomartString` is of form `#.#.#.#` where each octet is denoted by a single `#`. To ensure that a particular octet is always in the IP, one can replace `#` with the value. Example: `255.#.13.#` is valid. `255.##.13.#`, `255.13` or `255:13:#.#` are invalid variations.

func Ipv6

func Ipv6() (string, error)

Generates an IPv6 address.

func Ipv6WithCustomSegments

func Ipv6WithCustomSegments(formatString string) (string, error)

Generates an IPv6 address with custom segments set. `fomartString` is of form `#:#:#:#:#:#:#:#` where each segment is denoted by a single `#`. To ensure that a particular segment is always in the IP, one can replace `#` with the value. Example: `ff21:#:255:#:#:#:#:13` is valid.

func MaleName

func MaleName() (string, error)

Generates a male name.

func Name

func Name() (string, error)

Generates a name. Can be a `female` or `male` name.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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