petstore

package
v0.0.0-...-f3ba3b0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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

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_another_proto protoreflect.FileDescriptor
View Source
var File_petstore_proto protoreflect.FileDescriptor
View Source
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

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) CreatePet

func (m *MockPetStoreServer) CreatePet(ctx context.Context, in *Pet) (*Pet, error)

CreatePet mocks base method.

func (*MockPetStoreServer) DeletePet

func (m *MockPetStoreServer) DeletePet(ctx context.Context, in *Pet) (*emptypb.Empty, error)

DeletePet mocks base method.

func (*MockPetStoreServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPetStoreServer) GetAll

func (m *MockPetStoreServer) GetAll(ctx context.Context, in *emptypb.Empty) (*Pets, error)

GetAll mocks base method.

func (*MockPetStoreServer) GetPet

func (m *MockPetStoreServer) GetPet(ctx context.Context, in *Pet) (*Pet, error)

GetPet mocks base method.

func (*MockPetStoreServer) UpdatePet

func (m *MockPetStoreServer) UpdatePet(ctx context.Context, in *Pet) (*Pet, error)

UpdatePet mocks base method.

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) Descriptor() ([]byte, []int)

Deprecated: Use Pet.ProtoReflect.Descriptor instead.

func (*Pet) GetId

func (x *Pet) GetId() string

func (*Pet) GetName

func (x *Pet) GetName() string

func (*Pet) GetStatus

func (x *Pet) GetStatus() Status

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 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) 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 UnimplementedPetStoreServer

type UnimplementedPetStoreServer struct {
}

UnimplementedPetStoreServer must be embedded to have forward compatible implementations.

func (UnimplementedPetStoreServer) CreatePet

func (UnimplementedPetStoreServer) DeletePet

func (UnimplementedPetStoreServer) GetAll

func (UnimplementedPetStoreServer) GetPet

func (UnimplementedPetStoreServer) UpdatePet

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.

Jump to

Keyboard shortcuts

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