Documentation ¶
Index ¶
- Constants
- type Account
- type AccountType
- type Conflict
- type Device
- type ErrorConflict
- type ErrorForbidden
- type InputAccountDataRequest
- type InputAccountDataResponse
- type PerformAccountCreationRequest
- type PerformAccountCreationResponse
- type PerformAccountDeactivationRequest
- type PerformAccountDeactivationResponse
- type PerformDeviceCreationRequest
- type PerformDeviceCreationResponse
- type PerformDeviceDeletionRequest
- type PerformDeviceDeletionResponse
- type PerformDeviceUpdateRequest
- type PerformDeviceUpdateResponse
- type PerformPasswordUpdateRequest
- type PerformPasswordUpdateResponse
- type QueryAccessTokenRequest
- type QueryAccessTokenResponse
- type QueryAccountDataRequest
- type QueryAccountDataResponse
- type QueryDeviceInfosRequest
- type QueryDeviceInfosResponse
- type QueryDevicesRequest
- type QueryDevicesResponse
- type QueryProfileRequest
- type QueryProfileResponse
- type QuerySearchProfilesRequest
- type QuerySearchProfilesResponse
- type UserInternalAPI
Constants ¶
const ( // ConflictUpdate will update matching records returning no error ConflictUpdate Conflict = 1 // ConflictAbort will reject the request with ErrorConflict ConflictAbort Conflict = 2 // AccountTypeUser indicates this is a user account AccountTypeUser AccountType = 1 // AccountTypeGuest indicates this is a guest account AccountTypeGuest AccountType = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { UserID string Localpart string ServerName gomatrixserverlib.ServerName AppServiceID string }
Account represents a Matrix account on this home server.
type Conflict ¶
type Conflict int
Conflict is an enum representing what to do when encountering conflicting when creating profiles/devices
type Device ¶
type Device struct { ID string UserID string // The access_token granted to this device. // This uniquely identifies the device from all other devices and clients. AccessToken string // The unique ID of the session identified by the access token. // Can be used as a secure substitution in places where data needs to be // associated with access tokens. SessionID int64 DisplayName string LastSeenTS int64 LastSeenIP string UserAgent string }
Device represents a client's device (mobile, web, etc)
type ErrorConflict ¶
type ErrorConflict struct {
Message string
}
ErrorConflict is an error indicating that there was a conflict which resulted in the request being aborted.
func (*ErrorConflict) Error ¶
func (e *ErrorConflict) Error() string
type ErrorForbidden ¶
type ErrorForbidden struct {
Message string
}
ErrorForbidden is an error indicating that the supplied access token is forbidden
func (*ErrorForbidden) Error ¶
func (e *ErrorForbidden) Error() string
type InputAccountDataRequest ¶
type InputAccountDataRequest struct { UserID string // required: the user to set account data for RoomID string // optional: the room to associate the account data with DataType string // required: the data type of the data AccountData json.RawMessage // required: the message content }
InputAccountDataRequest is the request for InputAccountData
type InputAccountDataResponse ¶
type InputAccountDataResponse struct { }
InputAccountDataResponse is the response for InputAccountData
type PerformAccountCreationRequest ¶
type PerformAccountCreationRequest struct { AccountType AccountType // Required: whether this is a guest or user account Localpart string // Required: The localpart for this account. Ignored if account type is guest. AppServiceID string // optional: the application service ID (not user ID) creating this account, if any. Password string // optional: if missing then this account will be a passwordless account OnConflict Conflict }
PerformAccountCreationRequest is the request for PerformAccountCreation
type PerformAccountCreationResponse ¶
PerformAccountCreationResponse is the response for PerformAccountCreation
type PerformAccountDeactivationRequest ¶
type PerformAccountDeactivationRequest struct {
Localpart string
}
PerformAccountDeactivationRequest is the request for PerformAccountDeactivation
type PerformAccountDeactivationResponse ¶
type PerformAccountDeactivationResponse struct {
AccountDeactivated bool
}
PerformAccountDeactivationResponse is the response for PerformAccountDeactivation
type PerformDeviceCreationRequest ¶
type PerformDeviceCreationRequest struct { Localpart string AccessToken string // optional: if blank one will be made on your behalf // optional: if nil an ID is generated for you. If set, replaces any existing device session, // which will generate a new access token and invalidate the old one. DeviceID *string // optional: if nil no display name will be associated with this device. DeviceDisplayName *string // IP address of this device IPAddr string // Useragent for this device UserAgent string }
PerformDeviceCreationRequest is the request for PerformDeviceCreation
type PerformDeviceCreationResponse ¶
PerformDeviceCreationResponse is the response for PerformDeviceCreation
type PerformDeviceDeletionRequest ¶
type PerformDeviceDeletionRequest struct { UserID string // The devices to delete. An empty slice means delete all devices. DeviceIDs []string // The requesting device ID to exclude from deletion. This is needed // so that a password change doesn't cause that client to be logged // out. Only specify when DeviceIDs is empty. ExceptDeviceID string }
type PerformDeviceDeletionResponse ¶
type PerformDeviceDeletionResponse struct { }
type PerformPasswordUpdateRequest ¶
type PerformPasswordUpdateRequest struct { Localpart string // Required: The localpart for this account. Password string // Required: The new password to set. }
PerformAccountCreationRequest is the request for PerformAccountCreation
type PerformPasswordUpdateResponse ¶
PerformAccountCreationResponse is the response for PerformAccountCreation
type QueryAccessTokenRequest ¶
type QueryAccessTokenRequest struct { AccessToken string // optional user ID, valid only if the token is an appservice. // https://matrix.org/docs/spec/application_service/r0.1.2#using-sync-and-events AppServiceUserID string }
QueryAccessTokenRequest is the request for QueryAccessToken
type QueryAccessTokenResponse ¶
QueryAccessTokenResponse is the response for QueryAccessToken
type QueryAccountDataRequest ¶
type QueryAccountDataRequest struct { UserID string // required: the user to get account data for. RoomID string // optional: the room ID, or global account data if not specified. DataType string // optional: the data type, or all types if not specified. }
QueryAccountDataRequest is the request for QueryAccountData
type QueryAccountDataResponse ¶
type QueryAccountDataResponse struct { GlobalAccountData map[string]json.RawMessage // type -> data RoomAccountData map[string]map[string]json.RawMessage // room -> type -> data }
QueryAccountDataResponse is the response for QueryAccountData
type QueryDeviceInfosRequest ¶
type QueryDeviceInfosRequest struct {
DeviceIDs []string
}
QueryDeviceInfosRequest is the request to QueryDeviceInfos
type QueryDeviceInfosResponse ¶
type QueryDeviceInfosResponse struct { DeviceInfo map[string]struct { DisplayName string UserID string } }
QueryDeviceInfosResponse is the response to QueryDeviceInfos
type QueryDevicesRequest ¶
type QueryDevicesRequest struct {
UserID string
}
QueryDevicesRequest is the request for QueryDevices
type QueryDevicesResponse ¶
QueryDevicesResponse is the response for QueryDevices
type QueryProfileRequest ¶
type QueryProfileRequest struct { // The user ID to query UserID string }
QueryProfileRequest is the request for QueryProfile
type QueryProfileResponse ¶
type QueryProfileResponse struct { // True if the user exists. Querying for a profile does not create them. UserExists bool // The current display name if set. DisplayName string // The current avatar URL if set. AvatarURL string }
QueryProfileResponse is the response for QueryProfile
type QuerySearchProfilesRequest ¶
type QuerySearchProfilesRequest struct { // The search string to match SearchString string // How many results to return Limit int }
QuerySearchProfilesRequest is the request for QueryProfile
type QuerySearchProfilesResponse ¶
type QuerySearchProfilesResponse struct { // Profiles matching the search Profiles []authtypes.Profile }
QuerySearchProfilesResponse is the response for QuerySearchProfilesRequest
type UserInternalAPI ¶
type UserInternalAPI interface { InputAccountData(ctx context.Context, req *InputAccountDataRequest, res *InputAccountDataResponse) error PerformAccountCreation(ctx context.Context, req *PerformAccountCreationRequest, res *PerformAccountCreationResponse) error PerformPasswordUpdate(ctx context.Context, req *PerformPasswordUpdateRequest, res *PerformPasswordUpdateResponse) error PerformDeviceCreation(ctx context.Context, req *PerformDeviceCreationRequest, res *PerformDeviceCreationResponse) error PerformDeviceDeletion(ctx context.Context, req *PerformDeviceDeletionRequest, res *PerformDeviceDeletionResponse) error PerformDeviceUpdate(ctx context.Context, req *PerformDeviceUpdateRequest, res *PerformDeviceUpdateResponse) error PerformAccountDeactivation(ctx context.Context, req *PerformAccountDeactivationRequest, res *PerformAccountDeactivationResponse) error QueryProfile(ctx context.Context, req *QueryProfileRequest, res *QueryProfileResponse) error QueryAccessToken(ctx context.Context, req *QueryAccessTokenRequest, res *QueryAccessTokenResponse) error QueryDevices(ctx context.Context, req *QueryDevicesRequest, res *QueryDevicesResponse) error QueryAccountData(ctx context.Context, req *QueryAccountDataRequest, res *QueryAccountDataResponse) error QueryDeviceInfos(ctx context.Context, req *QueryDeviceInfosRequest, res *QueryDeviceInfosResponse) error QuerySearchProfiles(ctx context.Context, req *QuerySearchProfilesRequest, res *QuerySearchProfilesResponse) error }
UserInternalAPI is the internal API for information about users and devices.