user

package
v0.0.0-...-91a96f4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgreUserRepository

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

func NewPostgreUserRepository

func NewPostgreUserRepository(db *sql.DB) PostgreUserRepository

func (*PostgreUserRepository) CreateUser

func (r *PostgreUserRepository) CreateUser(user User) (User, error)

func (*PostgreUserRepository) GetUserByEmail

func (r *PostgreUserRepository) GetUserByEmail(email string) (User, error)

type Server

type Server struct {
	pb.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(repo UserRepository) *Server

func (*Server) CreateUser

func (s *Server) CreateUser(ctx context.Context, req *pb.UserRequest) (*pb.UserResponse, error)

func (*Server) GetUserByEmail

func (s *Server) GetUserByEmail(ctx context.Context, req *pb.UserEmail) (*pb.UserResponse, error)

func (*Server) LoginUser

func (s *Server) LoginUser(ctx context.Context, req *pb.LoginRequest) (*pb.UserResponse, error)

type User

type User struct {
	ID        int32
	Email     string
	Name      string
	Password  string
	CreatedAt time.Time
}

type UserLogin

type UserLogin struct {
	Email    string
	Password string
}

type UserRepository

type UserRepository interface {
	CreateUser(User) (User, error)
	GetUserByEmail(string) (User, error)
}

Jump to

Keyboard shortcuts

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