Documentation
¶
Overview ¶
Package petstore serves as an example for how to represent a REST API specification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StatusValues = xyz.AccessorFor(Status.Values)
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { api.Specification `` /* 165-byte string literal not displayed */ UploadImageForPet func(context.Context, PetID, string, fs.File) error `rest:"POST(multipart/form-data) /pet/{petId=%v}/uploadImage (additionalMetadata,file)" uploads an image.` AddPet func(context.Context, Pet) error `rest:"POST /pet" adds a new pet to the store.` SetPet func(context.Context, Pet) error `rest:"PUT /pet" update an existing pet.` FindByStatus func(context.Context, ...Status) ([]Pet, error) `rest:"GET /pet/findByStatus?status=%v" (multiple status values can be provided with comma separated strings)` FindByTags func(context.Context, ...string) ([]Pet, error) `` /* 149-byte string literal not displayed */ GetPet func(context.Context, PetID) (Pet, error) `rest:"GET /pet/{petId=%v}" returns a single pet.` ModPet func(context.Context, Pet) error `rest:"POST(multipart/form-data) /pet/{petId}" updates a pet in the store with form data.` DeletePet func(context.Context, PetID) error `rest:"DELETE /pet/{petId=%v}"` }
API specification, named this way, as it is the runtime.link convention. Typically this will be placed in a file called api.go and will be at the top of the file, so that it can act as a table of contents for the API.
Click to show internal directories.
Click to hide internal directories.