Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RegexCGA = regexp.MustCompile(`^CGA(-[23456789cfghjmpqrvwx]{4}){3}$`)
)
Functions ¶
func GenerateCGAID ¶
func GenerateCGAIDWithSeed ¶
func ValidateCGAID ¶
ValidateCGAID returns an error if the given ID is not a valid CGA ID.
Types ¶
type IDGenerator ¶
var DefaultIDGenerator IDGenerator = &RandomIDGenerator{}
type RandomIDGenerator ¶
type RandomIDGenerator struct{}
RandomIDGenerator generates a random CGA ID that uses the current time as the seed.
func (RandomIDGenerator) GenerateCGAID ¶
func (g RandomIDGenerator) GenerateCGAID() (string, error)
type StaticIDGenerator ¶
type StaticIDGenerator struct {
// The ID to return every time.
ID string
}
func (StaticIDGenerator) GenerateCGAID ¶
func (s StaticIDGenerator) GenerateCGAID() (string, error)
Click to show internal directories.
Click to hide internal directories.