petstorev2

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PetService_GetPetByID_FullMethodName        = "/io.swagger.petstore.v2.PetService/GetPetByID"
	PetService_UpdatePetWithForm_FullMethodName = "/io.swagger.petstore.v2.PetService/UpdatePetWithForm"
	PetService_DeletePet_FullMethodName         = "/io.swagger.petstore.v2.PetService/DeletePet"
	PetService_UploadFile_FullMethodName        = "/io.swagger.petstore.v2.PetService/UploadFile"
	PetService_AddPet_FullMethodName            = "/io.swagger.petstore.v2.PetService/AddPet"
	PetService_UpdatePet_FullMethodName         = "/io.swagger.petstore.v2.PetService/UpdatePet"
	PetService_FindPetsByTag_FullMethodName     = "/io.swagger.petstore.v2.PetService/FindPetsByTag"
	PetService_FindPetsByStatus_FullMethodName  = "/io.swagger.petstore.v2.PetService/FindPetsByStatus"
)

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "unknown",
		1: "available",
		2: "pending",
		3: "sold",
	}
	Status_value = map[string]int32{
		"unknown":   0,
		"available": 1,
		"pending":   2,
		"sold":      3,
	}
)

Enum value maps for Status.

View Source
var File_io_swagger_petstore_v2_pets_proto protoreflect.FileDescriptor
View Source
var PetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "io.swagger.petstore.v2.PetService",
	HandlerType: (*PetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPetByID",
			Handler:    _PetService_GetPetByID_Handler,
		},
		{
			MethodName: "UpdatePetWithForm",
			Handler:    _PetService_UpdatePetWithForm_Handler,
		},
		{
			MethodName: "DeletePet",
			Handler:    _PetService_DeletePet_Handler,
		},
		{
			MethodName: "UploadFile",
			Handler:    _PetService_UploadFile_Handler,
		},
		{
			MethodName: "AddPet",
			Handler:    _PetService_AddPet_Handler,
		},
		{
			MethodName: "UpdatePet",
			Handler:    _PetService_UpdatePet_Handler,
		},
		{
			MethodName: "FindPetsByTag",
			Handler:    _PetService_FindPetsByTag_Handler,
		},
		{
			MethodName: "FindPetsByStatus",
			Handler:    _PetService_FindPetsByStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "io/swagger/petstore/v2/pets.proto",
}

PetService_ServiceDesc is the grpc.ServiceDesc for PetService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPetServiceServer

func RegisterPetServiceServer(s grpc.ServiceRegistrar, srv PetServiceServer)

Types

type ApiResponse

type ApiResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Type    string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ApiResponse) Descriptor deprecated

func (*ApiResponse) Descriptor() ([]byte, []int)

Deprecated: Use ApiResponse.ProtoReflect.Descriptor instead.

func (*ApiResponse) GetCode

func (x *ApiResponse) GetCode() int32

func (*ApiResponse) GetMessage

func (x *ApiResponse) GetMessage() string

func (*ApiResponse) GetType

func (x *ApiResponse) GetType() string

func (*ApiResponse) ProtoMessage

func (*ApiResponse) ProtoMessage()

func (*ApiResponse) ProtoReflect

func (x *ApiResponse) ProtoReflect() protoreflect.Message

func (*ApiResponse) Reset

func (x *ApiResponse) Reset()

func (*ApiResponse) String

func (x *ApiResponse) String() string

type Category

type Category struct {
	Id   int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Category) Descriptor deprecated

func (*Category) Descriptor() ([]byte, []int)

Deprecated: Use Category.ProtoReflect.Descriptor instead.

func (*Category) GetId

func (x *Category) GetId() int64

func (*Category) GetName

func (x *Category) GetName() string

func (*Category) ProtoMessage

func (*Category) ProtoMessage()

func (*Category) ProtoReflect

func (x *Category) ProtoReflect() protoreflect.Message

func (*Category) Reset

func (x *Category) Reset()

func (*Category) String

func (x *Category) String() string

type Pet

type Pet struct {
	Id        int64     `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Category  *Category `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"`
	Name      string    `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	PhotoUrls []string  `protobuf:"bytes,4,rep,name=photo_urls,json=photoUrls,proto3" json:"photo_urls,omitempty"`
	Tags      []*Tag    `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"`
	Status    string    `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Pet) Descriptor deprecated

func (*Pet) Descriptor() ([]byte, []int)

Deprecated: Use Pet.ProtoReflect.Descriptor instead.

func (*Pet) GetCategory

func (x *Pet) GetCategory() *Category

func (*Pet) GetId

func (x *Pet) GetId() int64

func (*Pet) GetName

func (x *Pet) GetName() string

func (*Pet) GetPhotoUrls

func (x *Pet) GetPhotoUrls() []string

func (*Pet) GetStatus

func (x *Pet) GetStatus() string

func (*Pet) GetTags

func (x *Pet) GetTags() []*Tag

func (*Pet) ProtoMessage

func (*Pet) ProtoMessage()

func (*Pet) ProtoReflect

func (x *Pet) ProtoReflect() protoreflect.Message

func (*Pet) Reset

func (x *Pet) Reset()

func (*Pet) String

func (x *Pet) String() string

type PetBody

type PetBody struct {
	PetId int64  `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"`
	Body  string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*PetBody) Descriptor deprecated

func (*PetBody) Descriptor() ([]byte, []int)

Deprecated: Use PetBody.ProtoReflect.Descriptor instead.

func (*PetBody) GetBody

func (x *PetBody) GetBody() string

func (*PetBody) GetPetId

func (x *PetBody) GetPetId() int64

func (*PetBody) ProtoMessage

func (*PetBody) ProtoMessage()

func (*PetBody) ProtoReflect

func (x *PetBody) ProtoReflect() protoreflect.Message

func (*PetBody) Reset

func (x *PetBody) Reset()

func (*PetBody) String

func (x *PetBody) String() string

type PetID

type PetID struct {
	PetId int64 `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"`
	// contains filtered or unexported fields
}

func (*PetID) Descriptor deprecated

func (*PetID) Descriptor() ([]byte, []int)

Deprecated: Use PetID.ProtoReflect.Descriptor instead.

func (*PetID) GetPetId

func (x *PetID) GetPetId() int64

func (*PetID) ProtoMessage

func (*PetID) ProtoMessage()

func (*PetID) ProtoReflect

func (x *PetID) ProtoReflect() protoreflect.Message

func (*PetID) Reset

func (x *PetID) Reset()

func (*PetID) String

func (x *PetID) String() string

type PetServiceClient

type PetServiceClient interface {
	GetPetByID(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*Pet, error)
	UpdatePetWithForm(ctx context.Context, in *UpdatePetWithFormReq, opts ...grpc.CallOption) (*emptypb.Empty, error)
	DeletePet(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UploadFile(ctx context.Context, in *UploadFileReq, opts ...grpc.CallOption) (*ApiResponse, error)
	AddPet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
	UpdatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
	// Deprecated: Do not use.
	FindPetsByTag(ctx context.Context, in *TagReq, opts ...grpc.CallOption) (*Pets, error)
	FindPetsByStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Pets, error)
}

PetServiceClient is the client API for PetService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewPetServiceClient

func NewPetServiceClient(cc grpc.ClientConnInterface) PetServiceClient

type PetServiceServer

type PetServiceServer interface {
	GetPetByID(context.Context, *PetID) (*Pet, error)
	UpdatePetWithForm(context.Context, *UpdatePetWithFormReq) (*emptypb.Empty, error)
	DeletePet(context.Context, *PetID) (*emptypb.Empty, error)
	UploadFile(context.Context, *UploadFileReq) (*ApiResponse, error)
	AddPet(context.Context, *Pet) (*Pet, error)
	UpdatePet(context.Context, *Pet) (*Pet, error)
	// Deprecated: Do not use.
	FindPetsByTag(context.Context, *TagReq) (*Pets, error)
	FindPetsByStatus(context.Context, *StatusReq) (*Pets, error)
	// contains filtered or unexported methods
}

PetServiceServer is the server API for PetService service. All implementations must embed UnimplementedPetServiceServer for forward compatibility

type Pets

type Pets struct {
	Pets []*Pet `protobuf:"bytes,1,rep,name=pets,proto3" json:"pets,omitempty"`
	// contains filtered or unexported fields
}

func (*Pets) Descriptor deprecated

func (*Pets) Descriptor() ([]byte, []int)

Deprecated: Use Pets.ProtoReflect.Descriptor instead.

func (*Pets) GetPets

func (x *Pets) GetPets() []*Pet

func (*Pets) ProtoMessage

func (*Pets) ProtoMessage()

func (*Pets) ProtoReflect

func (x *Pets) ProtoReflect() protoreflect.Message

func (*Pets) Reset

func (x *Pets) Reset()

func (*Pets) String

func (x *Pets) String() string

type Status

type Status int32
const (
	Status_unknown   Status = 0
	Status_available Status = 1
	Status_pending   Status = 2
	Status_sold      Status = 3
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type StatusReq

type StatusReq struct {
	Status []string `protobuf:"bytes,1,rep,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusReq) Descriptor deprecated

func (*StatusReq) Descriptor() ([]byte, []int)

Deprecated: Use StatusReq.ProtoReflect.Descriptor instead.

func (*StatusReq) GetStatus

func (x *StatusReq) GetStatus() []string

func (*StatusReq) ProtoMessage

func (*StatusReq) ProtoMessage()

func (*StatusReq) ProtoReflect

func (x *StatusReq) ProtoReflect() protoreflect.Message

func (*StatusReq) Reset

func (x *StatusReq) Reset()

func (*StatusReq) String

func (x *StatusReq) String() string

type Tag

type Tag struct {
	Id   int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Tag) Descriptor deprecated

func (*Tag) Descriptor() ([]byte, []int)

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetId

func (x *Tag) GetId() int64

func (*Tag) GetName

func (x *Tag) GetName() string

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

func (x *Tag) ProtoReflect() protoreflect.Message

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type TagReq

type TagReq struct {
	Tag []string `protobuf:"bytes,1,rep,name=tag,proto3" json:"tag,omitempty"`
	// contains filtered or unexported fields
}

func (*TagReq) Descriptor deprecated

func (*TagReq) Descriptor() ([]byte, []int)

Deprecated: Use TagReq.ProtoReflect.Descriptor instead.

func (*TagReq) GetTag

func (x *TagReq) GetTag() []string

func (*TagReq) ProtoMessage

func (*TagReq) ProtoMessage()

func (*TagReq) ProtoReflect

func (x *TagReq) ProtoReflect() protoreflect.Message

func (*TagReq) Reset

func (x *TagReq) Reset()

func (*TagReq) String

func (x *TagReq) String() string

type UnimplementedPetServiceServer

type UnimplementedPetServiceServer struct {
}

UnimplementedPetServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPetServiceServer) AddPet

func (UnimplementedPetServiceServer) DeletePet

func (UnimplementedPetServiceServer) FindPetsByStatus

func (UnimplementedPetServiceServer) FindPetsByTag

func (UnimplementedPetServiceServer) GetPetByID

func (UnimplementedPetServiceServer) UpdatePet

func (UnimplementedPetServiceServer) UpdatePetWithForm

func (UnimplementedPetServiceServer) UploadFile

type UnsafePetServiceServer

type UnsafePetServiceServer interface {
	// contains filtered or unexported methods
}

UnsafePetServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PetServiceServer will result in compilation errors.

type UpdatePetWithFormReq

type UpdatePetWithFormReq struct {
	PetId  int64  `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdatePetWithFormReq) Descriptor deprecated

func (*UpdatePetWithFormReq) Descriptor() ([]byte, []int)

Deprecated: Use UpdatePetWithFormReq.ProtoReflect.Descriptor instead.

func (*UpdatePetWithFormReq) GetName

func (x *UpdatePetWithFormReq) GetName() string

func (*UpdatePetWithFormReq) GetPetId

func (x *UpdatePetWithFormReq) GetPetId() int64

func (*UpdatePetWithFormReq) GetStatus

func (x *UpdatePetWithFormReq) GetStatus() string

func (*UpdatePetWithFormReq) ProtoMessage

func (*UpdatePetWithFormReq) ProtoMessage()

func (*UpdatePetWithFormReq) ProtoReflect

func (x *UpdatePetWithFormReq) ProtoReflect() protoreflect.Message

func (*UpdatePetWithFormReq) Reset

func (x *UpdatePetWithFormReq) Reset()

func (*UpdatePetWithFormReq) String

func (x *UpdatePetWithFormReq) String() string

type UploadFileReq

type UploadFileReq struct {
	PetId              int64  `protobuf:"varint,1,opt,name=pet_id,json=petId,proto3" json:"pet_id,omitempty"`
	AdditionalMetadata string `protobuf:"bytes,2,opt,name=additional_metadata,json=additionalMetadata,proto3" json:"additional_metadata,omitempty"`
	File               string `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadFileReq) Descriptor deprecated

func (*UploadFileReq) Descriptor() ([]byte, []int)

Deprecated: Use UploadFileReq.ProtoReflect.Descriptor instead.

func (*UploadFileReq) GetAdditionalMetadata

func (x *UploadFileReq) GetAdditionalMetadata() string

func (*UploadFileReq) GetFile

func (x *UploadFileReq) GetFile() string

func (*UploadFileReq) GetPetId

func (x *UploadFileReq) GetPetId() int64

func (*UploadFileReq) ProtoMessage

func (*UploadFileReq) ProtoMessage()

func (*UploadFileReq) ProtoReflect

func (x *UploadFileReq) ProtoReflect() protoreflect.Message

func (*UploadFileReq) Reset

func (x *UploadFileReq) Reset()

func (*UploadFileReq) String

func (x *UploadFileReq) String() string

Directories

Path Synopsis
The service defined herein comes from v2 of the Petstore service, which is used as an example for Swagger/OpenAPI.
The service defined herein comes from v2 of the Petstore service, which is used as an example for Swagger/OpenAPI.

Jump to

Keyboard shortcuts

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