Documentation ¶
Index ¶
- func ErrCodeFromStatus(code int) string
- func ListenAndServeDebug() error
- func NewSessionManager() *scs.SessionManager
- func StatusCode(err error) int
- type Error
- type Server
- func (s *Server) CreateSession(ctx context.Context, user *todo.User) error
- func (s *Server) DestroySession(ctx context.Context) error
- func (s *Server) Listen() (err error)
- func (s *Server) Port() int
- func (s *Server) RenewSession(ctx context.Context) error
- func (s *Server) Scheme() string
- func (s *Server) Shutdown() error
- func (s *Server) URL() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrCodeFromStatus ¶
ErrCodeFromStatus returns the corresponding error code for an HTTP status code.
func ListenAndServeDebug ¶
func ListenAndServeDebug() error
func NewSessionManager ¶
func NewSessionManager() *scs.SessionManager
func StatusCode ¶
StatusCode returns the HTTP status code for an error code.
Types ¶
type Server ¶
type Server struct { // config values Addr string Domain string TLS bool APIKey string CORSAllowedOrigins string // AssetsDirectory is the path to the frontend HTML/CSS/JavaScript AssetsDirectory string Logger todo.Logger // LoggerMiddleware is exposed for testing purposes. LoggerMiddleware func(http.Handler) http.Handler SessionManager *scs.SessionManager ItemListService todo.ItemListService UserService todo.UserService // contains filtered or unexported fields }
func (*Server) CreateSession ¶
Click to show internal directories.
Click to hide internal directories.