Documentation
¶
Index ¶
- func ErrorHandler(next echo.HandlerFunc) echo.HandlerFunc
- func RequestLogger(next echo.HandlerFunc) echo.HandlerFunc
- func RequestRecover(next echo.HandlerFunc) echo.HandlerFunc
- func RequestTimeout(timeout time.Duration) echo.MiddlewareFunc
- type AppTemplate
- type HTTPServer
- func (s *HTTPServer) APICreateSecret(c echo.Context) error
- func (s *HTTPServer) APIGetSecret(c echo.Context) error
- func (s *HTTPServer) APIInfos(c echo.Context) error
- func (s *HTTPServer) CreateSecret(c echo.Context) error
- func (s *HTTPServer) DisplayAboutPage(c echo.Context) error
- func (s *HTTPServer) DisplayHomePage(c echo.Context) error
- func (s *HTTPServer) DisplayOfflinePage(c echo.Context) error
- func (s *HTTPServer) GetSecret(c echo.Context) error
- func (s *HTTPServer) GetSecretContent(c echo.Context) error
- func (s *HTTPServer) Shutdown() error
- func (s *HTTPServer) Start() (returnErr error)
- func (s *HTTPServer) TestCreateSecret(c echo.Context) error
- func (s *HTTPServer) TestGetSecret(c echo.Context) error
- func (s *HTTPServer) TestSecret(c echo.Context) error
- type HTTPServerConfig
- type TemplatesRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func ErrorHandler(next echo.HandlerFunc) echo.HandlerFunc
func RequestLogger ¶
func RequestLogger(next echo.HandlerFunc) echo.HandlerFunc
inspired from https://github.com/ziflex/lecho/blob/3cf18943c98abe517c9ac68740579093481588cc/middleware.go
func RequestRecover ¶
func RequestRecover(next echo.HandlerFunc) echo.HandlerFunc
inspired from https://github.com/labstack/echo/blob/3b07058a1d8f440497dc7be1d2ad9a2767c84a57/middleware/recover.go
func RequestTimeout ¶
Types ¶
type AppTemplate ¶
type AppTemplate string
const ( TemplateOffline AppTemplate = "_offline" TemplateAbout AppTemplate = "about" TemplateCreateSecret AppTemplate = "create-secret" TemplateGetSecret AppTemplate = "get-secret" TemplateError AppTemplate = "error" TemplateViewSecret AppTemplate = "view-secret" TemplateViewSecretLink AppTemplate = "view-secret-link" )
type HTTPServer ¶
type HTTPServer struct { PublicURL string Store common.Store // contains filtered or unexported fields }
func New ¶
func New(config HTTPServerConfig, publicURL string, store common.Store) *HTTPServer
func (*HTTPServer) APICreateSecret ¶
func (s *HTTPServer) APICreateSecret(c echo.Context) error
func (*HTTPServer) APIGetSecret ¶
func (s *HTTPServer) APIGetSecret(c echo.Context) error
func (*HTTPServer) APIInfos ¶
func (s *HTTPServer) APIInfos(c echo.Context) error
func (*HTTPServer) CreateSecret ¶
func (s *HTTPServer) CreateSecret(c echo.Context) error
func (*HTTPServer) DisplayAboutPage ¶
func (s *HTTPServer) DisplayAboutPage(c echo.Context) error
func (*HTTPServer) DisplayHomePage ¶
func (s *HTTPServer) DisplayHomePage(c echo.Context) error
func (*HTTPServer) DisplayOfflinePage ¶
func (s *HTTPServer) DisplayOfflinePage(c echo.Context) error
func (*HTTPServer) GetSecret ¶
func (s *HTTPServer) GetSecret(c echo.Context) error
func (*HTTPServer) GetSecretContent ¶
func (s *HTTPServer) GetSecretContent(c echo.Context) error
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown() error
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start() (returnErr error)
func (*HTTPServer) TestCreateSecret ¶
func (s *HTTPServer) TestCreateSecret(c echo.Context) error
func (*HTTPServer) TestGetSecret ¶
func (s *HTTPServer) TestGetSecret(c echo.Context) error
func (*HTTPServer) TestSecret ¶
func (s *HTTPServer) TestSecret(c echo.Context) error
type HTTPServerConfig ¶
type HTTPServerConfig struct { Host string `default:"0.0.0.0"` Port uint64 `default:"5000"` Timeout time.Duration `default:"5s"` ReadHeaderTimeout time.Duration `default:"15s"` // the amount of time allowed to read request headers ReadTimeout time.Duration `default:"30s"` // the maximum duration for reading the entire request, including the body WriteTimeout time.Duration `default:"5m"` // the maximum duration before timing out writes of the response IdleTimeout time.Duration `default:"30s"` // the maximum amount of time to wait for the next request when keep-alives are enabled. RequestTimeout time.Duration `default:"3s"` ShutdownTimeout time.Duration `default:"15s"` GzipCompressionLevel int `default:"5"` DebugTemplates bool `default:"false"` }
type TemplatesRenderer ¶
type TemplatesRenderer struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.