oapi

package
v0.0.0-...-941c140 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 6 Imported by: 0

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

View Source
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 HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

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

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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

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 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

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 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

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

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.

Jump to

Keyboard shortcuts

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