port

package
v0.0.0-...-23b2a61 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

This section is empty.

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

func LogBody

func LogBody(upd tgbotapi.Update)

AK TODO TEMP to get raw result

Types

type ChiServerOptions

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

type Error

type Error struct {
	Message string `json:"message"`
	Slug    string `json:"slug"`
}

Error defines model for Error.

type HandleTelegramMessageJSONBody

type HandleTelegramMessageJSONBody = map[string]interface{}

HandleTelegramMessageJSONBody defines parameters for HandleTelegramMessage.

type HandleTelegramMessageJSONRequestBody

type HandleTelegramMessageJSONRequestBody = HandleTelegramMessageJSONBody

HandleTelegramMessageJSONRequestBody defines body for HandleTelegramMessage for application/json ContentType.

type HandleVideoSaveFailedMessageJSONRequestBody

type HandleVideoSaveFailedMessageJSONRequestBody = PubSubMessage

HandleVideoSaveFailedMessageJSONRequestBody defines body for HandleVideoSaveFailedMessage for application/json ContentType.

type HandleVideoSavedMessageJSONRequestBody

type HandleVideoSavedMessageJSONRequestBody = PubSubMessage

HandleVideoSavedMessageJSONRequestBody defines body for HandleVideoSavedMessage for application/json ContentType.

type HttpServer

type HttpServer struct {
	// contains filtered or unexported fields
}

implements interface generated by openapi spec

func NewHttpServer

func NewHttpServer(app app.Application) HttpServer

func (HttpServer) HandleTelegramMessage

func (h HttpServer) HandleTelegramMessage(w http.ResponseWriter, r *http.Request)

func (HttpServer) HandleVideoSaveFailedMessage

func (h HttpServer) HandleVideoSaveFailedMessage(w http.ResponseWriter, r *http.Request)

func (HttpServer) HandleVideoSavedMessage

func (h HttpServer) HandleVideoSavedMessage(w http.ResponseWriter, r *http.Request)

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PubSubMessage

type PubSubMessage struct {
	Message struct {
		Data        string    `json:"data"`
		MessageId   string    `json:"message_id"`
		PublishTime time.Time `json:"publish_time"`
	} `json:"message"`
}

PubSubMessage defines model for PubSubMessage.

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 {

	// (POST /pubsub/subscriptions/video-save-failed)
	HandleVideoSaveFailedMessage(w http.ResponseWriter, r *http.Request)

	// (POST /pubsub/subscriptions/video-saved)
	HandleVideoSavedMessage(w http.ResponseWriter, r *http.Request)

	// (POST /telegram/callback)
	HandleTelegramMessage(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) HandleTelegramMessage

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

HandleTelegramMessage operation middleware

func (*ServerInterfaceWrapper) HandleVideoSaveFailedMessage

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

HandleVideoSaveFailedMessage operation middleware

func (*ServerInterfaceWrapper) HandleVideoSavedMessage

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

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

type UnmarshallingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshallingParamError) Error

func (e *UnmarshallingParamError) Error() string

func (*UnmarshallingParamError) Unwrap

func (e *UnmarshallingParamError) Unwrap() error

type VideoSavedMessage

type VideoSavedMessage struct {
	SavedVideoAddr string `json:"saved_video_addr"`
	OriginalUrl    string `json:"original_url"`
}

Jump to

Keyboard shortcuts

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