api

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2019 DeepMap, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package api provides primitives to interact the openapi HTTP API.

This is an autogenerated file, any edits which you make here will be lost!

Package api provides primitives to interact the openapi HTTP API.

This is an autogenerated file, any edits which you make here will be lost!

Package api provides primitives to interact the openapi HTTP API.

This is an autogenerated file, any edits which you make here will be lost!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (*openapi3.Swagger, error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file.

func NewAddPetRequest

func NewAddPetRequest(server string, body NewPet) (*http.Request, error)

NewAddPetRequest generates requests for AddPet with JSON body

func NewAddPetRequestWithBody

func NewAddPetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewAddPetRequestWithBody generates requests for AddPet with non-JSON body

func NewDeletePetRequest

func NewDeletePetRequest(server string, id int64) (*http.Request, error)

NewDeletePetRequest generates requests for DeletePet

func NewFindPetByIdRequest

func NewFindPetByIdRequest(server string, id int64) (*http.Request, error)

NewFindPetByIdRequest generates requests for FindPetById

func NewFindPetsRequest

func NewFindPetsRequest(server string, params *FindPetsParams) (*http.Request, error)

NewFindPetsRequest generates requests for FindPets

func RegisterHandlers

func RegisterHandlers(router runtime.EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example.
	Server string

	// HTTP client with any customized settings, such as certificate chains.
	Client http.Client

	// A callback for modifying requests which are generated before sending over
	// the network.
	RequestEditor func(req *http.Request, ctx context.Context) error
}

Client which conforms to the OpenAPI3 specification for this service.

func (*Client) AddPet

func (c *Client) AddPet(ctx context.Context, body NewPet) (*http.Response, error)

AddPet request with JSON body

func (*Client) DeletePet

func (c *Client) DeletePet(ctx context.Context, id int64) (*http.Response, error)

DeletePet request

func (*Client) FindPetById

func (c *Client) FindPetById(ctx context.Context, id int64) (*http.Response, error)

FindPetById request

func (*Client) FindPets

func (c *Client) FindPets(ctx context.Context, params *FindPetsParams) (*http.Response, error)

FindPets request

type ClientInterface added in v1.1.5

type ClientInterface interface {

	// FindPets request
	FindPets(ctx context.Context, params *FindPetsParams) (*http.Response, error)

	// AddPet request with JSON body
	AddPet(ctx context.Context, body NewPet) (*http.Response, error)

	// DeletePet request
	DeletePet(ctx context.Context, id int64) (*http.Response, error)

	// FindPetById request
	FindPetById(ctx context.Context, id int64) (*http.Response, error)
}

The interface specification for the client above.

type Error

type Error struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

Error defines component schema for Error.

type FindPetsParams

type FindPetsParams struct {
	Tags  *[]string `json:"tags,omitempty"`
	Limit *int32    `json:"limit,omitempty"`
}

FindPetsParams defines parameters for FindPets.

type NewPet

type NewPet struct {
	Name string  `json:"name"`
	Tag  *string `json:"tag,omitempty"`
}

NewPet defines component schema for NewPet.

type Pet

type Pet struct {
	// Embedded struct due to allOf(#/components/schemas/NewPet)
	NewPet
	// Embedded fields due to inline allOf schema
	Id int64 `json:"id"`
}

Pet defines component schema for Pet.

type ServerInterface

type ServerInterface interface {
	//  (GET /pets)
	FindPets(ctx echo.Context, params FindPetsParams) error
	//  (POST /pets)
	AddPet(ctx echo.Context) error
	//  (DELETE /pets/{id})
	DeletePet(ctx echo.Context, id int64) error
	//  (GET /pets/{id})
	FindPetById(ctx echo.Context, id int64) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) AddPet

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

AddPet converts echo context to params.

func (*ServerInterfaceWrapper) DeletePet

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

DeletePet converts echo context to params.

func (*ServerInterfaceWrapper) FindPetById

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

FindPetById converts echo context to params.

func (*ServerInterfaceWrapper) FindPets

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

FindPets converts echo context to params.

Jump to

Keyboard shortcuts

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