Documentation ¶
Index ¶
- func AuthenticateClient(c *gin.Context) (string, map[string]string, int, error)
- func AuthenticateServer(c *gin.Context) (string, map[string]string, int, error)
- func CreateAuthorizedAppAndUser(appKey string, secretkey string, name string, username string) (model.App, int, error)
- func GetAuthorizedApp(appKey string, secretkey string) (model.App, int, error)
- func GetAuthorizedAppFromContext(c *gin.Context) (model.App, int, error)
- func GetAuthorizedUser(appKey string, secretkey string, userName string) (model.User, int, error)
- func GetAuthorizedUserFromContext(c *gin.Context) (model.User, int, error)
- func GetTokenString(c *gin.Context) (string, int, error)
- func RemoveAuthorizedApp(appKey string, secretkey string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateClient ¶
AuthenticateClient authenticate a token that generated from client that is valid.
func AuthenticateServer ¶
AuthenticateServer authenticate a token that generated from API server that is valid.
func CreateAuthorizedAppAndUser ¶
func CreateAuthorizedAppAndUser(appKey string, secretkey string, name string, username string) (model.App, int, error)
CreateAuthorizedApp creates an authorized app
func GetAuthorizedApp ¶
GetAuthorizedApp gets an authorized app from *gin.Context
func GetAuthorizedAppFromContext ¶
GetAuthorizedAppFromContext gets an authorized app from *gin.Context
func GetAuthorizedUser ¶
GetAuthorizedUser gets an authorized user from *gin.Context
func GetAuthorizedUserFromContext ¶
GetAuthorizedUserFromContext gets an authorized user from *gin.Context
func GetTokenString ¶
GetTokenString extract a token from an authentication header.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.