identifier

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 2 Imported by: 0

README

Go-Identifier

Go-Identifier is a simple package that generates NanoID and UUID v5 strings

Installation

go get github.com/allenakinkunle/go-identifier

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IIdentifier

type IIdentifier interface {
	NewNanoID() string
	NewUUIDv5(name string) string
}

type Identifier

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

func NewIdentifier

func NewIdentifier(characters string, length uint, namespace string) (*Identifier, error)

func (Identifier) NewNanoID

func (i Identifier) NewNanoID() string

func (Identifier) NewUUIDv5

func (i Identifier) NewUUIDv5(name string) string

type MockIdentifier

type MockIdentifier struct{}

MockIdentifier mockNanoGenerator Mock of IIdentifier

func NewMockIdentifier

func NewMockIdentifier() MockIdentifier

func (MockIdentifier) NewNanoID

func (m MockIdentifier) NewNanoID() string

func (MockIdentifier) NewUUIDv5

func (m MockIdentifier) NewUUIDv5(name string) string

Jump to

Keyboard shortcuts

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