openapi

package
v0.0.0-...-ae451d1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 10 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.9.1 DO NOT EDIT.

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

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

Index

Constants

View Source
const (
	BasicAuthScopes = "BasicAuth.Scopes"
)

Variables

This section is empty.

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 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 EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type CreateMeetupJSONBody

type CreateMeetupJSONBody Meetup

CreateMeetupJSONBody defines parameters for CreateMeetup.

type CreateMeetupJSONRequestBody

type CreateMeetupJSONRequestBody CreateMeetupJSONBody

CreateMeetupJSONRequestBody defines body for CreateMeetup for application/json ContentType.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type Error

type Error struct {
	// Error code
	Code int32 `json:"Code"`

	// Error message
	Message string `json:"Message"`
}

Error defines model for Error.

type ErrorResponse

type ErrorResponse struct {
	Error Error `json:"Error"`
}

ErrorResponse defines model for ErrorResponse.

type Meetup

type Meetup struct {
	AttendeeList []string `json:"AttendeeList"`

	// username of organiser.
	Organiser string `json:"Organiser"`

	// Meetup Date and Time
	PlannedDateTime time.Time `json:"PlannedDateTime"`

	// Meetup Reminder Date and Time
	RemindDateTime *time.Time `json:"RemindDateTime,omitempty"`
}

Meetup defines model for Meetup.

type MeetupResponse

type MeetupResponse struct {
	Meetup Meetup `json:"Meetup"`

	// Unique ID of the created meetup
	MeetupID string `json:"MeetupID"`
}

MeetupResponse defines model for MeetupResponse.

type ServerInterface

type ServerInterface interface {
	// deletes a meetup
	// (DELETE /meetup)
	DeleteMeetup(ctx echo.Context) error
	// Creates a meetup
	// (PUT /meetup)
	CreateMeetup(ctx echo.Context) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateMeetup

func (w *ServerInterfaceWrapper) CreateMeetup(ctx echo.Context) error

CreateMeetup converts echo context to params.

func (*ServerInterfaceWrapper) DeleteMeetup

func (w *ServerInterfaceWrapper) DeleteMeetup(ctx echo.Context) error

DeleteMeetup converts echo context to params.

Jump to

Keyboard shortcuts

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