Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterPetStoreServer(s grpc.ServiceRegistrar, srv PetStoreServer)
- type MockPetStoreClient
- func (m *MockPetStoreClient) CreatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
- func (m *MockPetStoreClient) DeletePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*emptypb.Empty, error)
- func (m *MockPetStoreClient) EXPECT() *MockPetStoreClientMockRecorder
- func (m *MockPetStoreClient) GetAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Pets, error)
- func (m *MockPetStoreClient) GetPet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
- func (m *MockPetStoreClient) UpdatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
- type MockPetStoreClientMockRecorder
- func (mr *MockPetStoreClientMockRecorder) CreatePet(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockPetStoreClientMockRecorder) DeletePet(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockPetStoreClientMockRecorder) GetAll(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockPetStoreClientMockRecorder) GetPet(ctx, in interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockPetStoreClientMockRecorder) UpdatePet(ctx, in interface{}, opts ...interface{}) *gomock.Call
- type MockPetStoreServer
- func (m *MockPetStoreServer) CreatePet(ctx context.Context, in *Pet) (*Pet, error)
- func (m *MockPetStoreServer) DeletePet(ctx context.Context, in *Pet) (*emptypb.Empty, error)
- func (m *MockPetStoreServer) EXPECT() *MockPetStoreServerMockRecorder
- func (m *MockPetStoreServer) GetAll(ctx context.Context, in *emptypb.Empty) (*Pets, error)
- func (m *MockPetStoreServer) GetPet(ctx context.Context, in *Pet) (*Pet, error)
- func (m *MockPetStoreServer) UpdatePet(ctx context.Context, in *Pet) (*Pet, error)
- type MockPetStoreServerMockRecorder
- func (mr *MockPetStoreServerMockRecorder) CreatePet(ctx, in interface{}) *gomock.Call
- func (mr *MockPetStoreServerMockRecorder) DeletePet(ctx, in interface{}) *gomock.Call
- func (mr *MockPetStoreServerMockRecorder) GetAll(ctx, in interface{}) *gomock.Call
- func (mr *MockPetStoreServerMockRecorder) GetPet(ctx, in interface{}) *gomock.Call
- func (mr *MockPetStoreServerMockRecorder) UpdatePet(ctx, in interface{}) *gomock.Call
- type Pet
- type PetStoreClient
- type PetStoreServer
- type Pets
- type Status
- type UnimplementedPetStoreServer
- func (UnimplementedPetStoreServer) CreatePet(context.Context, *Pet) (*Pet, error)
- func (UnimplementedPetStoreServer) DeletePet(context.Context, *Pet) (*emptypb.Empty, error)
- func (UnimplementedPetStoreServer) GetAll(context.Context, *emptypb.Empty) (*Pets, error)
- func (UnimplementedPetStoreServer) GetPet(context.Context, *Pet) (*Pet, error)
- func (UnimplementedPetStoreServer) UpdatePet(context.Context, *Pet) (*Pet, error)
- type UnsafePetStoreServer
Constants ¶
const ( PetStore_GetAll_FullMethodName = "/petstore.PetStore/GetAll" PetStore_GetPet_FullMethodName = "/petstore.PetStore/GetPet" PetStore_CreatePet_FullMethodName = "/petstore.PetStore/CreatePet" PetStore_UpdatePet_FullMethodName = "/petstore.PetStore/UpdatePet" PetStore_DeletePet_FullMethodName = "/petstore.PetStore/DeletePet" )
Variables ¶
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.
var File_another_proto protoreflect.FileDescriptor
var File_petstore_proto protoreflect.FileDescriptor
var PetStore_ServiceDesc = grpc.ServiceDesc{ ServiceName: "petstore.PetStore", HandlerType: (*PetStoreServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAll", Handler: _PetStore_GetAll_Handler, }, { MethodName: "GetPet", Handler: _PetStore_GetPet_Handler, }, { MethodName: "CreatePet", Handler: _PetStore_CreatePet_Handler, }, { MethodName: "UpdatePet", Handler: _PetStore_UpdatePet_Handler, }, { MethodName: "DeletePet", Handler: _PetStore_DeletePet_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "petstore.proto", }
PetStore_ServiceDesc is the grpc.ServiceDesc for PetStore service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPetStoreServer ¶
func RegisterPetStoreServer(s grpc.ServiceRegistrar, srv PetStoreServer)
Types ¶
type MockPetStoreClient ¶
type MockPetStoreClient struct {
// contains filtered or unexported fields
}
MockPetStoreClient is a mock of PetStoreClient interface.
func NewMockPetStoreClient ¶
func NewMockPetStoreClient(ctrl *gomock.Controller) *MockPetStoreClient
NewMockPetStoreClient creates a new mock instance.
func (*MockPetStoreClient) CreatePet ¶
func (m *MockPetStoreClient) CreatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
CreatePet mocks base method.
func (*MockPetStoreClient) DeletePet ¶
func (m *MockPetStoreClient) DeletePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*emptypb.Empty, error)
DeletePet mocks base method.
func (*MockPetStoreClient) EXPECT ¶
func (m *MockPetStoreClient) EXPECT() *MockPetStoreClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPetStoreClient) GetAll ¶
func (m *MockPetStoreClient) GetAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Pets, error)
GetAll mocks base method.
func (*MockPetStoreClient) GetPet ¶
func (m *MockPetStoreClient) GetPet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
GetPet mocks base method.
func (*MockPetStoreClient) UpdatePet ¶
func (m *MockPetStoreClient) UpdatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error)
UpdatePet mocks base method.
type MockPetStoreClientMockRecorder ¶
type MockPetStoreClientMockRecorder struct {
// contains filtered or unexported fields
}
MockPetStoreClientMockRecorder is the mock recorder for MockPetStoreClient.
func (*MockPetStoreClientMockRecorder) CreatePet ¶
func (mr *MockPetStoreClientMockRecorder) CreatePet(ctx, in interface{}, opts ...interface{}) *gomock.Call
CreatePet indicates an expected call of CreatePet.
func (*MockPetStoreClientMockRecorder) DeletePet ¶
func (mr *MockPetStoreClientMockRecorder) DeletePet(ctx, in interface{}, opts ...interface{}) *gomock.Call
DeletePet indicates an expected call of DeletePet.
func (*MockPetStoreClientMockRecorder) GetAll ¶
func (mr *MockPetStoreClientMockRecorder) GetAll(ctx, in interface{}, opts ...interface{}) *gomock.Call
GetAll indicates an expected call of GetAll.
func (*MockPetStoreClientMockRecorder) GetPet ¶
func (mr *MockPetStoreClientMockRecorder) GetPet(ctx, in interface{}, opts ...interface{}) *gomock.Call
GetPet indicates an expected call of GetPet.
func (*MockPetStoreClientMockRecorder) UpdatePet ¶
func (mr *MockPetStoreClientMockRecorder) UpdatePet(ctx, in interface{}, opts ...interface{}) *gomock.Call
UpdatePet indicates an expected call of UpdatePet.
type MockPetStoreServer ¶
type MockPetStoreServer struct {
// contains filtered or unexported fields
}
MockPetStoreServer is a mock of PetStoreServer interface.
func NewMockPetStoreServer ¶
func NewMockPetStoreServer(ctrl *gomock.Controller) *MockPetStoreServer
NewMockPetStoreServer creates a new mock instance.
func (*MockPetStoreServer) EXPECT ¶
func (m *MockPetStoreServer) EXPECT() *MockPetStoreServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockPetStoreServerMockRecorder ¶
type MockPetStoreServerMockRecorder struct {
// contains filtered or unexported fields
}
MockPetStoreServerMockRecorder is the mock recorder for MockPetStoreServer.
func (*MockPetStoreServerMockRecorder) CreatePet ¶
func (mr *MockPetStoreServerMockRecorder) CreatePet(ctx, in interface{}) *gomock.Call
CreatePet indicates an expected call of CreatePet.
func (*MockPetStoreServerMockRecorder) DeletePet ¶
func (mr *MockPetStoreServerMockRecorder) DeletePet(ctx, in interface{}) *gomock.Call
DeletePet indicates an expected call of DeletePet.
func (*MockPetStoreServerMockRecorder) GetAll ¶
func (mr *MockPetStoreServerMockRecorder) GetAll(ctx, in interface{}) *gomock.Call
GetAll indicates an expected call of GetAll.
func (*MockPetStoreServerMockRecorder) GetPet ¶
func (mr *MockPetStoreServerMockRecorder) GetPet(ctx, in interface{}) *gomock.Call
GetPet indicates an expected call of GetPet.
func (*MockPetStoreServerMockRecorder) UpdatePet ¶
func (mr *MockPetStoreServerMockRecorder) UpdatePet(ctx, in interface{}) *gomock.Call
UpdatePet indicates an expected call of UpdatePet.
type Pet ¶
type Pet struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Status Status `protobuf:"varint,3,opt,name=status,proto3,enum=petstore.Status" json:"status,omitempty"` // contains filtered or unexported fields }
func (*Pet) Descriptor
deprecated
func (*Pet) ProtoMessage ¶
func (*Pet) ProtoMessage()
func (*Pet) ProtoReflect ¶
func (x *Pet) ProtoReflect() protoreflect.Message
type PetStoreClient ¶
type PetStoreClient interface { GetAll(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Pets, error) GetPet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) CreatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) UpdatePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*Pet, error) DeletePet(ctx context.Context, in *Pet, opts ...grpc.CallOption) (*emptypb.Empty, error) }
PetStoreClient is the client API for PetStore 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 NewPetStoreClient ¶
func NewPetStoreClient(cc grpc.ClientConnInterface) PetStoreClient
type PetStoreServer ¶
type PetStoreServer interface { GetAll(context.Context, *emptypb.Empty) (*Pets, error) GetPet(context.Context, *Pet) (*Pet, error) CreatePet(context.Context, *Pet) (*Pet, error) UpdatePet(context.Context, *Pet) (*Pet, error) DeletePet(context.Context, *Pet) (*emptypb.Empty, error) // contains filtered or unexported methods }
PetStoreServer is the server API for PetStore service. All implementations must embed UnimplementedPetStoreServer 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) ProtoMessage ¶
func (*Pets) ProtoMessage()
func (*Pets) ProtoReflect ¶
func (x *Pets) ProtoReflect() protoreflect.Message
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 UnimplementedPetStoreServer ¶
type UnimplementedPetStoreServer struct { }
UnimplementedPetStoreServer must be embedded to have forward compatible implementations.
type UnsafePetStoreServer ¶
type UnsafePetStoreServer interface {
// contains filtered or unexported methods
}
UnsafePetStoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PetStoreServer will result in compilation errors.