Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAcceptableContentType = errors.New("no acceptable content type")
ErrNoAcceptableContentType is returned when the request does not have an acceptable Content-Type OR Accept header.
View Source
var ErrNotBearerAuth = errors.New("not a bearer authentication token")
View Source
var Module = fx.Module("api", fx.Decorate(func(slog *slog.Logger) *slog.Logger { return slog.With("module", "api") }), fx.Provide( NewServer, NewAuthenticator, newOpenAPIHandler, newOpenAPIHandlerForImportExport, (*Authenticator).AuthenticationFunc, (*openAPIHandlerForImportExport).asHandler, ), )
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator is an authenticator that authenticates requests.
func NewAuthenticator ¶
func NewAuthenticator(users *user.UserService) *Authenticator
NewAuthenticator creates a new authenticator.
func (*Authenticator) AuthenticationFunc ¶
func (a *Authenticator) AuthenticationFunc() openapi3filter.AuthenticationFunc
type OpenAPIHandlerServices ¶
type OpenAPIHandlerServices struct {
fx.In
Users *user.UserService
Notification notification.NotificationService
UserNotifications notification.UserNotificationService
Dosage dosage.DosageStorage
DoseHistory dosage.DoseHistoryStorage
}
OpenAPIHandlerServices is the set of service dependencies required by the OpenAPIHandler.
type ServerInputs ¶
type ServerInputs struct {
fx.In
Handler openapi.ServerInterface
Authenticator openapi3filter.AuthenticationFunc
}
ServerInputs is a set of dependencies required by the Server.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.