api

package
v0.0.0-...-d328d9e Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

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

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

Index

Constants

This section is empty.

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 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 PathToRawSpec

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

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

Types

type ChiServerOptions

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

type FetchTreatmentBadRequest

type FetchTreatmentBadRequest externalRef0.Error

FetchTreatmentBadRequest defines model for FetchTreatmentBadRequest.

type FetchTreatmentJSONRequestBody

type FetchTreatmentJSONRequestBody FetchTreatmentRequestBody

FetchTreatmentJSONRequestBody defines body for FetchTreatment for application/json ContentType.

type FetchTreatmentParams

type FetchTreatmentParams struct {
	PassKey string `json:"pass-key"`
}

FetchTreatmentParams defines parameters for FetchTreatment.

type FetchTreatmentRequestBody

type FetchTreatmentRequestBody struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

FetchTreatmentRequestBody defines model for FetchTreatmentRequestBody.

func (FetchTreatmentRequestBody) Get

func (a FetchTreatmentRequestBody) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for FetchTreatmentRequestBody. Returns the specified element and whether it was found

func (FetchTreatmentRequestBody) MarshalJSON

func (a FetchTreatmentRequestBody) MarshalJSON() ([]byte, error)

Override default JSON handling for FetchTreatmentRequestBody to handle AdditionalProperties

func (*FetchTreatmentRequestBody) Set

func (a *FetchTreatmentRequestBody) Set(fieldName string, value interface{})

Setter for additional properties for FetchTreatmentRequestBody

func (*FetchTreatmentRequestBody) UnmarshalJSON

func (a *FetchTreatmentRequestBody) UnmarshalJSON(b []byte) error

Override default JSON handling for FetchTreatmentRequestBody to handle AdditionalProperties

type FetchTreatmentSuccess

type FetchTreatmentSuccess struct {
	Data *externalRef0.SelectedTreatment `json:"data,omitempty"`
}

FetchTreatmentSuccess defines model for FetchTreatmentSuccess.

type InternalServerError

type InternalServerError externalRef0.Error

InternalServerError defines model for InternalServerError.

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type ServerInterface

type ServerInterface interface {
	// Fetch treatment for the given request parameters and project
	// (POST /projects/{project_id}/fetch-treatment)
	FetchTreatment(w http.ResponseWriter, r *http.Request, projectId int64, params FetchTreatmentParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) FetchTreatment

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

FetchTreatment operation middleware

Jump to

Keyboard shortcuts

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