Documentation
¶
Index ¶
- type CreateUserArgs
- type FindUserByOperationOutput
- type SigninArgs
- type SigninOutput
- type SignupArgs
- type UsersAPI
- func (*UsersAPI) Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (u *UsersAPI) Signin(ctx context.Context, request *generated.SigninRequest) (*generated.SigninResponse, error)
- func (u *UsersAPI) Signup(ctx context.Context, request *generated.SignupRequest) (*generated.SigninResponse, error)
- type UsersPostgresRepository
- func (u *UsersPostgresRepository) Create(ctx context.Context, args *CreateUserArgs) (int32, error)
- func (u *UsersPostgresRepository) FindByEmail(ctx context.Context, email string) (*FindUserByOperationOutput, error)
- func (u *UsersPostgresRepository) FindByUsername(ctx context.Context, username string) (*FindUserByOperationOutput, error)
- func (u *UsersPostgresRepository) UserIDExists(ctx context.Context, id int32) (bool, error)
- type UsersRepository
- type UsersService
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 SigninArgs ¶
type SigninOutput ¶
type SignupArgs ¶
type UsersAPI ¶
type UsersAPI struct {
generated.UnimplementedUsersServiceServer
// contains filtered or unexported fields
}
func NewUsersAPI ¶
func NewUsersAPI(usersService *UsersService) *UsersAPI
func (*UsersAPI) Signin ¶
func (u *UsersAPI) Signin(ctx context.Context, request *generated.SigninRequest, ) (*generated.SigninResponse, error)
func (*UsersAPI) Signup ¶
func (u *UsersAPI) Signup(ctx context.Context, request *generated.SignupRequest, ) (*generated.SigninResponse, error)
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 (u *UsersPostgresRepository) FindByEmail(ctx context.Context, email string, ) (*FindUserByOperationOutput, error)
func (*UsersPostgresRepository) FindByUsername ¶
func (u *UsersPostgresRepository) FindByUsername(ctx context.Context, username string, ) (*FindUserByOperationOutput, error)
func (*UsersPostgresRepository) UserIDExists ¶
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)
Click to show internal directories.
Click to hide internal directories.