resourceid

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Next

func Next() string

func ValidateUserSettable

func ValidateUserSettable(id string) error

ValidateUserSettable validates a user-settable resource ID.

From https://google.aip.dev/122#resource-id-segments:

User-settable resource IDs should conform to RFC-1034; which restricts to letters, numbers, and hyphen, with the first character a letter, the last a letter or a number, and a 63 character maximum. Additionally, user-settable resource IDs should restrict letters to lower-case.

User-settable IDs should not be permitted to be a UUID (or any value that syntactically appears to be a UUID).

See also: https://google.aip.dev/133#user-specified-ids

Types

type Generator added in v0.0.3

type Generator interface {
	Next() (string, error)
}

func SonyFlakeGenerator added in v0.0.3

func SonyFlakeGenerator() Generator

Jump to

Keyboard shortcuts

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