rest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

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

Code generated by unknown module path version unknown version DO NOT EDIT.

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

Code generated by unknown module path version unknown version DO NOT EDIT.

Index

Constants

View Source
const (
	BasicAuthScopes = "basicAuth.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 AddInputJSONBody

type AddInputJSONBody AddInputReqBody

AddInputJSONBody defines parameters for AddInput.

type AddInputJSONRequestBody

type AddInputJSONRequestBody AddInputJSONBody

AddInputJSONRequestBody defines body for AddInput for application/json ContentType.

type AddInputReqBody

type AddInputReqBody struct {
	ChatId      int64  `json:"chatId"`
	Description string `json:"description"`
	InputType   string `json:"inputType"`
	Name        string `json:"name"`
	UserId      int64  `json:"userId"`
}

AddInputReqBody defines model for AddInputReqBody.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL     string
	BaseRouter  chi.Router
	Middlewares []MiddlewareFunc
}

type ErrorResp

type ErrorResp struct {
	HttpStatus int     `json:"http_status"`
	Message    *string `json:"message,omitempty"`
	Name       string  `json:"name"`
}

ErrorResp defines model for ErrorResp.

type HttpServer

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

func NewHttpServer

func NewHttpServer(app app.App) HttpServer

func (HttpServer) AddInput

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

(POST /addInput)

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type ServerInterface

type ServerInterface interface {

	// (POST /addInput)
	AddInput(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AddInput

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

AddInput operation middleware

type SuccessResp

type SuccessResp struct {
	Success bool `json:"success"`
}

SuccessResp defines model for SuccessResp.

Jump to

Keyboard shortcuts

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