Documentation ¶
Index ¶
- Constants
- func DisableLog()
- func UseLogger(logger slog.Logger)
- type Comments
- func (c *Comments) HandleComments(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleCount(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleDel(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleEdit(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleNew(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandlePolicy(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleTimestamps(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleVote(w http.ResponseWriter, r *http.Request)
- func (c *Comments) HandleVotes(w http.ResponseWriter, r *http.Request)
- type EventNew
Constants ¶
const (
// EventTypeNew is emitted when a new comment is made.
EventTypeNew = "comments-new"
)
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
Types ¶
type Comments ¶
type Comments struct {
// contains filtered or unexported fields
}
Comments is the context for the comments API.
func New ¶
func New(cfg *config.Config, pdc *pdclient.Client, udb user.Database, s *sessions.Sessions, e *events.Manager, plugins []pdv2.Plugin) (*Comments, error)
New returns a new Comments context.
func (*Comments) HandleComments ¶
func (c *Comments) HandleComments(w http.ResponseWriter, r *http.Request)
HandleComments is the request handler for the comments v1 Comments route.
func (*Comments) HandleCount ¶
func (c *Comments) HandleCount(w http.ResponseWriter, r *http.Request)
HandleCount is the request handler for the comments v1 Count route.
func (*Comments) HandleDel ¶
func (c *Comments) HandleDel(w http.ResponseWriter, r *http.Request)
HandleDel is the request handler for the comments v1 Del route.
func (*Comments) HandleEdit ¶ added in v1.4.0
func (c *Comments) HandleEdit(w http.ResponseWriter, r *http.Request)
HandleEdit is the request handler for the comments v1 Edit route.
func (*Comments) HandleNew ¶
func (c *Comments) HandleNew(w http.ResponseWriter, r *http.Request)
HandleNew is the request handler for the comments v1 New route.
func (*Comments) HandlePolicy ¶
func (c *Comments) HandlePolicy(w http.ResponseWriter, r *http.Request)
HandlePolicy is the request handler for the comments v1 Policy route.
func (*Comments) HandleTimestamps ¶
func (c *Comments) HandleTimestamps(w http.ResponseWriter, r *http.Request)
HandleTimestamps is the request handler for the comments v1 Timestamps route.
func (*Comments) HandleVote ¶
func (c *Comments) HandleVote(w http.ResponseWriter, r *http.Request)
HandleVote is the request handler for the comments v1 Vote route.
func (*Comments) HandleVotes ¶
func (c *Comments) HandleVotes(w http.ResponseWriter, r *http.Request)
HandleVotes is the request handler for the comments v1 Votes route.