service

package
v0.0.0-...-3285ba3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUUID

func GenerateUUID() string

Types

type AuthService

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

func NewAuthService

func NewAuthService(r postgres.UserRepository) AuthService

func (AuthService) Authenticate

func (s AuthService) Authenticate(login, password string) (*TokenResponse, error)

func (AuthService) ConfirmAccount

func (s AuthService) ConfirmAccount(secret string) error

func (AuthService) GetSessions

func (s AuthService) GetSessions(id uint64) ([]UserSession, error)

func (AuthService) GetUserInfo

func (s AuthService) GetUserInfo(id uint64) (*model.User, error)

func (AuthService) PasswordRequest

func (s AuthService) PasswordRequest(mail string) (*model.User, error)

func (AuthService) PasswordReset

func (s AuthService) PasswordReset(secret, password string) (*TokenResponse, error)

func (AuthService) RefreshToken

func (s AuthService) RefreshToken(token string) (*string, error)

func (AuthService) Registration

func (s AuthService) Registration(login, mail, password, firstName, lastName, middleName string) (*RegResponse, error)

func (AuthService) RevokeToken

func (s AuthService) RevokeToken(uuid string) error

func (AuthService) SetNewConfirmCode

func (s AuthService) SetNewConfirmCode(id uint64) (*string, error)

type RegResponse

type RegResponse struct {
	Token        string
	RefreshToken string
	ConfirmCode  string
	Status       bool
	Text         string
}

type TokenResponse

type TokenResponse struct {
	JWTToken     string `json:"jwt_token"`
	RefreshToken string `json:"refresh_token"`
}

type UserSession

type UserSession struct {
	Uuid      string
	CreatedAt time.Time
}

Jump to

Keyboard shortcuts

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