favicon

package
v0.0.0-...-d63482c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Favicon

type Favicon string

Favicon is 64x64 sized data uri image send in response to a server list ping. Refer to https://en.wikipedia.org/wiki/Data_URI_scheme for details. Example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAAEElEQVR42mP8z8BQzzCCAQB+lAGA+H8KEAAAAABJRU5ErkJggg=="

func FromBytes

func FromBytes(b []byte) Favicon

FromBytes takes base64 bytes encoding of an image and converts it to Favicon.

func FromFile

func FromFile(filename string) (Favicon, error)

FromFile takes the filename of an image and converts it to Favicon.

func FromImage

func FromImage(img image.Image) (Favicon, error)

FromImage converts an image.Image to Favicon.

func Parse

func Parse(s string) (Favicon, error)

Parse takes a data uri string or filename and converts it to Favicon.

func (Favicon) Bytes

func (f Favicon) Bytes() []byte

Bytes returns the bytes encoding of the favicon.

func (*Favicon) UnmarshalJSON

func (f *Favicon) UnmarshalJSON(bytes []byte) (err error)

UnmarshalJSON implements json.Unmarshaler.

func (*Favicon) UnmarshalYAML

func (f *Favicon) UnmarshalYAML(value *yaml.Node) (err error)

UnmarshalYAML implements yaml.Unmarshaler.

Jump to

Keyboard shortcuts

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