Documentation
¶
Index ¶
- Constants
- Variables
- func AbsoluteURL(c echo.Context, resource string) string
- func ActivityHandler(db Database) echo.HandlerFunc
- func IndexHandler(configuration IndexConfiguration) echo.HandlerFunc
- func New(db Database, ga string) *echo.Echo
- func RSSHandler(db Database) echo.HandlerFunc
- func ScrapeForumTimezone(doc *goquery.Document) (*time.Location, error)
- func SubdomainURL(c echo.Context, subdomain string) string
- type Activity
- type BoltDatabase
- type Database
- type DynamoDBDatabase
- type ForumIndexer
- type ForumIndexerConfiguration
- type ForumPost
- type IndexConfiguration
- type Locale
- type RedditComment
- type RedditIndexer
- type RedditIndexerConfiguration
- type RedditPost
Constants ¶
View Source
const ( ForumPostType = iota RedditCommentType RedditPostType )
Variables ¶
View Source
var Locales = []*Locale{ { IncludeReddit: true, Image: "static/images/locales/gb.png", }, { Subdomain: "br", Image: "static/images/locales/br.png", Translations: map[string]string{ "Activity": "Atividade", "Thread": "Discussão", "Poster": "Autor", "Time": "Hora", "Forum": "Fórum", }, }, { Subdomain: "ru", Image: "static/images/locales/ru.png", Translations: map[string]string{ "Activity": "Активность", "Thread": "Тема", "Poster": "Автор", "Time": "Время", "Forum": "Форум", }, }, { Subdomain: "th", Image: "static/images/locales/th.png", }, { Subdomain: "de", Image: "static/images/locales/de.png", Translations: map[string]string{ "Activity": "Aktivität", "Thread": "Beitrag", "Poster": "Verfasser", "Time": "Datum", "Forum": "Forum", }, }, { Subdomain: "fr", Image: "static/images/locales/fr.png", Translations: map[string]string{ "Activity": "Activité", "Thread": "Fil de discussion", "Poster": "Posteur", "Time": "Date", "Forum": "Forum", }, }, { Subdomain: "es", Image: "static/images/locales/es.png", Translations: map[string]string{ "Activity": "Actividad", "Thread": "Tema", "Poster": "Autor", "Time": "Fecha", "Forum": "Foro", }, }, }
Functions ¶
func ActivityHandler ¶
func ActivityHandler(db Database) echo.HandlerFunc
func IndexHandler ¶
func IndexHandler(configuration IndexConfiguration) echo.HandlerFunc
func RSSHandler ¶
func RSSHandler(db Database) echo.HandlerFunc
Types ¶
type BoltDatabase ¶
type BoltDatabase struct {
// contains filtered or unexported fields
}
func NewBoltDatabase ¶
func NewBoltDatabase(path string) (*BoltDatabase, error)
func (*BoltDatabase) AddActivity ¶
func (db *BoltDatabase) AddActivity(activity []Activity) error
func (*BoltDatabase) Close ¶
func (db *BoltDatabase) Close() error
type DynamoDBDatabase ¶
type DynamoDBDatabase struct {
// contains filtered or unexported fields
}
func NewDynamoDBDatabase ¶
func NewDynamoDBDatabase(client *dynamodb.DynamoDB, tableName string) (*DynamoDBDatabase, error)
func (*DynamoDBDatabase) AddActivity ¶
func (db *DynamoDBDatabase) AddActivity(activity []Activity) error
func (*DynamoDBDatabase) Close ¶
func (db *DynamoDBDatabase) Close() error
type ForumIndexer ¶
type ForumIndexer struct {
// contains filtered or unexported fields
}
func NewForumIndexer ¶
func NewForumIndexer(configuration ForumIndexerConfiguration) (*ForumIndexer, error)
func (*ForumIndexer) Close ¶
func (indexer *ForumIndexer) Close()
type ForumPost ¶
type ForumPost struct { Id int `json:"id"` BodyHTML string `json:"body_html"` Time time.Time `json:"time"` Poster string `json:"poster"` ThreadId int `json:"thread_id"` ThreadTitle string `json:"thread_title"` ForumId int `json:"forum_id"` ForumName string `json:"forum_name"` }
func ScrapeForumPosts ¶
func (*ForumPost) ActivityKey ¶
func (*ForumPost) ActivityTime ¶
func (ForumPost) MarshalJSON ¶
type IndexConfiguration ¶
type IndexConfiguration struct {
GoogleAnalytics string
}
type Locale ¶
type Locale struct { Subdomain string Image string IncludeReddit bool Translations map[string]string ParseTime func(s string, tz *time.Location) (time.Time, error) // contains filtered or unexported fields }
func LocaleForRequest ¶
func (*Locale) ActivityFilter ¶
func (*Locale) RefreshForumIds ¶
type RedditComment ¶
type RedditComment struct { Id string `json:"id"` Author string `json:"author"` BodyHTML string `json:"body_html"` PostId string `json:"post_id"` PostTitle string `json:"post_title"` Time time.Time `json:"time"` }
func (*RedditComment) ActivityKey ¶
func (c *RedditComment) ActivityKey() uint32
func (*RedditComment) ActivityTime ¶
func (c *RedditComment) ActivityTime() time.Time
func (*RedditComment) CommentURL ¶
func (c *RedditComment) CommentURL() string
func (*RedditComment) PostURL ¶
func (c *RedditComment) PostURL() string
type RedditIndexer ¶
type RedditIndexer struct {
// contains filtered or unexported fields
}
func NewRedditIndexer ¶
func NewRedditIndexer(configuration RedditIndexerConfiguration) (*RedditIndexer, error)
func (*RedditIndexer) Close ¶
func (indexer *RedditIndexer) Close()
type RedditIndexerConfiguration ¶
type RedditIndexerConfiguration struct {
Database Database
}
type RedditPost ¶
type RedditPost struct { Id string `json:"id"` Author string `json:"author"` Title string `json:"title"` URL string `json:"url"` BodyHTML string `json:"body_html,omitempty"` Permalink string `json:"permalink"` Time time.Time `json:"time"` }
func (*RedditPost) ActivityKey ¶
func (p *RedditPost) ActivityKey() uint32
func (*RedditPost) ActivityTime ¶
func (p *RedditPost) ActivityTime() time.Time
Click to show internal directories.
Click to hide internal directories.