Documentation
¶
Index ¶
- func GetAPIKey(c echo.Context) error
- func GetSelf(c echo.Context) error
- func GetStore() *mongostore.MongoStore
- func GoogleAuthCallback(c echo.Context) error
- func GoogleAuthLogin(c echo.Context) error
- func HandleUser(c echo.Context, user goth.User) bson.ObjectId
- func InitOauth(dbAddress string, dbName string)
- func IsAuthorized(c echo.Context, path string) bool
- func Logout(c echo.Context) error
- func ResetAPIKey(c echo.Context) error
- type APIUser
- type Permission
- type Role
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStore ¶
func GetStore() *mongostore.MongoStore
func GoogleAuthCallback ¶
func GoogleAuthLogin ¶
func IsAuthorized ¶
IsAuthorized checks the session included in the request. If the user is not authorized for the given request, returns false and makes an appropriate response with the context. Otherwise, returns true and defers responses to the caller. If the user is authorized for a given endpoint, IsAuthorized extends the session's expiration.
func ResetAPIKey ¶
Types ¶
type Permission ¶
type Role ¶
type Role struct { ID bson.ObjectId `bson:"_id" json:"id"` Name string `bson:"name" json:"name"` Permissions []Permission `bson:"permissions" json:"permissions"` }
Click to show internal directories.
Click to hide internal directories.