Documentation ¶
Overview ¶
nntpchan frontend allows posting to nntpchan network via various implementations
Index ¶
- type CaptchaServer
- func (cs *CaptchaServer) CheckSession(w http.ResponseWriter, r *http.Request, solution string) (bool, error)
- func (cs *CaptchaServer) NewCaptcha(w http.ResponseWriter, r *http.Request)
- func (cs *CaptchaServer) Reload(c *config.MiddlewareConfig)
- func (cs *CaptchaServer) SetupRoutes(m *mux.Router)
- func (cs *CaptchaServer) VerifyCaptcha(w http.ResponseWriter, r *http.Request)
- type Frontend
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptchaServer ¶
type CaptchaServer struct {
// contains filtered or unexported fields
}
server of captchas implements frontend.Middleware
func NewCaptchaServer ¶
func NewCaptchaServer(w, h int, prefix string, store *sessions.CookieStore) *CaptchaServer
create new captcha server using existing session store
func (*CaptchaServer) CheckSession ¶
func (cs *CaptchaServer) CheckSession(w http.ResponseWriter, r *http.Request, solution string) (bool, error)
return true if this session has solved the last captcha given provided solution, otherwise false
func (*CaptchaServer) NewCaptcha ¶
func (cs *CaptchaServer) NewCaptcha(w http.ResponseWriter, r *http.Request)
generate a new captcha
func (*CaptchaServer) Reload ¶
func (cs *CaptchaServer) Reload(c *config.MiddlewareConfig)
func (*CaptchaServer) SetupRoutes ¶
func (cs *CaptchaServer) SetupRoutes(m *mux.Router)
func (*CaptchaServer) VerifyCaptcha ¶
func (cs *CaptchaServer) VerifyCaptcha(w http.ResponseWriter, r *http.Request)
verify a captcha
type Frontend ¶
type Frontend interface { // run mainloop using net.Listener Serve(l net.Listener) error // do we accept this inbound post? AllowPost(p model.PostReference) bool // trigger a manual regen of indexes for a root post Regen(p model.PostReference) // implements nntp.EventHooks GotArticle(msgid nntp.MessageID, group nntp.Newsgroup) // implements nntp.EventHooks SentArticleVia(msgid nntp.MessageID, feedname string) // reload config Reload(c *config.FrontendConfig) }
a frontend that displays nntp posts and allows posting
func NewHTTPFrontend ¶
create a new http frontend give frontend config
type Middleware ¶
type Middleware interface { // set up routes SetupRoutes(m *mux.Router) // reload with new configuration Reload(c *config.MiddlewareConfig) }
http middleware
func OverchanMiddleware ¶
func OverchanMiddleware(c *config.MiddlewareConfig, markupCache cache.CacheInterface, db database.DB) (m Middleware, err error)
create standard overchan middleware
Click to show internal directories.
Click to hide internal directories.