shortuuid

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUUIDGenerator added in v0.12.0

func NewUUIDGenerator() *uuidGenerator

Types

type Generator added in v0.12.0

type Generator interface {
	// New returns a new ShortUUID string
	New() string
}

type ShortUUID

type ShortUUID uuid.UUID

ShortUUID is a type that can stringify a UUID without hyphens.

func New

func New() ShortUUID

New constructs a ShortUUID object.

func (ShortUUID) String

func (u ShortUUID) String() string
Example
package main

import (
	"fmt"

	"github.com/inklabs/rangedb/rangedbtest"

	"github.com/inklabs/rangedb/pkg/shortuuid"
)

func main() {
	// Given
	rangedbtest.SetRand(101)
	u := shortuuid.New()

	// When
	fmt.Println(u.String())

}
Output:

b03b2442c5de4e58b6c62e8094847f3d

Jump to

Keyboard shortcuts

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