users

package
v0.0.0-...-9a1086c Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserArgs

type CreateUserArgs struct {
	Name,
	Email,
	Username,
	HashedPassword string
}

type FindUserByOperationOutput

type FindUserByOperationOutput struct {
	ID             int32
	HashedPassword string
}

type SigninArgs

type SigninArgs struct {
	Email    *string `validate:"omitempty,email"`
	Username *string `validate:"omitempty,username"`

	Password string `validate:"password"`
}

type SigninOutput

type SigninOutput struct {
	UserID int32
	JWT    string
}

type SignupArgs

type SignupArgs struct {
	Name     string `validate:"name"`
	Email    string `validate:"email"`
	Username string `validate:"username"`
	Password string `validate:"password"`
}

type UsersAPI

type UsersAPI struct {
	generated.UnimplementedUsersServiceServer
	// contains filtered or unexported fields
}

func NewUsersAPI

func NewUsersAPI(usersService *UsersService) *UsersAPI

func (*UsersAPI) Ping

func (*UsersAPI) Signin

func (*UsersAPI) Signup

type UsersPostgresRepository

type UsersPostgresRepository struct {
	*connectors.PostgresConnector
	// contains filtered or unexported fields
}

func (*UsersPostgresRepository) Create

func (u *UsersPostgresRepository) Create(ctx context.Context,
	args *CreateUserArgs,
) (int32, error)

func (*UsersPostgresRepository) FindByEmail

func (*UsersPostgresRepository) FindByUsername

func (u *UsersPostgresRepository) FindByUsername(ctx context.Context,
	username string,
) (*FindUserByOperationOutput, error)

func (*UsersPostgresRepository) UserIDExists

func (u *UsersPostgresRepository) UserIDExists(ctx context.Context, id int32) (bool, error)

type UsersRepository

type UsersRepository interface {
	Create(ctx context.Context, args *CreateUserArgs) (int32, error)

	FindByEmail(ctx context.Context, email string) (*FindUserByOperationOutput, error)
	FindByUsername(ctx context.Context, username string) (*FindUserByOperationOutput, error)
	UserIDExists(ctx context.Context, id int32) (bool, error)
}

func NewUsersPostgresRepository

func NewUsersPostgresRepository(ctx context.Context,
	postgresConnector *connectors.PostgresConnector,
) UsersRepository

type UsersService

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

func NewUsersService

func NewUsersService(
	validator *goValidator.Validate,
	usersRespository UsersRepository,
	tokenService token.TokenService,
) *UsersService

func (*UsersService) Signin

func (u *UsersService) Signin(ctx context.Context, args *SigninArgs) (*SigninOutput, error)

func (*UsersService) Signup

func (u *UsersService) Signup(ctx context.Context, args *SignupArgs) (*SigninOutput, error)

Jump to

Keyboard shortcuts

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