user

package
v0.0.0-...-2af310e Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_user_proto protoreflect.FileDescriptor

Functions

func NewUserEndpoints

func NewUserEndpoints() []*api.Endpoint

func RegisterUserHandler

func RegisterUserHandler(s server.Server, hdlr UserHandler, opts ...server.HandlerOption) error

Types

type Account

type Account struct {

	// unique account id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// alphanumeric username
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// an email address
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// unix timestamp
	Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
	// unix timestamp
	Updated int64 `protobuf:"varint,5,opt,name=updated,proto3" json:"updated,omitempty"`
	// if the account is verified
	Verified bool `protobuf:"varint,6,opt,name=verified,proto3" json:"verified,omitempty"`
	// date of verification
	VerificationDate int64 `protobuf:"varint,7,opt,name=verification_date,json=verificationDate,proto3" json:"verification_date,omitempty"`
	// Store any custom data you want about your users in this fields.
	Profile map[string]string `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Account) Descriptor deprecated

func (*Account) Descriptor() ([]byte, []int)

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetCreated

func (x *Account) GetCreated() int64

func (*Account) GetEmail

func (x *Account) GetEmail() string

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) GetProfile

func (x *Account) GetProfile() map[string]string

func (*Account) GetUpdated

func (x *Account) GetUpdated() int64

func (*Account) GetUsername

func (x *Account) GetUsername() string

func (*Account) GetVerificationDate

func (x *Account) GetVerificationDate() int64

func (*Account) GetVerified

func (x *Account) GetVerified() bool

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

func (x *Account) ProtoReflect() protoreflect.Message

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type CreateRequest

type CreateRequest struct {

	// optional account id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the username
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// the email address
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// the user password
	Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	// optional user profile as map<string,string>
	Profile map[string]string `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

Create a new user account. The email address and username for the account must be unique.

func (*CreateRequest) Descriptor deprecated

func (*CreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetEmail

func (x *CreateRequest) GetEmail() string

func (*CreateRequest) GetId

func (x *CreateRequest) GetId() string

func (*CreateRequest) GetPassword

func (x *CreateRequest) GetPassword() string

func (*CreateRequest) GetProfile

func (x *CreateRequest) GetProfile() map[string]string

func (*CreateRequest) GetUsername

func (x *CreateRequest) GetUsername() string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

func (x *CreateRequest) ProtoReflect() protoreflect.Message

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {
	Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

func (*CreateResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetAccount

func (x *CreateResponse) GetAccount() *Account

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

func (x *CreateResponse) ProtoReflect() protoreflect.Message

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// the account id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Delete an account by id

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

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

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type ListRequest

type ListRequest struct {
	Offset uint32 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
	// Maximum number of records to return. Default limit is 25.
	// Maximum limit is 1000. Anything higher will return an error.
	Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

List all users. Returns a paged list of results

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetLimit

func (x *ListRequest) GetLimit() uint32

func (*ListRequest) GetOffset

func (x *ListRequest) GetOffset() uint32

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Users []*Account `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetUsers

func (x *ListResponse) GetUsers() []*Account

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type LoginRequest

type LoginRequest struct {

	// The username of the user
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// The email address of the user
	Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	// The password of the user
	Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

Login using username or email. The response will return a new session for successful login, 401 in the case of login failure and 500 for any other error

func (*LoginRequest) Descriptor deprecated

func (*LoginRequest) Descriptor() ([]byte, []int)

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetEmail

func (x *LoginRequest) GetEmail() string

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) GetUsername

func (x *LoginRequest) GetUsername() string

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) ProtoReflect

func (x *LoginRequest) ProtoReflect() protoreflect.Message

func (*LoginRequest) Reset

func (x *LoginRequest) Reset()

func (*LoginRequest) String

func (x *LoginRequest) String() string

type LoginResponse

type LoginResponse struct {

	// The session of the logged in  user
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResponse) Descriptor deprecated

func (*LoginResponse) Descriptor() ([]byte, []int)

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetSession

func (x *LoginResponse) GetSession() *Session

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) ProtoReflect

func (x *LoginResponse) ProtoReflect() protoreflect.Message

func (*LoginResponse) Reset

func (x *LoginResponse) Reset()

func (*LoginResponse) String

func (x *LoginResponse) String() string

type LogoutAllRequest

type LogoutAllRequest struct {

	// the user to logout
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Logout of all user's sessions

func (*LogoutAllRequest) Descriptor deprecated

func (*LogoutAllRequest) Descriptor() ([]byte, []int)

Deprecated: Use LogoutAllRequest.ProtoReflect.Descriptor instead.

func (*LogoutAllRequest) GetUserId

func (x *LogoutAllRequest) GetUserId() string

func (*LogoutAllRequest) ProtoMessage

func (*LogoutAllRequest) ProtoMessage()

func (*LogoutAllRequest) ProtoReflect

func (x *LogoutAllRequest) ProtoReflect() protoreflect.Message

func (*LogoutAllRequest) Reset

func (x *LogoutAllRequest) Reset()

func (*LogoutAllRequest) String

func (x *LogoutAllRequest) String() string

type LogoutAllResponse

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

func (*LogoutAllResponse) Descriptor deprecated

func (*LogoutAllResponse) Descriptor() ([]byte, []int)

Deprecated: Use LogoutAllResponse.ProtoReflect.Descriptor instead.

func (*LogoutAllResponse) ProtoMessage

func (*LogoutAllResponse) ProtoMessage()

func (*LogoutAllResponse) ProtoReflect

func (x *LogoutAllResponse) ProtoReflect() protoreflect.Message

func (*LogoutAllResponse) Reset

func (x *LogoutAllResponse) Reset()

func (*LogoutAllResponse) String

func (x *LogoutAllResponse) String() string

type LogoutRequest

type LogoutRequest struct {

	// the session id for the user to logout
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

Logout a user account

func (*LogoutRequest) Descriptor deprecated

func (*LogoutRequest) Descriptor() ([]byte, []int)

Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.

func (*LogoutRequest) GetSessionId

func (x *LogoutRequest) GetSessionId() string

func (*LogoutRequest) ProtoMessage

func (*LogoutRequest) ProtoMessage()

func (*LogoutRequest) ProtoReflect

func (x *LogoutRequest) ProtoReflect() protoreflect.Message

func (*LogoutRequest) Reset

func (x *LogoutRequest) Reset()

func (*LogoutRequest) String

func (x *LogoutRequest) String() string

type LogoutResponse

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

func (*LogoutResponse) Descriptor deprecated

func (*LogoutResponse) Descriptor() ([]byte, []int)

Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead.

func (*LogoutResponse) ProtoMessage

func (*LogoutResponse) ProtoMessage()

func (*LogoutResponse) ProtoReflect

func (x *LogoutResponse) ProtoReflect() protoreflect.Message

func (*LogoutResponse) Reset

func (x *LogoutResponse) Reset()

func (*LogoutResponse) String

func (x *LogoutResponse) String() string

type ReadRequest

type ReadRequest struct {

	// the account id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the account username
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// the account email
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

Read an account by id, username or email. Only one need to be specified.

func (*ReadRequest) Descriptor deprecated

func (*ReadRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetEmail

func (x *ReadRequest) GetEmail() string

func (*ReadRequest) GetId

func (x *ReadRequest) GetId() string

func (*ReadRequest) GetUsername

func (x *ReadRequest) GetUsername() string

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect

func (x *ReadRequest) ProtoReflect() protoreflect.Message

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

type ReadResponse

type ReadResponse struct {
	Account *Account `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

func (*ReadResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetAccount

func (x *ReadResponse) GetAccount() *Account

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect

func (x *ReadResponse) ProtoReflect() protoreflect.Message

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

type ReadSessionRequest

type ReadSessionRequest struct {

	// The unique session id
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

Read a session by the session id. In the event it has expired or is not found and error is returned.

func (*ReadSessionRequest) Descriptor deprecated

func (*ReadSessionRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReadSessionRequest.ProtoReflect.Descriptor instead.

func (*ReadSessionRequest) GetSessionId

func (x *ReadSessionRequest) GetSessionId() string

func (*ReadSessionRequest) ProtoMessage

func (*ReadSessionRequest) ProtoMessage()

func (*ReadSessionRequest) ProtoReflect

func (x *ReadSessionRequest) ProtoReflect() protoreflect.Message

func (*ReadSessionRequest) Reset

func (x *ReadSessionRequest) Reset()

func (*ReadSessionRequest) String

func (x *ReadSessionRequest) String() string

type ReadSessionResponse

type ReadSessionResponse struct {

	// the session for the user
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadSessionResponse) Descriptor deprecated

func (*ReadSessionResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReadSessionResponse.ProtoReflect.Descriptor instead.

func (*ReadSessionResponse) GetSession

func (x *ReadSessionResponse) GetSession() *Session

func (*ReadSessionResponse) ProtoMessage

func (*ReadSessionResponse) ProtoMessage()

func (*ReadSessionResponse) ProtoReflect

func (x *ReadSessionResponse) ProtoReflect() protoreflect.Message

func (*ReadSessionResponse) Reset

func (x *ReadSessionResponse) Reset()

func (*ReadSessionResponse) String

func (x *ReadSessionResponse) String() string

type ResetPasswordRequest

type ResetPasswordRequest struct {

	// the email to reset the password for
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// The code from the verification email
	Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
	// the new password
	NewPassword string `protobuf:"bytes,3,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"`
	// confirm new password
	ConfirmPassword string `protobuf:"bytes,4,opt,name=confirm_password,json=confirmPassword,proto3" json:"confirm_password,omitempty"`
	// contains filtered or unexported fields
}

Reset password with the code sent by the "SendPasswordResetEmail" endpoint.

func (*ResetPasswordRequest) Descriptor deprecated

func (*ResetPasswordRequest) Descriptor() ([]byte, []int)

Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead.

func (*ResetPasswordRequest) GetCode

func (x *ResetPasswordRequest) GetCode() string

func (*ResetPasswordRequest) GetConfirmPassword

func (x *ResetPasswordRequest) GetConfirmPassword() string

func (*ResetPasswordRequest) GetEmail

func (x *ResetPasswordRequest) GetEmail() string

func (*ResetPasswordRequest) GetNewPassword

func (x *ResetPasswordRequest) GetNewPassword() string

func (*ResetPasswordRequest) ProtoMessage

func (*ResetPasswordRequest) ProtoMessage()

func (*ResetPasswordRequest) ProtoReflect

func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message

func (*ResetPasswordRequest) Reset

func (x *ResetPasswordRequest) Reset()

func (*ResetPasswordRequest) String

func (x *ResetPasswordRequest) String() string

type ResetPasswordResponse

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

func (*ResetPasswordResponse) Descriptor deprecated

func (*ResetPasswordResponse) Descriptor() ([]byte, []int)

Deprecated: Use ResetPasswordResponse.ProtoReflect.Descriptor instead.

func (*ResetPasswordResponse) ProtoMessage

func (*ResetPasswordResponse) ProtoMessage()

func (*ResetPasswordResponse) ProtoReflect

func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message

func (*ResetPasswordResponse) Reset

func (x *ResetPasswordResponse) Reset()

func (*ResetPasswordResponse) String

func (x *ResetPasswordResponse) String() string

type SendMagicLinkRequest

type SendMagicLinkRequest struct {

	// the email address of the user
	Email   string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// Text content of the email. Don't forget to include the string '$micro_verification_link' which will be replaced by the real verification link
	// HTML emails are not available currently.
	TextContent string `protobuf:"bytes,3,opt,name=text_content,json=textContent,proto3" json:"text_content,omitempty"`
	// Display name of the sender for the email. Note: the email address will still be 'support@m3o.com'
	FromName string `protobuf:"bytes,4,opt,name=from_name,json=fromName,proto3" json:"from_name,omitempty"`
	// Your web site address, example www.example.com or user.example.com
	Address string `protobuf:"bytes,5,opt,name=address,proto3" json:"address,omitempty"`
	// Endpoint name where your http request handler handles MagicLink by
	// calling M3O VerifyToken endpoint. You can return as a result a success,
	// failed or redirect to another page.
	Endpoint string `protobuf:"bytes,6,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// contains filtered or unexported fields
}

Login using email only - Passwordless

func (*SendMagicLinkRequest) Descriptor deprecated

func (*SendMagicLinkRequest) Descriptor() ([]byte, []int)

Deprecated: Use SendMagicLinkRequest.ProtoReflect.Descriptor instead.

func (*SendMagicLinkRequest) GetAddress

func (x *SendMagicLinkRequest) GetAddress() string

func (*SendMagicLinkRequest) GetEmail

func (x *SendMagicLinkRequest) GetEmail() string

func (*SendMagicLinkRequest) GetEndpoint

func (x *SendMagicLinkRequest) GetEndpoint() string

func (*SendMagicLinkRequest) GetFromName

func (x *SendMagicLinkRequest) GetFromName() string

func (*SendMagicLinkRequest) GetSubject

func (x *SendMagicLinkRequest) GetSubject() string

func (*SendMagicLinkRequest) GetTextContent

func (x *SendMagicLinkRequest) GetTextContent() string

func (*SendMagicLinkRequest) ProtoMessage

func (*SendMagicLinkRequest) ProtoMessage()

func (*SendMagicLinkRequest) ProtoReflect

func (x *SendMagicLinkRequest) ProtoReflect() protoreflect.Message

func (*SendMagicLinkRequest) Reset

func (x *SendMagicLinkRequest) Reset()

func (*SendMagicLinkRequest) String

func (x *SendMagicLinkRequest) String() string

type SendMagicLinkResponse

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

func (*SendMagicLinkResponse) Descriptor deprecated

func (*SendMagicLinkResponse) Descriptor() ([]byte, []int)

Deprecated: Use SendMagicLinkResponse.ProtoReflect.Descriptor instead.

func (*SendMagicLinkResponse) ProtoMessage

func (*SendMagicLinkResponse) ProtoMessage()

func (*SendMagicLinkResponse) ProtoReflect

func (x *SendMagicLinkResponse) ProtoReflect() protoreflect.Message

func (*SendMagicLinkResponse) Reset

func (x *SendMagicLinkResponse) Reset()

func (*SendMagicLinkResponse) String

func (x *SendMagicLinkResponse) String() string

type SendPasswordResetEmailRequest

type SendPasswordResetEmailRequest struct {

	// email address to send reset for
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// subject of the email
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// Text content of the email. Don't forget to include the string '$code' which will be replaced by the real verification link
	// HTML emails are not available currently.
	TextContent string `protobuf:"bytes,3,opt,name=text_content,json=textContent,proto3" json:"text_content,omitempty"`
	// Display name of the sender for the email. Note: the email address will still be 'noreply@email.m3ocontent.com'
	FromName string `protobuf:"bytes,4,opt,name=from_name,json=fromName,proto3" json:"from_name,omitempty"`
	// Number of secs that the password reset email is valid for, defaults to 1800 secs (30 mins)
	Expiration int64 `protobuf:"varint,5,opt,name=expiration,proto3" json:"expiration,omitempty"`
	// contains filtered or unexported fields
}

Send an email with a verification code to reset password. Call "ResetPassword" endpoint once user provides the code.

func (*SendPasswordResetEmailRequest) Descriptor deprecated

func (*SendPasswordResetEmailRequest) Descriptor() ([]byte, []int)

Deprecated: Use SendPasswordResetEmailRequest.ProtoReflect.Descriptor instead.

func (*SendPasswordResetEmailRequest) GetEmail

func (x *SendPasswordResetEmailRequest) GetEmail() string

func (*SendPasswordResetEmailRequest) GetExpiration

func (x *SendPasswordResetEmailRequest) GetExpiration() int64

func (*SendPasswordResetEmailRequest) GetFromName

func (x *SendPasswordResetEmailRequest) GetFromName() string

func (*SendPasswordResetEmailRequest) GetSubject

func (x *SendPasswordResetEmailRequest) GetSubject() string

func (*SendPasswordResetEmailRequest) GetTextContent

func (x *SendPasswordResetEmailRequest) GetTextContent() string

func (*SendPasswordResetEmailRequest) ProtoMessage

func (*SendPasswordResetEmailRequest) ProtoMessage()

func (*SendPasswordResetEmailRequest) ProtoReflect

func (*SendPasswordResetEmailRequest) Reset

func (x *SendPasswordResetEmailRequest) Reset()

func (*SendPasswordResetEmailRequest) String

type SendPasswordResetEmailResponse

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

func (*SendPasswordResetEmailResponse) Descriptor deprecated

func (*SendPasswordResetEmailResponse) Descriptor() ([]byte, []int)

Deprecated: Use SendPasswordResetEmailResponse.ProtoReflect.Descriptor instead.

func (*SendPasswordResetEmailResponse) ProtoMessage

func (*SendPasswordResetEmailResponse) ProtoMessage()

func (*SendPasswordResetEmailResponse) ProtoReflect

func (*SendPasswordResetEmailResponse) Reset

func (x *SendPasswordResetEmailResponse) Reset()

func (*SendPasswordResetEmailResponse) String

type SendVerificationEmailRequest

type SendVerificationEmailRequest struct {

	// email address to send the verification code
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
	// subject of the email
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// Text content of the email. Don't forget to include the string '$micro_verification_link' which will be replaced by the real verification link
	// HTML emails are not available currently.
	TextContent string `protobuf:"bytes,3,opt,name=text_content,json=textContent,proto3" json:"text_content,omitempty"`
	// The url to redirect to after successful verification
	RedirectUrl string `protobuf:"bytes,4,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"`
	// The url to redirect to incase of failure
	FailureRedirectUrl string `protobuf:"bytes,5,opt,name=failure_redirect_url,json=failureRedirectUrl,proto3" json:"failure_redirect_url,omitempty"`
	// Display name of the sender for the email. Note: the email address will still be 'noreply@email.m3ocontent.com'
	FromName string `protobuf:"bytes,6,opt,name=from_name,json=fromName,proto3" json:"from_name,omitempty"`
	// contains filtered or unexported fields
}

Send a verification email to a user. Email "from" will be 'noreply@email.m3ocontent.com'. The verification link will be injected in the email as a template variable, $micro_verification_link e.g 'Welcome to M3O! Use the link below to verify your email: $micro_verification_link' The variable will be replaced with a url similar to: 'https://user.m3o.com/user/verify?token=a-verification-token&redirectUrl=your-redir-url'

func (*SendVerificationEmailRequest) Descriptor deprecated

func (*SendVerificationEmailRequest) Descriptor() ([]byte, []int)

Deprecated: Use SendVerificationEmailRequest.ProtoReflect.Descriptor instead.

func (*SendVerificationEmailRequest) GetEmail

func (x *SendVerificationEmailRequest) GetEmail() string

func (*SendVerificationEmailRequest) GetFailureRedirectUrl

func (x *SendVerificationEmailRequest) GetFailureRedirectUrl() string

func (*SendVerificationEmailRequest) GetFromName

func (x *SendVerificationEmailRequest) GetFromName() string

func (*SendVerificationEmailRequest) GetRedirectUrl

func (x *SendVerificationEmailRequest) GetRedirectUrl() string

func (*SendVerificationEmailRequest) GetSubject

func (x *SendVerificationEmailRequest) GetSubject() string

func (*SendVerificationEmailRequest) GetTextContent

func (x *SendVerificationEmailRequest) GetTextContent() string

func (*SendVerificationEmailRequest) ProtoMessage

func (*SendVerificationEmailRequest) ProtoMessage()

func (*SendVerificationEmailRequest) ProtoReflect

func (*SendVerificationEmailRequest) Reset

func (x *SendVerificationEmailRequest) Reset()

func (*SendVerificationEmailRequest) String

type SendVerificationEmailResponse

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

func (*SendVerificationEmailResponse) Descriptor deprecated

func (*SendVerificationEmailResponse) Descriptor() ([]byte, []int)

Deprecated: Use SendVerificationEmailResponse.ProtoReflect.Descriptor instead.

func (*SendVerificationEmailResponse) ProtoMessage

func (*SendVerificationEmailResponse) ProtoMessage()

func (*SendVerificationEmailResponse) ProtoReflect

func (*SendVerificationEmailResponse) Reset

func (x *SendVerificationEmailResponse) Reset()

func (*SendVerificationEmailResponse) String

type Session

type Session struct {

	// the session id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the associated user id
	UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
	// unix timestamp
	Created int64 `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
	// unix timestamp
	Expires int64 `protobuf:"varint,5,opt,name=expires,proto3" json:"expires,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) Descriptor deprecated

func (*Session) Descriptor() ([]byte, []int)

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetCreated

func (x *Session) GetCreated() int64

func (*Session) GetExpires

func (x *Session) GetExpires() int64

func (*Session) GetId

func (x *Session) GetId() string

func (*Session) GetUserId

func (x *Session) GetUserId() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

func (x *Session) ProtoReflect() protoreflect.Message

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type UpdatePasswordRequest

type UpdatePasswordRequest struct {

	// the account id
	UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
	// the old password
	OldPassword string `protobuf:"bytes,2,opt,name=old_password,json=oldPassword,proto3" json:"old_password,omitempty"`
	// the new password
	NewPassword string `protobuf:"bytes,3,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"`
	// confirm new password
	ConfirmPassword string `protobuf:"bytes,4,opt,name=confirm_password,json=confirmPassword,proto3" json:"confirm_password,omitempty"`
	// contains filtered or unexported fields
}

Update the account password

func (*UpdatePasswordRequest) Descriptor deprecated

func (*UpdatePasswordRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdatePasswordRequest.ProtoReflect.Descriptor instead.

func (*UpdatePasswordRequest) GetConfirmPassword

func (x *UpdatePasswordRequest) GetConfirmPassword() string

func (*UpdatePasswordRequest) GetNewPassword

func (x *UpdatePasswordRequest) GetNewPassword() string

func (*UpdatePasswordRequest) GetOldPassword

func (x *UpdatePasswordRequest) GetOldPassword() string

func (*UpdatePasswordRequest) GetUserId

func (x *UpdatePasswordRequest) GetUserId() string

func (*UpdatePasswordRequest) ProtoMessage

func (*UpdatePasswordRequest) ProtoMessage()

func (*UpdatePasswordRequest) ProtoReflect

func (x *UpdatePasswordRequest) ProtoReflect() protoreflect.Message

func (*UpdatePasswordRequest) Reset

func (x *UpdatePasswordRequest) Reset()

func (*UpdatePasswordRequest) String

func (x *UpdatePasswordRequest) String() string

type UpdatePasswordResponse

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

func (*UpdatePasswordResponse) Descriptor deprecated

func (*UpdatePasswordResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdatePasswordResponse.ProtoReflect.Descriptor instead.

func (*UpdatePasswordResponse) ProtoMessage

func (*UpdatePasswordResponse) ProtoMessage()

func (*UpdatePasswordResponse) ProtoReflect

func (x *UpdatePasswordResponse) ProtoReflect() protoreflect.Message

func (*UpdatePasswordResponse) Reset

func (x *UpdatePasswordResponse) Reset()

func (*UpdatePasswordResponse) String

func (x *UpdatePasswordResponse) String() string

type UpdateRequest

type UpdateRequest struct {

	// the account id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the new username
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// the new email address
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// the user profile as map<string,string>
	Profile map[string]string `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

Update the account username or email

func (*UpdateRequest) Descriptor deprecated

func (*UpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetEmail

func (x *UpdateRequest) GetEmail() string

func (*UpdateRequest) GetId

func (x *UpdateRequest) GetId() string

func (*UpdateRequest) GetProfile

func (x *UpdateRequest) GetProfile() map[string]string

func (*UpdateRequest) GetUsername

func (x *UpdateRequest) GetUsername() string

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

func (x *UpdateRequest) ProtoReflect() protoreflect.Message

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

type UpdateResponse

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

func (*UpdateResponse) Descriptor deprecated

func (*UpdateResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

func (x *UpdateResponse) ProtoReflect() protoreflect.Message

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

type UserService

type UserService interface {
	Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error)
	Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
	Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
	UpdatePassword(ctx context.Context, in *UpdatePasswordRequest, opts ...client.CallOption) (*UpdatePasswordResponse, error)
	Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResponse, error)
	Logout(ctx context.Context, in *LogoutRequest, opts ...client.CallOption) (*LogoutResponse, error)
	LogoutAll(ctx context.Context, in *LogoutAllRequest, opts ...client.CallOption) (*LogoutAllResponse, error)
	ReadSession(ctx context.Context, in *ReadSessionRequest, opts ...client.CallOption) (*ReadSessionResponse, error)
	VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...client.CallOption) (*VerifyEmailResponse, error)
	SendVerificationEmail(ctx context.Context, in *SendVerificationEmailRequest, opts ...client.CallOption) (*SendVerificationEmailResponse, error)
	SendPasswordResetEmail(ctx context.Context, in *SendPasswordResetEmailRequest, opts ...client.CallOption) (*SendPasswordResetEmailResponse, error)
	ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...client.CallOption) (*ResetPasswordResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
	SendMagicLink(ctx context.Context, in *SendMagicLinkRequest, opts ...client.CallOption) (*SendMagicLinkResponse, error)
	VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...client.CallOption) (*VerifyTokenResponse, error)
}

func NewUserService

func NewUserService(name string, c client.Client) UserService

type VerifyEmailRequest

type VerifyEmailRequest struct {

	// The token from the verification email
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

Verify the email address of an account from a token sent in an email to the user.

func (*VerifyEmailRequest) Descriptor deprecated

func (*VerifyEmailRequest) Descriptor() ([]byte, []int)

Deprecated: Use VerifyEmailRequest.ProtoReflect.Descriptor instead.

func (*VerifyEmailRequest) GetToken

func (x *VerifyEmailRequest) GetToken() string

func (*VerifyEmailRequest) ProtoMessage

func (*VerifyEmailRequest) ProtoMessage()

func (*VerifyEmailRequest) ProtoReflect

func (x *VerifyEmailRequest) ProtoReflect() protoreflect.Message

func (*VerifyEmailRequest) Reset

func (x *VerifyEmailRequest) Reset()

func (*VerifyEmailRequest) String

func (x *VerifyEmailRequest) String() string

type VerifyEmailResponse

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

func (*VerifyEmailResponse) Descriptor deprecated

func (*VerifyEmailResponse) Descriptor() ([]byte, []int)

Deprecated: Use VerifyEmailResponse.ProtoReflect.Descriptor instead.

func (*VerifyEmailResponse) ProtoMessage

func (*VerifyEmailResponse) ProtoMessage()

func (*VerifyEmailResponse) ProtoReflect

func (x *VerifyEmailResponse) ProtoReflect() protoreflect.Message

func (*VerifyEmailResponse) Reset

func (x *VerifyEmailResponse) Reset()

func (*VerifyEmailResponse) String

func (x *VerifyEmailResponse) String() string

type VerifyTokenRequest

type VerifyTokenRequest struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

Check whether the token attached to MagicLink is valid or not. Ideally, you need to call this endpoint from your http request handler that handles the endpoint which is specified in the SendMagicLink request.

func (*VerifyTokenRequest) Descriptor deprecated

func (*VerifyTokenRequest) Descriptor() ([]byte, []int)

Deprecated: Use VerifyTokenRequest.ProtoReflect.Descriptor instead.

func (*VerifyTokenRequest) GetToken

func (x *VerifyTokenRequest) GetToken() string

func (*VerifyTokenRequest) ProtoMessage

func (*VerifyTokenRequest) ProtoMessage()

func (*VerifyTokenRequest) ProtoReflect

func (x *VerifyTokenRequest) ProtoReflect() protoreflect.Message

func (*VerifyTokenRequest) Reset

func (x *VerifyTokenRequest) Reset()

func (*VerifyTokenRequest) String

func (x *VerifyTokenRequest) String() string

type VerifyTokenResponse

type VerifyTokenResponse struct {
	IsValid bool     `protobuf:"varint,1,opt,name=is_valid,json=isValid,proto3" json:"is_valid,omitempty"`
	Session *Session `protobuf:"bytes,2,opt,name=session,proto3" json:"session,omitempty"`
	Message string   `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*VerifyTokenResponse) Descriptor deprecated

func (*VerifyTokenResponse) Descriptor() ([]byte, []int)

Deprecated: Use VerifyTokenResponse.ProtoReflect.Descriptor instead.

func (*VerifyTokenResponse) GetIsValid

func (x *VerifyTokenResponse) GetIsValid() bool

func (*VerifyTokenResponse) GetMessage

func (x *VerifyTokenResponse) GetMessage() string

func (*VerifyTokenResponse) GetSession

func (x *VerifyTokenResponse) GetSession() *Session

func (*VerifyTokenResponse) ProtoMessage

func (*VerifyTokenResponse) ProtoMessage()

func (*VerifyTokenResponse) ProtoReflect

func (x *VerifyTokenResponse) ProtoReflect() protoreflect.Message

func (*VerifyTokenResponse) Reset

func (x *VerifyTokenResponse) Reset()

func (*VerifyTokenResponse) String

func (x *VerifyTokenResponse) String() string

Jump to

Keyboard shortcuts

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