codegen

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package codegen 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

View Source
const (
	Access_tokenScopes = "access_token.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 BadResponse

type BadResponse = BaseResponse

BadResponse defines model for BadResponse.

type BaseResponse

type BaseResponse struct {
	// Message Error message
	Message *string `json:"message,omitempty"`
}

BaseResponse defines model for BaseResponse.

type DeleteEventOK

type DeleteEventOK = Event

DeleteEventOK defines model for DeleteEventOK.

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 Event

type Event struct {
	// EventUuid UUID of the event
	EventUuid *openapi_types.UUID `json:"event_uuid,omitempty"`

	// Name event name
	Name string `json:"name"`

	// Properties event properties
	Properties []Property `json:"properties"`

	// SourceID associated source id
	SourceID string `json:"sourceID"`

	// Timestamp timestamp this event took place
	Timestamp *time.Time `json:"timestamp,omitempty"`
}

Event defines model for Event.

type EventUuid

type EventUuid = openapi_types.UUID

EventUuid defines model for event_uuid.

type GetEventsParams

type GetEventsParams struct {
	// Form Form of the events to get
	Form *time.Time `form:"form,omitempty" json:"form,omitempty"`
}

GetEventsParams defines parameters for GetEvents.

type OKResponse

type OKResponse = BaseResponse

OKResponse defines model for OKResponse.

type Property

type Property struct {
	// Name Name of the property
	Name *string `json:"name,omitempty"`

	// Value Value of the property
	Value *string `json:"value,omitempty"`
}

Property defines model for Property.

type ResponseNotFound

type ResponseNotFound = BaseResponse

ResponseNotFound defines model for ResponseNotFound.

type Serial

type Serial = string

Serial defines model for serial.

type ServerInterface

type ServerInterface interface {
	// Delete an event
	// (DELETE /event/local_storage/{serial})
	DeleteEventBySerial(ctx echo.Context, serial Serial) error
	// Delete an event
	// (DELETE /event/{event_uuid})
	DeleteEvent(ctx echo.Context, eventUuid EventUuid) error
	// Get all events
	// (GET /events)
	GetEvents(ctx echo.Context, params GetEventsParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) DeleteEvent

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

DeleteEvent converts echo context to params.

func (*ServerInterfaceWrapper) DeleteEventBySerial

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

DeleteEventBySerial converts echo context to params.

func (*ServerInterfaceWrapper) GetEvents

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

GetEvents converts echo context to params.

Jump to

Keyboard shortcuts

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