Documentation
¶
Overview ¶
Package oapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Package oapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- Constants
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type ChiServerOptions
- type InvalidParamFormatError
- type ListRecentNotificationsParams
- type MarkNotificationsReadJSONBody
- type MarkNotificationsReadJSONRequestBody
- type MiddlewareFunc
- type Notification
- type NotificationRule
- type NotificationRuleChannel
- type NotificationRuleInput
- type NotificationRuleInputChannel
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteNotification(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetUnreadCount(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListNotificationRules(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListRecentNotifications(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) MarkNotificationsRead(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpsertNotificationRule(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) DeleteNotification(w http.ResponseWriter, r *http.Request, id string)
- func (_ Unimplemented) GetUnreadCount(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListNotificationRules(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListRecentNotifications(w http.ResponseWriter, r *http.Request, params ListRecentNotificationsParams)
- func (_ Unimplemented) MarkNotificationsRead(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) UpsertNotificationRule(w http.ResponseWriter, r *http.Request)
- type UnmarshalingParamError
- type UpsertNotificationRuleJSONRequestBody
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListRecentNotificationsParams ¶
type ListRecentNotificationsParams struct {
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
}
ListRecentNotificationsParams defines parameters for ListRecentNotifications.
type MarkNotificationsReadJSONBody ¶
type MarkNotificationsReadJSONBody struct {
LastId string `json:"lastId"`
}
MarkNotificationsReadJSONBody defines parameters for MarkNotificationsRead.
type MarkNotificationsReadJSONRequestBody ¶
type MarkNotificationsReadJSONRequestBody MarkNotificationsReadJSONBody
MarkNotificationsReadJSONRequestBody defines body for MarkNotificationsRead for application/json ContentType.
type Notification ¶
type Notification struct {
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
Message string `json:"message"`
Title string `json:"title"`
Type string `json:"type"`
}
Notification defines model for Notification.
type NotificationRule ¶
type NotificationRule struct {
Channel NotificationRuleChannel `json:"channel"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
Enabled bool `json:"enabled"`
EventType string `json:"eventType"`
Id string `json:"id"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
NotificationRule defines model for NotificationRule.
type NotificationRuleChannel ¶
type NotificationRuleChannel string
NotificationRuleChannel defines model for NotificationRule.Channel.
const ( NotificationRuleChannelEmail NotificationRuleChannel = "email" NotificationRuleChannelInapp NotificationRuleChannel = "inapp" NotificationRuleChannelWebhook NotificationRuleChannel = "webhook" )
Defines values for NotificationRuleChannel.
type NotificationRuleInput ¶
type NotificationRuleInput struct {
Channel NotificationRuleInputChannel `json:"channel"`
Enabled bool `json:"enabled"`
EventType string `json:"eventType"`
}
NotificationRuleInput defines model for NotificationRuleInput.
type NotificationRuleInputChannel ¶
type NotificationRuleInputChannel string
NotificationRuleInputChannel defines model for NotificationRuleInput.Channel.
const ( NotificationRuleInputChannelEmail NotificationRuleInputChannel = "email" NotificationRuleInputChannelInapp NotificationRuleInputChannel = "inapp" NotificationRuleInputChannelWebhook NotificationRuleInputChannel = "webhook" )
Defines values for NotificationRuleInputChannel.
type RequiredHeaderError ¶
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 ServerInterface ¶
type ServerInterface interface {
// Mark notifications as read up to lastId (inclusive)
// (POST /api/v1/notifications/read)
MarkNotificationsRead(w http.ResponseWriter, r *http.Request)
// List recent notifications (last 30 days)
// (GET /api/v1/notifications/recent)
ListRecentNotifications(w http.ResponseWriter, r *http.Request, params ListRecentNotificationsParams)
// List notification rules for current user
// (GET /api/v1/notifications/rules)
ListNotificationRules(w http.ResponseWriter, r *http.Request)
// Create or update a notification rule
// (POST /api/v1/notifications/rules)
UpsertNotificationRule(w http.ResponseWriter, r *http.Request)
// Get the number of unread notifications
// (GET /api/v1/notifications/unread-count)
GetUnreadCount(w http.ResponseWriter, r *http.Request)
// Delete a notification by id (SQL read model only)
// (DELETE /api/v1/notifications/{id})
DeleteNotification(w http.ResponseWriter, r *http.Request, id string)
}
ServerInterface represents all server handlers.
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) DeleteNotification ¶
func (siw *ServerInterfaceWrapper) DeleteNotification(w http.ResponseWriter, r *http.Request)
DeleteNotification operation middleware
func (*ServerInterfaceWrapper) GetUnreadCount ¶
func (siw *ServerInterfaceWrapper) GetUnreadCount(w http.ResponseWriter, r *http.Request)
GetUnreadCount operation middleware
func (*ServerInterfaceWrapper) ListNotificationRules ¶
func (siw *ServerInterfaceWrapper) ListNotificationRules(w http.ResponseWriter, r *http.Request)
ListNotificationRules operation middleware
func (*ServerInterfaceWrapper) ListRecentNotifications ¶
func (siw *ServerInterfaceWrapper) ListRecentNotifications(w http.ResponseWriter, r *http.Request)
ListRecentNotifications operation middleware
func (*ServerInterfaceWrapper) MarkNotificationsRead ¶
func (siw *ServerInterfaceWrapper) MarkNotificationsRead(w http.ResponseWriter, r *http.Request)
MarkNotificationsRead operation middleware
func (*ServerInterfaceWrapper) UpsertNotificationRule ¶
func (siw *ServerInterfaceWrapper) UpsertNotificationRule(w http.ResponseWriter, r *http.Request)
UpsertNotificationRule operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) DeleteNotification ¶
func (_ Unimplemented) DeleteNotification(w http.ResponseWriter, r *http.Request, id string)
Delete a notification by id (SQL read model only) (DELETE /api/v1/notifications/{id})
func (Unimplemented) GetUnreadCount ¶
func (_ Unimplemented) GetUnreadCount(w http.ResponseWriter, r *http.Request)
Get the number of unread notifications (GET /api/v1/notifications/unread-count)
func (Unimplemented) ListNotificationRules ¶
func (_ Unimplemented) ListNotificationRules(w http.ResponseWriter, r *http.Request)
List notification rules for current user (GET /api/v1/notifications/rules)
func (Unimplemented) ListRecentNotifications ¶
func (_ Unimplemented) ListRecentNotifications(w http.ResponseWriter, r *http.Request, params ListRecentNotificationsParams)
List recent notifications (last 30 days) (GET /api/v1/notifications/recent)
func (Unimplemented) MarkNotificationsRead ¶
func (_ Unimplemented) MarkNotificationsRead(w http.ResponseWriter, r *http.Request)
Mark notifications as read up to lastId (inclusive) (POST /api/v1/notifications/read)
func (Unimplemented) UpsertNotificationRule ¶
func (_ Unimplemented) UpsertNotificationRule(w http.ResponseWriter, r *http.Request)
Create or update a notification rule (POST /api/v1/notifications/rules)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpsertNotificationRuleJSONRequestBody ¶
type UpsertNotificationRuleJSONRequestBody = NotificationRuleInput
UpsertNotificationRuleJSONRequestBody defines body for UpsertNotificationRule for application/json ContentType.