Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TokenState_name = map[int32]string{
0: "WATCH",
1: "LOGOUT",
2: "TRACEROUTE",
3: "FREEZE",
4: "UNFREEZE",
}
View Source
var TokenState_value = map[string]int32{
"WATCH": 0,
"LOGOUT": 1,
"TRACEROUTE": 2,
"FREEZE": 3,
"UNFREEZE": 4,
}
Functions ¶
This section is empty.
Types ¶
type AccessDetails ¶
type AccessTokens ¶
type ResponseObject ¶
type ResponseObject struct { Error string `json:"error,omitempty"` Code int `json:"code,omitempty"` Tokens *AccessTokens `json:"tokens,omitempty"` Token string `json:"token,omitempty"` Message string `json:"message,omitempty"` }
ResponseObject ... general response object
type ServiceAccess ¶
type ServiceAccess struct { UserID uint64 `json:"id,omitempty"` Status TokenStatus `json:"status,omitempty"` Claims *jwt.MapClaims `json:"claims,omitempty"` }
type ServiceError ¶
type ServiceRequest ¶
type ServiceRequest struct { UserID uint64 `json:"user_id"` Payload interface{} `json:"payload,omitempty"` }
type TokenAffectRequest ¶
type TokenAffectRequest struct { Token string `json:"token"` DesiredState TokenState `json:"desired_state,omitempty"` }
type TokenAffectResponse ¶
type TokenAffectResponse struct { EffectApplied bool `json:"effect_applied,omitempty"` Message string `json:"message,omitempty"` Error *ServiceError `json:"error,omitempty"` }
type TokenClaim ¶
type TokenClaim struct { Claim string `json:"claim"` Value interface{} `json:"value"` }
type TokenDetails ¶
type TokenState ¶
type TokenState int32
const ( TokenState_WATCH TokenState = 0 TokenState_LOGOUT TokenState = 1 TokenState_TRACEROUTE TokenState = 2 TokenState_FREEZE TokenState = 3 TokenState_UNFREEZE TokenState = 4 )
type TokenStatus ¶
type TokenStatus int32
const ( TokenStatus_INVALID TokenStatus = 0 TokenStatus_AUTHORIZED TokenStatus = 1 TokenStatus_RESTRICTED TokenStatus = 2 TokenStatus_EXPIRED TokenStatus = 3 )
type TokenVerifyResponse ¶
type TokenVerifyResponse struct { Access ServiceAccess `json:"access,omitempty"` Error ServiceError `json:"error,omitempty"` }
func (*TokenVerifyResponse) MapClaims ¶
func (c *TokenVerifyResponse) MapClaims() map[string]string
Maps the claims from the request to be encoded in the jwt
Click to show internal directories.
Click to hide internal directories.