ident

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ident provides the helpers functions.

Index

Constants

This section is empty.

Variables

View Source
var NumberStart int64 = 1

Functions

func GenID

func GenID() string

GenID The function "GenID" generates a new unique identifier and returns it as a string.

func GenSize

func GenSize() int

GenSize The function "GenSize" returns the size of the generated identifier

func Use

func Use(ident Identifier)

Use sets the defaultGenerator ident.

func Validate

func Validate(id string) bool

Validate The function "Validate" checks whether the given identifier is valid or not.

Types

type Identifier

type Identifier interface {
	Name() string
	Gen() string
	Validate(id string) bool
	Size() int
}

Identifier is the interface of ident.

func Default

func Default() Identifier

Default method returns the default defaultGenerator ident.

Jump to

Keyboard shortcuts

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