Documentation ¶
Index ¶
- func RSSTextFormat(plain string) string
- func RegistToRouter(s *mux.Router, path string, fn func(w http.ResponseWriter, r *http.Request))
- func RenderRSS(st interface{}, wr io.Writer)
- func RenderTemplate(file string, st interface{}, wr io.Writer)
- type CGI
- func (c *CGI) CheckGetCache() bool
- func (c *CGI) CheckVisitor() bool
- func (c *CGI) Defaults() *Defaults
- func (c *CGI) Footer(menubar *Menubar)
- func (c *CGI) HTMLFormat(plain, appli string, title string, absuri bool) string
- func (c *CGI) HasAuth() bool
- func (c *CGI) Header(title, rss string, cookie []*http.Cookie, denyRobot bool)
- func (c *CGI) Host() string
- func (c *CGI) IsAdmin() bool
- func (c *CGI) IsBot() bool
- func (c *CGI) IsFriend() bool
- func (c *CGI) MakeMenubar(id, rss string) *Menubar
- func (c *CGI) Path() string
- func (c *CGI) Print302(next string)
- func (c *CGI) Print403()
- func (c *CGI) Print404(ca *thread.Cache, id string)
- func (c *CGI) PrintIndexList(cl []*thread.Cache, target string, footer bool, searchNewFile bool, ...)
- func (c *CGI) PrintNewElementForm()
- func (c *CGI) RFC822Time(stamp int64) string
- func (c *CGI) RemoveFileForm(ca *thread.Cache, title string)
- func (c *CGI) ResAnchor(id, appli string, title string, absuri bool) string
- type CacheInfo
- type Defaults
- type Htemplate
- type Item
- type ListItem
- type LoggingServeMux
- type Menubar
- type Message
- type RSS
- type Ttemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RSSTextFormat ¶ added in v0.2.0
RSSTextFormat formats plain string to stirng usable in html.
func RegistToRouter ¶ added in v0.2.0
RegistToRouter registers fn to s with path.
func RenderTemplate ¶ added in v0.2.0
RenderTemplate executes template and write to wr.
Types ¶
type CGI ¶ added in v0.2.0
CGI is a base class for all http handlers.
func NewCGI ¶ added in v0.2.0
NewCGI reads messages file, and set params , returns CGI obj. CGI obj is cached.
func (*CGI) CheckGetCache ¶ added in v0.2.0
CheckGetCache return true if visitor is firend or admin and user-agent is not robot.
func (*CGI) CheckVisitor ¶ added in v0.2.0
CheckVisitor returns true if visitor is permitted.
func (*CGI) HTMLFormat ¶ added in v0.2.0
HTMLFormat converts plain text to html , including converting link string to <a href="link">.
func (*CGI) IsAdmin ¶ added in v0.2.0
IsAdmin returns tur if matches admin regexp setted in config file.
func (*CGI) IsFriend ¶ added in v0.2.0
IsFriend returns tur if matches friend regexp setted in config file.
func (*CGI) MakeMenubar ¶ added in v0.2.0
MakeMenubar makes and returns *Menubar obj.
func (*CGI) Path ¶ added in v0.2.0
Path returns path part of url. e.g. /thread.CGI/hoe/moe -> hoe/moe
func (*CGI) Print403 ¶ added in v0.2.0
func (c *CGI) Print403()
Print403 renders 403 forbidden page with jump page.
func (*CGI) Print404 ¶ added in v0.2.0
Print404 render the 404 page. if ca!=nil also renders info page of removing cache.
func (*CGI) PrintIndexList ¶ added in v0.2.0
func (c *CGI) PrintIndexList(cl []*thread.Cache, target string, footer bool, searchNewFile bool, filter, tagg string)
PrintIndexList renders index_list.txt which renders threads in cachelist.
func (*CGI) PrintNewElementForm ¶ added in v0.2.0
func (c *CGI) PrintNewElementForm()
PrintNewElementForm renders new_element_form.txt for posting new thread.
func (*CGI) RFC822Time ¶ added in v0.2.0
RFC822Time convers stamp to "2006-01-02 15:04:05"
func (*CGI) RemoveFileForm ¶ added in v0.2.0
RemoveFileForm render remove_form_form page.
type Defaults ¶ added in v0.2.0
type Defaults struct { AdminCGI string GatewayCGI string ThreadCGI string ServerCGI string Message Message IsAdmin bool IsFriend bool Version string DescChanges string DescNew string DescRecent string DescIndex string DescSearch string DescStatus string Path string EmptyList template.HTML }
Defaults is default variables for templates.
type Htemplate ¶ added in v0.1.0
type Htemplate struct {
*htmlTemplate.Template
}
Htemplate is for rendering html stuff.
type Item ¶
type Item struct { Title string Link string Description string Creator string Date int64 Content string Subject []string // contains filtered or unexported fields }
Item represents RSS contents.
type LoggingServeMux ¶
LoggingServeMux is ServerMux with logging
func NewLoggingServeMux ¶
func NewLoggingServeMux() *LoggingServeMux
NewLoggingServeMux returns loggingServeMux obj.
func (*LoggingServeMux) RegistCompressHandler ¶
func (s *LoggingServeMux) RegistCompressHandler(path string, fn func(w http.ResponseWriter, r *http.Request))
RegistCompressHandler registers fn to s after registering CompressHandler with path.
func (*LoggingServeMux) RegisterPprof ¶
func (s *LoggingServeMux) RegisterPprof()
RegisterPprof registers pprof relates funcs to s.
func (*LoggingServeMux) ServeHTTP ¶
func (s *LoggingServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP just calles http.ServeMux.ServeHTTP after logging.
type Message ¶ added in v0.2.0
Message hold string map.
func SearchMessage ¶ added in v0.2.0
SearchMessage parse Accept-Language header ,selects most-weighted(biggest q) language ,reads the associated message file, and creates and returns message obj.
type RSS ¶
type RSS struct { Encode string Lang string Title string Link string Description string Feeds []*Item URI string XSL string // contains filtered or unexported fields }
RSS represents RSS info.
func (*RSS) Append ¶ added in v0.2.0
func (r *RSS) Append(link, title, creator, description, content string, subject []string, date int64, abs bool)
Append adds RSS an item.
type Ttemplate ¶ added in v0.1.0
type Ttemplate struct {
*textTemplate.Template
}
Ttemplate is for rendering text rss template.