Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterPetstoreServiceServer(s grpc.ServiceRegistrar, srv PetstoreServiceServer)
- type ApiResponse
- func (*ApiResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ApiResponse) GetCode() int32
- func (x *ApiResponse) GetMessage() string
- func (x *ApiResponse) GetType() string
- func (*ApiResponse) ProtoMessage()
- func (x *ApiResponse) ProtoReflect() protoreflect.Message
- func (x *ApiResponse) Reset()
- func (x *ApiResponse) String() string
- type Category
- type Empty
- type Pet
- func (*Pet) Descriptor() ([]byte, []int)deprecated
- func (x *Pet) GetCategory() *Category
- func (x *Pet) GetId() int64
- func (x *Pet) GetName() string
- func (x *Pet) GetPhotoUrls() []string
- func (x *Pet) GetStatus() string
- func (x *Pet) GetTags() []*Tag
- func (*Pet) ProtoMessage()
- func (x *Pet) ProtoReflect() protoreflect.Message
- func (x *Pet) Reset()
- func (x *Pet) String() string
- type PetBody
- type PetID
- type Pets
- type PetstoreServiceClient
- type PetstoreServiceServer
- type PetstoreService_GetPetsClient
- type PetstoreService_GetPetsServer
- type Status
- type StatusReq
- type Tag
- type UnimplementedPetstoreServiceServer
- func (UnimplementedPetstoreServiceServer) AddPet(context.Context, *Pet) (*Pet, error)
- func (UnimplementedPetstoreServiceServer) DeletePet(context.Context, *PetID) (*Empty, error)
- func (UnimplementedPetstoreServiceServer) FindPetsByStatus(context.Context, *StatusReq) (*Pets, error)
- func (UnimplementedPetstoreServiceServer) GetPetByID(context.Context, *PetID) (*Pet, error)
- func (UnimplementedPetstoreServiceServer) GetPets(*Empty, PetstoreService_GetPetsServer) error
- func (UnimplementedPetstoreServiceServer) UpdatePet(context.Context, *Pet) (*Pet, error)
- func (UnimplementedPetstoreServiceServer) UpdatePetWithForm(context.Context, *UpdatePetWithFormReq) (*Empty, error)
- func (UnimplementedPetstoreServiceServer) UploadFile(context.Context, *UploadFileReq) (*ApiResponse, error)
- type UnsafePetstoreServiceServer
- type UpdatePetWithFormReq
- func (*UpdatePetWithFormReq) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePetWithFormReq) GetName() string
- func (x *UpdatePetWithFormReq) GetPetId() int64
- func (x *UpdatePetWithFormReq) GetStatus() string
- func (*UpdatePetWithFormReq) ProtoMessage()
- func (x *UpdatePetWithFormReq) ProtoReflect() protoreflect.Message
- func (x *UpdatePetWithFormReq) Reset()
- func (x *UpdatePetWithFormReq) String() string
- type UploadFileReq
- func (*UploadFileReq) Descriptor() ([]byte, []int)deprecated
- func (x *UploadFileReq) GetAdditionalMetadata() string
- func (x *UploadFileReq) GetFile() string
- func (x *UploadFileReq) GetPetId() int64
- func (*UploadFileReq) ProtoMessage()
- func (x *UploadFileReq) ProtoReflect() protoreflect.Message
- func (x *UploadFileReq) Reset()
- func (x *UploadFileReq) String() string
Constants ¶
const ( PetstoreService_GetPetByID_FullMethodName = "/petstore.v1.PetstoreService/GetPetByID" PetstoreService_GetPets_FullMethodName = "/petstore.v1.PetstoreService/GetPets" PetstoreService_UpdatePetWithForm_FullMethodName = "/petstore.v1.PetstoreService/UpdatePetWithForm" PetstoreService_DeletePet_FullMethodName = "/petstore.v1.PetstoreService/DeletePet" PetstoreService_UploadFile_FullMethodName = "/petstore.v1.PetstoreService/UploadFile" PetstoreService_AddPet_FullMethodName = "/petstore.v1.PetstoreService/AddPet" PetstoreService_UpdatePet_FullMethodName = "/petstore.v1.PetstoreService/UpdatePet" PetstoreService_FindPetsByStatus_FullMethodName = "/petstore.v1.PetstoreService/FindPetsByStatus" )
Variables ¶
var ( Status_name = map[int32]string{ 0: "available", 1: "pending", 2: "sold", } Status_value = map[string]int32{ "available": 0, "pending": 1, "sold": 2, } )
Enum value maps for Status.
var File_petstore_proto protoreflect.FileDescriptor
var PetstoreService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "petstore.v1.PetstoreService", HandlerType: (*PetstoreServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPetByID", Handler: _PetstoreService_GetPetByID_Handler, }, { MethodName: "UpdatePetWithForm", Handler: _PetstoreService_UpdatePetWithForm_Handler, }, { MethodName: "DeletePet", Handler: _PetstoreService_DeletePet_Handler, }, { MethodName: "UploadFile", Handler: _PetstoreService_UploadFile_Handler, }, { MethodName: "AddPet", Handler: _PetstoreService_AddPet_Handler, }, { MethodName: "UpdatePet", Handler: _PetstoreService_UpdatePet_Handler, }, { MethodName: "FindPetsByStatus", Handler: _PetstoreService_FindPetsByStatus_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetPets", Handler: _PetstoreService_GetPets_Handler, ServerStreams: true, }, }, Metadata: "petstore.proto", }
PetstoreService_ServiceDesc is the grpc.ServiceDesc for PetstoreService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPetstoreServiceServer ¶
func RegisterPetstoreServiceServer(s grpc.ServiceRegistrar, srv PetstoreServiceServer)
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) ProtoMessage ¶
func (*Category) ProtoMessage()
func (*Category) ProtoReflect ¶
func (x *Category) ProtoReflect() protoreflect.Message
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
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) GetCategory ¶
func (*Pet) GetPhotoUrls ¶
func (*Pet) ProtoMessage ¶
func (*Pet) ProtoMessage()
func (*Pet) ProtoReflect ¶
func (x *Pet) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*PetBody) ProtoMessage()
func (*PetBody) ProtoReflect ¶
func (x *PetBody) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*PetID) ProtoMessage()
func (*PetID) ProtoReflect ¶
func (x *PetID) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*Pets) ProtoMessage()
func (*Pets) ProtoReflect ¶
func (x *Pets) ProtoReflect() protoreflect.Message
type PetstoreServiceClient ¶
type PetstoreServiceClient interface {
GetPetByID(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*Pet, error)
GetPets(ctx context.Context, in *Empty, opts ...grpc.CallOption) (PetstoreService_GetPetsClient, error)
UpdatePetWithForm(ctx context.Context, in *UpdatePetWithFormReq, opts ...grpc.CallOption) (*Empty, error)
DeletePet(ctx context.Context, in *PetID, opts ...grpc.CallOption) (*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)
FindPetsByStatus(ctx context.Context, in *StatusReq, opts ...grpc.CallOption) (*Pets, error)
}
PetstoreServiceClient is the client API for PetstoreService 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 NewPetstoreServiceClient ¶
func NewPetstoreServiceClient(cc grpc.ClientConnInterface) PetstoreServiceClient
type PetstoreServiceServer ¶
type PetstoreServiceServer interface {
GetPetByID(context.Context, *PetID) (*Pet, error)
GetPets(*Empty, PetstoreService_GetPetsServer) error
UpdatePetWithForm(context.Context, *UpdatePetWithFormReq) (*Empty, error)
DeletePet(context.Context, *PetID) (*Empty, error)
UploadFile(context.Context, *UploadFileReq) (*ApiResponse, error)
AddPet(context.Context, *Pet) (*Pet, error)
UpdatePet(context.Context, *Pet) (*Pet, error)
FindPetsByStatus(context.Context, *StatusReq) (*Pets, error)
// contains filtered or unexported methods
}
PetstoreServiceServer is the server API for PetstoreService service. All implementations must embed UnimplementedPetstoreServiceServer for forward compatibility
type PetstoreService_GetPetsClient ¶
type PetstoreService_GetPetsClient interface {
Recv() (*Pet, error)
grpc.ClientStream
}
type PetstoreService_GetPetsServer ¶
type PetstoreService_GetPetsServer interface {
Send(*Pet) error
grpc.ServerStream
}
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
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) ProtoMessage ¶
func (*StatusReq) ProtoMessage()
func (*StatusReq) ProtoReflect ¶
func (x *StatusReq) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*Tag) ProtoMessage()
func (*Tag) ProtoReflect ¶
func (x *Tag) ProtoReflect() protoreflect.Message
type UnimplementedPetstoreServiceServer ¶
type UnimplementedPetstoreServiceServer struct {
}
UnimplementedPetstoreServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPetstoreServiceServer) FindPetsByStatus ¶
func (UnimplementedPetstoreServiceServer) GetPetByID ¶
func (UnimplementedPetstoreServiceServer) GetPets ¶
func (UnimplementedPetstoreServiceServer) GetPets(*Empty, PetstoreService_GetPetsServer) error
func (UnimplementedPetstoreServiceServer) UpdatePetWithForm ¶
func (UnimplementedPetstoreServiceServer) UpdatePetWithForm(context.Context, *UpdatePetWithFormReq) (*Empty, error)
func (UnimplementedPetstoreServiceServer) UploadFile ¶
func (UnimplementedPetstoreServiceServer) UploadFile(context.Context, *UploadFileReq) (*ApiResponse, error)
type UnsafePetstoreServiceServer ¶
type UnsafePetstoreServiceServer interface {
// contains filtered or unexported methods
}
UnsafePetstoreServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PetstoreServiceServer 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