api

package
v0.0.0-...-953cc36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2019 License: NCSA Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config = &auth0Config{
		done: make(chan struct{}),
	}
)

Config ...

Functions

This section is empty.

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

Api ...

func New

func New(iopts ...Option) *Api

New ...

func (*Api) CreateUser

func (api *Api) CreateUser(createUserRequestData CreateUserRequestData) (User, error)

CreateUser ...

func (*Api) DeleteUser

func (api *Api) DeleteUser(userID string) error

DeleteUser ...

func (*Api) FindUser

func (api *Api) FindUser(username string) (User, error)

FindUser ...

func (*Api) GetUser

func (api *Api) GetUser(getUserRequestData GetUserRequestData) (User, error)

GetUser ...

func (*Api) GetUsersByEmail

func (api *Api) GetUsersByEmail(email string) ([]User, error)

GetUsersByEmail ...

func (Api) MarshalEasyJSON

func (v Api) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Api) MarshalJSON

func (v Api) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Api) Options

func (api *Api) Options() Options

Options ...

func (*Api) Send

func (api *Api) Send(method, endpointUrl string, body interface{}) (*http.Response, error)

Send ...

func (*Api) SendVerificationEmail

func (api *Api) SendVerificationEmail(requestData SendVerificationEmailRequestData) error

SendVerificationEmail ...

func (*Api) UnmarshalEasyJSON

func (v *Api) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Api) UnmarshalJSON

func (v *Api) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Api) UpdateUser

func (api *Api) UpdateUser(userID string, updateUserRequestData UpdateUserRequestData) (User, error)

UpdateUser ...

type CreateUserRequestData

type CreateUserRequestData struct {
	AppMetadata   map[string]interface{} `json:"app_metadata,omitempty"`
	Connection    string                 `json:"connection"`
	Email         string                 `json:"email,omitempty"`
	EmailVerified bool                   `json:"email_verified,omitempty"`
	Password      string                 `json:"password,omitempty"`
	PhoneNumber   string                 `json:"phone_number,omitempty"`
	PhoneVerified bool                   `json:"phone_verified,omitempty"`
	UserMetadata  map[string]interface{} `json:"user_metadata,omitempty"`
	Username      string                 `json:"username,omitempty"`
	VerifyEmail   bool                   `json:"verify_email,omitempty"`
	GivenName     string                 `json:"-"`
}

CreateUserRequestData ...

func (CreateUserRequestData) MarshalEasyJSON

func (v CreateUserRequestData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CreateUserRequestData) MarshalJSON

func (v CreateUserRequestData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CreateUserRequestData) UnmarshalEasyJSON

func (v *CreateUserRequestData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CreateUserRequestData) UnmarshalJSON

func (v *CreateUserRequestData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ErrorResponse

type ErrorResponse struct {
	StatusCode int    `json:"statusCode"`
	ErrorTag   string `json:"error"`
	Message    string `json:"message"`
	ErrorCode  string `json:"errorCode"`
}

ErrorResponse ...

func (ErrorResponse) Error

func (er ErrorResponse) Error() string

Error ...

func (ErrorResponse) MarshalEasyJSON

func (v ErrorResponse) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ErrorResponse) MarshalJSON

func (v ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ErrorResponse) UnmarshalEasyJSON

func (v *ErrorResponse) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ErrorResponse) UnmarshalJSON

func (v *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type GetUserRequestData

type GetUserRequestData struct {
	UserID string `json:"user_id"`
}

GetUserRequestData ...

func (GetUserRequestData) MarshalEasyJSON

func (v GetUserRequestData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (GetUserRequestData) MarshalJSON

func (v GetUserRequestData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*GetUserRequestData) UnmarshalEasyJSON

func (v *GetUserRequestData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*GetUserRequestData) UnmarshalJSON

func (v *GetUserRequestData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Identity

type Identity struct {
	Connection string `json:"connection,omitempty"`
	UserID     string `json:"user_id,omitempty"`
	Provider   string `json:"provider,omitempty"`
	IsSocial   bool   `json:"isSocial,omitempty"`
}

Identity ...

func (Identity) MarshalEasyJSON

func (v Identity) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Identity) MarshalJSON

func (v Identity) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Identity) UnmarshalEasyJSON

func (v *Identity) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Identity) UnmarshalJSON

func (v *Identity) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Option

type Option func(*Options)

Option ...

func ClientID

func ClientID(s string) Option

ClientID ...

func ClientSecret

func ClientSecret(s string) Option

ClientSecret ...

func Connection

func Connection(s string) Option

Connection ...

func Domain

func Domain(s string) Option

Domain ...

type Options

type Options struct {
	Domain       string
	ClientID     string
	ClientSecret string
	Connection   string
}

Options ...

func (Options) MarshalEasyJSON

func (v Options) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Options) MarshalJSON

func (v Options) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Options) UnmarshalEasyJSON

func (v *Options) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Options) UnmarshalJSON

func (v *Options) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type SendVerificationEmailRequestData

type SendVerificationEmailRequestData struct {
	UserID string `json:"user_id"`
}

SendVerificationEmailRequestData ...

func (SendVerificationEmailRequestData) MarshalEasyJSON

func (v SendVerificationEmailRequestData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SendVerificationEmailRequestData) MarshalJSON

func (v SendVerificationEmailRequestData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SendVerificationEmailRequestData) UnmarshalEasyJSON

func (v *SendVerificationEmailRequestData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SendVerificationEmailRequestData) UnmarshalJSON

func (v *SendVerificationEmailRequestData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UpdateUserRequestData

type UpdateUserRequestData struct {
	AppMetadata       map[string]interface{} `json:"app_metadata,omitempty"`
	Blocked           bool                   `json:"blocked,omitempty"`
	ClientID          string                 `json:"client_id,omitempty"`
	Connection        string                 `json:"connection,omitempty"`
	Email             string                 `json:"email,omitempty"`
	EmailVerified     bool                   `json:"email_verified,omitempty"`
	Password          string                 `json:"password,omitempty"`
	PhoneNumber       string                 `json:"phone_number,omitempty"`
	PhoneVerified     bool                   `json:"phone_verified,omitempty"`
	UserMetadata      map[string]interface{} `json:"user_metadata,omitempty"`
	Username          string                 `json:"username,omitempty"`
	VerifyEmail       bool                   `json:"verify_email,omitempty"`
	VerifyPassword    bool                   `json:"verify_password,omitempty"`
	VerifyPhoneNumber bool                   `json:"verify_phone_number,omitempty"`
	GivenName         string                 `json:"-"`
}

UpdateUserRequestData ...

func (UpdateUserRequestData) MarshalEasyJSON

func (v UpdateUserRequestData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UpdateUserRequestData) MarshalJSON

func (v UpdateUserRequestData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UpdateUserRequestData) UnmarshalEasyJSON

func (v *UpdateUserRequestData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UpdateUserRequestData) UnmarshalJSON

func (v *UpdateUserRequestData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type User

type User struct {
	Email         string                 `json:"email,omitempty"`
	EmailVerified bool                   `json:"email_verified,omitempty"`
	Username      string                 `json:"username,omitempty"`
	PhoneNumber   string                 `json:"phone_number,omitempty"`
	PhoneVerified bool                   `json:"phone_verified,omitempty"`
	UserID        string                 `json:"user_id,omitempty"`
	CreatedAt     string                 `json:"created_at,omitempty"`
	UpdatedAt     string                 `json:"updated_at,omitempty"`
	Identities    []Identity             `json:"identities,omitempty"`
	AppMetadata   map[string]interface{} `json:"app_metadata,omitempty"`
	UserMetadata  map[string]interface{} `json:"user_metadata,omitempty"`
	Picture       string                 `json:"picture,omitempty"`
	Name          string                 `json:"name,omitempty"`
	Nickname      string                 `json:"nickname,omitempty"`
	Multifactor   []string               `json:"multifactor,omitempty"`
	LastIP        string                 `json:"last_ip,omitempty"`
	LastLogin     string                 `json:"last_login,omitempty"`
	LoginsCount   int                    `json:"logins_count,omitempty"`
	Blocked       bool                   `json:"blocked,omitempty"`
	GivenName     string                 `json:"given_name,omitempty"`
	FamilyName    string                 `json:"family_name,omitempty"`
}

User ...

func (User) MarshalEasyJSON

func (v User) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (User) MarshalJSON

func (v User) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*User) UnmarshalEasyJSON

func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*User) UnmarshalJSON

func (v *User) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserPage

type UserPage struct {
	Start  int    `json:"start"`
	Limit  int    `json:"limit"`
	Length int    `json:"length"`
	Users  []User `json:"users"`
}

UserPage ...

func (UserPage) MarshalEasyJSON

func (v UserPage) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserPage) MarshalJSON

func (v UserPage) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserPage) UnmarshalEasyJSON

func (v *UserPage) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserPage) UnmarshalJSON

func (v *UserPage) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL