api

package
v0.0.0-...-ae8581d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TopicalAPI

type TopicalAPI struct {
	// contains filtered or unexported fields
}

TopicalAPI represents an API instance, with internal state for templates, storage, and session used by handlers.

func New

func New(templates *template.Template, storage storage.TopicalStore, session session.TopicalSession) *TopicalAPI

New returns a new TopicalAPI instance

func (*TopicalAPI) JoinCreate

func (t *TopicalAPI) JoinCreate(w http.ResponseWriter, r *http.Request)

JoinCreate accepts a payload of user info and saves the user in a session

func (*TopicalAPI) JoinShow

func (t *TopicalAPI) JoinShow(w http.ResponseWriter, r *http.Request)

JoinShow renders the page allowing a user to log in

func (*TopicalAPI) MessageCreate

func (api *TopicalAPI) MessageCreate(w http.ResponseWriter, r *http.Request)

MessageCreate accepts a form POST, creating a message within a given Topic

func (*TopicalAPI) RegisterRoutes

func (t *TopicalAPI) RegisterRoutes(r *mux.Router)

RegisterRoutes registers handler functions defined in this package on a router instance

func (*TopicalAPI) TopicCreate

func (api *TopicalAPI) TopicCreate(w http.ResponseWriter, r *http.Request)

TopicCreate creates a new topic based on inputs from client

func (*TopicalAPI) TopicList

func (api *TopicalAPI) TopicList(w http.ResponseWriter, r *http.Request)

TopicList renders a list of recent topics with message counts in order of most recent post

func (*TopicalAPI) TopicNew

func (api *TopicalAPI) TopicNew(w http.ResponseWriter, r *http.Request)

TopicNew renders a form for creating a new topic

func (*TopicalAPI) TopicShow

func (api *TopicalAPI) TopicShow(w http.ResponseWriter, r *http.Request)

TopicShow renders a topic with it's associated threaded messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL