service

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthService

func NewAuthService(adapter port.AuthAdapter) port.AuthService

func NewMigrationService

func NewMigrationService(ctx *apptypes.Context) port.MigrationService

func NewUserService

func NewUserService(adapter port.AuthAdapter) port.UserService

Types

type AuthService

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

func (*AuthService) Login

func (s *AuthService) Login(login, password string) (types.Session, error)

Login checks the provided login and password against the database. If the login is valid and the password matches, it returns a token that can be used to authenticate future requests.

func (*AuthService) Logout

func (s *AuthService) Logout(token string) error

func (*AuthService) Register

func (s *AuthService) Register(login, password string) (types.Session, error)

Register creates a new user account. It can return ErrLoginEmpty, ErrPasswordEmpty, or ErrPasswordLength if the login or password is too short.

func (*AuthService) Verify

func (s *AuthService) Verify(token string) (*types.Session, error)

type MigrationService

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

func (*MigrationService) GetUUID

func (s *MigrationService) GetUUID() uuid.UUID

func (*MigrationService) OnEvent

func (s *MigrationService) OnEvent(e event.Event) error

type UserService

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

func (*UserService) GetUser

func (s *UserService) GetUser(username string) (types.User, error)

func (*UserService) GetUserByID

func (s *UserService) GetUserByID(id uint) (types.User, error)

func (*UserService) GetUserCredentialsMethods

func (s *UserService) GetUserCredentialsMethods(userID uint) ([]types.CredentialsMethods, error)

func (*UserService) PatchUser

func (s *UserService) PatchUser(user types.User) (types.User, error)

Jump to

Keyboard shortcuts

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