Documentation
¶
Index ¶
- func RegisterRoutes(e *echo.Echo, basePath string, handlers *gotrust.GenericAuthHandlers)
- func WrapHandler(handler gotrust.HTTPHandler) echo.HandlerFunc
- func WrapMiddleware(middleware gotrust.HTTPMiddleware) echo.MiddlewareFunc
- type EchoContext
- func (e *EchoContext) Context() context.Context
- func (e *EchoContext) GetCookie(name string) (*http.Cookie, error)
- func (e *EchoContext) GetFormValue(key string) string
- func (e *EchoContext) GetHeader(key string) string
- func (e *EchoContext) GetQueryParam(key string) string
- func (e *EchoContext) SetCookie(cookie *http.Cookie)
- func (e *EchoContext) SetHeader(key, value string)
- func (e *EchoContext) SetStatus(code int)
- type EchoRouter
- func (r *EchoRouter) DELETE(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
- func (r *EchoRouter) GET(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
- func (r *EchoRouter) Group(prefix string, middleware ...gotrust.HTTPMiddleware) gotrust.Router
- func (r *EchoRouter) POST(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
- func (r *EchoRouter) PUT(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(e *echo.Echo, basePath string, handlers *gotrust.GenericAuthHandlers)
RegisterRoutes registers all auth routes on an Echo instance
func WrapHandler ¶
func WrapHandler(handler gotrust.HTTPHandler) echo.HandlerFunc
WrapHandler converts a gotrust.HTTPHandler to echo.HandlerFunc
func WrapMiddleware ¶
func WrapMiddleware(middleware gotrust.HTTPMiddleware) echo.MiddlewareFunc
WrapMiddleware converts a gotrust.HTTPMiddleware to echo.MiddlewareFunc
Types ¶
type EchoContext ¶
EchoContext wraps echo.Context to implement gotrust.HTTPContext
func (*EchoContext) Context ¶
func (e *EchoContext) Context() context.Context
Context returns the request context
func (*EchoContext) GetCookie ¶
func (e *EchoContext) GetCookie(name string) (*http.Cookie, error)
GetCookie gets a cookie
func (*EchoContext) GetFormValue ¶
func (e *EchoContext) GetFormValue(key string) string
GetFormValue gets a form value
func (*EchoContext) GetHeader ¶
func (e *EchoContext) GetHeader(key string) string
GetHeader gets a request header
func (*EchoContext) GetQueryParam ¶
func (e *EchoContext) GetQueryParam(key string) string
GetQueryParam gets a query parameter
func (*EchoContext) SetCookie ¶
func (e *EchoContext) SetCookie(cookie *http.Cookie)
SetCookie sets a cookie
func (*EchoContext) SetHeader ¶
func (e *EchoContext) SetHeader(key, value string)
SetHeader sets a response header
func (*EchoContext) SetStatus ¶
func (e *EchoContext) SetStatus(code int)
SetStatus sets the response status code
type EchoRouter ¶
type EchoRouter struct {
// contains filtered or unexported fields
}
EchoRouter wraps echo.Group to implement gotrust.Router
func NewEchoRouter ¶
func NewEchoRouter(group *echo.Group) *EchoRouter
NewEchoRouter creates a new Echo router wrapper
func (*EchoRouter) DELETE ¶
func (r *EchoRouter) DELETE(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
DELETE registers a DELETE route
func (*EchoRouter) GET ¶
func (r *EchoRouter) GET(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
GET registers a GET route
func (*EchoRouter) Group ¶
func (r *EchoRouter) Group(prefix string, middleware ...gotrust.HTTPMiddleware) gotrust.Router
Group creates a new route group
func (*EchoRouter) POST ¶
func (r *EchoRouter) POST(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
POST registers a POST route
func (*EchoRouter) PUT ¶
func (r *EchoRouter) PUT(path string, handler gotrust.HTTPHandler, middleware ...gotrust.HTTPMiddleware)
PUT registers a PUT route