Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Tokens = []Token{ &RichToken{ BasicToken: BasicToken{ Key: "{{SOURCE}}", Extractor: func(record *resource.Record) string { return string(record.InfoData.Source) }, }, Description: "The source platform of the card", }, &RichToken{ BasicToken: BasicToken{ Key: "{{PLATFORM_ID}}", Extractor: func(record *resource.Record) string { return record.InfoData.PlatformID }, }, Description: "The unique platform identifier for the card", }, &RichToken{ BasicToken: BasicToken{ Key: "{{CHARACTER_ID}}", Extractor: func(record *resource.Record) string { return record.CharacterID }, }, Description: "The unique character identifier", }, &RichToken{ BasicToken: BasicToken{ Key: "{{NAME}}", Extractor: func(record *resource.Record) string { return record.Name }, }, Description: "The name of the character", }, &RichToken{ BasicToken: BasicToken{ Key: "{{TITLE}}", Extractor: func(record *resource.Record) string { return record.Title }, }, Description: "The title of the card", }, &RichToken{ BasicToken: BasicToken{ Key: "{{CREATE_TIME}}", Extractor: func(record *resource.Record) string { return strconv.Itoa(int(timestamp.ConvertToSeconds(record.CreateTime))) }, }, Description: "The creation timestamp in seconds", }, &RichToken{ BasicToken: BasicToken{ Key: "{{CREATE_DATE}}", Extractor: func(record *resource.Record) string { return strconv.Itoa(int(timestamp.ConvertToSeconds(record.CreateTime))) }, }, Description: "The creation date in UTC format", }, &RichToken{ BasicToken: BasicToken{ Key: "{{UPDATE_TIME}}", Extractor: func(record *resource.Record) string { return strconv.Itoa(int(timestamp.ConvertToSeconds(record.UpdateTime))) }, }, Description: "The last update timestamp in seconds", }, &RichToken{ BasicToken: BasicToken{ Key: "{{UPDATE_DATE}}", Extractor: func(record *resource.Record) string { return strconv.Itoa(int(timestamp.ConvertToSeconds(record.UpdateTime))) }, }, Description: "The last update date in UTC format", }, &RichToken{ BasicToken: BasicToken{ Key: "{{C_NICKNAME}}", Extractor: func(record *resource.Record) string { return record.Nickname }, }, Description: "The nickname of the card creator", }, &RichToken{ BasicToken: BasicToken{ Key: "{{C_USERNAME}}", Extractor: func(record *resource.Record) string { return record.Username }, }, Description: "The username of the card creator", }, }
Tokens is the list of available template tokens for resource records
Functions ¶
This section is empty.
Types ¶
type BasicToken ¶
type BasicToken = templater.BasicToken[*resource.Record]
BasicToken is a simple token with a key and extractor function
type CompiledTemplate ¶
type CompiledTemplate = templater.CompiledTemplate[*resource.Record]
CompiledTemplate is a pre-compiled template for resource records
Click to show internal directories.
Click to hide internal directories.