identity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(id string) bool

IsValid validates an ID.

func NanoID

func NanoID() string

NanoID implements Factory function.

func Register

func Register(name string, fct Factory)

Register registers a new factory by name. It will panic if multiple factories are registered under the same name.

func UUID

func UUID() string

UUID implements Factory function.

Types

type Factory

type Factory func() string

Factory is an interface to various ID factories.

func Get

func Get(name string) (Factory, error)

Get returns a Factory by name.

Jump to

Keyboard shortcuts

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