Documentation ¶
Index ¶
- Constants
- func GenerateJWT(email string, id string, userType int32) (string, error)
- func NewGrpcServer(port string, s UsersService) *grpc.Server
- func NewSqlDb(dburl string) (*sql.DB, error)
- func NewUsersServer(s UsersService) proto.UserServiceServer
- type CustomClaims
- type DetailedUser
- type EventProducer
- type LoginRequest
- type RegisterUserRequest
- type User
- type UsersRepository
- type UsersService
Constants ¶
View Source
const (
FetchUserByEmailQuery = "SELECT id, username, salt, pass_hash, user_type FROM users WHERE email = $1"
)
Variables ¶
This section is empty.
Functions ¶
func NewGrpcServer ¶
func NewGrpcServer(port string, s UsersService) *grpc.Server
func NewUsersServer ¶
func NewUsersServer(s UsersService) proto.UserServiceServer
Types ¶
type CustomClaims ¶
type DetailedUser ¶
type EventProducer ¶
func NewEventProducer ¶
func NewEventProducer(exchange string, ch *amqp.Channel) EventProducer
type LoginRequest ¶
type RegisterUserRequest ¶
type UsersRepository ¶
type UsersRepository interface { FetchUser(id uuid.UUID) (*DetailedUser, error) FetchUserByEmail(email string) (*DetailedUser, error) FetchAllUsers() ([]*User, error) RegisterUser(id uuid.UUID, username string, email string, salt string, passHash string, userType int32) error }
func NewUsersRepository ¶
func NewUsersRepository(db *sql.DB) UsersRepository
type UsersService ¶
type UsersService interface { GetUser(id string) (*User, error) GetAllUsers() ([]*User, error) LoginUser(LoginRequest) (*string, error) RegisterUser(req RegisterUserRequest) (*uuid.UUID, error) }
func NewUsersService ¶
func NewUsersService(repo UsersRepository, p EventProducer) UsersService
Click to show internal directories.
Click to hide internal directories.