account

package
v0.0.0-...-46e61fc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	AccessToken string `json:"accessToken"`
}

func (*AccessToken) ToBytes

func (a *AccessToken) ToBytes() []byte

func (*AccessToken) Validate

func (a *AccessToken) Validate() error

type Account

type Account struct {
	AccountID          uuid.UUID `json:"accountID" gorm:"primary_key"`
	Email              string    `json:"email"`
	Password           string    `json:"password"`
	Username           string    `json:"username"`
	IsConfirmed        bool      `json:"isConfirmed"`
	IsApplicationAdmin bool      `json:"isApplicationAdmin"`
	CreatedAt          time.Time `json:"createdAt"`
	UpdatedAt          time.Time `json:"updatedAt"`
}

func (*Account) HashPassword

func (a *Account) HashPassword()

func (*Account) IsNotConfirmed

func (a *Account) IsNotConfirmed() bool

func (*Account) SetApplicationAdminTrue

func (a *Account) SetApplicationAdminTrue() *Account

func (*Account) SetIsConfirmedTrue

func (a *Account) SetIsConfirmedTrue() *Account

func (*Account) SetNewAccountData

func (a *Account) SetNewAccountData() *Account

func (*Account) SetNewPassword

func (a *Account) SetNewPassword(password string) *Account

func (*Account) ToGetAccountDataResponse

func (a *Account) ToGetAccountDataResponse(permissions []string) *proto.GetAccountDataResponse

func (*Account) ToLoginResponse

func (a *Account) ToLoginResponse(accessToken, refreshToken string, expiresAt time.Time) *authEntities.LoginResponse

func (*Account) ToResponse

func (a *Account) ToResponse() *Response

func (*Account) ToTokenData

func (a *Account) ToTokenData() *tokenEntities.TokenData

func (*Account) Update

func (a *Account) Update() *Account

func (*Account) UpdateFromUpdateAccountData

func (a *Account) UpdateFromUpdateAccountData(data *UpdateAccount)

type ChangePasswordData

type ChangePasswordData struct {
	Password  string    `json:"password"`
	AccountID uuid.UUID `json:"accountID" swaggerignore:"true"`
}

func (*ChangePasswordData) SetAccountID

func (c *ChangePasswordData) SetAccountID(accountID uuid.UUID) *ChangePasswordData

func (*ChangePasswordData) ToBytes

func (c *ChangePasswordData) ToBytes() []byte

func (*ChangePasswordData) Validate

func (c *ChangePasswordData) Validate() error

type CheckEmailAndUsername

type CheckEmailAndUsername struct {
	Email    string `json:"email"`
	Username string `json:"username"`
}

func (*CheckEmailAndUsername) ToBytes

func (c *CheckEmailAndUsername) ToBytes() []byte

func (*CheckEmailAndUsername) Validate

func (c *CheckEmailAndUsername) Validate() error

type Data

type Data struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Username string `json:"username"`
}

func (*Data) ToAccount

func (u *Data) ToAccount() *Account

func (*Data) ToBytes

func (u *Data) ToBytes() []byte

func (*Data) Validate

func (u *Data) Validate() error

type Email

type Email struct {
	Email string `json:"email"`
}

func (*Email) ToBytes

func (e *Email) ToBytes() []byte

func (*Email) Validate

func (e *Email) Validate() error

type RefreshToken

type RefreshToken struct {
	RefreshToken string `json:"refreshToken"`
}

func (*RefreshToken) ToBytes

func (r *RefreshToken) ToBytes() []byte

func (*RefreshToken) Validate

func (r *RefreshToken) Validate() error

type ResetCodeData

type ResetCodeData struct {
	Email string `json:"email"`
	Code  string `json:"code"`
}

func (*ResetCodeData) ToBytes

func (r *ResetCodeData) ToBytes() []byte

func (*ResetCodeData) Validate

func (r *ResetCodeData) Validate() error

nolint // valid magic number

type Response

type Response struct {
	AccountID          uuid.UUID `json:"accountID" gorm:"primary_key"`
	Email              string    `json:"email"`
	Username           string    `json:"username"`
	IsConfirmed        bool      `json:"isConfirmed"`
	IsApplicationAdmin bool      `json:"isApplicationAdmin"`
	CreatedAt          time.Time `json:"createdAt"`
	UpdatedAt          time.Time `json:"updatedAt"`
}

type UpdateAccount

type UpdateAccount struct {
	AccountID   uuid.UUID `json:"accountID" swaggerignore:"true"`
	Email       string    `json:"email"`
	Username    string    `json:"username"`
	IsConfirmed bool      `json:"isConfirmed" swaggerignore:"true"`
}

func (*UpdateAccount) HasEmailChange

func (u *UpdateAccount) HasEmailChange(email string) bool

func (*UpdateAccount) SetAccountIDAndIsConfirmed

func (u *UpdateAccount) SetAccountIDAndIsConfirmed(accountID uuid.UUID, isConfirmed bool) *UpdateAccount

func (*UpdateAccount) ToBytes

func (u *UpdateAccount) ToBytes() []byte

func (*UpdateAccount) Validate

func (u *UpdateAccount) Validate() error

Jump to

Keyboard shortcuts

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