Documentation ¶
Index ¶
- type DefaultValue
- type Gravatar
- func (g *Gravatar) AvatarURL() string
- func (g *Gravatar) Default(value DefaultValue) *Gravatar
- func (g *Gravatar) DefaultURL(urlString string) *Gravatar
- func (g *Gravatar) ForceDefault(force bool) *Gravatar
- func (g *Gravatar) JSONURL() string
- func (g *Gravatar) JSONURLCallback(callback string) string
- func (g *Gravatar) Profiles() (*Profiles, error)
- func (g *Gravatar) Rating(rating Rating) *Gravatar
- func (g *Gravatar) Size(size int) *Gravatar
- func (g *Gravatar) URL() string
- type Photo
- type Profile
- type Profiles
- type Rating
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultValue ¶
type DefaultValue string
DefaultValue is a value suitable for the default parameter
const ( NoDefault DefaultValue = "" NotFound DefaultValue = "404" MysteryMan DefaultValue = "mm" Identicon DefaultValue = "identicon" Monsterid DefaultValue = "monsterid" Wavatar DefaultValue = "wavatar" Retro DefaultValue = "retro" Blank DefaultValue = "blank" )
See https://de.gravatar.com/site/implement/images/#default-image
type Gravatar ¶
type Gravatar struct {
// contains filtered or unexported fields
}
Gravatar is a struct for configuring and generating a Gravatar-URL
func (*Gravatar) AvatarURL ¶
AvatarURL generates the URL to get the avatar of the user based on the given configuration
func (*Gravatar) Default ¶
func (g *Gravatar) Default(value DefaultValue) *Gravatar
Default sets a default value to be used if no image is available
func (*Gravatar) DefaultURL ¶
DefaultURL sets a URL to use as default image (See https://de.gravatar.com/site/implement/images/#default-image) An invalid URL will be ignored
func (*Gravatar) ForceDefault ¶
ForceDefault sets if the default avatar should be forced o be returned
func (*Gravatar) JSONURLCallback ¶
JSONURLCallback returns the URL to fetch profile data as json and sets the callback parameter (See https://de.gravatar.com/site/implement/profiles/json/#request-options)
type Profile ¶
type Profile struct { ID string `json:"id"` Hash string `json:"hash"` RequestHash string `json:"requestHash"` ProfileURL string `json:"profileUrl"` PreferredUsername string `json:"prefferedUsername"` ThumbnailURL string `json:"thumbnailUrl"` Photos []Photo `json:"photos"` Name []string `json:"name"` DisplayName string `json:"displayName"` Urls []string `json:"urls"` }
Profile represents a single profile