libravatar: strk.kbt.io/projects/go/libravatar Index | Files

package libravatar

import "strk.kbt.io/projects/go/libravatar"

Index

Package Files

libravatar.go

Constants

const (
    // Do not load any image if none is associated with the email
    // hash, instead return an HTTP 404 (File Not Found) response
    HTTP404 = "404"
    // (mystery-man) a simple, cartoon-style silhouetted outline of
    // a person (does not vary by email hash)
    MysteryMan = "mm"
    // a geometric pattern based on an email hash
    IdentIcon = "identicon"
    // a generated 'monster' with different colors, faces, etc
    MonsterID = "monsterid"
    // generated faces with differing features and backgrounds
    Wavatar = "wavatar"
    // awesome generated, 8-bit arcade-style pixelated faces
    Retro = "retro"
)

Default images (to be used as defaultURL)

Variables

var (
    // DefaultLibravatar is a default Libravatar object,
    // enabling object-less function calls
    DefaultLibravatar = New()
)

func FromEmail Uses

func FromEmail(email string) (string, error)

FromEmail is the object-less call to DefaultLibravatar for an email adders

func FromURL Uses

func FromURL(openid string) (string, error)

FromURL is the object-less call to DefaultLibravatar for a URL

type Libravatar Uses

type Libravatar struct {
    // contains filtered or unexported fields
}

Libravatar is an opaque structure holding service configuration

func New Uses

func New() *Libravatar

New instanciates a new Libravatar object (handle)

func (*Libravatar) FromEmail Uses

func (v *Libravatar) FromEmail(email string) (string, error)

FromEmail returns the url of the avatar for the given email

func (*Libravatar) FromURL Uses

func (v *Libravatar) FromURL(openid string) (string, error)

FromURL returns the url of the avatar for the given url (typically for OpenID)

func (*Libravatar) SetAvatarSize Uses

func (v *Libravatar) SetAvatarSize(size uint)

SetAvatarSize sets avatars image dimension (0 for default)

func (*Libravatar) SetFallbackHost Uses

func (v *Libravatar) SetFallbackHost(host string)

SetFallbackHost sets the hostname for fallbacks in case no avatar service is defined for a domain

func (*Libravatar) SetSecureFallbackHost Uses

func (v *Libravatar) SetSecureFallbackHost(host string)

SetSecureFallbackHost sets the hostname for fallbacks in case no avatar service is defined for a domain, when requiring secure domains

func (*Libravatar) SetUseHTTPS Uses

func (v *Libravatar) SetUseHTTPS(use bool)

SetUseHTTPS sets flag requesting use of https for fetching avatars

Package libravatar imports 9 packages (graph) and is imported by 4 packages. Updated 2016-11-11. Refresh now. Tools for package owners.