Documentation ¶
Overview ¶
Package handlers provides the HTTP handlers for the API server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datalayer ¶
type Datalayer interface { CreateUser(ctx context.Context, user models.User) error SignInUser(ctx context.Context, username, password string) (string, error) GetUserById(ctx context.Context, id int) (models.UserInfo, error) }
Datalayer is an interface that defines the methods for the datalayer.
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints is a struct that defines the handler for the MADR endpoints.
func New ¶
func New(data Datalayer, ew ErrorWriter, logger Logger) *Endpoints
New is a constructor for the Endpoints struct.
func (*Endpoints) GetUserInfo ¶
func (e *Endpoints) GetUserInfo(w http.ResponseWriter, r *http.Request)
GetUserInfo is a handler for the get-user-info endpoint.
type ErrorWriter ¶
type ErrorWriter interface {
Error(w http.ResponseWriter, msg string, status int)
}
ErrorWriter is an interface that defines the methods for the error writer.
Click to show internal directories.
Click to hide internal directories.