Documentation ¶
Index ¶
Constants ¶
View Source
const ( ServiceCode = "73" GrantType = "client_credentials" TSLayout = "2006-01-02T15:04:05+07:00" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func NewAuthService ¶
func NewAuthService(cfg *config.EnvParams) *AuthService
func (*AuthService) GetAccessToken ¶
func (a *AuthService) GetAccessToken(w http.ResponseWriter, r *http.Request) (*TokenResponse, *res.Message)
func (*AuthService) ValidateAccessToken ¶
func (a *AuthService) ValidateAccessToken(accessToken string, serviceCode string) *res.Message
type TokenHeader ¶
type TokenHeader struct { ContentType string `header:"Content-Type" validate:"required"` ClientKey string `header:"X-Client-Key" validate:"required,max=64"` Timestamp string `header:"X-Timestamp" validate:"required" ` Signature string `header:"X-Signature" validate:"required"` }
time_format:"2006-01-02T15:04:05+07:00"
type TokenRequest ¶
type TokenRequest struct {
GrantType string `json:"grantType" validate:"required"`
}
Click to show internal directories.
Click to hide internal directories.