Documentation
¶
Index ¶
Constants ¶
View Source
const ( TimeDateFormat = "2006-01-02 15:04" // YYYY-MM-DD HH:MM. DateFormat = "2006-01-02" // YYYY-MM-DD. TimeFormat = "15:04" //HH:MM AuthorNone = "None" )
View Source
const ( ErrNoData = "no data" ErrNoChecksum = "no checksum" ErrBadChecksum = "bad checksum" )
View Source
const ( CR = "\r" LF = "\n" // NewLine is a new line. // This is the correct new line, as it used to be in the history of mankind. // If you are a user of Unix, Linux, Macintosh or something else, check the // Wikipedia: https://en.wikipedia.org/wiki/Newline NewLine = CR + LF )
Variables ¶
View Source
var Categories = map[string]*Category{
"event": {
Name: "Events",
Path: "event",
CssClass: "tmbEvents",
Description: "Latest events which may attract your attention.",
Icon: "event",
},
"game": {
Name: "Games",
Path: "game",
CssClass: "tmbGames",
Description: "Computer games of all kinds and for all platforms, " +
"including consoles, portable gaming devices and smartphones.",
Icon: "game",
},
"hard": {
Name: "Hardware",
Path: "hard",
CssClass: "tmbHardware",
Description: "Various computer hardware, from cases and power supply units " +
"to microprocessors and GPUs.",
Icon: "hard",
},
"life": {
Name: "Life",
Path: "life",
CssClass: "tmbLife",
Description: "Everything about life in the universe. [br]" +
"From flowers and bees to animals and humanoids.",
Icon: "life",
},
"media": {
Name: "Multimedia",
Path: "media",
CssClass: "tmbMultimedia",
Description: "Audio, video, animation, images, photography, literature. " +
"Anything from a short ringtone sound to a full-length feature film.",
Icon: "media",
},
"motor": {
Name: "Motorsport",
Path: "motor",
CssClass: "tmbMotorsport",
Description: "All kinds of automobile sports. From kart and buggy " +
"to IndyCar and Formula One.",
Icon: "motor",
},
"news": {
Name: "News",
Path: "news",
CssClass: "tmbNews",
Description: "All kinds of news all around the world of planet Earth.",
Icon: "news",
},
"review": {
Name: "Reviews",
Path: "review",
CssClass: "tmbReviews",
Description: "Reviews of all kinds. From bread toasters to supercomputers.",
Icon: "review",
},
"soft": {
Name: "Software",
Path: "soft",
CssClass: "tmbSoftware",
Description: "Software of all kinds.",
Icon: "soft",
},
"tech": {
Name: "Technology",
Path: "tech",
CssClass: "tmbTechnology",
Description: "Everything about past, modern and future technologies.",
Icon: "tech",
},
}
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { DateTimeUTC time.Time Category string Title string Description string Content string Icon string Author string CRC32Hex string }
func NewArticle ¶
func NewArticleFromFile ¶
func (*Article) CalculateCRC32 ¶
func (*Article) CheckCRC32 ¶
func (*Article) SaveAsFile ¶
type RawArticle ¶
type RawArticle struct { DateUTC string `json:"Date"` TimeUTC string `json:"Time"` Category string `json:"Category"` Title string `json:"Title"` Description string `json:"Description"` Content string `json:"Content"` Icon string `json:"Icon"` Author string `json:"Author"` CRC32Hex string `json:"CRC32"` }
type SortedFile ¶
type SortedFiles ¶
type SortedFiles []*SortedFile
SortedFiles are files are sorted in a reverse way: first file is the newest one.
func (SortedFiles) GetNonTopItems ¶
func (sfs SortedFiles) GetNonTopItems(n int) SortedFiles
GetNonTopItems tries to return non-top items excluding the N top items.
func (SortedFiles) GetTopItems ¶
func (sfs SortedFiles) GetTopItems(n int) SortedFiles
GetTopItems tries to return N top items from the list. If there are less than N top items available, they are returned.
func (SortedFiles) Len ¶
func (sfs SortedFiles) Len() int
func (SortedFiles) Less ¶
func (sfs SortedFiles) Less(i, j int) bool
func (SortedFiles) Swap ¶
func (sfs SortedFiles) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.