Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateAccessToken(i TokenInputs) (string, error)
- func Init(r *mux.Router, db *sql.DB) error
- func RequiresValidAccessToken(handler ClaimsHttpHandler) common.HttpHandler
- type Claims
- type ClaimsHttpHandler
- type LoginRequest
- type LoginResponse
- type RefreshTokenResponse
- type RegisterNewUserRequest
- type RegisterNewUserResponse
- type TokenInputs
- type User
- type UserModel
Constants ¶
View Source
const (
AuthenticationHeader = "MixerAuth"
)
View Source
const (
UserTable = "user"
)
Variables ¶
View Source
var ErrInvalidToken = errors.New("invalid token")
View Source
var UserModelStruct = sqlbuilder.NewStruct(new(UserModel))
Functions ¶
func GenerateAccessToken ¶
func GenerateAccessToken(i TokenInputs) (string, error)
func RequiresValidAccessToken ¶
func RequiresValidAccessToken(handler ClaimsHttpHandler) common.HttpHandler
Types ¶
type Claims ¶
type Claims struct { Username string `json:"username"` TokenType string `json:"token_type"` jwt.StandardClaims }
type ClaimsHttpHandler ¶
type ClaimsHttpHandler func(http.ResponseWriter, *http.Request, Claims)
type LoginRequest ¶
type LoginResponse ¶
type RefreshTokenResponse ¶
type RegisterNewUserRequest ¶
type RegisterNewUserResponse ¶
type TokenInputs ¶
type TokenInputs struct {
Username string
}
Click to show internal directories.
Click to hide internal directories.