Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORS ¶
type CORS struct {
// contains filtered or unexported fields
}
CORS struct is just middleware that can be used to set access control This object containe 4 field. The field that held by this struct is : --> middleware : middleware field is data with type of *UseMiddleware --> allowOrigin : this field will held all origin that can be set into CORS.
the allowOrigin is field with []string data type
--> allowMethod : this field will held all method that can be set into CORS.
the allowMethod is field with []string data type
--> allowHeader : this field will held all header that can be set into CORS.
the allowHeader is field with []string data type
func (*CORS) AddHandler ¶
Function AddHandler will add http.Handler into the CORS Before the request into the handler, the reqeust will be handler by this CORS
func (*CORS) AllowHeaders ¶
AllowOrigins function is used to set all allowed headers
func (*CORS) AllowMethods ¶
AllowOrigins function is used to set all allowed methods
func (*CORS) AllowOrigins ¶
AllowOrigins function is used to set all allowed origin
type Middleware ¶
Middleware is a function that need one parameter with type of http.Handler and will return a http.Handler
type UseJWTMiddlewarewithECDSA ¶ added in v0.1.4
type UseJWTMiddlewarewithECDSA struct {
// contains filtered or unexported fields
}
func NewJWTMiddlewarewithECDSA ¶ added in v0.1.4
func NewJWTMiddlewarewithECDSA(privateKey string) *UseJWTMiddlewarewithECDSA
func (*UseJWTMiddlewarewithECDSA) AddHandler ¶ added in v0.1.4
func (ec *UseJWTMiddlewarewithECDSA) AddHandler(handler http.Handler)
func (*UseJWTMiddlewarewithECDSA) ServeHTTP ¶ added in v0.1.4
func (ec *UseJWTMiddlewarewithECDSA) ServeHTTP(w http.ResponseWriter, r *http.Request)
type UseMiddleware ¶
type UseMiddleware struct {
// contains filtered or unexported fields
}
UseMiddleware struct can create an object to apply UseMiddleware in specific *multiplexer.Router object. This struct has two field. The first field is : ---> function, which is a Middleware Function The second one is : --> handler, which is a http.Handler where the middleware will be applied
func NewUseMiddleware ¶
func NewUseMiddleware() *UseMiddleware
NewUseMiddleware will return UseMiddleware object
func (*UseMiddleware) AddHandler ¶
func (um *UseMiddleware) AddHandler(handler http.Handler)
AddRouter function will add new http.Handler into the UseMiddleware object
func (*UseMiddleware) AddMiddleware ¶
func (um *UseMiddleware) AddMiddleware(middleware Middleware)
AddMiddleware function will add new Middleware function into the UseMiddleware object
func (*UseMiddleware) ServeHTTP ¶
func (mw *UseMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)