Documentation ¶
Index ¶
- Variables
- func RegisterPetsAPIServer(s grpc.ServiceRegistrar, srv PetsAPIServer)
- type AddPetRequest
- func (*AddPetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddPetRequest) GetBreed() string
- func (x *AddPetRequest) GetRisk() int32
- func (x *AddPetRequest) GetType() string
- func (*AddPetRequest) ProtoMessage()
- func (x *AddPetRequest) ProtoReflect() protoreflect.Message
- func (x *AddPetRequest) Reset()
- func (x *AddPetRequest) String() string
- type AddPetResponse
- type GetPetRequest
- func (*GetPetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPetRequest) GetBreed() string
- func (x *GetPetRequest) GetType() string
- func (*GetPetRequest) ProtoMessage()
- func (x *GetPetRequest) ProtoReflect() protoreflect.Message
- func (x *GetPetRequest) Reset()
- func (x *GetPetRequest) String() string
- type GetPetResponse
- func (*GetPetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPetResponse) GetLastUpdated() *timestamppb.Timestamp
- func (x *GetPetResponse) GetPet() *Pet
- func (*GetPetResponse) ProtoMessage()
- func (x *GetPetResponse) ProtoReflect() protoreflect.Message
- func (x *GetPetResponse) Reset()
- func (x *GetPetResponse) String() string
- type GetPetsRequest
- type GetPetsResponse
- type Pet
- func (*Pet) Descriptor() ([]byte, []int)deprecated
- func (x *Pet) GetBreed() string
- func (x *Pet) GetId() string
- func (x *Pet) GetRisk() int32
- func (x *Pet) GetType() string
- func (*Pet) ProtoMessage()
- func (x *Pet) ProtoReflect() protoreflect.Message
- func (x *Pet) Reset()
- func (x *Pet) String() string
- type PetsAPIClient
- type PetsAPIServer
- type UnimplementedPetsAPIServer
- type UnsafePetsAPIServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_v1beta1_pets_pets_api_proto protoreflect.FileDescriptor
var PetsAPI_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pets.PetsAPI", HandlerType: (*PetsAPIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPet", Handler: _PetsAPI_GetPet_Handler, }, { MethodName: "GetPets", Handler: _PetsAPI_GetPets_Handler, }, { MethodName: "AddPet", Handler: _PetsAPI_AddPet_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/v1beta1/pets/pets_api.proto", }
PetsAPI_ServiceDesc is the grpc.ServiceDesc for PetsAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPetsAPIServer ¶
func RegisterPetsAPIServer(s grpc.ServiceRegistrar, srv PetsAPIServer)
Types ¶
type AddPetRequest ¶
type AddPetRequest struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Breed string `protobuf:"bytes,2,opt,name=breed,proto3" json:"breed,omitempty"` Risk int32 `protobuf:"varint,3,opt,name=risk,proto3" json:"risk,omitempty"` // contains filtered or unexported fields }
AddPetRequest defines the request for adding a pet to a database of pets.
func (*AddPetRequest) Descriptor
deprecated
func (*AddPetRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddPetRequest.ProtoReflect.Descriptor instead.
func (*AddPetRequest) GetBreed ¶
func (x *AddPetRequest) GetBreed() string
func (*AddPetRequest) GetRisk ¶
func (x *AddPetRequest) GetRisk() int32
func (*AddPetRequest) GetType ¶
func (x *AddPetRequest) GetType() string
func (*AddPetRequest) ProtoMessage ¶
func (*AddPetRequest) ProtoMessage()
func (*AddPetRequest) ProtoReflect ¶
func (x *AddPetRequest) ProtoReflect() protoreflect.Message
func (*AddPetRequest) Reset ¶
func (x *AddPetRequest) Reset()
func (*AddPetRequest) String ¶
func (x *AddPetRequest) String() string
type AddPetResponse ¶
type AddPetResponse struct {
// contains filtered or unexported fields
}
AddPetResponse defines the response for adding a pet to a database of pets.
func (*AddPetResponse) Descriptor
deprecated
func (*AddPetResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddPetResponse.ProtoReflect.Descriptor instead.
func (*AddPetResponse) ProtoMessage ¶
func (*AddPetResponse) ProtoMessage()
func (*AddPetResponse) ProtoReflect ¶
func (x *AddPetResponse) ProtoReflect() protoreflect.Message
func (*AddPetResponse) Reset ¶
func (x *AddPetResponse) Reset()
func (*AddPetResponse) String ¶
func (x *AddPetResponse) String() string
type GetPetRequest ¶
type GetPetRequest struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Breed string `protobuf:"bytes,2,opt,name=breed,proto3" json:"breed,omitempty"` // contains filtered or unexported fields }
GetPetRequest defines the request for fetching a pet by type/breed from a database of pets.
func (*GetPetRequest) Descriptor
deprecated
func (*GetPetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPetRequest.ProtoReflect.Descriptor instead.
func (*GetPetRequest) GetBreed ¶
func (x *GetPetRequest) GetBreed() string
func (*GetPetRequest) GetType ¶
func (x *GetPetRequest) GetType() string
func (*GetPetRequest) ProtoMessage ¶
func (*GetPetRequest) ProtoMessage()
func (*GetPetRequest) ProtoReflect ¶
func (x *GetPetRequest) ProtoReflect() protoreflect.Message
func (*GetPetRequest) Reset ¶
func (x *GetPetRequest) Reset()
func (*GetPetRequest) String ¶
func (x *GetPetRequest) String() string
type GetPetResponse ¶
type GetPetResponse struct { Pet *Pet `protobuf:"bytes,1,opt,name=pet,proto3" json:"pet,omitempty"` LastUpdated *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` // contains filtered or unexported fields }
GetPetResponse defines the response for fetching a pet by type/breed from a database of pets.
func (*GetPetResponse) Descriptor
deprecated
func (*GetPetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPetResponse.ProtoReflect.Descriptor instead.
func (*GetPetResponse) GetLastUpdated ¶
func (x *GetPetResponse) GetLastUpdated() *timestamppb.Timestamp
func (*GetPetResponse) GetPet ¶
func (x *GetPetResponse) GetPet() *Pet
func (*GetPetResponse) ProtoMessage ¶
func (*GetPetResponse) ProtoMessage()
func (*GetPetResponse) ProtoReflect ¶
func (x *GetPetResponse) ProtoReflect() protoreflect.Message
func (*GetPetResponse) Reset ¶
func (x *GetPetResponse) Reset()
func (*GetPetResponse) String ¶
func (x *GetPetResponse) String() string
type GetPetsRequest ¶
type GetPetsRequest struct {
// contains filtered or unexported fields
}
GetPetsRequest defines the request for fetching all pets from a database of pets.
func (*GetPetsRequest) Descriptor
deprecated
func (*GetPetsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPetsRequest.ProtoReflect.Descriptor instead.
func (*GetPetsRequest) ProtoMessage ¶
func (*GetPetsRequest) ProtoMessage()
func (*GetPetsRequest) ProtoReflect ¶
func (x *GetPetsRequest) ProtoReflect() protoreflect.Message
func (*GetPetsRequest) Reset ¶
func (x *GetPetsRequest) Reset()
func (*GetPetsRequest) String ¶
func (x *GetPetsRequest) String() string
type GetPetsResponse ¶
type GetPetsResponse struct { Pet []*Pet `protobuf:"bytes,1,rep,name=pet,proto3" json:"pet,omitempty"` // array! // contains filtered or unexported fields }
GetPetsResponse defines the response for fetching all pets from a database of pets.
func (*GetPetsResponse) Descriptor
deprecated
func (*GetPetsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPetsResponse.ProtoReflect.Descriptor instead.
func (*GetPetsResponse) GetPet ¶
func (x *GetPetsResponse) GetPet() []*Pet
func (*GetPetsResponse) ProtoMessage ¶
func (*GetPetsResponse) ProtoMessage()
func (*GetPetsResponse) ProtoReflect ¶
func (x *GetPetsResponse) ProtoReflect() protoreflect.Message
func (*GetPetsResponse) Reset ¶
func (x *GetPetsResponse) Reset()
func (*GetPetsResponse) String ¶
func (x *GetPetsResponse) String() string
type Pet ¶
type Pet struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` Breed string `protobuf:"bytes,3,opt,name=breed,proto3" json:"breed,omitempty"` Risk int32 `protobuf:"varint,4,opt,name=risk,proto3" json:"risk,omitempty"` // contains filtered or unexported fields }
Pet defines a pet resource.
func (*Pet) Descriptor
deprecated
func (*Pet) ProtoMessage ¶
func (*Pet) ProtoMessage()
func (*Pet) ProtoReflect ¶
func (x *Pet) ProtoReflect() protoreflect.Message
type PetsAPIClient ¶
type PetsAPIClient interface { GetPet(ctx context.Context, in *GetPetRequest, opts ...grpc.CallOption) (*GetPetResponse, error) GetPets(ctx context.Context, in *GetPetsRequest, opts ...grpc.CallOption) (*GetPetsResponse, error) AddPet(ctx context.Context, in *AddPetRequest, opts ...grpc.CallOption) (*AddPetResponse, error) }
PetsAPIClient is the client API for PetsAPI 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 NewPetsAPIClient ¶
func NewPetsAPIClient(cc grpc.ClientConnInterface) PetsAPIClient
type PetsAPIServer ¶
type PetsAPIServer interface { GetPet(context.Context, *GetPetRequest) (*GetPetResponse, error) GetPets(context.Context, *GetPetsRequest) (*GetPetsResponse, error) AddPet(context.Context, *AddPetRequest) (*AddPetResponse, error) // contains filtered or unexported methods }
PetsAPIServer is the server API for PetsAPI service. All implementations must embed UnimplementedPetsAPIServer for forward compatibility
type UnimplementedPetsAPIServer ¶
type UnimplementedPetsAPIServer struct { }
UnimplementedPetsAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedPetsAPIServer) AddPet ¶
func (UnimplementedPetsAPIServer) AddPet(context.Context, *AddPetRequest) (*AddPetResponse, error)
func (UnimplementedPetsAPIServer) GetPet ¶
func (UnimplementedPetsAPIServer) GetPet(context.Context, *GetPetRequest) (*GetPetResponse, error)
func (UnimplementedPetsAPIServer) GetPets ¶
func (UnimplementedPetsAPIServer) GetPets(context.Context, *GetPetsRequest) (*GetPetsResponse, error)
type UnsafePetsAPIServer ¶
type UnsafePetsAPIServer interface {
// contains filtered or unexported methods
}
UnsafePetsAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PetsAPIServer will result in compilation errors.