advisory

package
v0.37.35 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegexCGA = regexp.MustCompile(`^CGA(-[23456789cfghjmpqrvwx]{4}){3}$`)
)

Functions

func GenerateCGAID

func GenerateCGAID() (string, error)

func GenerateCGAIDWithSeed

func GenerateCGAIDWithSeed(seed int64) (string, error)

func ValidateCGAID

func ValidateCGAID(id string) error

ValidateCGAID returns an error if the given ID is not a valid CGA ID.

Types

type IDGenerator

type IDGenerator interface {
	GenerateCGAID() (string, error)
}
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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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