Documentation
¶
Index ¶
- type CreateArgon2UserOption
- type CreateArgon2UserOptions
- type CreateBcryptUserOption
- type CreateBcryptUserOptions
- type CreateJWTOption
- type CreateJWTOptions
- type CreateMD5UserOption
- type CreateMD5UserOptions
- type CreateOption
- type CreateOptions
- type CreatePHPassUserOption
- type CreatePHPassUserOptions
- type CreateSHAUserOption
- type CreateSHAUserOptions
- type CreateScryptModifiedUserOption
- type CreateScryptModifiedUserOptions
- type CreateScryptUserOption
- type CreateScryptUserOptions
- type CreateTargetOption
- type CreateTargetOptions
- type CreateTokenOption
- type CreateTokenOptions
- type ListIdentitiesOption
- type ListIdentitiesOptions
- type ListLogsOption
- type ListLogsOptions
- type ListOption
- type ListOptions
- type ListTargetsOption
- type ListTargetsOptions
- type UpdateTargetOption
- type UpdateTargetOptions
- type Users
- func (srv *Users) Create(UserId string, optionalSetters ...CreateOption) (*models.User, error)
- func (srv *Users) CreateArgon2User(UserId string, Email string, Password string, ...) (*models.User, error)
- func (srv *Users) CreateBcryptUser(UserId string, Email string, Password string, ...) (*models.User, error)
- func (srv *Users) CreateJWT(UserId string, optionalSetters ...CreateJWTOption) (*models.Jwt, error)
- func (srv *Users) CreateMD5User(UserId string, Email string, Password string, ...) (*models.User, error)
- func (srv *Users) CreateMfaRecoveryCodes(UserId string) (*models.MfaRecoveryCodes, error)
- func (srv *Users) CreatePHPassUser(UserId string, Email string, Password string, ...) (*models.User, error)
- func (srv *Users) CreateSHAUser(UserId string, Email string, Password string, ...) (*models.User, error)
- func (srv *Users) CreateScryptModifiedUser(UserId string, Email string, Password string, PasswordSalt string, ...) (*models.User, error)
- func (srv *Users) CreateScryptUser(UserId string, Email string, Password string, PasswordSalt string, ...) (*models.User, error)
- func (srv *Users) CreateSession(UserId string) (*models.Session, error)
- func (srv *Users) CreateTarget(UserId string, TargetId string, ProviderType string, Identifier string, ...) (*models.Target, error)
- func (srv *Users) CreateToken(UserId string, optionalSetters ...CreateTokenOption) (*models.Token, error)
- func (srv *Users) Delete(UserId string) (*interface{}, error)
- func (srv *Users) DeleteIdentity(IdentityId string) (*interface{}, error)
- func (srv *Users) DeleteMfaAuthenticator(UserId string, Type string) (*models.User, error)
- func (srv *Users) DeleteSession(UserId string, SessionId string) (*interface{}, error)
- func (srv *Users) DeleteSessions(UserId string) (*interface{}, error)
- func (srv *Users) DeleteTarget(UserId string, TargetId string) (*interface{}, error)
- func (srv *Users) Get(UserId string) (*models.User, error)
- func (srv *Users) GetMfaRecoveryCodes(UserId string) (*models.MfaRecoveryCodes, error)
- func (srv *Users) GetPrefs(UserId string) (*models.Preferences, error)
- func (srv *Users) GetTarget(UserId string, TargetId string) (*models.Target, error)
- func (srv *Users) List(optionalSetters ...ListOption) (*models.UserList, error)
- func (srv *Users) ListIdentities(optionalSetters ...ListIdentitiesOption) (*models.IdentityList, error)
- func (srv *Users) ListLogs(UserId string, optionalSetters ...ListLogsOption) (*models.LogList, error)
- func (srv *Users) ListMemberships(UserId string) (*models.MembershipList, error)
- func (srv *Users) ListMfaFactors(UserId string) (*models.MfaFactors, error)
- func (srv *Users) ListSessions(UserId string) (*models.SessionList, error)
- func (srv *Users) ListTargets(UserId string, optionalSetters ...ListTargetsOption) (*models.TargetList, error)
- func (srv *Users) UpdateEmail(UserId string, Email string) (*models.User, error)
- func (srv *Users) UpdateEmailVerification(UserId string, EmailVerification bool) (*models.User, error)
- func (srv *Users) UpdateLabels(UserId string, Labels []interface{}) (*models.User, error)
- func (srv *Users) UpdateMfa(UserId string, Mfa bool) (*models.User, error)
- func (srv *Users) UpdateMfaRecoveryCodes(UserId string) (*models.MfaRecoveryCodes, error)
- func (srv *Users) UpdateName(UserId string, Name string) (*models.User, error)
- func (srv *Users) UpdatePassword(UserId string, Password string) (*models.User, error)
- func (srv *Users) UpdatePhone(UserId string, Number string) (*models.User, error)
- func (srv *Users) UpdatePhoneVerification(UserId string, PhoneVerification bool) (*models.User, error)
- func (srv *Users) UpdatePrefs(UserId string, Prefs interface{}) (*models.Preferences, error)
- func (srv *Users) UpdateStatus(UserId string, Status bool) (*models.User, error)
- func (srv *Users) UpdateTarget(UserId string, TargetId string, optionalSetters ...UpdateTargetOption) (*models.Target, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateArgon2UserOption ¶
type CreateArgon2UserOption func(*CreateArgon2UserOptions)
func WithCreateArgon2UserName ¶
func WithCreateArgon2UserName(v string) CreateArgon2UserOption
type CreateArgon2UserOptions ¶
type CreateArgon2UserOptions struct {
Name string
// contains filtered or unexported fields
}
func (CreateArgon2UserOptions) New ¶
func (options CreateArgon2UserOptions) New() *CreateArgon2UserOptions
type CreateBcryptUserOption ¶
type CreateBcryptUserOption func(*CreateBcryptUserOptions)
func WithCreateBcryptUserName ¶
func WithCreateBcryptUserName(v string) CreateBcryptUserOption
type CreateBcryptUserOptions ¶
type CreateBcryptUserOptions struct {
Name string
// contains filtered or unexported fields
}
func (CreateBcryptUserOptions) New ¶
func (options CreateBcryptUserOptions) New() *CreateBcryptUserOptions
type CreateJWTOption ¶
type CreateJWTOption func(*CreateJWTOptions)
func WithCreateJWTDuration ¶
func WithCreateJWTDuration(v int) CreateJWTOption
func WithCreateJWTSessionId ¶
func WithCreateJWTSessionId(v string) CreateJWTOption
type CreateJWTOptions ¶
type CreateJWTOptions struct {
SessionId string
Duration int
// contains filtered or unexported fields
}
func (CreateJWTOptions) New ¶
func (options CreateJWTOptions) New() *CreateJWTOptions
type CreateMD5UserOption ¶
type CreateMD5UserOption func(*CreateMD5UserOptions)
func WithCreateMD5UserName ¶
func WithCreateMD5UserName(v string) CreateMD5UserOption
type CreateMD5UserOptions ¶
type CreateMD5UserOptions struct {
Name string
// contains filtered or unexported fields
}
func (CreateMD5UserOptions) New ¶
func (options CreateMD5UserOptions) New() *CreateMD5UserOptions
type CreateOption ¶
type CreateOption func(*CreateOptions)
func WithCreateEmail ¶
func WithCreateEmail(v string) CreateOption
func WithCreateName ¶
func WithCreateName(v string) CreateOption
func WithCreatePassword ¶
func WithCreatePassword(v string) CreateOption
func WithCreatePhone ¶
func WithCreatePhone(v string) CreateOption
type CreateOptions ¶
type CreateOptions struct {
Email string
Phone string
Password string
Name string
// contains filtered or unexported fields
}
func (CreateOptions) New ¶
func (options CreateOptions) New() *CreateOptions
type CreatePHPassUserOption ¶
type CreatePHPassUserOption func(*CreatePHPassUserOptions)
func WithCreatePHPassUserName ¶
func WithCreatePHPassUserName(v string) CreatePHPassUserOption
type CreatePHPassUserOptions ¶
type CreatePHPassUserOptions struct {
Name string
// contains filtered or unexported fields
}
func (CreatePHPassUserOptions) New ¶
func (options CreatePHPassUserOptions) New() *CreatePHPassUserOptions
type CreateSHAUserOption ¶
type CreateSHAUserOption func(*CreateSHAUserOptions)
func WithCreateSHAUserName ¶
func WithCreateSHAUserName(v string) CreateSHAUserOption
func WithCreateSHAUserPasswordVersion ¶
func WithCreateSHAUserPasswordVersion(v string) CreateSHAUserOption
type CreateSHAUserOptions ¶
type CreateSHAUserOptions struct {
PasswordVersion string
Name string
// contains filtered or unexported fields
}
func (CreateSHAUserOptions) New ¶
func (options CreateSHAUserOptions) New() *CreateSHAUserOptions
type CreateScryptModifiedUserOption ¶
type CreateScryptModifiedUserOption func(*CreateScryptModifiedUserOptions)
func WithCreateScryptModifiedUserName ¶
func WithCreateScryptModifiedUserName(v string) CreateScryptModifiedUserOption
type CreateScryptModifiedUserOptions ¶
type CreateScryptModifiedUserOptions struct {
Name string
// contains filtered or unexported fields
}
func (CreateScryptModifiedUserOptions) New ¶
func (options CreateScryptModifiedUserOptions) New() *CreateScryptModifiedUserOptions
type CreateScryptUserOption ¶
type CreateScryptUserOption func(*CreateScryptUserOptions)
func WithCreateScryptUserName ¶
func WithCreateScryptUserName(v string) CreateScryptUserOption
type CreateScryptUserOptions ¶
type CreateScryptUserOptions struct {
Name string
// contains filtered or unexported fields
}
func (CreateScryptUserOptions) New ¶
func (options CreateScryptUserOptions) New() *CreateScryptUserOptions
type CreateTargetOption ¶
type CreateTargetOption func(*CreateTargetOptions)
func WithCreateTargetName ¶
func WithCreateTargetName(v string) CreateTargetOption
func WithCreateTargetProviderId ¶
func WithCreateTargetProviderId(v string) CreateTargetOption
type CreateTargetOptions ¶
type CreateTargetOptions struct {
ProviderId string
Name string
// contains filtered or unexported fields
}
func (CreateTargetOptions) New ¶
func (options CreateTargetOptions) New() *CreateTargetOptions
type CreateTokenOption ¶
type CreateTokenOption func(*CreateTokenOptions)
func WithCreateTokenExpire ¶
func WithCreateTokenExpire(v int) CreateTokenOption
func WithCreateTokenLength ¶
func WithCreateTokenLength(v int) CreateTokenOption
type CreateTokenOptions ¶
func (CreateTokenOptions) New ¶
func (options CreateTokenOptions) New() *CreateTokenOptions
type ListIdentitiesOption ¶
type ListIdentitiesOption func(*ListIdentitiesOptions)
func WithListIdentitiesQueries ¶
func WithListIdentitiesQueries(v []interface{}) ListIdentitiesOption
func WithListIdentitiesSearch ¶
func WithListIdentitiesSearch(v string) ListIdentitiesOption
type ListIdentitiesOptions ¶
type ListIdentitiesOptions struct {
Queries []interface{}
Search string
// contains filtered or unexported fields
}
func (ListIdentitiesOptions) New ¶
func (options ListIdentitiesOptions) New() *ListIdentitiesOptions
type ListLogsOption ¶
type ListLogsOption func(*ListLogsOptions)
func WithListLogsQueries ¶
func WithListLogsQueries(v []interface{}) ListLogsOption
type ListLogsOptions ¶
type ListLogsOptions struct {
Queries []interface{}
// contains filtered or unexported fields
}
func (ListLogsOptions) New ¶
func (options ListLogsOptions) New() *ListLogsOptions
type ListOption ¶
type ListOption func(*ListOptions)
func WithListQueries ¶
func WithListQueries(v []interface{}) ListOption
func WithListSearch ¶
func WithListSearch(v string) ListOption
type ListOptions ¶
type ListOptions struct {
Queries []interface{}
Search string
// contains filtered or unexported fields
}
func (ListOptions) New ¶
func (options ListOptions) New() *ListOptions
type ListTargetsOption ¶
type ListTargetsOption func(*ListTargetsOptions)
func WithListTargetsQueries ¶
func WithListTargetsQueries(v []interface{}) ListTargetsOption
type ListTargetsOptions ¶
type ListTargetsOptions struct {
Queries []interface{}
// contains filtered or unexported fields
}
func (ListTargetsOptions) New ¶
func (options ListTargetsOptions) New() *ListTargetsOptions
type UpdateTargetOption ¶
type UpdateTargetOption func(*UpdateTargetOptions)
func WithUpdateTargetIdentifier ¶
func WithUpdateTargetIdentifier(v string) UpdateTargetOption
func WithUpdateTargetName ¶
func WithUpdateTargetName(v string) UpdateTargetOption
func WithUpdateTargetProviderId ¶
func WithUpdateTargetProviderId(v string) UpdateTargetOption
type UpdateTargetOptions ¶
type UpdateTargetOptions struct {
Identifier string
ProviderId string
Name string
// contains filtered or unexported fields
}
func (UpdateTargetOptions) New ¶
func (options UpdateTargetOptions) New() *UpdateTargetOptions
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users service
func (*Users) CreateArgon2User ¶
func (srv *Users) CreateArgon2User(UserId string, Email string, Password string, optionalSetters ...CreateArgon2UserOption) (*models.User, error)
CreateArgon2User create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateBcryptUser ¶
func (srv *Users) CreateBcryptUser(UserId string, Email string, Password string, optionalSetters ...CreateBcryptUserOption) (*models.User, error)
CreateBcryptUser create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateJWT ¶
CreateJWT use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
func (*Users) CreateMD5User ¶
func (srv *Users) CreateMD5User(UserId string, Email string, Password string, optionalSetters ...CreateMD5UserOption) (*models.User, error)
CreateMD5User create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateMfaRecoveryCodes ¶
func (srv *Users) CreateMfaRecoveryCodes(UserId string) (*models.MfaRecoveryCodes, error)
CreateMfaRecoveryCodes generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
func (*Users) CreatePHPassUser ¶
func (srv *Users) CreatePHPassUser(UserId string, Email string, Password string, optionalSetters ...CreatePHPassUserOption) (*models.User, error)
CreatePHPassUser create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateSHAUser ¶
func (srv *Users) CreateSHAUser(UserId string, Email string, Password string, optionalSetters ...CreateSHAUserOption) (*models.User, error)
CreateSHAUser create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateScryptModifiedUser ¶
func (srv *Users) CreateScryptModifiedUser(UserId string, Email string, Password string, PasswordSalt string, PasswordSaltSeparator string, PasswordSignerKey string, optionalSetters ...CreateScryptModifiedUserOption) (*models.User, error)
CreateScryptModifiedUser create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateScryptUser ¶
func (srv *Users) CreateScryptUser(UserId string, Email string, Password string, PasswordSalt string, PasswordCpu int, PasswordMemory int, PasswordParallel int, PasswordLength int, optionalSetters ...CreateScryptUserOption) (*models.User, error)
CreateScryptUser create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
func (*Users) CreateSession ¶
CreateSession creates a session for a user. Returns an immediately usable session object.
If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
func (*Users) CreateTarget ¶
func (srv *Users) CreateTarget(UserId string, TargetId string, ProviderType string, Identifier string, optionalSetters ...CreateTargetOption) (*models.Target, error)
CreateTarget create a messaging target.
func (*Users) CreateToken ¶
func (srv *Users) CreateToken(UserId string, optionalSetters ...CreateTokenOption) (*models.Token, error)
CreateToken returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
func (*Users) Delete ¶
Delete delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
func (*Users) DeleteIdentity ¶
DeleteIdentity delete an identity by its unique ID.
func (*Users) DeleteMfaAuthenticator ¶
DeleteMfaAuthenticator delete an authenticator app.
func (*Users) DeleteSession ¶
DeleteSession delete a user sessions by its unique ID.
func (*Users) DeleteSessions ¶
DeleteSessions delete all user's sessions by using the user's unique ID.
func (*Users) DeleteTarget ¶
DeleteTarget delete a messaging target.
func (*Users) GetMfaRecoveryCodes ¶
func (srv *Users) GetMfaRecoveryCodes(UserId string) (*models.MfaRecoveryCodes, error)
GetMfaRecoveryCodes get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
func (*Users) GetPrefs ¶
func (srv *Users) GetPrefs(UserId string) (*models.Preferences, error)
GetPrefs get the user preferences by its unique ID.
func (*Users) List ¶
func (srv *Users) List(optionalSetters ...ListOption) (*models.UserList, error)
List get a list of all the project's users. You can use the query params to filter your results.
func (*Users) ListIdentities ¶
func (srv *Users) ListIdentities(optionalSetters ...ListIdentitiesOption) (*models.IdentityList, error)
ListIdentities get identities for all users.
func (*Users) ListLogs ¶
func (srv *Users) ListLogs(UserId string, optionalSetters ...ListLogsOption) (*models.LogList, error)
ListLogs get the user activity logs list by its unique ID.
func (*Users) ListMemberships ¶
func (srv *Users) ListMemberships(UserId string) (*models.MembershipList, error)
ListMemberships get the user membership list by its unique ID.
func (*Users) ListMfaFactors ¶
func (srv *Users) ListMfaFactors(UserId string) (*models.MfaFactors, error)
ListMfaFactors list the factors available on the account to be used as a MFA challange.
func (*Users) ListSessions ¶
func (srv *Users) ListSessions(UserId string) (*models.SessionList, error)
ListSessions get the user sessions list by its unique ID.
func (*Users) ListTargets ¶
func (srv *Users) ListTargets(UserId string, optionalSetters ...ListTargetsOption) (*models.TargetList, error)
ListTargets list the messaging targets that are associated with a user.
func (*Users) UpdateEmail ¶
UpdateEmail update the user email by its unique ID.
func (*Users) UpdateEmailVerification ¶
func (srv *Users) UpdateEmailVerification(UserId string, EmailVerification bool) (*models.User, error)
UpdateEmailVerification update the user email verification status by its unique ID.
func (*Users) UpdateLabels ¶
UpdateLabels update the user labels by its unique ID.
Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
func (*Users) UpdateMfaRecoveryCodes ¶
func (srv *Users) UpdateMfaRecoveryCodes(UserId string) (*models.MfaRecoveryCodes, error)
UpdateMfaRecoveryCodes regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
func (*Users) UpdateName ¶
UpdateName update the user name by its unique ID.
func (*Users) UpdatePassword ¶
UpdatePassword update the user password by its unique ID.
func (*Users) UpdatePhone ¶
UpdatePhone update the user phone by its unique ID.
func (*Users) UpdatePhoneVerification ¶
func (srv *Users) UpdatePhoneVerification(UserId string, PhoneVerification bool) (*models.User, error)
UpdatePhoneVerification update the user phone verification status by its unique ID.
func (*Users) UpdatePrefs ¶
func (srv *Users) UpdatePrefs(UserId string, Prefs interface{}) (*models.Preferences, error)
UpdatePrefs update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
func (*Users) UpdateStatus ¶
UpdateStatus update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
func (*Users) UpdateTarget ¶
func (srv *Users) UpdateTarget(UserId string, TargetId string, optionalSetters ...UpdateTargetOption) (*models.Target, error)
UpdateTarget update a messaging target.