Documentation ¶
Index ¶
Constants ¶
View Source
const ContentType = "image/svg+xml"
ContentType describes the content type which should be echoed back to clients when writing generated icons to http responses.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator interface { // Id provides a simple url friendly identifier via which this generator may be referenced when // multiple are exposed. Id() string // Size identifies the width and height of this particular icon as defined within the generated // vector file. Size() uint // Write produces a new image for the given payload and writes its contents to the given writer. Write(input []byte, writer io.Writer) // Draw generates an icon for the given payload and writes its contents to the SVG at the current // location. Draw(input []byte, canvas *svg.SVG) }
Generator provides a generation function for a given style of identicon.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry encapsulates a set of known generators.
func EmptyRegistry ¶
func EmptyRegistry() *Registry
EmptyRegistry creates a new registry devoid of any known generators.
func NewRegistry ¶
NewRegistry creates a registry with the given generator implementations.
Click to show internal directories.
Click to hide internal directories.