Documentation ¶
Index ¶
- func AppAPIDocument() *fiber.App
- func AppMetricsPrometheus(mainApp *fiber.App) *fiber.App
- func MappingStandard(code int, dataList interface{}, responsePagination *ResponsePagination) (response ResponseDataList, err *Error)
- func MustError(err error, str ...string)
- type APIHTTP
- func (api *APIHTTP) HandlerLogic(handler HandlerLogic)
- func (api *APIHTTP) MappingResponse(handler MappingResponse)
- func (api *APIHTTP) OnPostHandler(handler OnPostHandler)
- func (api *APIHTTP) OnPreAuth(handler Handler)
- func (api *APIHTTP) OnPreHandler(handler OnPreHandler)
- func (api *APIHTTP) OnPreResponse(handler OnPreResponse)
- func (api *APIHTTP) ParseRequest(handler ParseRequest)
- func (api *APIHTTP) SendResponse(handler SendResponse)
- func (api *APIHTTP) SetHandlerByPassLifeCycle(handler fiber.Handler)
- func (api *APIHTTP) SetupHandlerHTTP(service interface{}) fiber.Handler
- func (api *APIHTTP) ValidateAuth(handler Handler)
- func (api *APIHTTP) ValidateHeaders(handler Handler)
- func (api *APIHTTP) ValidateParams(handler Handler)
- func (api *APIHTTP) ValidateQuery(handler Handler)
- func (api *APIHTTP) ValidateRequest(handler ValidateRequest)
- func (api *APIHTTP) ValidateResponse(handler ValidateResponse)
- type Context
- type Error
- type Handler
- type HandlerLogic
- type InterfaceClose
- type MappingResponse
- type MappingResponseStandard
- type MicroService
- func (ms *MicroService) Add(method string, path string, api *APIHTTP)
- func (ms *MicroService) Delete(path string, api *APIHTTP)
- func (ms *MicroService) Get(path string, api *APIHTTP)
- func (ms *MicroService) Patch(path string, api *APIHTTP)
- func (ms *MicroService) Post(path string, api *APIHTTP)
- func (ms *MicroService) Put(path string, api *APIHTTP)
- type OnPostHandler
- type OnPreHandler
- type OnPreResponse
- type ParseRequest
- type Portal
- type RequestPagination
- type ResponseDataList
- type ResponseError
- type ResponsePagination
- type SendResponse
- type ValidateRequest
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppMetricsPrometheus ¶
func AppMetricsPrometheus(mainApp *fiber.App) *fiber.App
AppMetricsPrometheus Func
func MappingStandard ¶
func MappingStandard(code int, dataList interface{}, responsePagination *ResponsePagination) (response ResponseDataList, err *Error)
MappingStandard Func
Types ¶
type APIHTTP ¶
type APIHTTP struct {
// contains filtered or unexported fields
}
APIHTTP Struct
func (*APIHTTP) HandlerLogic ¶
func (api *APIHTTP) HandlerLogic(handler HandlerLogic)
HandlerLogic func
func (*APIHTTP) MappingResponse ¶
func (api *APIHTTP) MappingResponse(handler MappingResponse)
MappingResponse func
func (*APIHTTP) OnPostHandler ¶
func (api *APIHTTP) OnPostHandler(handler OnPostHandler)
OnPostHandler func
func (*APIHTTP) OnPreHandler ¶
func (api *APIHTTP) OnPreHandler(handler OnPreHandler)
OnPreHandler func
func (*APIHTTP) OnPreResponse ¶
func (api *APIHTTP) OnPreResponse(handler OnPreResponse)
OnPreResponse func
func (*APIHTTP) ParseRequest ¶
func (api *APIHTTP) ParseRequest(handler ParseRequest)
ParseRequest func
func (*APIHTTP) SendResponse ¶
func (api *APIHTTP) SendResponse(handler SendResponse)
SendResponse func
func (*APIHTTP) SetHandlerByPassLifeCycle ¶
func (api *APIHTTP) SetHandlerByPassLifeCycle(handler fiber.Handler)
SetHandlerByPassLifeCycle API
func (*APIHTTP) SetupHandlerHTTP ¶
func (api *APIHTTP) SetupHandlerHTTP(service interface{}) fiber.Handler
SetupHandlerHTTP API
func (*APIHTTP) ValidateHeaders ¶
ValidateHeaders func
func (*APIHTTP) ValidateParams ¶
ValidateParams func
func (*APIHTTP) ValidateQuery ¶
ValidateQuery func
func (*APIHTTP) ValidateRequest ¶
func (api *APIHTTP) ValidateRequest(handler ValidateRequest)
ValidateRequest func
func (*APIHTTP) ValidateResponse ¶
func (api *APIHTTP) ValidateResponse(handler ValidateResponse)
ValidateResponse func
type Context ¶
type Context struct { Ctx *fiber.Ctx Service interface{} State map[string]interface{} }
Context Struct
type HandlerLogic ¶
type HandlerLogic = func(context *Context, requestValidated interface{}) (code int, responseRaw interface{}, responsePagination *ResponsePagination, err *Error)
HandlerLogic Type
type InterfaceClose ¶
type InterfaceClose interface {
Close() error
}
InterfaceClose for Manage Defer Close
type MappingResponse ¶
type MappingResponse = func(context *Context, code int, responseRaw interface{}, responsePagination *ResponsePagination) (codeOut int, responseMapping interface{}, responsePaginationOut *ResponsePagination, err *Error)
MappingResponse Type
type MappingResponseStandard ¶
type MappingResponseStandard = func(context *Context, code int, responseRaw interface{}, responsePagination *ResponsePagination) (codeOut int, responseMapping interface{}, err *Error)
MappingResponseStandard Type
type MicroService ¶
type MicroService struct {
// contains filtered or unexported fields
}
MicroService Struct
func NewMicroService ¶
func NewMicroService(app *fiber.App, path string, service interface{}) *MicroService
NewMicroService API
type OnPostHandler ¶
type OnPostHandler = func(context *Context, code int, responseRawIn interface{}, responsePagination *ResponsePagination) (codeOut int, responseRawOut interface{}, responsePaginationOut *ResponsePagination, err *Error)
OnPostHandler Type
type OnPreHandler ¶
type OnPreHandler = func(context *Context, requestValidatedIn interface{}) (requestValidatedOut interface{}, err *Error)
OnPreHandler Type
type OnPreResponse ¶
type OnPreResponse = func(context *Context, code int, requestValidatedIn interface{}) (codeOut int, requestValidatedOut interface{}, err *Error)
OnPreResponse Type
type ParseRequest ¶
ParseRequest Type
type Portal ¶
type Portal struct {
// contains filtered or unexported fields
}
Portal Struct
func (*Portal) AppendInterfaceClose ¶
func (pt *Portal) AppendInterfaceClose(iList ...interface{})
AppendInterfaceClose Func
type RequestPagination ¶
type RequestPagination struct { Page int `json:"page" swaggertype:"integer"` PageSize int `json:"page_size" swaggertype:"integer"` }
RequestPagination Struct
type ResponseDataList ¶
type ResponseDataList struct { Success bool `json:"success" swaggertype:"boolean"` Message string `json:"message" swaggertype:"string"` Data interface{} `json:"data,omitempty" swaggertype:"object"` ResponsePagination *ResponsePagination `json:"pagination,omitempty" swaggertype:"object"` ResponseError *ResponseError `json:"error,omitempty" swaggertype:"object"` // errors don't define JSON marshaling` }
ResponseDataList for Send Response Message to Encode Response
type ResponseError ¶
type ResponseError struct {
Message string `json:"message" swaggertype:"string"`
}
ResponseError Struct
type ResponsePagination ¶
type ResponsePagination struct { Page int `json:"page" swaggertype:"integer"` PageSize int `json:"page_size" swaggertype:"integer"` PageCount int `json:"page_count" swaggertype:"integer"` ItemCount int `json:"item_count" swaggertype:"integer"` TotalCount int `json:"total_count" swaggertype:"integer"` }
ResponsePagination Struct
type SendResponse ¶
SendResponse Type
type ValidateRequest ¶
type ValidateRequest = func(context *Context, requestMapping interface{}) (requestValidated interface{}, err *Error)
ValidateRequest Type
type ValidateResponse ¶
type ValidateResponse = func(context *Context, code int, responseMapping interface{}, responsePagination *ResponsePagination) (codeOut int, responseValidated interface{}, responsePaginationOut *ResponsePagination, err *Error)
ValidateResponse Type