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

View File

@@ -1,14 +1,47 @@
// Package jdenticon provides highly recognizable identicon generation.
// Package jdenticon provides a Go library for generating highly recognizable identicons -
// geometric avatar images generated deterministically from any input string.
//
// This package is a Go port of the JavaScript library Jdenticon,
// offering the same visual quality and recognizability in Go applications.
// This package wraps the internal/engine functionality to provide a clean, thread-safe
// public API that follows Go idioms and conventions.
//
// Basic usage:
//
// icon := jdenticon.Generate("user@example.com", 200)
// svg := icon.ToSVG()
// png := icon.ToPNG()
// // Generate with default configuration
// icon, err := jdenticon.Generate("user@example.com", 200)
// if err != nil {
// log.Fatal(err)
// }
//
// The library supports both SVG and PNG output formats, with configurable
// styling options including color themes, saturation, and brightness.
package jdenticon
// // Render as SVG
// svgData, err := icon.ToSVG()
// if err != nil {
// log.Fatal(err)
// }
//
// // Render as PNG
// pngData, err := icon.ToPNG()
// if err != nil {
// log.Fatal(err)
// }
//
// Advanced usage with custom configuration:
//
// // Create custom configuration
// config := jdenticon.DefaultConfig()
// config.ColorSaturation = 0.7
// config.Padding = 0.1
// config.BackgroundColor = "#ffffff"
//
// // Create generator with caching
// generator, err := jdenticon.NewGeneratorWithConfig(config, 100)
// if err != nil {
// log.Fatal(err)
// }
//
// // Generate multiple icons efficiently
// icon1, err := generator.Generate("user1@example.com", 64)
// icon2, err := generator.Generate("user2@example.com", 64)
//
// The library is designed to be thread-safe and performant, with LRU caching
// and singleflight to prevent duplicate work.
package jdenticon