mirror of
https://github.com/1f349/violet.git
synced 2024-11-21 19:01:39 +00:00
20 lines
416 B
Go
20 lines
416 B
Go
package favicons
|
|
|
|
import "database/sql"
|
|
|
|
// FaviconImage stores the url, hash and raw bytes of an image
|
|
type FaviconImage struct {
|
|
Url string
|
|
Hash string
|
|
Raw []byte
|
|
}
|
|
|
|
// CreateFaviconImage outputs a FaviconImage with the specified URL or nil if
|
|
// the URL is an empty string.
|
|
func CreateFaviconImage(url sql.NullString) *FaviconImage {
|
|
if !url.Valid {
|
|
return nil
|
|
}
|
|
return &FaviconImage{Url: url.String}
|
|
}
|