petstoreserver

package
v4.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJSONResponse

func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error

EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code

func Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter(routers ...Router) *mux.Router

NewRouter creates a new router for any number of api routers

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

Types

type AdditionalPropertiesClass

type AdditionalPropertiesClass struct {
	MapProperty map[string]string `json:"map_property,omitempty"`

	MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"`
}

type Animal

type Animal struct {
	ClassName string `json:"className"`

	Color string `json:"color,omitempty"`
}

type AnotherFakeApiController

type AnotherFakeApiController struct {
	// contains filtered or unexported fields
}

A AnotherFakeApiController binds http requests to an api service and writes the service results to the http response

func (*AnotherFakeApiController) Call123TestSpecialTags

func (c *AnotherFakeApiController) Call123TestSpecialTags(w http.ResponseWriter, r *http.Request)

Call123TestSpecialTags - To test special tags

func (*AnotherFakeApiController) Routes

func (c *AnotherFakeApiController) Routes() Routes

Routes returns all of the api route for the AnotherFakeApiController

type ApiResponse

type ApiResponse struct {
	Code int32 `json:"code,omitempty"`

	Type string `json:"type,omitempty"`

	Message string `json:"message,omitempty"`
}

type ArrayOfArrayOfNumberOnly

type ArrayOfArrayOfNumberOnly struct {
	ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
}

type ArrayOfNumberOnly

type ArrayOfNumberOnly struct {
	ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
}

type ArrayTest

type ArrayTest struct {
	ArrayOfString []string `json:"array_of_string,omitempty"`

	ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"`

	ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"`
}

type Capitalization

type Capitalization struct {
	SmallCamel string `json:"smallCamel,omitempty"`

	CapitalCamel string `json:"CapitalCamel,omitempty"`

	SmallSnake string `json:"small_Snake,omitempty"`

	CapitalSnake string `json:"Capital_Snake,omitempty"`

	SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"`

	// Name of the pet
	ATT_NAME string `json:"ATT_NAME,omitempty"`
}

type Cat

type Cat struct {
	ClassName string `json:"className"`

	Color string `json:"color,omitempty"`

	Declawed bool `json:"declawed,omitempty"`
}

type CatAllOf

type CatAllOf struct {
	Declawed bool `json:"declawed,omitempty"`
}

type Category

type Category struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name"`
}

type ClassModel

type ClassModel struct {
	Class string `json:"_class,omitempty"`
}

ClassModel - Model for testing model with \"_class\" property

type Client

type Client struct {
	Client string `json:"client,omitempty"`
}

type DefaultApiController

type DefaultApiController struct {
	// contains filtered or unexported fields
}

A DefaultApiController binds http requests to an api service and writes the service results to the http response

func (*DefaultApiController) FooGet

FooGet -

func (*DefaultApiController) Routes

func (c *DefaultApiController) Routes() Routes

Routes returns all of the api route for the DefaultApiController

type Dog

type Dog struct {
	ClassName string `json:"className"`

	Color string `json:"color,omitempty"`

	Breed string `json:"breed,omitempty"`
}

type DogAllOf

type DogAllOf struct {
	Breed string `json:"breed,omitempty"`
}

type EnumArrays

type EnumArrays struct {
	JustSymbol string `json:"just_symbol,omitempty"`

	ArrayEnum []string `json:"array_enum,omitempty"`
}

type EnumClass

type EnumClass string
const (
	ABC EnumClass = "_abc"
	EFG EnumClass = "-efg"
	XYZ EnumClass = "(xyz)"
)

List of EnumClass

type EnumTest

type EnumTest struct {
	EnumString string `json:"enum_string,omitempty"`

	EnumStringRequired string `json:"enum_string_required"`

	EnumInteger int32 `json:"enum_integer,omitempty"`

	EnumNumber float64 `json:"enum_number,omitempty"`

	OuterEnum *OuterEnum `json:"outerEnum,omitempty"`

	OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"`

	OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"`

	OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"`
}

type FakeApiController

type FakeApiController struct {
	// contains filtered or unexported fields
}

A FakeApiController binds http requests to an api service and writes the service results to the http response

func (*FakeApiController) FakeHealthGet

func (c *FakeApiController) FakeHealthGet(w http.ResponseWriter, r *http.Request)

FakeHealthGet - Health check endpoint

func (*FakeApiController) FakeOuterBooleanSerialize

func (c *FakeApiController) FakeOuterBooleanSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterBooleanSerialize -

func (*FakeApiController) FakeOuterCompositeSerialize

func (c *FakeApiController) FakeOuterCompositeSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterCompositeSerialize -

func (*FakeApiController) FakeOuterNumberSerialize

func (c *FakeApiController) FakeOuterNumberSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterNumberSerialize -

func (*FakeApiController) FakeOuterStringSerialize

func (c *FakeApiController) FakeOuterStringSerialize(w http.ResponseWriter, r *http.Request)

FakeOuterStringSerialize -

func (*FakeApiController) Routes

func (c *FakeApiController) Routes() Routes

Routes returns all of the api route for the FakeApiController

func (*FakeApiController) TestBodyWithFileSchema

func (c *FakeApiController) TestBodyWithFileSchema(w http.ResponseWriter, r *http.Request)

TestBodyWithFileSchema -

func (*FakeApiController) TestBodyWithQueryParams

func (c *FakeApiController) TestBodyWithQueryParams(w http.ResponseWriter, r *http.Request)

TestBodyWithQueryParams -

func (*FakeApiController) TestClientModel

func (c *FakeApiController) TestClientModel(w http.ResponseWriter, r *http.Request)

TestClientModel - To test \"client\" model

func (*FakeApiController) TestEndpointParameters

func (c *FakeApiController) TestEndpointParameters(w http.ResponseWriter, r *http.Request)

TestEndpointParameters - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트

func (*FakeApiController) TestEnumParameters

func (c *FakeApiController) TestEnumParameters(w http.ResponseWriter, r *http.Request)

TestEnumParameters - To test enum parameters

func (*FakeApiController) TestGroupParameters

func (c *FakeApiController) TestGroupParameters(w http.ResponseWriter, r *http.Request)

TestGroupParameters - Fake endpoint to test group parameters (optional)

func (*FakeApiController) TestInlineAdditionalProperties

func (c *FakeApiController) TestInlineAdditionalProperties(w http.ResponseWriter, r *http.Request)

TestInlineAdditionalProperties - test inline additionalProperties

func (*FakeApiController) TestJsonFormData

func (c *FakeApiController) TestJsonFormData(w http.ResponseWriter, r *http.Request)

TestJsonFormData - test json serialization of form data

func (*FakeApiController) TestQueryParameterCollectionFormat

func (c *FakeApiController) TestQueryParameterCollectionFormat(w http.ResponseWriter, r *http.Request)

TestQueryParameterCollectionFormat -

type FakeClassnameTags123ApiController

type FakeClassnameTags123ApiController struct {
	// contains filtered or unexported fields
}

A FakeClassnameTags123ApiController binds http requests to an api service and writes the service results to the http response

func (*FakeClassnameTags123ApiController) Routes

Routes returns all of the api route for the FakeClassnameTags123ApiController

func (*FakeClassnameTags123ApiController) TestClassname

TestClassname - To test class name in snake case

type File

type File struct {

	// Test capitalization
	SourceURI string `json:"sourceURI,omitempty"`
}

File - Must be named `File` for test.

type FileSchemaTestClass

type FileSchemaTestClass struct {
	File File `json:"file,omitempty"`

	Files []File `json:"files,omitempty"`
}

type Foo

type Foo struct {
	Bar string `json:"bar,omitempty"`
}

type FormatTest

type FormatTest struct {
	Integer int32 `json:"integer,omitempty"`

	Int32 int32 `json:"int32,omitempty"`

	Int64 int64 `json:"int64,omitempty"`

	Number float32 `json:"number"`

	Float float32 `json:"float,omitempty"`

	Double float64 `json:"double,omitempty"`

	String string `json:"string,omitempty"`

	Byte string `json:"byte"`

	Binary *os.File `json:"binary,omitempty"`

	Date string `json:"date"`

	DateTime time.Time `json:"dateTime,omitempty"`

	Uuid string `json:"uuid,omitempty"`

	Password string `json:"password"`

	// A string that is a 10 digit number. Can have leading zeros.
	PatternWithDigits string `json:"pattern_with_digits,omitempty"`

	// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
	PatternWithDigitsAndDelimiter string `json:"pattern_with_digits_and_delimiter,omitempty"`
}

type HasOnlyReadOnly

type HasOnlyReadOnly struct {
	Bar string `json:"bar,omitempty"`

	Foo string `json:"foo,omitempty"`
}

type HealthCheckResult

type HealthCheckResult struct {
	NullableMessage *string `json:"NullableMessage,omitempty"`
}

HealthCheckResult - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.

type InlineObject

type InlineObject struct {

	// Updated name of the pet
	Name string `json:"name,omitempty"`

	// Updated status of the pet
	Status string `json:"status,omitempty"`
}

type InlineObject1

type InlineObject1 struct {

	// Additional data to pass to server
	AdditionalMetadata string `json:"additionalMetadata,omitempty"`

	// file to upload
	File *os.File `json:"file,omitempty"`
}

type InlineObject2

type InlineObject2 struct {

	// Form parameter enum test (string array)
	EnumFormStringArray []string `json:"enum_form_string_array,omitempty"`

	// Form parameter enum test (string)
	EnumFormString string `json:"enum_form_string,omitempty"`
}

type InlineObject3

type InlineObject3 struct {

	// None
	Integer int32 `json:"integer,omitempty"`

	// None
	Int32 int32 `json:"int32,omitempty"`

	// None
	Int64 int64 `json:"int64,omitempty"`

	// None
	Number float32 `json:"number"`

	// None
	Float float32 `json:"float,omitempty"`

	// None
	Double float64 `json:"double"`

	// None
	String string `json:"string,omitempty"`

	// None
	PatternWithoutDelimiter string `json:"pattern_without_delimiter"`

	// None
	Byte string `json:"byte"`

	// None
	Binary *os.File `json:"binary,omitempty"`

	// None
	Date string `json:"date,omitempty"`

	// None
	DateTime time.Time `json:"dateTime,omitempty"`

	// None
	Password string `json:"password,omitempty"`

	// None
	Callback string `json:"callback,omitempty"`
}

type InlineObject4

type InlineObject4 struct {

	// field1
	Param string `json:"param"`

	// field2
	Param2 string `json:"param2"`
}

type InlineObject5

type InlineObject5 struct {

	// Additional data to pass to server
	AdditionalMetadata string `json:"additionalMetadata,omitempty"`

	// file to upload
	RequiredFile *os.File `json:"requiredFile"`
}

type InlineResponseDefault

type InlineResponseDefault struct {
	String Foo `json:"string,omitempty"`
}

type List

type List struct {
	Var123List string `json:"123-list,omitempty"`
}

type MapTest

type MapTest struct {
	MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`

	MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`

	DirectMap map[string]bool `json:"direct_map,omitempty"`

	IndirectMap map[string]bool `json:"indirect_map,omitempty"`
}

type MixedPropertiesAndAdditionalPropertiesClass

type MixedPropertiesAndAdditionalPropertiesClass struct {
	Uuid string `json:"uuid,omitempty"`

	DateTime time.Time `json:"dateTime,omitempty"`

	Map map[string]Animal `json:"map,omitempty"`
}

type Model200Response

type Model200Response struct {
	Name int32 `json:"name,omitempty"`

	Class string `json:"class,omitempty"`
}

Model200Response - Model for testing model name starting with number

type Name

type Name struct {
	Name int32 `json:"name"`

	SnakeCase int32 `json:"snake_case,omitempty"`

	Property string `json:"property,omitempty"`

	Var123Number int32 `json:"123Number,omitempty"`
}

Name - Model for testing model name same as property name

type NullableClass

type NullableClass struct {
	IntegerProp *int32 `json:"integer_prop,omitempty"`

	NumberProp *float32 `json:"number_prop,omitempty"`

	BooleanProp *bool `json:"boolean_prop,omitempty"`

	StringProp *string `json:"string_prop,omitempty"`

	DateProp *string `json:"date_prop,omitempty"`

	DatetimeProp *time.Time `json:"datetime_prop,omitempty"`

	ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"`

	ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"`

	ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"`

	ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"`

	ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"`

	ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"`
}

type NumberOnly

type NumberOnly struct {
	JustNumber float32 `json:"JustNumber,omitempty"`
}

type Order

type Order struct {
	Id int64 `json:"id,omitempty"`

	PetId int64 `json:"petId,omitempty"`

	Quantity int32 `json:"quantity,omitempty"`

	ShipDate time.Time `json:"shipDate,omitempty"`

	// Order Status
	Status string `json:"status,omitempty"`

	Complete bool `json:"complete,omitempty"`
}

type OuterComposite

type OuterComposite struct {
	MyNumber float32 `json:"my_number,omitempty"`

	MyString string `json:"my_string,omitempty"`

	MyBoolean bool `json:"my_boolean,omitempty"`
}

type OuterEnum

type OuterEnum string
const (
	PLACED    OuterEnum = "placed"
	APPROVED  OuterEnum = "approved"
	DELIVERED OuterEnum = "delivered"
)

List of OuterEnum

type OuterEnumDefaultValue

type OuterEnumDefaultValue string
const (
	PLACED    OuterEnumDefaultValue = "placed"
	APPROVED  OuterEnumDefaultValue = "approved"
	DELIVERED OuterEnumDefaultValue = "delivered"
)

List of OuterEnumDefaultValue

type OuterEnumInteger

type OuterEnumInteger int32

type OuterEnumIntegerDefaultValue

type OuterEnumIntegerDefaultValue int32

type Pet

type Pet struct {
	Id int64 `json:"id,omitempty"`

	Category Category `json:"category,omitempty"`

	Name string `json:"name"`

	PhotoUrls []string `json:"photoUrls"`

	Tags []Tag `json:"tags,omitempty"`

	// pet status in the store
	Status string `json:"status,omitempty"`
}

type PetApiController

type PetApiController struct {
	// contains filtered or unexported fields
}

A PetApiController binds http requests to an api service and writes the service results to the http response

func (*PetApiController) AddPet

func (c *PetApiController) AddPet(w http.ResponseWriter, r *http.Request)

AddPet - Add a new pet to the store

func (*PetApiController) DeletePet

func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request)

DeletePet - Deletes a pet

func (*PetApiController) FindPetsByStatus

func (c *PetApiController) FindPetsByStatus(w http.ResponseWriter, r *http.Request)

FindPetsByStatus - Finds Pets by status

func (*PetApiController) FindPetsByTags

func (c *PetApiController) FindPetsByTags(w http.ResponseWriter, r *http.Request)

FindPetsByTags - Finds Pets by tags

func (*PetApiController) GetPetById

func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request)

GetPetById - Find pet by ID

func (*PetApiController) Routes

func (c *PetApiController) Routes() Routes

Routes returns all of the api route for the PetApiController

func (*PetApiController) UpdatePet

func (c *PetApiController) UpdatePet(w http.ResponseWriter, r *http.Request)

UpdatePet - Update an existing pet

func (*PetApiController) UpdatePetWithForm

func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Request)

UpdatePetWithForm - Updates a pet in the store with form data

func (*PetApiController) UploadFile

func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request)

UploadFile - uploads an image

func (*PetApiController) UploadFileWithRequiredFile

func (c *PetApiController) UploadFileWithRequiredFile(w http.ResponseWriter, r *http.Request)

UploadFileWithRequiredFile - uploads an image (required)

type ReadOnlyFirst

type ReadOnlyFirst struct {
	Bar string `json:"bar,omitempty"`

	Baz string `json:"baz,omitempty"`
}

type Return

type Return struct {
	Return int32 `json:"return,omitempty"`
}

Return - Model for testing reserved words

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

A Route defines the parameters for an api endpoint

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving api routes

func NewAnotherFakeApiController

func NewAnotherFakeApiController(s AnotherFakeApiServicer) Router

NewAnotherFakeApiController creates a default api controller

func NewDefaultApiController

func NewDefaultApiController(s DefaultApiServicer) Router

NewDefaultApiController creates a default api controller

func NewFakeApiController

func NewFakeApiController(s FakeApiServicer) Router

NewFakeApiController creates a default api controller

func NewFakeClassnameTags123ApiController

func NewFakeClassnameTags123ApiController(s FakeClassnameTags123ApiServicer) Router

NewFakeClassnameTags123ApiController creates a default api controller

func NewPetApiController

func NewPetApiController(s PetApiServicer) Router

NewPetApiController creates a default api controller

func NewStoreApiController

func NewStoreApiController(s StoreApiServicer) Router

NewStoreApiController creates a default api controller

func NewUserApiController

func NewUserApiController(s UserApiServicer) Router

NewUserApiController creates a default api controller

type Routes

type Routes []Route

Routes are a collection of defined api endpoints

type SpecialModelName

type SpecialModelName struct {
	SpecialPropertyName int64 `json:"$special[property.name],omitempty"`
}

type StoreApiController

type StoreApiController struct {
	// contains filtered or unexported fields
}

A StoreApiController binds http requests to an api service and writes the service results to the http response

func (*StoreApiController) DeleteOrder

func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request)

DeleteOrder - Delete purchase order by ID

func (*StoreApiController) GetInventory

func (c *StoreApiController) GetInventory(w http.ResponseWriter, r *http.Request)

GetInventory - Returns pet inventories by status

func (*StoreApiController) GetOrderById

func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request)

GetOrderById - Find purchase order by ID

func (*StoreApiController) PlaceOrder

func (c *StoreApiController) PlaceOrder(w http.ResponseWriter, r *http.Request)

PlaceOrder - Place an order for a pet

func (*StoreApiController) Routes

func (c *StoreApiController) Routes() Routes

Routes returns all of the api route for the StoreApiController

type Tag

type Tag struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

type User

type User struct {
	Id int64 `json:"id,omitempty"`

	Username string `json:"username,omitempty"`

	FirstName string `json:"firstName,omitempty"`

	LastName string `json:"lastName,omitempty"`

	Email string `json:"email,omitempty"`

	Password string `json:"password,omitempty"`

	Phone string `json:"phone,omitempty"`

	// User Status
	UserStatus int32 `json:"userStatus,omitempty"`
}

type UserApiController

type UserApiController struct {
	// contains filtered or unexported fields
}

A UserApiController binds http requests to an api service and writes the service results to the http response

func (*UserApiController) CreateUser

func (c *UserApiController) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser - Create user

func (*UserApiController) CreateUsersWithArrayInput

func (c *UserApiController) CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request)

CreateUsersWithArrayInput - Creates list of users with given input array

func (*UserApiController) CreateUsersWithListInput

func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *http.Request)

CreateUsersWithListInput - Creates list of users with given input array

func (*UserApiController) DeleteUser

func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser - Delete user

func (*UserApiController) GetUserByName

func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request)

GetUserByName - Get user by user name

func (*UserApiController) LoginUser

func (c *UserApiController) LoginUser(w http.ResponseWriter, r *http.Request)

LoginUser - Logs user into the system

func (*UserApiController) LogoutUser

func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request)

LogoutUser - Logs out current logged in user session

func (*UserApiController) Routes

func (c *UserApiController) Routes() Routes

Routes returns all of the api route for the UserApiController

func (*UserApiController) UpdateUser

func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser - Updated user

Jump to

Keyboard shortcuts

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