openapi

package
v0.0.0-...-92e2f29 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

This section is empty.

Variables

View Source
var GptClient *oapi.Client

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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 GptToken

func GptToken() (token string)

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type Message

type Message struct {
	Message string `json:"message"`
}

Message defines model for Message.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type ScottyChatInput

type ScottyChatInput struct {
	Message string  `json:"message"`
	Stream  *bool   `json:"stream,omitempty"`
	User    *string `json:"user,omitempty"`
}

ScottyChatInput defines model for ScottyChatInput.

type ScottyChatJSONRequestBody

type ScottyChatJSONRequestBody = ScottyChatInput

ScottyChatJSONRequestBody defines body for ScottyChat for application/json ContentType.

type ScottyChatOutput

type ScottyChatOutput struct {
	Messages []Message `json:"messages"`
}

ScottyChatOutput defines model for ScottyChatOutput.

type ServerInterface

type ServerInterface interface {

	// (POST /scotty/v1/chat)
	ScottyChat(c *gin.Context)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) ScottyChat

func (siw *ServerInterfaceWrapper) ScottyChat(c *gin.Context)

ScottyChat operation middleware

Jump to

Keyboard shortcuts

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