Initial release: Go Jdenticon library v0.1.0

- Core library with SVG and PNG generation
- CLI tool with generate and batch commands
- Cross-platform path handling for Windows compatibility
- Comprehensive test suite with integration tests
This commit is contained in:
Kevin McIntyre
2026-01-02 23:56:48 -05:00
parent f84b511895
commit d9e84812ff
292 changed files with 19725 additions and 38884 deletions

35
cmd/jdenticon/types.go Normal file
View File

@@ -0,0 +1,35 @@
package main
import "fmt"
// FormatFlag is a custom pflag.Value for handling --format validation and completion
type FormatFlag string
const (
// FormatPNG represents PNG output format for identicon generation
FormatPNG FormatFlag = "png"
// FormatSVG represents SVG output format for identicon generation
FormatSVG FormatFlag = "svg"
)
// String is used both by pflag and fmt.Stringer
func (f *FormatFlag) String() string {
return string(*f)
}
// Set must have pointer receiver, so it can change the value of f.
func (f *FormatFlag) Set(v string) error {
switch v {
case "png", "svg":
*f = FormatFlag(v)
return nil
default:
return fmt.Errorf(`must be one of "png" or "svg"`)
}
}
// Type is only used in help text
func (f *FormatFlag) Type() string {
return "string"
}