Documentation ¶
Index ¶
- func Cron(routes func(router RouterC))
- func FuseG(grpcPort int, routes func(router RouterG))
- func FuseGR(grpcPort int, grpcRoutes func(router RouterG), restPort int, ...)
- func FuseGS(grpcPort int, grpcRoutes func(router RouterG), wsPort int, ...)
- func FuseR(restPort int, routes func(router RouterR))
- func FuseRS(restPort int, routes func(router RouterR), ws func(router RouterS))
- func WsStream(logc clog.Instance, addr string, header *map[string]string, ...)
- type FuseRCallOpt
- type FuseRContext
- type FuseRContextBuilder
- type FuseRRegulator
- type FuseSContext
- type FuseSLocal
- type FuseSRun
- type Response
- type ResponseMeta
- type ResponseOpt
- type RouterC
- type RouterG
- type RouterR
- type RouterS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FuseRCallOpt ¶
type FuseRCallOpt interface { OverrideHeader(val map[string]string) FuseRCallOpt OverrideParam(val map[string]string) FuseRCallOpt OverrideQuery(val map[string]string) FuseRCallOpt OverrideForm(val map[string][]string) FuseRCallOpt }
type FuseRContext ¶
type FuseRContext interface { Clog() clog.Instance Auth(obj ...any) any UserId(id ...any) any PartnerId(id ...any) any SetFiles(files map[string]string) ReqHeader() *map[string]string ReqParam() *map[string]string ReqQuery() *map[string]string ReqForm() *map[string][]string ReqFile() *map[string][]*multipart.FileHeader GetHeader(key string, dval ...string) *string GetClientIP() string RouteMethod() string RoutePath() string ReqParser(header any, body any) error ReqParserPQF(param any, query any, form any) error LastResponse() (val any, meta ResponseMeta) R200OK(val any, opt ...ResponseOpt) any R201Created(val any, opt ...ResponseOpt) any R202Accepted(val any, opt ...ResponseOpt) any R204NoContent(val any, opt ...ResponseOpt) any R301MovedPermanently(val any, opt ...ResponseOpt) any R307TemporaryRedirect(val any, opt ...ResponseOpt) any R308PermanentRedirect(val any, opt ...ResponseOpt) any R400BadRequest(val any, opt ...ResponseOpt) any R403Forbidden(val any, opt ...ResponseOpt) any R404NotFound(val any, opt ...ResponseOpt) any R406NotAcceptable(val any, opt ...ResponseOpt) any R412PreconditionFailed(val any, opt ...ResponseOpt) any R418Teapot(val any, opt ...ResponseOpt) any R428PreconditionRequired(val any, opt ...ResponseOpt) any R500InternalServerError(err error, opt ...ResponseOpt) any }
type FuseRContextBuilder ¶
type FuseRContextBuilder interface {
Build() FuseRContext
}
type FuseRRegulator ¶
type FuseRRegulator interface { Next() (next bool, handler func(ctx FuseRContext) any) IsHandler(handler func(ctx FuseRContext) any) bool Call(handler func(ctx FuseRContext) any, opt ...FuseRCallOpt) (res any, meta ResponseMeta, raw bool) CallOpt() FuseRCallOpt Endpoint() string Recover() }
type FuseSContext ¶ added in v1.0.22
type FuseSLocal ¶ added in v1.0.22
type Response ¶ added in v1.0.5
type Response struct { Meta ResponseMeta `json:"meta"` Data any `json:"data,omitempty"` }
type ResponseMeta ¶ added in v1.0.5
type ResponseOpt ¶ added in v1.0.5
type RouterC ¶ added in v1.0.24
type RouterC interface { // duration like `1m` for every 1 minute, `2h` for every 2 hours. // valid time units: "s", "m", "h". Every(duration string, fn func(), startUpDelayed *time.Duration, allowParallel ...bool) // duration like `1m` for every 1 minute, `2h` for every 2 hours. // valid time units: "s", "m", "h". NEvery(duration string, fns []func(), startUpDelayed *time.Duration, allowParallel ...bool) // at a specific time of day in the form "HH:MM:SS" or "HH:MM". EveryDay(at string, fn func(), allowParallel ...bool) // at a specific time of day in the form "HH:MM:SS" or "HH:MM". NEveryDay(at string, fns []func(), allowParallel ...bool) }
type RouterR ¶
type RouterR interface { AutoRecover(autoRecover bool) PrintOnError(printOnError bool) Unrouted(handler func(ctx FuseRContext, method, path, url string) any) ErrorHandler(catcher func(ctx FuseRContext, err error) any) NoLog(paths []string) Endpoints(regulator func(regulator FuseRRegulator), auth func(FuseRContext) any, pathHandlers map[string][]func(FuseRContext) any) Static(endpointPaths map[string]string, config ...fiber.Static) }
type RouterS ¶ added in v1.0.22
type RouterS interface { Locals(fn func(sl FuseSLocal)) Register(path string, handler func(ctx FuseSContext)) Run(path string, registerCondition *func(ctx FuseSContext) bool, userUidCondition *func(ctx FuseSContext) (ok bool, userUid string)) FuseSRun }
Source Files ¶
- client-ip-func.go
- cron-impl.go
- cron-router-impl.go
- fuse-func.go
- fuse-g-impl.go
- fuse-g-router-impl.go
- fuse-g-server-handler-impl.go
- fuse-gr-impl.go
- fuse-gs-impl.go
- fuse-r-call-opt-impl.go
- fuse-r-context-func.go
- fuse-r-context-impl.go
- fuse-r-impl.go
- fuse-r-main-context.go
- fuse-r-regulator-func.go
- fuse-r-regulator-impl.go
- fuse-r-router-func.go
- fuse-r-router-impl.go
- fuse-rs-impl.go
- fuse-s-context-impl.go
- fuse-s-local-impl.go
- fuse-s-router-impl.go
- fuse-s-run-impl.go
- server-cron.go
- server-func.go
- server-fuse.go
- server-ice.go
- server-init.go
- server-model.go
- server-stu.go
- server-vars.go
- server-ws-func.go
Click to show internal directories.
Click to hide internal directories.