Documentation
¶
Index ¶
- Constants
- Variables
- type AddPetIn
- type AddPetOut
- type AddPetResponse
- type ApiResponse
- type Category
- type Client
- func (_c Client) AddPet(ctx context.Context, httpRequestBody *Pet) (httpResponseBody *Pet, httpStatusCode int, err error)
- func (_c Client) ForHost(host string) Client
- func (_c Client) GetPetById(ctx context.Context, petId int64) (httpResponseBody *Pet, httpStatusCode int, err error)
- func (_c Client) UploadFile(ctx context.Context, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) WithOptions(opts ...pub.Option) Client
- type GetPetByIdIn
- type GetPetByIdOut
- type GetPetByIdResponse
- type MulticastClient
- func (_c MulticastClient) AddPet(ctx context.Context, httpRequestBody *Pet) iter.Seq[*AddPetResponse]
- func (_c MulticastClient) ForHost(host string) MulticastClient
- func (_c MulticastClient) GetPetById(ctx context.Context, petId int64) iter.Seq[*GetPetByIdResponse]
- func (_c MulticastClient) UploadFile(ctx context.Context, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) WithOptions(opts ...pub.Option) MulticastClient
- type Pet
- type Tag
Constants ¶
const Description = `` /* 738-byte string literal not displayed */
Description is the human-readable summary of the microservice, surfaced in OpenAPI and discovery.
const Hostname = "petstore.example"
Hostname is the default hostname of the microservice.
const Name = "Petstore"
Name is the decorative PascalCase name of the microservice.
const Version = 1
Version is a generation counter bumped on each regeneration, not a semantic version.
Variables ¶
var AddPet = define.Function{ Host: Hostname, Method: "POST", Route: "/pet", In: AddPetIn{}, Out: AddPetOut{}, }
AddPet adds a new pet to the store.
var BearerToken = define.Config{ Value: string(""), Secret: true, }
BearerToken is the OAuth2 bearer token presented to the remote Swagger Petstore API.
var GetPetById = define.Function{ Host: Hostname, Method: "GET", Route: "/pet/{petId}", In: GetPetByIdIn{}, Out: GetPetByIdOut{}, }
GetPetById returns a single pet.
var RemoteBaseURL = define.Config{ Value: string(""), Default: "https://petstore3.swagger.io/api/v3", Validation: "url", }
RemoteBaseURL is the base URL of the remote Swagger Petstore API.
var UploadFile = define.Web{ Host: Hostname, Method: "POST", Route: "/pet/{petId}/uploadImage", }
UploadFile uploads an image of the pet.
Functions ¶
This section is empty.
Types ¶
type AddPetIn ¶
type AddPetIn struct {
HTTPRequestBody *Pet `json:"-"`
}
AddPetIn are the input arguments of AddPet.
type AddPetResponse ¶
type AddPetResponse multicastResponse // MARKER: AddPet
AddPetResponse packs the response of AddPet.
type ApiResponse ¶
type ApiResponse struct {
Code int32 `json:"code,omitzero" jsonschema_description:"Code is the response code"`
Type string `json:"type,omitzero" jsonschema_description:"Type is the response type"`
Message string `json:"message,omitzero" jsonschema_description:"Message is the response message"`
}
ApiResponse is a generic response from the Swagger Petstore API. Imported from the Swagger Petstore API.
type Category ¶
type Category struct {
ID int64 `json:"id,omitzero" jsonschema_description:"ID is the category identifier"`
Name string `json:"name,omitzero" jsonschema_description:"Name is the category name"`
}
Category is a pet category. Imported from the Swagger Petstore API.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a lightweight proxy for making unicast calls to the microservice.
func (Client) AddPet ¶
func (_c Client) AddPet(ctx context.Context, httpRequestBody *Pet) (httpResponseBody *Pet, httpStatusCode int, err error)
AddPet adds a new pet to the store.
func (Client) ForHost ¶
ForHost returns a copy of the client with a different hostname to be applied to requests.
func (Client) GetPetById ¶
func (_c Client) GetPetById(ctx context.Context, petId int64) (httpResponseBody *Pet, httpStatusCode int, err error)
GetPetById returns a single pet.
type GetPetByIdIn ¶
type GetPetByIdIn struct {
PetId int64 `json:"petId,omitzero" jsonschema_description:"petId is the ID of the pet to return"`
}
GetPetByIdIn are the input arguments of GetPetById.
type GetPetByIdOut ¶
GetPetByIdOut are the output arguments of GetPetById.
type GetPetByIdResponse ¶
type GetPetByIdResponse multicastResponse // MARKER: GetPetById
GetPetByIdResponse packs the response of GetPetById.
type MulticastClient ¶
type MulticastClient struct {
// contains filtered or unexported fields
}
MulticastClient is a lightweight proxy for making multicast calls to the microservice.
func NewMulticastClient ¶
func NewMulticastClient(caller service.Publisher) MulticastClient
NewMulticastClient creates a new multicast client proxy to the microservice.
func (MulticastClient) AddPet ¶
func (_c MulticastClient) AddPet(ctx context.Context, httpRequestBody *Pet) iter.Seq[*AddPetResponse]
AddPet adds a new pet to the store.
func (MulticastClient) ForHost ¶
func (_c MulticastClient) ForHost(host string) MulticastClient
ForHost returns a copy of the client with a different hostname to be applied to requests.
func (MulticastClient) GetPetById ¶
func (_c MulticastClient) GetPetById(ctx context.Context, petId int64) iter.Seq[*GetPetByIdResponse]
GetPetById returns a single pet.
func (MulticastClient) UploadFile ¶
func (_c MulticastClient) UploadFile(ctx context.Context, relativeURL string, body any) iter.Seq[*pub.Response]
UploadFile uploads an image of the pet.
func (MulticastClient) WithOptions ¶
func (_c MulticastClient) WithOptions(opts ...pub.Option) MulticastClient
WithOptions returns a copy of the client with options to be applied to requests.
type Pet ¶
type Pet struct {
ID int64 `json:"id,omitzero" jsonschema_description:"ID is the pet identifier"`
Name string `json:"name,omitzero" jsonschema_description:"Name is the pet name"`
Category *Category `json:"category,omitzero" jsonschema_description:"Category is the pet category"`
PhotoURLs []string `json:"photoUrls,omitzero" jsonschema_description:"PhotoURLs are the URLs of the pet photos"`
Tags []Tag `json:"tags,omitzero" jsonschema_description:"Tags are the pet tags"`
Status string `json:"status,omitzero" jsonschema_description:"Status is the pet status in the store"`
}
Pet is a pet in the store. Imported from the Swagger Petstore API.