Documentation
¶
Index ¶
- func BodyAllowedForStatus(status int) bool
- func BoxToHttpFileSystem(box goxr.Box) http.FileSystem
- func ReportNotHandableProblem(err error, ctx *fasthttp.RequestCtx, logger log.Logger)
- type HttpTime
- type Interceptor
- type JsonResponse
- type Server
- func (instance *Server) DoesETagMatched(fi os.FileInfo, ctx *fasthttp.RequestCtx) bool
- func (instance *Server) DoesModifiedMatched(fi os.FileInfo, ctx *fasthttp.RequestCtx) bool
- func (instance *Server) Handle(ctx *fasthttp.RequestCtx)
- func (instance *Server) HandleError(err error, interceptAllowed bool, ctx *fasthttp.RequestCtx)
- func (instance *Server) Log() log.Logger
- func (instance *Server) NotModifiedFor(fi os.FileInfo, ctx *fasthttp.RequestCtx)
- func (instance *Server) ResolveInitialTargetPath(ctx *fasthttp.RequestCtx) string
- func (instance *Server) Run() error
- func (instance *Server) ServeFile(path string, ctx *fasthttp.RequestCtx, interceptAllowed bool, statusCode int)
- func (instance *Server) ShouldHandleStatusCode(code int, ctx *fasthttp.RequestCtx) bool
- func (instance *Server) StatusCodeFor(err error) int
- func (instance *Server) Validate() error
- func (instance *Server) WriteFileHeadersFor(fi os.FileInfo, ctx *fasthttp.RequestCtx)
- func (instance *Server) WriteGenericHeaders(ctx *fasthttp.RequestCtx)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyAllowedForStatus ¶ added in v0.1.0
func BoxToHttpFileSystem ¶
func BoxToHttpFileSystem(box goxr.Box) http.FileSystem
func ReportNotHandableProblem ¶ added in v0.1.0
func ReportNotHandableProblem(err error, ctx *fasthttp.RequestCtx, logger log.Logger)
Types ¶
type Interceptor ¶ added in v0.1.0
type Interceptor interface { OnBeforeHandle(ctx *fasthttp.RequestCtx) (handled bool, newCtx *fasthttp.RequestCtx) OnAfterHandle(ctx *fasthttp.RequestCtx) OnTargetPathResolved(path string, ctx *fasthttp.RequestCtx) (newPath string) OnHandleError(err error, interceptAllowed bool, ctx *fasthttp.RequestCtx) (handled bool, newErr error, newCtx *fasthttp.RequestCtx) }
type JsonResponse ¶
type JsonResponse struct { Path string `json:"path,omitempty"` Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` Details string `json:"details,omitempty"` Time HttpTime `json:"time,omitempty"` }
func ErrorToHttpResponse ¶
func ErrorToHttpResponse(err error) JsonResponse
func (JsonResponse) Complete ¶
func (instance JsonResponse) Complete(ctx *fasthttp.RequestCtx) JsonResponse
func (JsonResponse) Serve ¶
func (instance JsonResponse) Serve(ctx *fasthttp.RequestCtx, logger log.Logger)
type Server ¶
type Server struct { Box goxr.Box Configuration configuration.Configuration Logger log.Logger Interceptor Interceptor }
func (*Server) DoesETagMatched ¶ added in v0.1.0
func (*Server) DoesModifiedMatched ¶ added in v0.1.0
func (*Server) Handle ¶ added in v0.1.0
func (instance *Server) Handle(ctx *fasthttp.RequestCtx)
func (*Server) HandleError ¶ added in v0.1.0
func (instance *Server) HandleError(err error, interceptAllowed bool, ctx *fasthttp.RequestCtx)
func (*Server) NotModifiedFor ¶ added in v0.1.0
func (instance *Server) NotModifiedFor(fi os.FileInfo, ctx *fasthttp.RequestCtx)
func (*Server) ResolveInitialTargetPath ¶ added in v0.1.0
func (instance *Server) ResolveInitialTargetPath(ctx *fasthttp.RequestCtx) string
func (*Server) ShouldHandleStatusCode ¶ added in v0.1.0
func (instance *Server) ShouldHandleStatusCode(code int, ctx *fasthttp.RequestCtx) bool
func (*Server) StatusCodeFor ¶ added in v0.1.0
func (*Server) WriteFileHeadersFor ¶ added in v0.1.0
func (instance *Server) WriteFileHeadersFor(fi os.FileInfo, ctx *fasthttp.RequestCtx)
func (*Server) WriteGenericHeaders ¶ added in v0.1.0
func (instance *Server) WriteGenericHeaders(ctx *fasthttp.RequestCtx)
Click to show internal directories.
Click to hide internal directories.