Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StandardTags = map[Slug]string{}/* 115 elements not displayed */
Functions ¶
func SanitizeName ¶
SanitizeName sanitizes the given tag to be used as a name (removes non-ASCII, trims trailing spaces, and titles)
func TagsToNames ¶
TagsToNames get a slice of tag names from a slice of tags
Types ¶
type CardInfo ¶
type CardInfo struct {
NormalizedURL string
DirectURL string
PlatformID string
CharacterID string
Name string
Title string
Tagline string
CreateTime timestamp.Nano
UpdateTime timestamp.Nano
IsForked bool
Tags []Tag
}
CardInfo struct for storing card information
func (*CardInfo) NormalizeSymbols ¶
func (c *CardInfo) NormalizeSymbols()
NormalizeSymbols trims whitespace from Name and Title and normalizes symbols in Tagline
type CreatorInfo ¶
CreatorInfo struct for storing creator information
type Metadata ¶
type Metadata struct {
Source source.ID
CardInfo
CreatorInfo
BookUpdateTime timestamp.Nano
GreetingsCount int
HasBook bool
}
Metadata struct for storing card metadata
func (*Metadata) IsConsistentWith ¶
IsConsistentWith checks if the metadata is consistent with the card
func (*Metadata) LatestUpdateTime ¶
LatestUpdateTime returns the latest update time of the card
type Slug ¶
type Slug = string
Slug type representing a tag slug
func SanitizeSlug ¶
SanitizeSlug sanitizes the given tag to be used as a slug (removes non-ASCII, '-', '_', whitespace and lowers all characters)
func TagsToSlugs ¶
TagsToSlugs get a slice of tag slugs from a slice of tags
type Tag ¶
Tag struct representing a tag
func ResolveTag ¶
ResolveTag resolves a tag string into a Tag struct.
func TagsFromJsonArray ¶
TagsFromJsonArray extracts tags from a JSON array
func TagsFromMap ¶
TagsFromMap transforms a map into a list of Tags (no sanitization will be applied)