openapi

package
v0.0.0-...-29719d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package openapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version (devel) DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type Auth200JSONResponse

type Auth200JSONResponse struct {
	// Token The session token
	Token string `json:"token"`
}

func (Auth200JSONResponse) VisitAuthResponse

func (response Auth200JSONResponse) VisitAuthResponse(w http.ResponseWriter) error

type AuthJSONBody

type AuthJSONBody struct {
	// Secret A secret and unique user identifier. This secret is generated once and never changes. It is used to both authenticate and identify a user, so it should be kept secret.
	Secret UserSecret `json:"secret"`
}

AuthJSONBody defines parameters for Auth.

type AuthJSONRequestBody

type AuthJSONRequestBody AuthJSONBody

AuthJSONRequestBody defines body for Auth for application/json ContentType.

type AuthParams

type AuthParams struct {
	// UserAgent The user agent of the client making the request.
	UserAgent *string `json:"User-Agent,omitempty"`
}

AuthParams defines parameters for Auth.

type AuthRequestObject

type AuthRequestObject struct {
	Params AuthParams
	Body   *AuthJSONRequestBody
}

type AuthResponseObject

type AuthResponseObject interface {
	VisitAuthResponse(w http.ResponseWriter) error
}

type AuthdefaultJSONResponse

type AuthdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (AuthdefaultJSONResponse) VisitAuthResponse

func (response AuthdefaultJSONResponse) VisitAuthResponse(w http.ResponseWriter) error

type ClearDosage204Response

type ClearDosage204Response struct {
}

func (ClearDosage204Response) VisitClearDosageResponse

func (response ClearDosage204Response) VisitClearDosageResponse(w http.ResponseWriter) error

type ClearDosageRequestObject

type ClearDosageRequestObject struct {
}

type ClearDosageResponseObject

type ClearDosageResponseObject interface {
	VisitClearDosageResponse(w http.ResponseWriter) error
}

type ClearDosagedefaultJSONResponse

type ClearDosagedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ClearDosagedefaultJSONResponse) VisitClearDosageResponse

func (response ClearDosagedefaultJSONResponse) VisitClearDosageResponse(w http.ResponseWriter) error

type CurrentUser200JSONResponse

type CurrentUser200JSONResponse struct {
	// Name The user's name
	Name string `json:"name"`

	// Locale A locale identifier.
	Locale Locale `json:"locale"`

	// Secret A secret and unique user identifier. This secret is generated once and never changes. It is used to both authenticate and identify a user, so it should be kept secret.
	Secret UserSecret `json:"secret"`
}

func (CurrentUser200JSONResponse) VisitCurrentUserResponse

func (response CurrentUser200JSONResponse) VisitCurrentUserResponse(w http.ResponseWriter) error

type CurrentUserRequestObject

type CurrentUserRequestObject struct {
}

type CurrentUserResponseObject

type CurrentUserResponseObject interface {
	VisitCurrentUserResponse(w http.ResponseWriter) error
}

type CurrentUserSessions200JSONResponse

type CurrentUserSessions200JSONResponse []Session

func (CurrentUserSessions200JSONResponse) VisitCurrentUserSessionsResponse

func (response CurrentUserSessions200JSONResponse) VisitCurrentUserSessionsResponse(w http.ResponseWriter) error

type CurrentUserSessionsRequestObject

type CurrentUserSessionsRequestObject struct {
}

type CurrentUserSessionsResponseObject

type CurrentUserSessionsResponseObject interface {
	VisitCurrentUserSessionsResponse(w http.ResponseWriter) error
}

type CurrentUserSessionsdefaultJSONResponse

type CurrentUserSessionsdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (CurrentUserSessionsdefaultJSONResponse) VisitCurrentUserSessionsResponse

func (response CurrentUserSessionsdefaultJSONResponse) VisitCurrentUserSessionsResponse(w http.ResponseWriter) error

type CurrentUserdefaultJSONResponse

type CurrentUserdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (CurrentUserdefaultJSONResponse) VisitCurrentUserResponse

func (response CurrentUserdefaultJSONResponse) VisitCurrentUserResponse(w http.ResponseWriter) error

type CustomNotifications

type CustomNotifications map[string]NotificationMessage

CustomNotifications Custom notifications that the user can override with. The object keys are the notification types.

type DeleteUserSession204Response

type DeleteUserSession204Response struct {
}

func (DeleteUserSession204Response) VisitDeleteUserSessionResponse

func (response DeleteUserSession204Response) VisitDeleteUserSessionResponse(w http.ResponseWriter) error

type DeleteUserSessionParams

type DeleteUserSessionParams struct {
	ID int64 `form:"id" json:"id"`
}

DeleteUserSessionParams defines parameters for DeleteUserSession.

type DeleteUserSessionRequestObject

type DeleteUserSessionRequestObject struct {
	Params DeleteUserSessionParams
}

type DeleteUserSessionResponseObject

type DeleteUserSessionResponseObject interface {
	VisitDeleteUserSessionResponse(w http.ResponseWriter) error
}

type DeleteUserSessiondefaultJSONResponse

type DeleteUserSessiondefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (DeleteUserSessiondefaultJSONResponse) VisitDeleteUserSessionResponse

func (response DeleteUserSessiondefaultJSONResponse) VisitDeleteUserSessionResponse(w http.ResponseWriter) error

type DeliveryMethod

type DeliveryMethod struct {
	// ID A short string representing the delivery method. This is what goes into the DeliveryMethod fields.
	ID string `json:"id"`

	// Units The units of the delivery method.
	Units string `json:"units"`

	// Name The full name of the delivery method.
	Name string `json:"name"`

	// Description A description of the delivery method.
	Description string `json:"description,omitempty"`
}

DeliveryMethod defines model for DeliveryMethod.

type DeliveryMethods200JSONResponse

type DeliveryMethods200JSONResponse []DeliveryMethod

func (DeliveryMethods200JSONResponse) VisitDeliveryMethodsResponse

func (response DeliveryMethods200JSONResponse) VisitDeliveryMethodsResponse(w http.ResponseWriter) error

type DeliveryMethodsRequestObject

type DeliveryMethodsRequestObject struct {
}

type DeliveryMethodsResponseObject

type DeliveryMethodsResponseObject interface {
	VisitDeliveryMethodsResponse(w http.ResponseWriter) error
}

type DeliveryMethodsdefaultJSONResponse

type DeliveryMethodsdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (DeliveryMethodsdefaultJSONResponse) VisitDeliveryMethodsResponse

func (response DeliveryMethodsdefaultJSONResponse) VisitDeliveryMethodsResponse(w http.ResponseWriter) error

type Dosage

type Dosage struct {
	// DeliveryMethod The delivery method to use.
	DeliveryMethod string `json:"deliveryMethod"`

	// Dose The dosage amount.
	Dose float32 `json:"dose"`

	// Interval The interval between doses in days.
	Interval float64 `json:"interval"`

	// Concurrence The number of estrogen patches on the body at once. Only relevant if delivery method is patch.
	Concurrence *int `json:"concurrence,omitempty"`
}

Dosage defines model for Dosage.

type Dosage200JSONResponse

type Dosage200JSONResponse struct {
	// Dosage The user's current dosage schedule. This is null if the user has no dosage set.
	Dosage *Dosage `json:"dosage,omitempty"`

	// History The user's dosage history within the requested time range. If either historyStart or historyEnd are not provided, this will be null.
	History *DosageHistory `json:"history,omitempty"`
}

func (Dosage200JSONResponse) VisitDosageResponse

func (response Dosage200JSONResponse) VisitDosageResponse(w http.ResponseWriter) error

type DosageHistory

type DosageHistory = []Dose

DosageHistory defines model for DosageHistory.

type DosageHistoryCSV

type DosageHistoryCSV = string

DosageHistoryCSV The CSV format of the user's dosage history.

type DosageParams

type DosageParams struct {
	Start *time.Time `form:"start,omitempty" json:"start,omitempty"`
	End   *time.Time `form:"end,omitempty" json:"end,omitempty"`
}

DosageParams defines parameters for Dosage.

type DosageRequestObject

type DosageRequestObject struct {
	Params DosageParams
}

type DosageResponseObject

type DosageResponseObject interface {
	VisitDosageResponse(w http.ResponseWriter) error
}

type Dose

type Dose struct {
	// DeliveryMethod The delivery method used.
	DeliveryMethod string `json:"deliveryMethod"`

	// Dose The dosage amount.
	Dose float32 `json:"dose"`

	// TakenAt The time the dosage was taken.
	TakenAt time.Time `json:"takenAt"`

	// TakenOffAt The time the dosage was taken off. This is only relevant for patch delivery methods.
	TakenOffAt *time.Time `json:"takenOffAt,omitempty"`

	// Comment A comment about the dosage, if any.
	Comment *string `json:"comment,omitempty"`
}

Dose A dose of medication in time.

type EditDose204Response

type EditDose204Response struct {
}

func (EditDose204Response) VisitEditDoseResponse

func (response EditDose204Response) VisitEditDoseResponse(w http.ResponseWriter) error

type EditDoseJSONBody

type EditDoseJSONBody = Dose

EditDoseJSONBody defines parameters for EditDose.

type EditDoseJSONRequestBody

type EditDoseJSONRequestBody = EditDoseJSONBody

EditDoseJSONRequestBody defines body for EditDose for application/json ContentType.

type EditDoseRequestObject

type EditDoseRequestObject struct {
	DoseTime time.Time `json:"doseTime"`
	Body     *EditDoseJSONRequestBody
}

type EditDoseResponseObject

type EditDoseResponseObject interface {
	VisitEditDoseResponse(w http.ResponseWriter) error
}

type EditDosedefaultJSONResponse

type EditDosedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (EditDosedefaultJSONResponse) VisitEditDoseResponse

func (response EditDosedefaultJSONResponse) VisitEditDoseResponse(w http.ResponseWriter) error

type EmailSubscription

type EmailSubscription struct {
	// Address The email address to send the notification to. This email address will appear in the `To` field of the email.
	Address openapi_types.Email `json:"address"`

	// Name The name of the user to send the email to. This name will be used with the email address in the `To` field.
	Name *string `json:"name,omitempty"`
}

EmailSubscription defines model for EmailSubscription.

type Error

type Error struct {
	// Details Additional details about the error. Ignored if [errors] is used.
	Details *interface{} `json:"details,omitempty"`

	// Errors An array of errors that caused this error. If this is populated, then [details] is omitted.
	Errors []Error `json:"errors,omitempty"`

	// Internal Whether the error is internal
	Internal *bool `json:"internal,omitempty"`

	// InternalCode An internal code for the error (useless for clients)
	InternalCode *string `json:"internalCode,omitempty"`

	// Message A message describing the error
	Message string `json:"message"`
}

Error defines model for Error.

type ErrorResponse

type ErrorResponse = Error

ErrorResponse defines model for ErrorResponse.

type ErrorResponseJSONResponse

type ErrorResponseJSONResponse Error

type ExportDoses200JSONResponse

type ExportDoses200JSONResponse struct {
	Body    DosageHistory
	Headers ExportDoses200ResponseHeaders
}

func (ExportDoses200JSONResponse) VisitExportDosesResponse

func (response ExportDoses200JSONResponse) VisitExportDosesResponse(w http.ResponseWriter) error

type ExportDoses200ResponseHeaders

type ExportDoses200ResponseHeaders struct {
	ContentDisposition string
}

type ExportDoses200TextCsvResponse

type ExportDoses200TextCsvResponse struct {
	Body          io.Reader
	Headers       ExportDoses200ResponseHeaders
	ContentLength int64
}

func (ExportDoses200TextCsvResponse) VisitExportDosesResponse

func (response ExportDoses200TextCsvResponse) VisitExportDosesResponse(w http.ResponseWriter) error

type ExportDoses429JSONResponse

type ExportDoses429JSONResponse struct {
	RateLimitedResponseJSONResponse
}

func (ExportDoses429JSONResponse) VisitExportDosesResponse

func (response ExportDoses429JSONResponse) VisitExportDosesResponse(w http.ResponseWriter) error

type ExportDosesParams

type ExportDosesParams struct {
	Start *time.Time `form:"start,omitempty" json:"start,omitempty"`
	End   *time.Time `form:"end,omitempty" json:"end,omitempty"`

	// Accept The format to export the dosage history in.
	Accept ExportDosesParamsAccept `json:"Accept"`
}

ExportDosesParams defines parameters for ExportDoses.

type ExportDosesParamsAccept

type ExportDosesParamsAccept string

ExportDosesParamsAccept defines parameters for ExportDoses.

const (
	ExportDosesParamsAcceptApplicationJSON ExportDosesParamsAccept = "application/json"
	ExportDosesParamsAcceptTextCsv         ExportDosesParamsAccept = "text/csv"
)

Defines values for ExportDosesParamsAccept.

type ExportDosesRequestObject

type ExportDosesRequestObject struct {
	Params ExportDosesParams
}

type ExportDosesResponseObject

type ExportDosesResponseObject interface {
	VisitExportDosesResponse(w http.ResponseWriter) error
}

type ExportDosesdefaultJSONResponse

type ExportDosesdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ExportDosesdefaultJSONResponse) VisitExportDosesResponse

func (response ExportDosesdefaultJSONResponse) VisitExportDosesResponse(w http.ResponseWriter) error

type ForgetDose204Response

type ForgetDose204Response struct {
}

func (ForgetDose204Response) VisitForgetDoseResponse

func (response ForgetDose204Response) VisitForgetDoseResponse(w http.ResponseWriter) error

type ForgetDoseRequestObject

type ForgetDoseRequestObject struct {
	DoseTime time.Time `json:"doseTime"`
}

type ForgetDoseResponseObject

type ForgetDoseResponseObject interface {
	VisitForgetDoseResponse(w http.ResponseWriter) error
}

type ForgetDosedefaultJSONResponse

type ForgetDosedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ForgetDosedefaultJSONResponse) VisitForgetDoseResponse

func (response ForgetDosedefaultJSONResponse) VisitForgetDoseResponse(w http.ResponseWriter) error

type ForgetDoses204Response

type ForgetDoses204Response struct {
}

func (ForgetDoses204Response) VisitForgetDosesResponse

func (response ForgetDoses204Response) VisitForgetDosesResponse(w http.ResponseWriter) error

type ForgetDosesParams

type ForgetDosesParams struct {
	DoseTimes []time.Time `form:"doseTimes" json:"doseTimes"`
}

ForgetDosesParams defines parameters for ForgetDoses.

type ForgetDosesRequestObject

type ForgetDosesRequestObject struct {
	Params ForgetDosesParams
}

type ForgetDosesResponseObject

type ForgetDosesResponseObject interface {
	VisitForgetDosesResponse(w http.ResponseWriter) error
}

type ForgetDosesdefaultJSONResponse

type ForgetDosesdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (ForgetDosesdefaultJSONResponse) VisitForgetDosesResponse

func (response ForgetDosesdefaultJSONResponse) VisitForgetDosesResponse(w http.ResponseWriter) error

type ImportDoses200JSONResponse

type ImportDoses200JSONResponse struct {
	Error *Error `json:"error,omitempty"`

	// Records The number of records in the file.
	Records int `json:"records"`

	// Succeeded The number of records actually imported successfully. This is not equal to #records if there were errors or duplicate entries.
	Succeeded int `json:"succeeded"`
}

func (ImportDoses200JSONResponse) VisitImportDosesResponse

func (response ImportDoses200JSONResponse) VisitImportDosesResponse(w http.ResponseWriter) error

type ImportDosesJSONRequestBody

type ImportDosesJSONRequestBody = DosageHistory

ImportDosesJSONRequestBody defines body for ImportDoses for application/json ContentType.

type ImportDosesParams

type ImportDosesParams struct {
	// ContentType The format to import the dosage history as.
	ContentType ImportDosesParamsContentType `json:"Content-Type"`
}

ImportDosesParams defines parameters for ImportDoses.

type ImportDosesParamsContentType

type ImportDosesParamsContentType string

ImportDosesParamsContentType defines parameters for ImportDoses.

const (
	ImportDosesParamsContentTypeApplicationJSON ImportDosesParamsContentType = "application/json"
	ImportDosesParamsContentTypeTextCsv         ImportDosesParamsContentType = "text/csv"
)

Defines values for ImportDosesParamsContentType.

type ImportDosesRequestObject

type ImportDosesRequestObject struct {
	Params   ImportDosesParams
	JSONBody *ImportDosesJSONRequestBody
	Body     io.Reader
}

type ImportDosesResponseObject

type ImportDosesResponseObject interface {
	VisitImportDosesResponse(w http.ResponseWriter) error
}

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type Locale

type Locale = user.Locale

Locale A locale identifier.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type Notification

type Notification struct {
	// Type The type of notification:
	//
	//   - `welcome_message` is sent to welcome the user. Realistically, it is
	//     used as a test message.
	//   - `reminder_message` is sent to remind the user of their hormone dose.
	//   - `account_notice_message` is sent to notify the user that they need
	//     to check their account.
	//   - `web_push_expiring_message` is sent to notify the user that their
	//     web push subscription is expiring.
	//   - `test_message` is sent to test your notification settings.
	Type NotificationType `json:"type"`

	// Message The message of the notification.
	Message NotificationMessage `json:"message"`

	// Username The username of the user to send the notification to.
	Username string `json:"username"`
}

Notification defines model for Notification.

type NotificationMessage

type NotificationMessage struct {
	// Title The title of the notification.
	Title string `json:"title"`

	// Message The message of the notification.
	Message string `json:"message"`
}

NotificationMessage The message of the notification. This is derived from the notification type but can be overridden by the user.

type NotificationMethodSupports

type NotificationMethodSupports = []string

NotificationMethodSupports A list of notification methods that the server supports.

type NotificationPreferences

type NotificationPreferences struct {
	CustomNotifications CustomNotifications `json:"customNotifications,omitempty"`
	NotificationConfigs struct {
		Email   *[]EmailSubscription `json:"email,omitempty"`
		WebPush *[]PushSubscription  `json:"webPush,omitempty"`
	} `json:"notificationConfigs"`
}

NotificationPreferences The user's notification preferences. Each key is a notification type and the value is the notification configuration for that type. It may be nil if the server does not support a particular notification type.

type NotificationType

type NotificationType string

NotificationType The type of notification:

  • `welcome_message` is sent to welcome the user. Realistically, it is used as a test message.
  • `reminder_message` is sent to remind the user of their hormone dose.
  • `account_notice_message` is sent to notify the user that they need to check their account.
  • `web_push_expiring_message` is sent to notify the user that their web push subscription is expiring.
  • `test_message` is sent to test your notification settings.
const (
	AccountNoticeMessage   NotificationType = "account_notice_message"
	ReminderMessage        NotificationType = "reminder_message"
	TestMessage            NotificationType = "test_message"
	WebPushExpiringMessage NotificationType = "web_push_expiring_message"
	WelcomeMessage         NotificationType = "welcome_message"
)

Defines values for NotificationType.

type PushDeviceID

type PushDeviceID = string

PushDeviceID A short ID associated with the device that the push subscription is for This is used to identify the device when updating its push subscription later on. Realistically, this will be handled as an opaque random string generated on the device side, so the server has no way to correlate it with any fingerprinting. The recommended way to generate this string in JavaScript is: ```js crypto.randomUUID().slice(0, 8) ```

type PushInfo

type PushInfo struct {
	// ApplicationServerKey A Base64-encoded string or ArrayBuffer containing an ECDSA P-256 public key that the push server will use to authenticate your application server. If specified, all messages from your application server must use the VAPID authentication scheme, and include a JWT signed with the corresponding private key. This key IS NOT the same ECDH key that you use to encrypt the data. For more information, see "Using VAPID with WebPush".
	ApplicationServerKey string `json:"applicationServerKey"`
}

PushInfo This is returned by the server and contains information that the client would need to subscribe to push notifications.

type PushSubscription

type PushSubscription struct {
	// DeviceID A short ID associated with the device that the push subscription is for This is used to identify the device when updating its push subscription later on.
	// Realistically, this will be handled as an opaque random string generated on the device side, so the server has no way to correlate  it with any fingerprinting.
	// The recommended way to generate this string in JavaScript is:
	// “`js crypto.randomUUID().slice(0, 8) “`
	DeviceID PushDeviceID `json:"deviceID"`

	// Endpoint The endpoint to send the notification to.
	Endpoint string `json:"endpoint"`

	// ExpirationTime The time at which the subscription expires. This is the time when the subscription will be automatically deleted by the browser.
	ExpirationTime time.Time `json:"expirationTime,omitempty"`

	// Keys The VAPID keys to encrypt the push notification.
	Keys struct {
		// P256Dh An Elliptic curve Diffie–Hellman public key on the P-256 curve (that is, the NIST secp256r1 elliptic curve). The resulting key is an uncompressed point in ANSI X9.62 format.
		P256Dh string `json:"p256dh"`

		// Auth An authentication secret, as described in Message Encryption for Web Push.
		Auth string `json:"auth"`
	} `json:"keys"`
}

PushSubscription The configuration for a push notification subscription. This is the object that is returned by calling PushSubscription.toJSON(). More information can be found at: https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/toJSON

type RateLimitedResponse

type RateLimitedResponse = Error

RateLimitedResponse defines model for RateLimitedResponse.

type RateLimitedResponseJSONResponse

type RateLimitedResponseJSONResponse struct {
	Body Error

	Headers RateLimitedResponseResponseHeaders
}

type RateLimitedResponseResponseHeaders

type RateLimitedResponseResponseHeaders struct {
	RetryAfter int32
}

type RecordDose200JSONResponse

type RecordDose200JSONResponse Dose

func (RecordDose200JSONResponse) VisitRecordDoseResponse

func (response RecordDose200JSONResponse) VisitRecordDoseResponse(w http.ResponseWriter) error

type RecordDoseRequestObject

type RecordDoseRequestObject struct {
}

type RecordDoseResponseObject

type RecordDoseResponseObject interface {
	VisitRecordDoseResponse(w http.ResponseWriter) error
}

type Register200JSONResponse

type Register200JSONResponse struct {
	// Name The user's name
	Name string `json:"name"`

	// Locale A locale identifier.
	Locale Locale `json:"locale"`

	// Secret A secret and unique user identifier. This secret is generated once and never changes. It is used to both authenticate and identify a user, so it should be kept secret.
	Secret UserSecret `json:"secret"`
}

func (Register200JSONResponse) VisitRegisterResponse

func (response Register200JSONResponse) VisitRegisterResponse(w http.ResponseWriter) error

type RegisterJSONBody

type RegisterJSONBody struct {
	// Name The name to register with
	Name string `json:"name"`
}

RegisterJSONBody defines parameters for Register.

type RegisterJSONRequestBody

type RegisterJSONRequestBody RegisterJSONBody

RegisterJSONRequestBody defines body for Register for application/json ContentType.

type RegisterRequestObject

type RegisterRequestObject struct {
	Body *RegisterJSONRequestBody
}

type RegisterResponseObject

type RegisterResponseObject interface {
	VisitRegisterResponse(w http.ResponseWriter) error
}

type RegisterdefaultJSONResponse

type RegisterdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (RegisterdefaultJSONResponse) VisitRegisterResponse

func (response RegisterdefaultJSONResponse) VisitRegisterResponse(w http.ResponseWriter) error

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type SendTestNotification204Response

type SendTestNotification204Response struct {
}

func (SendTestNotification204Response) VisitSendTestNotificationResponse

func (response SendTestNotification204Response) VisitSendTestNotificationResponse(w http.ResponseWriter) error

type SendTestNotificationRequestObject

type SendTestNotificationRequestObject struct {
}

type SendTestNotificationResponseObject

type SendTestNotificationResponseObject interface {
	VisitSendTestNotificationResponse(w http.ResponseWriter) error
}

type SendTestNotificationdefaultJSONResponse

type SendTestNotificationdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (SendTestNotificationdefaultJSONResponse) VisitSendTestNotificationResponse

func (response SendTestNotificationdefaultJSONResponse) VisitSendTestNotificationResponse(w http.ResponseWriter) error

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

ServeMux is an abstraction of http.ServeMux.

type ServerInterface

type ServerInterface interface {
	// Authenticate a user and obtain a session
	// (POST /auth)
	Auth(w http.ResponseWriter, r *http.Request, params AuthParams)
	// List all available delivery methods
	// (GET /delivery-methods)
	DeliveryMethods(w http.ResponseWriter, r *http.Request)
	// Clear the user's dosage schedule
	// (DELETE /dosage)
	ClearDosage(w http.ResponseWriter, r *http.Request)
	// Get the user's dosage and optionally their history
	// (GET /dosage)
	Dosage(w http.ResponseWriter, r *http.Request, params DosageParams)
	// Set the user's dosage
	// (PUT /dosage)
	SetDosage(w http.ResponseWriter, r *http.Request)
	// Delete multiple dosages from the user's history
	// (DELETE /dosage/dose)
	ForgetDoses(w http.ResponseWriter, r *http.Request, params ForgetDosesParams)
	// Record a new dosage to the user's history
	// (POST /dosage/dose)
	RecordDose(w http.ResponseWriter, r *http.Request)
	// Delete a dosage from the user's history
	// (DELETE /dosage/dose/{doseTime})
	ForgetDose(w http.ResponseWriter, r *http.Request, doseTime time.Time)
	// Update a dosage in the user's history
	// (PUT /dosage/dose/{doseTime})
	EditDose(w http.ResponseWriter, r *http.Request, doseTime time.Time)
	// Export the user's dosage history
	// (GET /dosage/export-doses)
	ExportDoses(w http.ResponseWriter, r *http.Request, params ExportDosesParams)
	// Import a CSV file of dosage history
	// (POST /dosage/import-doses)
	ImportDoses(w http.ResponseWriter, r *http.Request, params ImportDosesParams)
	// Get the current user
	// (GET /me)
	CurrentUser(w http.ResponseWriter, r *http.Request)
	// Delete one of the current user's sessions
	// (DELETE /me/sessions)
	DeleteUserSession(w http.ResponseWriter, r *http.Request, params DeleteUserSessionParams)
	// List the current user's sessions
	// (GET /me/sessions)
	CurrentUserSessions(w http.ResponseWriter, r *http.Request)
	// Get the server's supported notification methods
	// (GET /notifications/methods)
	SupportedNotificationMethods(w http.ResponseWriter, r *http.Request)
	// Get the user's notification preferences
	// (GET /notifications/preferences)
	UserNotificationPreferences(w http.ResponseWriter, r *http.Request)
	// Update the user's notification preferences
	// (PUT /notifications/preferences)
	UserUpdateNotificationPreferences(w http.ResponseWriter, r *http.Request)
	// Send a test notification
	// (POST /notifications/test)
	SendTestNotification(w http.ResponseWriter, r *http.Request)
	// Get the server's push notification information
	// (GET /push-info)
	WebPushInfo(w http.ResponseWriter, r *http.Request)
	// Register a new account
	// (POST /register)
	Register(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) Auth

Auth operation middleware

func (*ServerInterfaceWrapper) ClearDosage

func (siw *ServerInterfaceWrapper) ClearDosage(w http.ResponseWriter, r *http.Request)

ClearDosage operation middleware

func (*ServerInterfaceWrapper) CurrentUser

func (siw *ServerInterfaceWrapper) CurrentUser(w http.ResponseWriter, r *http.Request)

CurrentUser operation middleware

func (*ServerInterfaceWrapper) CurrentUserSessions

func (siw *ServerInterfaceWrapper) CurrentUserSessions(w http.ResponseWriter, r *http.Request)

CurrentUserSessions operation middleware

func (*ServerInterfaceWrapper) DeleteUserSession

func (siw *ServerInterfaceWrapper) DeleteUserSession(w http.ResponseWriter, r *http.Request)

DeleteUserSession operation middleware

func (*ServerInterfaceWrapper) DeliveryMethods

func (siw *ServerInterfaceWrapper) DeliveryMethods(w http.ResponseWriter, r *http.Request)

DeliveryMethods operation middleware

func (*ServerInterfaceWrapper) Dosage

Dosage operation middleware

func (*ServerInterfaceWrapper) EditDose

func (siw *ServerInterfaceWrapper) EditDose(w http.ResponseWriter, r *http.Request)

EditDose operation middleware

func (*ServerInterfaceWrapper) ExportDoses

func (siw *ServerInterfaceWrapper) ExportDoses(w http.ResponseWriter, r *http.Request)

ExportDoses operation middleware

func (*ServerInterfaceWrapper) ForgetDose

func (siw *ServerInterfaceWrapper) ForgetDose(w http.ResponseWriter, r *http.Request)

ForgetDose operation middleware

func (*ServerInterfaceWrapper) ForgetDoses

func (siw *ServerInterfaceWrapper) ForgetDoses(w http.ResponseWriter, r *http.Request)

ForgetDoses operation middleware

func (*ServerInterfaceWrapper) ImportDoses

func (siw *ServerInterfaceWrapper) ImportDoses(w http.ResponseWriter, r *http.Request)

ImportDoses operation middleware

func (*ServerInterfaceWrapper) RecordDose

func (siw *ServerInterfaceWrapper) RecordDose(w http.ResponseWriter, r *http.Request)

RecordDose operation middleware

func (*ServerInterfaceWrapper) Register

func (siw *ServerInterfaceWrapper) Register(w http.ResponseWriter, r *http.Request)

Register operation middleware

func (*ServerInterfaceWrapper) SendTestNotification

func (siw *ServerInterfaceWrapper) SendTestNotification(w http.ResponseWriter, r *http.Request)

SendTestNotification operation middleware

func (*ServerInterfaceWrapper) SetDosage

func (siw *ServerInterfaceWrapper) SetDosage(w http.ResponseWriter, r *http.Request)

SetDosage operation middleware

func (*ServerInterfaceWrapper) SupportedNotificationMethods

func (siw *ServerInterfaceWrapper) SupportedNotificationMethods(w http.ResponseWriter, r *http.Request)

SupportedNotificationMethods operation middleware

func (*ServerInterfaceWrapper) UserNotificationPreferences

func (siw *ServerInterfaceWrapper) UserNotificationPreferences(w http.ResponseWriter, r *http.Request)

UserNotificationPreferences operation middleware

func (*ServerInterfaceWrapper) UserUpdateNotificationPreferences

func (siw *ServerInterfaceWrapper) UserUpdateNotificationPreferences(w http.ResponseWriter, r *http.Request)

UserUpdateNotificationPreferences operation middleware

func (*ServerInterfaceWrapper) WebPushInfo

func (siw *ServerInterfaceWrapper) WebPushInfo(w http.ResponseWriter, r *http.Request)

WebPushInfo operation middleware

type Session

type Session struct {
	// ID The session identifier
	ID int64 `json:"id"`

	// CreatedAt The time the session was created
	CreatedAt time.Time `json:"createdAt"`

	// LastUsed The last time the session was used
	LastUsed time.Time `json:"lastUsed"`

	// ExpiresAt The time the session expires, or null if it never expires
	ExpiresAt time.Time `json:"expiresAt,omitempty"`
}

Session A session for a user.

type SetDosage204Response

type SetDosage204Response struct {
}

func (SetDosage204Response) VisitSetDosageResponse

func (response SetDosage204Response) VisitSetDosageResponse(w http.ResponseWriter) error

type SetDosageJSONRequestBody

type SetDosageJSONRequestBody = Dosage

SetDosageJSONRequestBody defines body for SetDosage for application/json ContentType.

type SetDosageRequestObject

type SetDosageRequestObject struct {
	Body *SetDosageJSONRequestBody
}

type SetDosageResponseObject

type SetDosageResponseObject interface {
	VisitSetDosageResponse(w http.ResponseWriter) error
}

type SetDosagedefaultJSONResponse

type SetDosagedefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (SetDosagedefaultJSONResponse) VisitSetDosageResponse

func (response SetDosagedefaultJSONResponse) VisitSetDosageResponse(w http.ResponseWriter) error

type StdHTTPServerOptions

type StdHTTPServerOptions struct {
	BaseURL          string
	BaseRouter       ServeMux
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictServerInterface

type StrictServerInterface interface {
	// Authenticate a user and obtain a session
	// (POST /auth)
	Auth(ctx context.Context, request AuthRequestObject) (AuthResponseObject, error)
	// List all available delivery methods
	// (GET /delivery-methods)
	DeliveryMethods(ctx context.Context, request DeliveryMethodsRequestObject) (DeliveryMethodsResponseObject, error)
	// Clear the user's dosage schedule
	// (DELETE /dosage)
	ClearDosage(ctx context.Context, request ClearDosageRequestObject) (ClearDosageResponseObject, error)
	// Get the user's dosage and optionally their history
	// (GET /dosage)
	Dosage(ctx context.Context, request DosageRequestObject) (DosageResponseObject, error)
	// Set the user's dosage
	// (PUT /dosage)
	SetDosage(ctx context.Context, request SetDosageRequestObject) (SetDosageResponseObject, error)
	// Delete multiple dosages from the user's history
	// (DELETE /dosage/dose)
	ForgetDoses(ctx context.Context, request ForgetDosesRequestObject) (ForgetDosesResponseObject, error)
	// Record a new dosage to the user's history
	// (POST /dosage/dose)
	RecordDose(ctx context.Context, request RecordDoseRequestObject) (RecordDoseResponseObject, error)
	// Delete a dosage from the user's history
	// (DELETE /dosage/dose/{doseTime})
	ForgetDose(ctx context.Context, request ForgetDoseRequestObject) (ForgetDoseResponseObject, error)
	// Update a dosage in the user's history
	// (PUT /dosage/dose/{doseTime})
	EditDose(ctx context.Context, request EditDoseRequestObject) (EditDoseResponseObject, error)
	// Export the user's dosage history
	// (GET /dosage/export-doses)
	ExportDoses(ctx context.Context, request ExportDosesRequestObject) (ExportDosesResponseObject, error)
	// Import a CSV file of dosage history
	// (POST /dosage/import-doses)
	ImportDoses(ctx context.Context, request ImportDosesRequestObject) (ImportDosesResponseObject, error)
	// Get the current user
	// (GET /me)
	CurrentUser(ctx context.Context, request CurrentUserRequestObject) (CurrentUserResponseObject, error)
	// Delete one of the current user's sessions
	// (DELETE /me/sessions)
	DeleteUserSession(ctx context.Context, request DeleteUserSessionRequestObject) (DeleteUserSessionResponseObject, error)
	// List the current user's sessions
	// (GET /me/sessions)
	CurrentUserSessions(ctx context.Context, request CurrentUserSessionsRequestObject) (CurrentUserSessionsResponseObject, error)
	// Get the server's supported notification methods
	// (GET /notifications/methods)
	SupportedNotificationMethods(ctx context.Context, request SupportedNotificationMethodsRequestObject) (SupportedNotificationMethodsResponseObject, error)
	// Get the user's notification preferences
	// (GET /notifications/preferences)
	UserNotificationPreferences(ctx context.Context, request UserNotificationPreferencesRequestObject) (UserNotificationPreferencesResponseObject, error)
	// Update the user's notification preferences
	// (PUT /notifications/preferences)
	UserUpdateNotificationPreferences(ctx context.Context, request UserUpdateNotificationPreferencesRequestObject) (UserUpdateNotificationPreferencesResponseObject, error)
	// Send a test notification
	// (POST /notifications/test)
	SendTestNotification(ctx context.Context, request SendTestNotificationRequestObject) (SendTestNotificationResponseObject, error)
	// Get the server's push notification information
	// (GET /push-info)
	WebPushInfo(ctx context.Context, request WebPushInfoRequestObject) (WebPushInfoResponseObject, error)
	// Register a new account
	// (POST /register)
	Register(ctx context.Context, request RegisterRequestObject) (RegisterResponseObject, error)
}

StrictServerInterface represents all server handlers.

type SupportedNotificationMethods200JSONResponse

type SupportedNotificationMethods200JSONResponse NotificationMethodSupports

func (SupportedNotificationMethods200JSONResponse) VisitSupportedNotificationMethodsResponse

func (response SupportedNotificationMethods200JSONResponse) VisitSupportedNotificationMethodsResponse(w http.ResponseWriter) error

type SupportedNotificationMethodsRequestObject

type SupportedNotificationMethodsRequestObject struct {
}

type SupportedNotificationMethodsResponseObject

type SupportedNotificationMethodsResponseObject interface {
	VisitSupportedNotificationMethodsResponse(w http.ResponseWriter) error
}

type SupportedNotificationMethodsdefaultJSONResponse

type SupportedNotificationMethodsdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (SupportedNotificationMethodsdefaultJSONResponse) VisitSupportedNotificationMethodsResponse

func (response SupportedNotificationMethodsdefaultJSONResponse) VisitSupportedNotificationMethodsResponse(w http.ResponseWriter) error

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type User

type User struct {
	// Name The user's name
	Name string `json:"name"`

	// Locale A locale identifier.
	Locale Locale `json:"locale"`
}

User A user of the system.

type UserNotificationPreferences200JSONResponse

type UserNotificationPreferences200JSONResponse NotificationPreferences

func (UserNotificationPreferences200JSONResponse) VisitUserNotificationPreferencesResponse

func (response UserNotificationPreferences200JSONResponse) VisitUserNotificationPreferencesResponse(w http.ResponseWriter) error

type UserNotificationPreferencesRequestObject

type UserNotificationPreferencesRequestObject struct {
}

type UserNotificationPreferencesResponseObject

type UserNotificationPreferencesResponseObject interface {
	VisitUserNotificationPreferencesResponse(w http.ResponseWriter) error
}

type UserNotificationPreferencesdefaultJSONResponse

type UserNotificationPreferencesdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (UserNotificationPreferencesdefaultJSONResponse) VisitUserNotificationPreferencesResponse

func (response UserNotificationPreferencesdefaultJSONResponse) VisitUserNotificationPreferencesResponse(w http.ResponseWriter) error

type UserSecret

type UserSecret = user.Secret

UserSecret A secret and unique user identifier. This secret is generated once and never changes. It is used to both authenticate and identify a user, so it should be kept secret.

type UserUpdateNotificationPreferences204Response

type UserUpdateNotificationPreferences204Response struct {
}

func (UserUpdateNotificationPreferences204Response) VisitUserUpdateNotificationPreferencesResponse

func (response UserUpdateNotificationPreferences204Response) VisitUserUpdateNotificationPreferencesResponse(w http.ResponseWriter) error

type UserUpdateNotificationPreferencesJSONBody

type UserUpdateNotificationPreferencesJSONBody struct {
	// Current The current notification preferences. This is used to determine whether the notification method update is still valid.
	// This field is very much optional and is only used to guard against race conditions.
	// TODO: Implement this field.
	Current             *NotificationPreferences `json:"_current,omitempty"`
	CustomNotifications CustomNotifications      `json:"customNotifications,omitempty"`
	NotificationConfigs struct {
		Email   *[]EmailSubscription `json:"email,omitempty"`
		WebPush *[]PushSubscription  `json:"webPush,omitempty"`
	} `json:"notificationConfigs"`
}

UserUpdateNotificationPreferencesJSONBody defines parameters for UserUpdateNotificationPreferences.

type UserUpdateNotificationPreferencesJSONRequestBody

type UserUpdateNotificationPreferencesJSONRequestBody UserUpdateNotificationPreferencesJSONBody

UserUpdateNotificationPreferencesJSONRequestBody defines body for UserUpdateNotificationPreferences for application/json ContentType.

type UserUpdateNotificationPreferencesRequestObject

type UserUpdateNotificationPreferencesRequestObject struct {
	Body *UserUpdateNotificationPreferencesJSONRequestBody
}

type UserUpdateNotificationPreferencesResponseObject

type UserUpdateNotificationPreferencesResponseObject interface {
	VisitUserUpdateNotificationPreferencesResponse(w http.ResponseWriter) error
}

type UserUpdateNotificationPreferencesdefaultJSONResponse

type UserUpdateNotificationPreferencesdefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (UserUpdateNotificationPreferencesdefaultJSONResponse) VisitUserUpdateNotificationPreferencesResponse

func (response UserUpdateNotificationPreferencesdefaultJSONResponse) VisitUserUpdateNotificationPreferencesResponse(w http.ResponseWriter) error

type WebPushInfo200JSONResponse

type WebPushInfo200JSONResponse PushInfo

func (WebPushInfo200JSONResponse) VisitWebPushInfoResponse

func (response WebPushInfo200JSONResponse) VisitWebPushInfoResponse(w http.ResponseWriter) error

type WebPushInfoRequestObject

type WebPushInfoRequestObject struct {
}

type WebPushInfoResponseObject

type WebPushInfoResponseObject interface {
	VisitWebPushInfoResponse(w http.ResponseWriter) error
}

type WebPushInfodefaultJSONResponse

type WebPushInfodefaultJSONResponse struct {
	Body       Error
	StatusCode int
}

func (WebPushInfodefaultJSONResponse) VisitWebPushInfoResponse

func (response WebPushInfodefaultJSONResponse) VisitWebPushInfoResponse(w http.ResponseWriter) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL