Documentation ¶
Overview ¶
Package web provides the plumbing for Inbucket's web GUI and RESTful API
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RenderJSON ¶
func RenderJSON(w http.ResponseWriter, data interface{}) error
RenderJSON sets the correct HTTP headers for JSON, then writes the specified data (typically a struct) encoded in JSON
func TextToHTML ¶
TextToHTML takes plain text, escapes it and tries to pretty it up for HTML display
Types ¶
type Context ¶
type Context struct { Vars map[string]string MsgHub *msghub.Hub Manager message.Manager RootConfig *config.Root WebConfig config.Web IsJSON bool }
Context is passed into every request handler function TODO remove redundant web config
func NewContext ¶
NewContext returns a Context for the given HTTP Request
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines an instance of the Web server.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.