Documentation
¶
Index ¶
Constants ¶
const ( // HS512alg is used to implement HS512 Algorithm HS512alg string = "HS512" // HS256alg is used to implement HS512 Algorithm HS256alg string = "HS256" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JWT ¶
type JWT struct { Payload // contains filtered or unexported fields }
JWT struct is used to store header and payload data to be created as a JWT Token Based on the first function name.
func (*JWT) SetPayload ¶
SetPayload is used to fill data into the payload to be encrypted, this function only can be passed using payload type from this library.
type Security ¶
type Security struct { SecretKey string WhiteListURI []string BlackListURI []string Message interface{} MiddlewarePayload map[string]interface{} }
Security is used to store JWT to be encrypted.
func (*Security) JWTMiddleware ¶
JWTMiddleware is implemented from middleware. this function are implemented with http.Handle param and it will return http.Handler
func (*Security) SetPayloadFromMiddleware ¶
SetPayloadFromMiddleware :
type VerifyToken ¶
type VerifyToken struct { Payload // contains filtered or unexported fields }
VerifyToken struct is used to store header and payload data that has been given from Verify function.
func Verify ¶
func Verify(secret string) *VerifyToken
Verify is used to verify your last JWT token based on secret key.
func (*VerifyToken) SetToken ¶
func (verif *VerifyToken) SetToken(token string) *VerifyToken
SetToken is used to fill JWT token to be filled to VerifyToken Struct.
func (*VerifyToken) Status ¶
func (verif *VerifyToken) Status() bool
Status function is used to get a status from JWT Token is original or fake.