Documentation ¶
Overview ¶
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.2 DO NOT EDIT.
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.2 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- 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
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type Error
- type HttpServer
- func (h HttpServer) SendNotification(w http.ResponseWriter, r *http.Request)
- func (h HttpServer) SubscribeNotification(w http.ResponseWriter, r *http.Request)
- func (h HttpServer) SubscriberStats(w http.ResponseWriter, r *http.Request)
- func (h HttpServer) SubscriberStatus(w http.ResponseWriter, r *http.Request)
- func (h HttpServer) UnsubscribeNotification(w http.ResponseWriter, r *http.Request)
- type InvalidParamFormatError
- type Message
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type SendNotificationJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) SendNotification(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SubscribeNotification(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SubscriberStats(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SubscriberStatus(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UnsubscribeNotification(w http.ResponseWriter, r *http.Request)
- type Stats
- type Status
- type SubscribeNotificationJSONRequestBody
- type Subscriber
- type SubscriberStatusJSONRequestBody
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
- type UnsubscribeNotificationJSONRequestBody
Constants ¶
const (
ApiKeyAuthScopes = "ApiKeyAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
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, 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 HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(application app.Application) HttpServer
func (HttpServer) SendNotification ¶
func (h HttpServer) SendNotification(w http.ResponseWriter, r *http.Request)
func (HttpServer) SubscribeNotification ¶
func (h HttpServer) SubscribeNotification(w http.ResponseWriter, r *http.Request)
func (HttpServer) SubscriberStats ¶
func (h HttpServer) SubscriberStats(w http.ResponseWriter, r *http.Request)
func (HttpServer) SubscriberStatus ¶
func (h HttpServer) SubscriberStatus(w http.ResponseWriter, r *http.Request)
func (HttpServer) UnsubscribeNotification ¶
func (h HttpServer) UnsubscribeNotification(w http.ResponseWriter, r *http.Request)
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Message ¶
type Message struct { // Message Notification message Message string `json:"message"` // Title Notification title Title string `json:"title"` }
Message defines model for Message.
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 SendNotificationJSONRequestBody ¶
type SendNotificationJSONRequestBody = Message
SendNotificationJSONRequestBody defines body for SendNotification for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface { // Send notification to all subscriber // (POST /notification/send) SendNotification(w http.ResponseWriter, r *http.Request) // Subscriber Stats // (GET /notification/stats) SubscriberStats(w http.ResponseWriter, r *http.Request) // Subscriber Status // (POST /notification/status) SubscriberStatus(w http.ResponseWriter, r *http.Request) // Subscribe to notification // (POST /notification/subscribe) SubscribeNotification(w http.ResponseWriter, r *http.Request) // Unsubscribe to notification // (POST /notification/unsubscribe) UnsubscribeNotification(w http.ResponseWriter, r *http.Request) }
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) SendNotification ¶
func (siw *ServerInterfaceWrapper) SendNotification(w http.ResponseWriter, r *http.Request)
SendNotification operation middleware
func (*ServerInterfaceWrapper) SubscribeNotification ¶
func (siw *ServerInterfaceWrapper) SubscribeNotification(w http.ResponseWriter, r *http.Request)
SubscribeNotification operation middleware
func (*ServerInterfaceWrapper) SubscriberStats ¶
func (siw *ServerInterfaceWrapper) SubscriberStats(w http.ResponseWriter, r *http.Request)
SubscriberStats operation middleware
func (*ServerInterfaceWrapper) SubscriberStatus ¶
func (siw *ServerInterfaceWrapper) SubscriberStatus(w http.ResponseWriter, r *http.Request)
SubscriberStatus operation middleware
func (*ServerInterfaceWrapper) UnsubscribeNotification ¶
func (siw *ServerInterfaceWrapper) UnsubscribeNotification(w http.ResponseWriter, r *http.Request)
UnsubscribeNotification operation middleware
type Stats ¶
type Stats struct { // TotalActiveSubs Totala active subscribers TotalActiveSubs int `json:"totalActiveSubs"` // TotalInactiveSubs Total inactive subscribers TotalInactiveSubs int `json:"totalInactiveSubs"` // TotalSubs Total subscribers TotalSubs int `json:"totalSubs"` }
Stats defines model for Stats.
type Status ¶
type Status struct { // IsActive Subscriber status IsActive bool `json:"isActive"` // UpdatedAt Last updated date UpdatedAt int64 `json:"updatedAt"` }
Status defines model for Status.
type SubscribeNotificationJSONRequestBody ¶
type SubscribeNotificationJSONRequestBody = Subscriber
SubscribeNotificationJSONRequestBody defines body for SubscribeNotification for application/json ContentType.
type Subscriber ¶
type Subscriber struct { // TokenID Client Token TokenID string `json:"tokenID"` // UpdatedAt Last updated date UpdatedAt int64 `json:"updatedAt"` }
Subscriber defines model for Subscriber.
type SubscriberStatusJSONRequestBody ¶
type SubscriberStatusJSONRequestBody = Subscriber
SubscriberStatusJSONRequestBody defines body for SubscriberStatus for application/json ContentType.
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 UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error
type UnsubscribeNotificationJSONRequestBody ¶
type UnsubscribeNotificationJSONRequestBody = Subscriber
UnsubscribeNotificationJSONRequestBody defines body for UnsubscribeNotification for application/json ContentType.