petstorev2connect

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

The service defined herein comes from v2 of the Petstore service, which is used as an example for Swagger/OpenAPI. The Swagger spec can be found here: https://petstore.swagger.io/v2/swagger.json A human-friendly HTML view of this API is also available at https://petstore.swagger.io.

This file defines only the "pet" service. The spec for this site also includes "store" and "user" services which are not supported via these RPC definitions.

Index

Constants

View Source
const (
	// PetServiceGetPetByIDProcedure is the fully-qualified name of the PetService's GetPetByID RPC.
	PetServiceGetPetByIDProcedure = "/io.swagger.petstore.v2.PetService/GetPetByID"
	// PetServiceUpdatePetWithFormProcedure is the fully-qualified name of the PetService's
	// UpdatePetWithForm RPC.
	PetServiceUpdatePetWithFormProcedure = "/io.swagger.petstore.v2.PetService/UpdatePetWithForm"
	// PetServiceDeletePetProcedure is the fully-qualified name of the PetService's DeletePet RPC.
	PetServiceDeletePetProcedure = "/io.swagger.petstore.v2.PetService/DeletePet"
	// PetServiceUploadFileProcedure is the fully-qualified name of the PetService's UploadFile RPC.
	PetServiceUploadFileProcedure = "/io.swagger.petstore.v2.PetService/UploadFile"
	// PetServiceAddPetProcedure is the fully-qualified name of the PetService's AddPet RPC.
	PetServiceAddPetProcedure = "/io.swagger.petstore.v2.PetService/AddPet"
	// PetServiceUpdatePetProcedure is the fully-qualified name of the PetService's UpdatePet RPC.
	PetServiceUpdatePetProcedure = "/io.swagger.petstore.v2.PetService/UpdatePet"
	// PetServiceFindPetsByTagProcedure is the fully-qualified name of the PetService's FindPetsByTag
	// RPC.
	PetServiceFindPetsByTagProcedure = "/io.swagger.petstore.v2.PetService/FindPetsByTag"
	// PetServiceFindPetsByStatusProcedure is the fully-qualified name of the PetService's
	// FindPetsByStatus RPC.
	PetServiceFindPetsByStatusProcedure = "/io.swagger.petstore.v2.PetService/FindPetsByStatus"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// PetServiceName is the fully-qualified name of the PetService service.
	PetServiceName = "io.swagger.petstore.v2.PetService"
)

Variables

This section is empty.

Functions

func NewPetServiceHandler

func NewPetServiceHandler(svc PetServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewPetServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type PetServiceClient

PetServiceClient is a client for the io.swagger.petstore.v2.PetService service.

func NewPetServiceClient

func NewPetServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PetServiceClient

NewPetServiceClient constructs a client for the io.swagger.petstore.v2.PetService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type PetServiceHandler

PetServiceHandler is an implementation of the io.swagger.petstore.v2.PetService service.

type UnimplementedPetServiceHandler

type UnimplementedPetServiceHandler struct{}

UnimplementedPetServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedPetServiceHandler) AddPet

func (UnimplementedPetServiceHandler) DeletePet

func (UnimplementedPetServiceHandler) FindPetsByStatus

func (UnimplementedPetServiceHandler) FindPetsByTag

func (UnimplementedPetServiceHandler) GetPetByID

func (UnimplementedPetServiceHandler) UpdatePet

func (UnimplementedPetServiceHandler) UploadFile

Jump to

Keyboard shortcuts

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