gravatar

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSize   = 80
	DefaultImage  = "identicon"
	DefaultRating = "pg"
)

Default values for gravatar options generated by this package.

Variables

This section is empty.

Functions

func Hash

func Hash(email string) string

Hash returns the Gravatar email MD5 hex encoded hash as defined in: https://en.gravatar.com/site/implement/hash/

func New

func New(email string, opts *Options) string

Types

type Options

type Options struct {
	// The square size of the image; an request images from 1px up to 2048px.
	Size int

	// One of 404, mp, identicon, monsterid, wavatar, retro, robohash, or blank.
	DefaultImage string

	// Force the default image to always load
	ForceDefault bool

	// Rating indicates image appropriateness, one of g, pg, r, or x.
	Rating string

	// File extension is optional, can be one of .png, .jpg, etc.
	FileExtension string
}

Jump to

Keyboard shortcuts

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