v1

package
v0.0.0-...-a2c21a8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Sex_name = map[int32]string{
		0: "UN",
		1: "MAN",
		2: "WOMAN",
	}
	Sex_value = map[string]int32{
		"UN":    0,
		"MAN":   1,
		"WOMAN": 2,
	}
)

Enum value maps for Sex.

View Source
var File_api_test_v1_test_proto protoreflect.FileDescriptor
View Source
var TestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.test.v1.TestService",
	HandlerType: (*TestServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateTest",
			Handler:    _TestService_CreateTest_Handler,
		},
		{
			MethodName: "UpdateTest",
			Handler:    _TestService_UpdateTest_Handler,
		},
		{
			MethodName: "DeleteTest",
			Handler:    _TestService_DeleteTest_Handler,
		},
		{
			MethodName: "GetTest",
			Handler:    _TestService_GetTest_Handler,
		},
		{
			MethodName: "ListTest",
			Handler:    _TestService_ListTest_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/test/v1/test.proto",
}

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

Functions

func NewTestServiceHandler

func NewTestServiceHandler(srv TestServiceHandler, opts ...http1.HandleOption) http.Handler

func RegisterTestServiceServer

func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)

Types

type CreateTestReply

type CreateTestReply struct {
	Data *Test `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

创建请求

func (*CreateTestReply) Descriptor deprecated

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

Deprecated: Use CreateTestReply.ProtoReflect.Descriptor instead.

func (*CreateTestReply) GetData

func (x *CreateTestReply) GetData() *Test

func (*CreateTestReply) ProtoMessage

func (*CreateTestReply) ProtoMessage()

func (*CreateTestReply) ProtoReflect

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

func (*CreateTestReply) Reset

func (x *CreateTestReply) Reset()

func (*CreateTestReply) String

func (x *CreateTestReply) String() string

type DeleteTestReply

type DeleteTestReply struct {
	// contains filtered or unexported fields
}

删除结果

func (*DeleteTestReply) Descriptor deprecated

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

Deprecated: Use DeleteTestReply.ProtoReflect.Descriptor instead.

func (*DeleteTestReply) ProtoMessage

func (*DeleteTestReply) ProtoMessage()

func (*DeleteTestReply) ProtoReflect

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

func (*DeleteTestReply) Reset

func (x *DeleteTestReply) Reset()

func (*DeleteTestReply) String

func (x *DeleteTestReply) String() string

type DeleteTestRequest

type DeleteTestRequest struct {
	Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"`
	// contains filtered or unexported fields
}

批量删除请求

func (*DeleteTestRequest) Descriptor deprecated

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

Deprecated: Use DeleteTestRequest.ProtoReflect.Descriptor instead.

func (*DeleteTestRequest) GetIds

func (x *DeleteTestRequest) GetIds() []int64

func (*DeleteTestRequest) ProtoMessage

func (*DeleteTestRequest) ProtoMessage()

func (*DeleteTestRequest) ProtoReflect

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

func (*DeleteTestRequest) Reset

func (x *DeleteTestRequest) Reset()

func (*DeleteTestRequest) String

func (x *DeleteTestRequest) String() string

type GetTestRequest

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

查询单个数据

func (*GetTestRequest) Descriptor deprecated

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

Deprecated: Use GetTestRequest.ProtoReflect.Descriptor instead.

func (*GetTestRequest) GetId

func (x *GetTestRequest) GetId() int64

func (*GetTestRequest) ProtoMessage

func (*GetTestRequest) ProtoMessage()

func (*GetTestRequest) ProtoReflect

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

func (*GetTestRequest) Reset

func (x *GetTestRequest) Reset()

func (*GetTestRequest) String

func (x *GetTestRequest) String() string

type ListTestOption

type ListTestOption struct {
	// contains filtered or unexported fields
}

列表查询条件

func (*ListTestOption) Descriptor deprecated

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

Deprecated: Use ListTestOption.ProtoReflect.Descriptor instead.

func (*ListTestOption) ProtoMessage

func (*ListTestOption) ProtoMessage()

func (*ListTestOption) ProtoReflect

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

func (*ListTestOption) Reset

func (x *ListTestOption) Reset()

func (*ListTestOption) String

func (x *ListTestOption) String() string

type ListTestReply

type ListTestReply struct {
	List []*Test `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	//数据总计
	Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
	//页码
	Page uint32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
	//分页大小
	PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

列表查询返回

func (*ListTestReply) Descriptor deprecated

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

Deprecated: Use ListTestReply.ProtoReflect.Descriptor instead.

func (*ListTestReply) GetList

func (x *ListTestReply) GetList() []*Test

func (*ListTestReply) GetPage

func (x *ListTestReply) GetPage() uint32

func (*ListTestReply) GetPageSize

func (x *ListTestReply) GetPageSize() uint32

func (*ListTestReply) GetTotal

func (x *ListTestReply) GetTotal() int64

func (*ListTestReply) ProtoMessage

func (*ListTestReply) ProtoMessage()

func (*ListTestReply) ProtoReflect

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

func (*ListTestReply) Reset

func (x *ListTestReply) Reset()

func (*ListTestReply) String

func (x *ListTestReply) String() string

type Sex

type Sex int32
const (
	//未知
	Sex_UN Sex = 0
	//男
	Sex_MAN Sex = 1
	//女
	Sex_WOMAN Sex = 2
)

func (Sex) Descriptor

func (Sex) Descriptor() protoreflect.EnumDescriptor

func (Sex) Enum

func (x Sex) Enum() *Sex

func (Sex) EnumDescriptor deprecated

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

Deprecated: Use Sex.Descriptor instead.

func (Sex) Number

func (x Sex) Number() protoreflect.EnumNumber

func (Sex) String

func (x Sex) String() string

func (Sex) Type

func (Sex) Type() protoreflect.EnumType

type Test

type Test struct {

	// id
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// 名称
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// 简介
	Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"`
	// 性别
	Sex Sex `protobuf:"varint,4,opt,name=sex,proto3,enum=api.test.v1.Sex" json:"sex,omitempty"`
	// 测试字段
	Ui uint32 `protobuf:"varint,5,opt,name=ui,proto3" json:"ui,omitempty"`
	// 测试字段
	I3 int32 `protobuf:"varint,6,opt,name=i3,proto3" json:"i3,omitempty"`
	// 测试字段
	Si3 int32 `protobuf:"zigzag32,7,opt,name=si3,proto3" json:"si3,omitempty"`
	// 测试字段
	Sf int32 `protobuf:"fixed32,8,opt,name=sf,proto3" json:"sf,omitempty"`
	// 测试字段
	F float32 `protobuf:"fixed32,9,opt,name=f,proto3" json:"f,omitempty"`
	// 测试时间字段
	UpdateTime *timestamp.Timestamp `protobuf:"bytes,22,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	// 测试时间字段
	CreateTime *timestamp.Timestamp `protobuf:"bytes,23,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

Test结构体(请在此处定义数据结构)

func (*Test) Descriptor deprecated

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

Deprecated: Use Test.ProtoReflect.Descriptor instead.

func (*Test) GetCreateTime

func (x *Test) GetCreateTime() *timestamp.Timestamp

func (*Test) GetDesc

func (x *Test) GetDesc() string

func (*Test) GetF

func (x *Test) GetF() float32

func (*Test) GetI3

func (x *Test) GetI3() int32

func (*Test) GetId

func (x *Test) GetId() int64

func (*Test) GetName

func (x *Test) GetName() string

func (*Test) GetSex

func (x *Test) GetSex() Sex

func (*Test) GetSf

func (x *Test) GetSf() int32

func (*Test) GetSi3

func (x *Test) GetSi3() int32

func (*Test) GetUi

func (x *Test) GetUi() uint32

func (*Test) GetUpdateTime

func (x *Test) GetUpdateTime() *timestamp.Timestamp

func (*Test) ProtoMessage

func (*Test) ProtoMessage()

func (*Test) ProtoReflect

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

func (*Test) Reset

func (x *Test) Reset()

func (*Test) String

func (x *Test) String() string

type TestServiceClient

type TestServiceClient interface {
	// 创建Test
	CreateTest(ctx context.Context, in *Test, opts ...grpc.CallOption) (*CreateTestReply, error)
	// 更新Test
	UpdateTest(ctx context.Context, in *Test, opts ...grpc.CallOption) (*UpdateTestReply, error)
	// 批量删除Test
	DeleteTest(ctx context.Context, in *DeleteTestRequest, opts ...grpc.CallOption) (*DeleteTestReply, error)
	// 获取Test详情
	GetTest(ctx context.Context, in *GetTestRequest, opts ...grpc.CallOption) (*Test, error)
	// 查询Test列表
	ListTest(ctx context.Context, in *ListTestOption, opts ...grpc.CallOption) (*ListTestReply, error)
}

TestServiceClient is the client API for TestService 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.

type TestServiceHandler

type TestServiceHandler interface {
	CreateTest(context.Context, *Test) (*CreateTestReply, error)

	DeleteTest(context.Context, *DeleteTestRequest) (*DeleteTestReply, error)

	GetTest(context.Context, *GetTestRequest) (*Test, error)

	ListTest(context.Context, *ListTestOption) (*ListTestReply, error)

	UpdateTest(context.Context, *Test) (*UpdateTestReply, error)
}

type TestServiceServer

type TestServiceServer interface {
	// 创建Test
	CreateTest(context.Context, *Test) (*CreateTestReply, error)
	// 更新Test
	UpdateTest(context.Context, *Test) (*UpdateTestReply, error)
	// 批量删除Test
	DeleteTest(context.Context, *DeleteTestRequest) (*DeleteTestReply, error)
	// 获取Test详情
	GetTest(context.Context, *GetTestRequest) (*Test, error)
	// 查询Test列表
	ListTest(context.Context, *ListTestOption) (*ListTestReply, error)
	// contains filtered or unexported methods
}

TestServiceServer is the server API for TestService service. All implementations must embed UnimplementedTestServiceServer for forward compatibility

type UnimplementedTestServiceServer

type UnimplementedTestServiceServer struct {
}

UnimplementedTestServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServiceServer) CreateTest

func (UnimplementedTestServiceServer) DeleteTest

func (UnimplementedTestServiceServer) GetTest

func (UnimplementedTestServiceServer) ListTest

func (UnimplementedTestServiceServer) UpdateTest

type UnsafeTestServiceServer

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

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

type UpdateTestReply

type UpdateTestReply struct {
	Data *Test `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

更新请求

func (*UpdateTestReply) Descriptor deprecated

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

Deprecated: Use UpdateTestReply.ProtoReflect.Descriptor instead.

func (*UpdateTestReply) GetData

func (x *UpdateTestReply) GetData() *Test

func (*UpdateTestReply) ProtoMessage

func (*UpdateTestReply) ProtoMessage()

func (*UpdateTestReply) ProtoReflect

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

func (*UpdateTestReply) Reset

func (x *UpdateTestReply) Reset()

func (*UpdateTestReply) String

func (x *UpdateTestReply) String() string

Jump to

Keyboard shortcuts

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