Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
Store UserStore
}
func NewService ¶
func (*Service) CreateUser ¶
CreateUser - adds a new user to the database
func (*Service) DeleteUser ¶
DeleteUser - deletes a user from the database by email
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` }
User - defines our user structure
type UserStore ¶
type UserStore interface { GetUser(ctx context.Context, email string) (User, error) CreateUser(ctx context.Context, in User) (User, error) UpdateUser(ctx context.Context, in User) (User, error) DeleteUser(ctx context.Context, email string) error }
UserStore - defines the interface we need our user storage layer to implement
Click to show internal directories.
Click to hide internal directories.