Documentation ¶
Index ¶
- Constants
- func BaseHandler[Req any, Resp any, Handler HandlerInterface[Req, Resp]](core requestCore.RequestCoreInterface, handler Handler, simulation bool, ...) any
- func CallApi[Resp any](w webFramework.WebFramework, core requestCore.RequestCoreInterface, ...) (*Resp, response.ErrorState)
- func CallApiNoLog[Resp any](method string, param libCallApi.CallParam) (*Resp, error)
- func CallHandler[Req any, Resp any](title, path, api, method, query string, isJson bool, hasInitializer bool, ...) any
- func CallRemote[Req any, Resp any](title, path, api, method string, hasQuery, isJson bool, hasInitializer bool, ...) any
- func CallRemoteWithRespParser[Req any, Resp any](title, path, api, method string, hasQuery, isJson, forwardAuth bool, ...) any
- func ConsumeRemoteGet(w webFramework.WebFramework, api, url string, ...) (int, int, string, any, bool, error)
- func ConsumeRemoteGetApi(api, url string, core requestCore.RequestCoreInterface, args ...any) any
- func ConsumeRemotePost(w webFramework.WebFramework, reqLog libRequest.RequestPtr, request any, ...) (int, string, any, error)
- func DefaultHeaders() []string
- func DefaultLocals() []string
- func Dml[Req libQuery.DmlModel](title, key string, core requestCore.RequestCoreInterface) any
- func DmlHandler[Req libQuery.DmlModel](title, key, path string, core requestCore.RequestCoreInterface, ...) any
- func DmlHandlerOld[Req libQuery.DmlModel](title, key string, core requestCore.RequestCoreInterface, mode libRequest.Type, ...) any
- func ExecDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, ...) (map[string]any, response.ErrorState)
- func ExecuteDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, ...) (map[string]any, response.ErrorState)
- func FinalizeDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, ...)
- func InitPostRequest(w webFramework.WebFramework, reqLog libRequest.RequestPtr, method, url string, ...) (int, map[string]string, error)
- func PreControlDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, ...) response.ErrorState
- func QueryHandler[Row any, Resp []Row](title, key, path string, queryMap map[string]libQuery.QueryCommand, ...) any
- type CallArgs
- func (c CallArgs[Req, Resp]) Finalizer(req HandlerRequest[Req, Resp])
- func (c CallArgs[Req, Resp]) Handler(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
- func (c CallArgs[Req, Resp]) Initializer(req HandlerRequest[Req, Resp]) response.ErrorState
- func (c CallArgs[Req, Resp]) Parameters() (string, libRequest.Type, bool, bool, string)
- func (c CallArgs[Req, Resp]) Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
- type DmlHandlerType
- func (h DmlHandlerType[Req, Resp]) Finalizer(req HandlerRequest[Req, Resp])
- func (h DmlHandlerType[Req, Resp]) Handler(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
- func (h DmlHandlerType[Req, Resp]) Initializer(req HandlerRequest[Req, Resp]) response.ErrorState
- func (h DmlHandlerType[Req, Resp]) Parameters() (string, libRequest.Type, bool, bool, string)
- func (h DmlHandlerType[Req, Resp]) Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
- type HandlerInterface
- type HandlerRequest
- type QueryHandlerType
- func (q QueryHandlerType[Req, Resp]) Finalizer(req HandlerRequest[Req, Resp])
- func (q QueryHandlerType[Row, Resp]) Handler(req HandlerRequest[Row, Resp]) (Resp, response.ErrorState)
- func (q QueryHandlerType[Row, Resp]) Initializer(req HandlerRequest[Row, Resp]) response.ErrorState
- func (q QueryHandlerType[Row, Resp]) Parameters() (string, libRequest.Type, bool, bool, string)
- func (q QueryHandlerType[Req, Resp]) Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
- type WsResponse
Constants ¶
View Source
const ( HeadersMap = "headersMap" FinalPath = "finalPath" )
Variables ¶
This section is empty.
Functions ¶
func BaseHandler ¶
func BaseHandler[Req any, Resp any, Handler HandlerInterface[Req, Resp]]( core requestCore.RequestCoreInterface, handler Handler, simulation bool, args ...any, ) any
func CallApi ¶ added in v0.9.7
func CallApi[Resp any]( w webFramework.WebFramework, core requestCore.RequestCoreInterface, method string, param libCallApi.CallParam) (*Resp, response.ErrorState)
func CallApiNoLog ¶ added in v0.9.24
func CallApiNoLog[Resp any]( method string, param libCallApi.CallParam) (*Resp, error)
func CallHandler ¶ added in v0.9.7
func CallHandler[Req any, Resp any]( title, path, api, method, query string, isJson bool, hasInitializer bool, headers []string, core requestCore.RequestCoreInterface, ) any
func CallRemote ¶ added in v0.9.7
func CallRemote[Req any, Resp any]( title, path, api, method string, hasQuery, isJson bool, hasInitializer bool, transmitter func( path, api, method string, requestByte []byte, headers map[string]string, parseRemoteResp func([]byte, string, int) (int, map[string]string, any, error), consumer func([]byte, string, string, string, string, map[string]string) ([]byte, string, int, error), ) (int, map[string]string, any, error), core requestCore.RequestCoreInterface, simulation bool, args ...string, ) any
func CallRemoteWithRespParser ¶ added in v0.9.7
func CallRemoteWithRespParser[Req any, Resp any]( title, path, api, method string, hasQuery, isJson, forwardAuth bool, hasInitializer bool, transmitter func( path, api, method string, requestByte []byte, headers map[string]string, parseRemoteResp func([]byte, string, int) (int, map[string]string, any, error), consumer func([]byte, string, string, string, string, map[string]string) ([]byte, string, int, error), ) (int, map[string]string, any, error), core requestCore.RequestCoreInterface, parseRemoteResp func([]byte, string, int) (int, map[string]string, any, error), simulation bool, args ...string, ) any
func ConsumeRemoteGet ¶ added in v0.9.7
func ConsumeRemoteGet( w webFramework.WebFramework, api, url string, core requestCore.RequestCoreInterface, args ...any) (int, int, string, any, bool, error)
func ConsumeRemoteGetApi ¶ added in v0.9.7
func ConsumeRemoteGetApi( api, url string, core requestCore.RequestCoreInterface, args ...any) any
func ConsumeRemotePost ¶ added in v0.9.7
func ConsumeRemotePost( w webFramework.WebFramework, reqLog libRequest.RequestPtr, request any, method, methodName, api, url string, parseRemoteResp func([]byte, string, int) (int, map[string]string, any, error), consumeHandler func([]byte, string, string, string, string, map[string]string) ([]byte, string, int, error), ) (int, string, any, error)
func DefaultHeaders ¶ added in v0.9.7
func DefaultHeaders() []string
func DefaultLocals ¶ added in v0.9.7
func DefaultLocals() []string
func Dml ¶
func Dml[Req libQuery.DmlModel]( title, key string, core requestCore.RequestCoreInterface, ) any
func DmlHandler ¶
func DmlHandler[Req libQuery.DmlModel]( title, key, path string, core requestCore.RequestCoreInterface, mode libRequest.Type, validateHeader bool, ) any
func DmlHandlerOld ¶ added in v0.9.2
func DmlHandlerOld[Req libQuery.DmlModel]( title, key string, core requestCore.RequestCoreInterface, mode libRequest.Type, validateHeader bool, ) any
func ExecDML ¶
func ExecDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, core requestCore.RequestCoreInterface) (map[string]any, response.ErrorState)
func ExecuteDML ¶
func ExecuteDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, core requestCore.RequestCoreInterface) (map[string]any, response.ErrorState)
func FinalizeDML ¶
func FinalizeDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, core requestCore.RequestCoreInterface)
func InitPostRequest ¶ added in v0.9.7
func InitPostRequest( w webFramework.WebFramework, reqLog libRequest.RequestPtr, method, url string, checkDuplicate func(libRequest.Request) error, addEvent func(webFramework.WebFramework, string, string, string, libRequest.RequestPtr), insertRequest func(libRequest.Request) error, args ...any, ) (int, map[string]string, error)
initializer func(c webFramework.WebFramework, method, url string, reqLog libRequest.RequestPtr, args ...any) (int, map[string]string, error),
func PreControlDML ¶
func PreControlDML(request libQuery.DmlModel, key, title string, w webFramework.WebFramework, core requestCore.RequestCoreInterface) response.ErrorState
func QueryHandler ¶ added in v0.9.20
func QueryHandler[Row any, Resp []Row]( title, key, path string, queryMap map[string]libQuery.QueryCommand, core requestCore.RequestCoreInterface, mode libRequest.Type, validateHeader, simulation bool, ) any
Types ¶
type CallArgs ¶ added in v0.9.7
type CallArgs[Req any, Resp any] struct { Title, Path, Api, Method string HasQuery, IsJson bool HasInitializer bool ForwardAuth bool Transmitter func( path, api, method string, requestByte []byte, headers map[string]string, parseRemoteResp func([]byte, string, int) (int, map[string]string, any, error), consumer func([]byte, string, string, string, string, map[string]string) ([]byte, string, int, error), ) (int, map[string]string, any, error) Args, Locals, Headers []string Parser func(respBytes []byte, desc string, status int) (int, map[string]string, any, error) }
func (CallArgs[Req, Resp]) Finalizer ¶ added in v0.9.7
func (c CallArgs[Req, Resp]) Finalizer(req HandlerRequest[Req, Resp])
func (CallArgs[Req, Resp]) Handler ¶ added in v0.9.7
func (c CallArgs[Req, Resp]) Handler(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
func (CallArgs[Req, Resp]) Initializer ¶ added in v0.9.7
func (c CallArgs[Req, Resp]) Initializer(req HandlerRequest[Req, Resp]) response.ErrorState
func (CallArgs[Req, Resp]) Parameters ¶ added in v0.9.7
func (CallArgs[Req, Resp]) Simulation ¶ added in v0.9.19
func (c CallArgs[Req, Resp]) Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
type DmlHandlerType ¶
type DmlHandlerType[Req libQuery.DmlModel, Resp map[string]any] struct { Title string Path string Mode libRequest.Type VerifyHeader bool Key string }
func (DmlHandlerType[Req, Resp]) Finalizer ¶
func (h DmlHandlerType[Req, Resp]) Finalizer(req HandlerRequest[Req, Resp])
func (DmlHandlerType[Req, Resp]) Handler ¶
func (h DmlHandlerType[Req, Resp]) Handler(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
func (DmlHandlerType[Req, Resp]) Initializer ¶
func (h DmlHandlerType[Req, Resp]) Initializer(req HandlerRequest[Req, Resp]) response.ErrorState
func (DmlHandlerType[Req, Resp]) Parameters ¶
func (h DmlHandlerType[Req, Resp]) Parameters() (string, libRequest.Type, bool, bool, string)
func (DmlHandlerType[Req, Resp]) Simulation ¶ added in v0.9.19
func (h DmlHandlerType[Req, Resp]) Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
type HandlerInterface ¶
type HandlerInterface[Req any, Resp any] interface { // returns handler title // Request Bodymode // and validate header option // and save to request table option // and url path of handler Parameters() (string, libRequest.Type, bool, bool, string) // runs after validating request Initializer(req HandlerRequest[Req, Resp]) response.ErrorState // main handler runs after initialize Handler(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState) // runs after sending back response Finalizer(req HandlerRequest[Req, Resp]) // handles simulation mode Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState) }
type HandlerRequest ¶
type HandlerRequest[Req any, Resp any] struct { Title string Core requestCore.RequestCoreInterface Header *libRequest.RequestHeader Request *Req Response Resp W webFramework.WebFramework Args []any }
type QueryHandlerType ¶ added in v0.9.20
type QueryHandlerType[Row any, Resp []Row] struct { Title string Path string Mode libRequest.Type VerifyHeader bool Key string Command libQuery.QueryCommand }
func (QueryHandlerType[Req, Resp]) Finalizer ¶ added in v0.9.20
func (q QueryHandlerType[Req, Resp]) Finalizer(req HandlerRequest[Req, Resp])
func (QueryHandlerType[Row, Resp]) Handler ¶ added in v0.9.20
func (q QueryHandlerType[Row, Resp]) Handler(req HandlerRequest[Row, Resp]) (Resp, response.ErrorState)
func (QueryHandlerType[Row, Resp]) Initializer ¶ added in v0.9.20
func (q QueryHandlerType[Row, Resp]) Initializer(req HandlerRequest[Row, Resp]) response.ErrorState
func (QueryHandlerType[Row, Resp]) Parameters ¶ added in v0.9.20
func (q QueryHandlerType[Row, Resp]) Parameters() (string, libRequest.Type, bool, bool, string)
func (QueryHandlerType[Req, Resp]) Simulation ¶ added in v0.9.20
func (q QueryHandlerType[Req, Resp]) Simulation(req HandlerRequest[Req, Resp]) (Resp, response.ErrorState)
type WsResponse ¶ added in v0.9.7
type WsResponse[Result any] struct { Status int `json:"status"` Description string `json:"description"` Result Result `json:"result,omitempty"` ErrorData []response.ErrorResponse `json:"errors,omitempty"` }
Click to show internal directories.
Click to hide internal directories.