Documentation
¶
Index ¶
- func BodyAllowedForStatus(status int) bool
- func BoxToHttpFileSystem(box goxr.Box) http.FileSystem
- func InitiatorBaseConfigureCli(instance *Initiator) error
- func InitiatorConfigureCliAction(instance *Initiator) error
- func InitiatorPhaseFixLogLevelFlag(instance *Initiator) error
- func InitiatorPrepare(instance *Initiator) error
- func ReportNotHandableProblem(err error, ctx *fasthttp.RequestCtx, logger log.Logger)
- type HttpTime
- type Initiator
- type InitiatorError
- type InitiatorPhase
- type Interceptor
- type JsonResponse
- type Server
- func (instance *Server) DoesETagMatched(box goxr.Box, fi os.FileInfo, ctx *fasthttp.RequestCtx) bool
- func (instance *Server) DoesModifiedMatched(box goxr.Box, fi os.FileInfo, ctx *fasthttp.RequestCtx) bool
- func (instance *Server) Handle(ctx *fasthttp.RequestCtx)
- func (instance *Server) HandleError(box goxr.Box, err error, interceptAllowed bool, ctx *fasthttp.RequestCtx)
- func (instance *Server) Log() log.Logger
- func (instance *Server) NotModifiedFor(box goxr.Box, fi os.FileInfo, ctx *fasthttp.RequestCtx)
- func (instance *Server) ResolveInitialTargetPath(box goxr.Box, ctx *fasthttp.RequestCtx) string
- func (instance *Server) Run() error
- func (instance *Server) ServeFile(box goxr.Box, path string, ctx *fasthttp.RequestCtx, interceptAllowed bool, ...)
- func (instance *Server) ShouldHandleStatusCode(box goxr.Box, 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 InitiatorBaseConfigureCli ¶ added in v0.2.0
func InitiatorConfigureCliAction ¶ added in v0.2.0
func InitiatorPhaseFixLogLevelFlag ¶ added in v0.2.0
func InitiatorPrepare ¶ added in v0.2.0
func ReportNotHandableProblem ¶ added in v0.1.0
func ReportNotHandableProblem(err error, ctx *fasthttp.RequestCtx, logger log.Logger)
Types ¶
type Initiator ¶ added in v0.2.0
type Initiator struct { Server *Server App *cli.App Phases []InitiatorPhase Fail func(initiator *Initiator, err error) }
func NewInitiatorFor ¶ added in v0.2.0
type InitiatorError ¶ added in v0.2.0
func InitiatorErrorFor ¶ added in v0.2.0
func InitiatorErrorFor(err error) InitiatorError
func (InitiatorError) Error ¶ added in v0.2.0
func (instance InitiatorError) Error() string
type InitiatorPhase ¶ added in v0.2.0
type Interceptor ¶ added in v0.1.0
type Interceptor interface { OnBeforeHandle(box goxr.Box, ctx *fasthttp.RequestCtx) (handled bool, newBox goxr.Box, newCtx *fasthttp.RequestCtx) OnAfterHandle(box goxr.Box, ctx *fasthttp.RequestCtx) OnTargetPathResolved(box goxr.Box, path string, ctx *fasthttp.RequestCtx) (newPath string) OnHandleError(box goxr.Box, 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 (*Server) NotModifiedFor ¶ added in v0.1.0
func (*Server) ResolveInitialTargetPath ¶ added in v0.1.0
func (*Server) ShouldHandleStatusCode ¶ added in v0.1.0
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)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.