gravatar

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gravatar generates random avatar images for users or organizations on sign up which they can override with their own avatars

Index

Constants

This section is empty.

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 {
	// Size of the image square; request images from 1px up to 2048px.
	Size int

	// DefaultImage is can be of 404, mp, identicon, monsterid, wavatar, retro, robohash, or blank.
	DefaultImage string

	// ForceDefault image to always load
	ForceDefault bool

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

	// FileExtension 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