Documentation ¶ Index ¶ type Server func New(config ServerConfig) (*Server, error) func (s *Server) Close() error func (s *Server) HTMLFunc(handler web.Handler, templateName string) http.Handler func (s *Server) JSONFunc(handler web.Handler) http.Handler func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) type ServerConfig Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Server ¶ type Server struct { // contains filtered or unexported fields } A Server wraps a HTTP frontend func New ¶ func New(config ServerConfig) (*Server, error) New instantiates a new server instance func (*Server) Close ¶ func (s *Server) Close() error Close frees any held resources func (*Server) HTMLFunc ¶ func (s *Server) HTMLFunc(handler web.Handler, templateName string) http.Handler HTMLFunc creates a HTTP handler that outputs HTML func (*Server) JSONFunc ¶ func (s *Server) JSONFunc(handler web.Handler) http.Handler JSONFunc creates a HTTP handler that outputs JSON func (*Server) ServeHTTP ¶ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) type ServerConfig ¶ type ServerConfig struct { Context context.Context // A descriptor that initialises the storage backend StorageDSN string // Log errors here ClientErrorLog io.Writer } A ServerConfig combines common options for running a HTTP frontend Source Files ¶ View all Source files htmlhandlers.go jsonhandlers.go redirect.go server.go static.go Directories ¶ Show internal Expand all Path Synopsis errors Click to show internal directories. Click to hide internal directories.