humanid

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 3 Imported by: 0

README

@42peaks/human-id

Introduction

This package generates short, human-readable IDs of the form: <adjective>-<noun>-<number> where number is a random number between 1 and 999999.

Usage

Quite simple:

import (
    "github.com/42peaks/humanid"
    "fmt"
)

func main() {
	id, err := humanid.Generate()
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Adjectives = AdjectivesType{}/* 267 elements not displayed */

)
View Source
var (
	Nouns = NounsType{}/* 267 elements not displayed */

)

Functions

func Generate

func Generate() (string, error)

Types

type AdjectivesType

type AdjectivesType []string

func (AdjectivesType) GetRandomWord

func (t AdjectivesType) GetRandomWord() (string, error)

func (AdjectivesType) MustGetRandomWord

func (t AdjectivesType) MustGetRandomWord() string

type NounsType

type NounsType []string

func (NounsType) GetRandomWord

func (t NounsType) GetRandomWord() (string, error)

func (NounsType) MustGetRandomWord

func (t NounsType) MustGetRandomWord() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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