idgen

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JobIDPrefix is the prefix of job ID.
	JobIDPrefix = "j-"

	// ExecutionIDPrefix is the prefix of execution ID.
	ExecutionIDPrefix = "e-"

	// EvaluationIDPrefix is the prefix of evaluation ID.
	EvaluationIDPrefix = "v-"
)
View Source
const ShortIDLength = 8
View Source
const ShortIDLengthWithPrefix = ShortIDLength + len(JobIDPrefix)

Variables

This section is empty.

Functions

func NewEvaluationID

func NewEvaluationID() string

NewEvaluationID generates a new evaluation ID.

func NewExecutionID

func NewExecutionID() string

NewExecutionID generates a new execution ID.

func NewJobID

func NewJobID() string

NewJobID generates a new job ID.

func ShortID

func ShortID(input string) string

ShortID takes a string in the format of "prefix-UUID" or just "UUID" and returns the prefix along with the first segment of the UUID. For example: - For "e-78faf114-6a45-457e-825c-40fd2fad768f", it returns "e-78faf114". - For "j-78faf114-6a45-457e-825c-40fd2fad768f", it returns "j-78faf114". - For "78faf114-6a45-457e-825c-40fd2fad768f", it returns "78faf114".

Types

This section is empty.

Jump to

Keyboard shortcuts

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