Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// resources
Users *usersClient
// contains filtered or unexported fields
}
Client is a UserKit client through which sub-resources can be accessed
type CoreError ¶
type CoreError struct {
Type string `json:"type"`
Code string `json:"code"`
Message string `json:"message"`
RetryWait float64 `json:"retry_wait"`
Param string `json:"param"`
}
CoreError is a base UserKit exception
type Error ¶
Error is what developers should usually expect to handle when using this SDK. It contains an Errors property which is populated with a list of CoreError's when hitting an endpoint which can return multiple errors.
type Requestor ¶
type Requestor struct {
APIKey string
}
Requestor holds info needed to make an authenticated request to the UserKit API endpoints.
func (*Requestor) Do ¶
func (ukrequest *Requestor) Do(method, url string, payload interface{}, sessionToken *string) (*UKResponse, error)
Do makes an authenticated request to the UserKit api. payload will be sent as a json request body. Some requests (such as to the users/by_token endpoint) require a sessionToken parameter.
type Session ¶
type Session struct {
Token string `json:"token"`
ExpiresInSecs float64 `json:"expires_in_secs"`
RefreshAfterSecs float64 `json:"refresh_after_secs"`
}
Session represents a UserKit user session
type UKResponse ¶
UKResponse holds the data from a http response. We need this so that the Do helper method can close the response.Body.
type User ¶
type User struct {
ID string `json:"id"`
Name string `json:"name"`
Username string `json:"username"`
Email string `json:"email"`
VerifiedEmail string `json:"verified_email"`
VerifiedPhone string `json:"verified_phone"`
AuthType string `json:"auth_type"`
LastFailedLogin float64 `json:"last_failed_login"`
LastLogin float64 `json:"last_login"`
Disabled bool `json:"disabled"`
Created float64 `json:"created"`
}
User is represents a UserKit User object