Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRepo = errors.New("unable to handle repo request")
ErrRepo is returned when there is an error communicating with the database.
Functions ¶
Types ¶
type CreateUserRequest ¶
CreateUserRequest holds the information for the create user request.
type CreateUserResponse ¶
type CreateUserResponse struct {
OK string `json:"ok"`
}
CreateUserResponse holds the information for the create user response.
type Endpoints ¶
Endpoints defines the endpoints that will be exposed to the public.
func MakeEndpoints ¶
MakeEndpoints creates and returns the Endpoints struct.
type GetUserRequest ¶
type GetUserRequest struct {
ID string `json:"id"`
}
GetUserRequest holds the information for the get user request.
type GetUserResponse ¶
type GetUserResponse struct {
Email string `json:"email"`
}
GetUserResponse holds the information for the get user response.
type Repository ¶
type Repository interface {
CreateUser(ctx context.Context, user User) error
GetUser(ctx context.Context, id string) (string, error)
}
Repository defines the interface for database interaction.“
type Service ¶
type Service interface {
CreateUser(ctx context.Context, email string, password string) (string, error)
GetUser(ctx context.Context, id string) (string, error)
}
Service defines the interface for the account service.
func NewService ¶
func NewService(repo Repository, logger log.Logger) Service
NewService creates and returns a new implementation of Service.
Click to show internal directories.
Click to hide internal directories.