api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: BSD-3-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen/v2 version 2.1.0 DO NOT EDIT.

Index

Constants

View Source
const (
	Api_keyScopes       = "api_key.Scopes"
	Petstore_authScopes = "petstore_auth.Scopes"
)

Variables

This section is empty.

Functions

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

Types

type AddPetFormdataRequestBody

type AddPetFormdataRequestBody = Pet

AddPetFormdataRequestBody defines body for AddPet for application/x-www-form-urlencoded ContentType.

type AddPetJSONRequestBody

type AddPetJSONRequestBody = Pet

AddPetJSONRequestBody defines body for AddPet for application/json ContentType.

type ApiResponse

type ApiResponse struct {
	Code    *int32  `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
	Type    *string `json:"type,omitempty"`
}

ApiResponse defines model for ApiResponse.

type Category

type Category struct {
	Id   *int64  `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

Category defines model for Category.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CreateUserFormdataRequestBody

type CreateUserFormdataRequestBody = User

CreateUserFormdataRequestBody defines body for CreateUser for application/x-www-form-urlencoded ContentType.

type CreateUserJSONRequestBody

type CreateUserJSONRequestBody = User

CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.

type CreateUsersWithListInputJSONBody

type CreateUsersWithListInputJSONBody = []User

CreateUsersWithListInputJSONBody defines parameters for CreateUsersWithListInput.

type CreateUsersWithListInputJSONRequestBody

type CreateUsersWithListInputJSONRequestBody = CreateUsersWithListInputJSONBody

CreateUsersWithListInputJSONRequestBody defines body for CreateUsersWithListInput for application/json ContentType.

type DeletePetParams

type DeletePetParams struct {
	ApiKey *string `json:"api_key,omitempty"`
}

DeletePetParams defines parameters for DeletePet.

type FindPetsByStatusParams

type FindPetsByStatusParams struct {
	// Status Status values that need to be considered for filter
	Status *FindPetsByStatusParamsStatus `form:"status,omitempty" json:"status,omitempty"`
}

FindPetsByStatusParams defines parameters for FindPetsByStatus.

type FindPetsByStatusParamsStatus

type FindPetsByStatusParamsStatus string

FindPetsByStatusParamsStatus defines parameters for FindPetsByStatus.

const (
	FindPetsByStatusParamsStatusAvailable FindPetsByStatusParamsStatus = "available"
	FindPetsByStatusParamsStatusPending   FindPetsByStatusParamsStatus = "pending"
	FindPetsByStatusParamsStatusSold      FindPetsByStatusParamsStatus = "sold"
)

Defines values for FindPetsByStatusParamsStatus.

type FindPetsByTagsParams

type FindPetsByTagsParams struct {
	// Tags Tags to filter by
	Tags *[]string `form:"tags,omitempty" json:"tags,omitempty"`
}

FindPetsByTagsParams defines parameters for FindPetsByTags.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type LoginUserParams

type LoginUserParams struct {
	// Username The user name for login
	Username *string `form:"username,omitempty" json:"username,omitempty"`

	// Password The password for login in clear text
	Password *string `form:"password,omitempty" json:"password,omitempty"`
}

LoginUserParams defines parameters for LoginUser.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type Order

type Order struct {
	Complete *bool      `json:"complete,omitempty"`
	Id       *int64     `json:"id,omitempty"`
	PetId    *int64     `json:"petId,omitempty"`
	Quantity *int32     `json:"quantity,omitempty"`
	ShipDate *time.Time `json:"shipDate,omitempty"`

	// Status Order Status
	Status *OrderStatus `json:"status,omitempty"`
}

Order defines model for Order.

type OrderStatus

type OrderStatus string

OrderStatus Order Status

const (
	Approved  OrderStatus = "approved"
	Delivered OrderStatus = "delivered"
	Placed    OrderStatus = "placed"
)

Defines values for OrderStatus.

type Pet

type Pet struct {
	Category  *Category `json:"category,omitempty"`
	Id        *int64    `json:"id,omitempty"`
	Name      string    `json:"name"`
	PhotoUrls []string  `json:"photoUrls"`

	// Status pet status in the store
	Status *PetStatus `json:"status,omitempty"`
	Tags   *[]Tag     `json:"tags,omitempty"`
}

Pet defines model for Pet.

type PetStatus

type PetStatus string

PetStatus pet status in the store

const (
	PetStatusAvailable PetStatus = "available"
	PetStatusPending   PetStatus = "pending"
	PetStatusSold      PetStatus = "sold"
)

Defines values for PetStatus.

type PlaceOrderFormdataRequestBody

type PlaceOrderFormdataRequestBody = Order

PlaceOrderFormdataRequestBody defines body for PlaceOrder for application/x-www-form-urlencoded ContentType.

type PlaceOrderJSONRequestBody

type PlaceOrderJSONRequestBody = Order

PlaceOrderJSONRequestBody defines body for PlaceOrder for application/json ContentType.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {
	// Add a new pet to the store
	// (POST /pet)
	AddPet(w http.ResponseWriter, r *http.Request)
	// Update an existing pet
	// (PUT /pet)
	UpdatePet(w http.ResponseWriter, r *http.Request)
	// Finds Pets by status
	// (GET /pet/findByStatus)
	FindPetsByStatus(w http.ResponseWriter, r *http.Request, params FindPetsByStatusParams)
	// Finds Pets by tags
	// (GET /pet/findByTags)
	FindPetsByTags(w http.ResponseWriter, r *http.Request, params FindPetsByTagsParams)
	// Deletes a pet
	// (DELETE /pet/{petId})
	DeletePet(w http.ResponseWriter, r *http.Request, petId int64, params DeletePetParams)
	// Find pet by ID
	// (GET /pet/{petId})
	GetPetById(w http.ResponseWriter, r *http.Request, petId int64)
	// Updates a pet in the store with form data
	// (POST /pet/{petId})
	UpdatePetWithForm(w http.ResponseWriter, r *http.Request, petId int64, params UpdatePetWithFormParams)
	// uploads an image
	// (POST /pet/{petId}/uploadImage)
	UploadFile(w http.ResponseWriter, r *http.Request, petId int64, params UploadFileParams)
	// Returns pet inventories by status
	// (GET /store/inventory)
	GetInventory(w http.ResponseWriter, r *http.Request)
	// Place an order for a pet
	// (POST /store/order)
	PlaceOrder(w http.ResponseWriter, r *http.Request)
	// Delete purchase order by ID
	// (DELETE /store/order/{orderId})
	DeleteOrder(w http.ResponseWriter, r *http.Request, orderId int64)
	// Find purchase order by ID
	// (GET /store/order/{orderId})
	GetOrderById(w http.ResponseWriter, r *http.Request, orderId int64)
	// Create user
	// (POST /user)
	CreateUser(w http.ResponseWriter, r *http.Request)
	// Creates list of users with given input array
	// (POST /user/createWithList)
	CreateUsersWithListInput(w http.ResponseWriter, r *http.Request)
	// Logs user into the system
	// (GET /user/login)
	LoginUser(w http.ResponseWriter, r *http.Request, params LoginUserParams)
	// Logs out current logged in user session
	// (GET /user/logout)
	LogoutUser(w http.ResponseWriter, r *http.Request)
	// Delete user
	// (DELETE /user/{username})
	DeleteUser(w http.ResponseWriter, r *http.Request, username string)
	// Get user by user name
	// (GET /user/{username})
	GetUserByName(w http.ResponseWriter, r *http.Request, username string)
	// Update user
	// (PUT /user/{username})
	UpdateUser(w http.ResponseWriter, r *http.Request, username string)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AddPet

AddPet operation middleware

func (*ServerInterfaceWrapper) CreateUser

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

CreateUser operation middleware

func (*ServerInterfaceWrapper) CreateUsersWithListInput

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

CreateUsersWithListInput operation middleware

func (*ServerInterfaceWrapper) DeleteOrder

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

DeleteOrder operation middleware

func (*ServerInterfaceWrapper) DeletePet

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

DeletePet operation middleware

func (*ServerInterfaceWrapper) DeleteUser

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

DeleteUser operation middleware

func (*ServerInterfaceWrapper) FindPetsByStatus

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

FindPetsByStatus operation middleware

func (*ServerInterfaceWrapper) FindPetsByTags

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

FindPetsByTags operation middleware

func (*ServerInterfaceWrapper) GetInventory

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

GetInventory operation middleware

func (*ServerInterfaceWrapper) GetOrderById

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

GetOrderById operation middleware

func (*ServerInterfaceWrapper) GetPetById

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

GetPetById operation middleware

func (*ServerInterfaceWrapper) GetUserByName

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

GetUserByName operation middleware

func (*ServerInterfaceWrapper) LoginUser

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

LoginUser operation middleware

func (*ServerInterfaceWrapper) LogoutUser

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

LogoutUser operation middleware

func (*ServerInterfaceWrapper) PlaceOrder

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

PlaceOrder operation middleware

func (*ServerInterfaceWrapper) UpdatePet

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

UpdatePet operation middleware

func (*ServerInterfaceWrapper) UpdatePetWithForm

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

UpdatePetWithForm operation middleware

func (*ServerInterfaceWrapper) UpdateUser

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

UpdateUser operation middleware

func (*ServerInterfaceWrapper) UploadFile

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

UploadFile operation middleware

type Tag

type Tag struct {
	Id   *int64  `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

Tag defines model for Tag.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) AddPet

func (_ Unimplemented) AddPet(w http.ResponseWriter, r *http.Request)

Add a new pet to the store (POST /pet)

func (Unimplemented) CreateUser

func (_ Unimplemented) CreateUser(w http.ResponseWriter, r *http.Request)

Create user (POST /user)

func (Unimplemented) CreateUsersWithListInput

func (_ Unimplemented) CreateUsersWithListInput(w http.ResponseWriter, r *http.Request)

Creates list of users with given input array (POST /user/createWithList)

func (Unimplemented) DeleteOrder

func (_ Unimplemented) DeleteOrder(w http.ResponseWriter, r *http.Request, orderId int64)

Delete purchase order by ID (DELETE /store/order/{orderId})

func (Unimplemented) DeletePet

func (_ Unimplemented) DeletePet(w http.ResponseWriter, r *http.Request, petId int64, params DeletePetParams)

Deletes a pet (DELETE /pet/{petId})

func (Unimplemented) DeleteUser

func (_ Unimplemented) DeleteUser(w http.ResponseWriter, r *http.Request, username string)

Delete user (DELETE /user/{username})

func (Unimplemented) FindPetsByStatus

func (_ Unimplemented) FindPetsByStatus(w http.ResponseWriter, r *http.Request, params FindPetsByStatusParams)

Finds Pets by status (GET /pet/findByStatus)

func (Unimplemented) FindPetsByTags

func (_ Unimplemented) FindPetsByTags(w http.ResponseWriter, r *http.Request, params FindPetsByTagsParams)

Finds Pets by tags (GET /pet/findByTags)

func (Unimplemented) GetInventory

func (_ Unimplemented) GetInventory(w http.ResponseWriter, r *http.Request)

Returns pet inventories by status (GET /store/inventory)

func (Unimplemented) GetOrderById

func (_ Unimplemented) GetOrderById(w http.ResponseWriter, r *http.Request, orderId int64)

Find purchase order by ID (GET /store/order/{orderId})

func (Unimplemented) GetPetById

func (_ Unimplemented) GetPetById(w http.ResponseWriter, r *http.Request, petId int64)

Find pet by ID (GET /pet/{petId})

func (Unimplemented) GetUserByName

func (_ Unimplemented) GetUserByName(w http.ResponseWriter, r *http.Request, username string)

Get user by user name (GET /user/{username})

func (Unimplemented) LoginUser

func (_ Unimplemented) LoginUser(w http.ResponseWriter, r *http.Request, params LoginUserParams)

Logs user into the system (GET /user/login)

func (Unimplemented) LogoutUser

func (_ Unimplemented) LogoutUser(w http.ResponseWriter, r *http.Request)

Logs out current logged in user session (GET /user/logout)

func (Unimplemented) PlaceOrder

func (_ Unimplemented) PlaceOrder(w http.ResponseWriter, r *http.Request)

Place an order for a pet (POST /store/order)

func (Unimplemented) UpdatePet

func (_ Unimplemented) UpdatePet(w http.ResponseWriter, r *http.Request)

Update an existing pet (PUT /pet)

func (Unimplemented) UpdatePetWithForm

func (_ Unimplemented) UpdatePetWithForm(w http.ResponseWriter, r *http.Request, petId int64, params UpdatePetWithFormParams)

Updates a pet in the store with form data (POST /pet/{petId})

func (Unimplemented) UpdateUser

func (_ Unimplemented) UpdateUser(w http.ResponseWriter, r *http.Request, username string)

Update user (PUT /user/{username})

func (Unimplemented) UploadFile

func (_ Unimplemented) UploadFile(w http.ResponseWriter, r *http.Request, petId int64, params UploadFileParams)

uploads an image (POST /pet/{petId}/uploadImage)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdatePetFormdataRequestBody

type UpdatePetFormdataRequestBody = Pet

UpdatePetFormdataRequestBody defines body for UpdatePet for application/x-www-form-urlencoded ContentType.

type UpdatePetJSONRequestBody

type UpdatePetJSONRequestBody = Pet

UpdatePetJSONRequestBody defines body for UpdatePet for application/json ContentType.

type UpdatePetWithFormParams

type UpdatePetWithFormParams struct {
	// Name Name of pet that needs to be updated
	Name *string `form:"name,omitempty" json:"name,omitempty"`

	// Status Status of pet that needs to be updated
	Status *string `form:"status,omitempty" json:"status,omitempty"`
}

UpdatePetWithFormParams defines parameters for UpdatePetWithForm.

type UpdateUserFormdataRequestBody

type UpdateUserFormdataRequestBody = User

UpdateUserFormdataRequestBody defines body for UpdateUser for application/x-www-form-urlencoded ContentType.

type UpdateUserJSONRequestBody

type UpdateUserJSONRequestBody = User

UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.

type UploadFileParams

type UploadFileParams struct {
	// AdditionalMetadata Additional Metadata
	AdditionalMetadata *string `form:"additionalMetadata,omitempty" json:"additionalMetadata,omitempty"`
}

UploadFileParams defines parameters for UploadFile.

type User

type User struct {
	Email     *string `json:"email,omitempty"`
	FirstName *string `json:"firstName,omitempty"`
	Id        *int64  `json:"id,omitempty"`
	LastName  *string `json:"lastName,omitempty"`
	Password  *string `json:"password,omitempty"`
	Phone     *string `json:"phone,omitempty"`

	// UserStatus User Status
	UserStatus *int32  `json:"userStatus,omitempty"`
	Username   *string `json:"username,omitempty"`
}

User defines model for User.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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