Documentation ¶
Index ¶
- Constants
- func WithSession(client Client) func(handler http.Handler) http.Handler
- type Client
- type ClientResponse
- type ClientsService
- type DeleteResponse
- type Email
- type EmailAddress
- type EmailResponse
- type EmailService
- type Error
- type ErrorResponse
- type IdentificationLink
- type PhoneNumber
- type SMSMessage
- type SMSMessageResponse
- type SMSService
- type Session
- type SessionsService
- type UpdateUser
- type User
- type UsersService
- type VerificationService
Constants ¶
View Source
const ( ProdUrl = "https://api.clerk.dev/v1/" ClientsUrl = "clients" ClientsVerifyUrl = ClientsUrl + "/verify" EmailsUrl = "emails" SessionsUrl = "sessions" SMSUrl = "sms_messages" UsersUrl = "users" )
View Source
const ( CookieSession = "__session" QueryParamSessionId = "_clerk_session_id" )
View Source
const (
ActiveSession = iota
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { NewRequest(method string, url string, body ...interface{}) (*http.Request, error) Do(req *http.Request, v interface{}) (*http.Response, error) Clients() *ClientsService Emails() *EmailService Sessions() *SessionsService SMS() *SMSService Users() *UsersService Verification() *VerificationService }
type ClientResponse ¶ added in v1.0.3
type ClientsService ¶ added in v1.0.3
type ClientsService service
func (*ClientsService) ListAll ¶ added in v1.0.3
func (s *ClientsService) ListAll() ([]ClientResponse, error)
func (*ClientsService) Read ¶ added in v1.0.3
func (s *ClientsService) Read(clientId string) (*ClientResponse, error)
func (*ClientsService) Verify ¶ added in v1.0.3
func (s *ClientsService) Verify(token string) (*ClientResponse, error)
type DeleteResponse ¶
type EmailAddress ¶
type EmailAddress struct { ID string `json:"id"` Object string `json:"object"` EmailAddress string `json:"email_address"` Verification interface{} `json:"verification"` LinkedTo []IdentificationLink `json:"linked_to"` }
type EmailResponse ¶
type EmailService ¶
type EmailService service
func (*EmailService) Create ¶
func (s *EmailService) Create(email Email) (*EmailResponse, error)
type ErrorResponse ¶ added in v1.0.5
func (*ErrorResponse) Error ¶ added in v1.0.5
func (e *ErrorResponse) Error() string
type IdentificationLink ¶
type PhoneNumber ¶
type PhoneNumber struct { ID string `json:"id"` Object string `json:"object"` PhoneNumber string `json:"phone_number"` ReservedForSecondFactor bool `json:"reserved_for_second_factor"` Verification interface{} `json:"verification"` LinkedTo []IdentificationLink `json:"linked_to"` }
type SMSMessage ¶
type SMSMessageResponse ¶
type SMSService ¶
type SMSService service
func (*SMSService) Create ¶
func (s *SMSService) Create(message SMSMessage) (*SMSMessageResponse, error)
type SessionsService ¶
type SessionsService service
func (*SessionsService) ListAll ¶
func (s *SessionsService) ListAll() ([]Session, error)
type UpdateUser ¶
type UpdateUser struct { FirstName *string `json:"first_name,omitempty"` LastName *string `json:"last_name,omitempty"` PrimaryEmailAddressID *string `json:"primary_email_address_id,omitempty"` PrimaryPhoneNumberID *string `json:"primary_phone_number_id,omitempty"` ProfileImage *string `json:"profile_image,omitempty"` Password *string `json:"password,omitempty"` }
type User ¶
type User struct { ID string `json:"id"` Object string `json:"object"` Username *string `json:"username"` FirstName *string `json:"first_name"` LastName *string `json:"last_name"` Gender *string `json:"gender"` Birthday *string `json:"birthday"` ProfileImageURL string `json:"profile_image_url"` PrimaryEmailAddressID *string `json:"primary_email_address_id"` PrimaryPhoneNumberID *string `json:"primary_phone_number_id"` PasswordEnabled bool `json:"password_enabled"` TwoFactorEnabled bool `json:"two_factor_enabled"` EmailAddresses []EmailAddress `json:"email_addresses"` PhoneNumbers []PhoneNumber `json:"phone_numbers"` ExternalAccounts []interface{} `json:"external_accounts"` Metadata interface{} `json:"metadata"` PrivateMetadata interface{} `json:"private_metadata,omitempty"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
type UsersService ¶
type UsersService service
func (*UsersService) Delete ¶
func (s *UsersService) Delete(userId string) (*DeleteResponse, error)
func (*UsersService) ListAll ¶
func (s *UsersService) ListAll() ([]User, error)
func (*UsersService) Update ¶
func (s *UsersService) Update(userId string, updateRequest *UpdateUser) (*User, error)
type VerificationService ¶ added in v1.0.3
type VerificationService service
Click to show internal directories.
Click to hide internal directories.