Documentation
¶
Index ¶
- Variables
- type Context
- func (ctx *Context) Claims() *WechyClaims
- func (ctx *Context) Failure(err error) error
- func (ctx *Context) IsAuthenticated() bool
- func (ctx *Context) NotFound() error
- func (ctx *Context) ParamAsInt(name string) (int, error)
- func (ctx *Context) SetClaims(claims *WechyClaims)
- func (ctx *Context) SetTenant(tenant *Tenant)
- func (ctx *Context) Tenant() *Tenant
- type HTMLRenderer
- type HandlerFunc
- type MiddlewareFunc
- type Tenant
- type User
- type UserProvider
- type WechyClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("Object not found")
ErrNotFound represents an object not found error
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context wraps echo.context to provide userful WeCHY information
func (*Context) Claims ¶
func (ctx *Context) Claims() *WechyClaims
Claims returns authenticated user claims
func (*Context) IsAuthenticated ¶
IsAuthenticated returns true if user is authenticated
func (*Context) ParamAsInt ¶
ParamAsInt returns parameter as int
func (*Context) SetClaims ¶
func (ctx *Context) SetClaims(claims *WechyClaims)
SetClaims update HTTP context with current claims
type HTMLRenderer ¶
type HTMLRenderer struct {
// contains filtered or unexported fields
}
HTMLRenderer renderer
func NewHTMLRenderer ¶
func NewHTMLRenderer(logger echo.Logger) *HTMLRenderer
NewHTMLRenderer creates a new HTMLRenderer
type MiddlewareFunc ¶
type MiddlewareFunc func(HandlerFunc) HandlerFunc
MiddlewareFunc represents an HTTP middleware
func OneYearCache ¶
func OneYearCache() MiddlewareFunc
OneYearCache adds Cache-Control header for one year
type User ¶
type User struct { ID int `json:"id"` Name string `json:"name"` Email string `json:"email"` Providers []*UserProvider `json:"providers"` }
User represents an user inside our application
type UserProvider ¶
UserProvider represents the relashionship between an User and an Authentication provide
type WechyClaims ¶
type WechyClaims struct { UserID int `json:"user/id"` UserName string `json:"user/name"` UserEmail string `json:"user/email"` jwt.StandardClaims }
WechyClaims represents what goes into JWT tokens
Click to show internal directories.
Click to hide internal directories.