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: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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