Documentation ¶
Overview ¶
Package app provides models that are needed by x.
Index ¶
Constants ¶
View Source
const DefaultHNFrontPageArticlesCount = 30
DefaultHNFrontPageArticlesCount is now 30
View Source
const EightHrs = 8 * 60 * 60 * time.Second
EightHrs in seconds
Variables ¶
View Source
var BgColors = []string{"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "blanchedalmond", "burlywood", "chartreuse"}
BgColors is the background colors for front-end
Functions ¶
This section is empty.
Types ¶
type Bringer ¶
type Bringer interface { SetContext(context.Context) Bring([]int) ([]*Item, error) // accepts empty slices GetURL(interface{}) string GetDiscussLink(interface{}) string GetSource() string }
Bringer brings a list of things from other portals
type Config ¶
type Config struct { RunHTTPS bool `json:"runHTTPS"` AutoCertCacheDir string `json:"autoCertCacheDir"` HTTPPort string `json:"HTTPPort"` EncryptKey string `json:"encKey"` IndexTemplatePath string `json:"indexTemplatePath"` AppDatabasePath string `json:"appDatabasePath"` StaticResourcesDirectoryPath string `json:"staticResourcesDirPath"` BlogResourcesDirectoryPath string `json:"blogResourcesDirPath"` RateLimit string `json:"rateLimit"` RobotsTextFilePath string `json:"robotsTxtPath"` EnableCors bool `json:"enableCors"` HaveRobotsTxt bool `json:"haveRobotsTxt"` PingGoogle bool `json:"pingGoogle"` FetchPreviews bool `json:"fetchPreviews"` }
Config is required configuration for app
type Item ¶
type Item struct { //ID is item's unique id. ID int `json:"id"` //By is the username of the item's author. By string `json:"by"` //Title of the story, poll or job. Title string `json:"title"` //URL of the story. URL string `json:"url"` //Deleted denotes if the item is deleted. Deleted bool `json:"deleted"` //Dead denotes if the item is dead. Dead bool `json:"dead"` //DiscussLink is where the discussion on this item goes. DiscussLink string `json:"discussLink"` //Added is the time of addition of item. Added int `json:"added"` //Domain is the domain from where the story is delivered. Domain string `json:"domain"` //EncryptedURL is the URL encrypted using key from config. EncryptedURL string `json:"encryptedURL"` //EncryptedDiscussLink is the URL encrypted using key from config. EncryptedDiscussLink string `json:"encryptedDiscussLink"` //Description of the item. Description string `json:"description"` //Source of the item Source string `json:"source"` }
Item is HN item
type PeriodicBringer ¶
type PeriodicBringer interface {
Bring() <-chan Bringer
}
PeriodicBringer gives us a bringer periodically
Source Files ¶
Click to show internal directories.
Click to hide internal directories.