Documentation
¶
Index ¶
- func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
- type BaseResponse
- func (*BaseResponse) Descriptor() ([]byte, []int)
- func (m *BaseResponse) GetCode() int32
- func (m *BaseResponse) GetMessage() string
- func (*BaseResponse) ProtoMessage()
- func (m *BaseResponse) Reset()
- func (m *BaseResponse) String() string
- func (m *BaseResponse) XXX_DiscardUnknown()
- func (m *BaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BaseResponse) XXX_Merge(src proto.Message)
- func (m *BaseResponse) XXX_Size() int
- func (m *BaseResponse) XXX_Unmarshal(b []byte) error
- type SearchUserParam
- func (*SearchUserParam) Descriptor() ([]byte, []int)
- func (m *SearchUserParam) GetId() int32
- func (m *SearchUserParam) GetIdCard() string
- func (m *SearchUserParam) GetMobile() string
- func (*SearchUserParam) ProtoMessage()
- func (m *SearchUserParam) Reset()
- func (m *SearchUserParam) String() string
- func (m *SearchUserParam) XXX_DiscardUnknown()
- func (m *SearchUserParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SearchUserParam) XXX_Merge(src proto.Message)
- func (m *SearchUserParam) XXX_Size() int
- func (m *SearchUserParam) XXX_Unmarshal(b []byte) error
- type UnimplementedUserServiceServer
- func (*UnimplementedUserServiceServer) Add(ctx context.Context, req *UserAddInfo) (*BaseResponse, error)
- func (*UnimplementedUserServiceServer) Get(ctx context.Context, req *SearchUserParam) (*User, error)
- func (*UnimplementedUserServiceServer) List(ctx context.Context, req *SearchUserParam) (*UserList, error)
- type User
- func (*User) Descriptor() ([]byte, []int)
- func (m *User) GetAge() int32
- func (m *User) GetId() int32
- func (m *User) GetIdCard() string
- func (m *User) GetMobile() string
- func (m *User) GetName() string
- func (m *User) GetSex() bool
- func (*User) ProtoMessage()
- func (m *User) Reset()
- func (m *User) String() string
- func (m *User) XXX_DiscardUnknown()
- func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *User) XXX_Merge(src proto.Message)
- func (m *User) XXX_Size() int
- func (m *User) XXX_Unmarshal(b []byte) error
- type UserAddInfo
- func (*UserAddInfo) Descriptor() ([]byte, []int)
- func (m *UserAddInfo) GetAge() int32
- func (m *UserAddInfo) GetName() string
- func (m *UserAddInfo) GetSex() bool
- func (*UserAddInfo) ProtoMessage()
- func (m *UserAddInfo) Reset()
- func (m *UserAddInfo) String() string
- func (m *UserAddInfo) XXX_DiscardUnknown()
- func (m *UserAddInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UserAddInfo) XXX_Merge(src proto.Message)
- func (m *UserAddInfo) XXX_Size() int
- func (m *UserAddInfo) XXX_Unmarshal(b []byte) error
- type UserList
- func (*UserList) Descriptor() ([]byte, []int)
- func (m *UserList) GetCount() int32
- func (m *UserList) GetIndex() int32
- func (m *UserList) GetPageSize() int32
- func (m *UserList) GetUsers() []*User
- func (*UserList) ProtoMessage()
- func (m *UserList) Reset()
- func (m *UserList) String() string
- func (m *UserList) XXX_DiscardUnknown()
- func (m *UserList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UserList) XXX_Merge(src proto.Message)
- func (m *UserList) XXX_Size() int
- func (m *UserList) XXX_Unmarshal(b []byte) error
- type UserService
- type UserServiceClient
- type UserServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
Types ¶
type BaseResponse ¶
type BaseResponse struct { Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BaseResponse) Descriptor ¶
func (*BaseResponse) Descriptor() ([]byte, []int)
func (*BaseResponse) GetCode ¶
func (m *BaseResponse) GetCode() int32
func (*BaseResponse) GetMessage ¶
func (m *BaseResponse) GetMessage() string
func (*BaseResponse) ProtoMessage ¶
func (*BaseResponse) ProtoMessage()
func (*BaseResponse) Reset ¶
func (m *BaseResponse) Reset()
func (*BaseResponse) String ¶
func (m *BaseResponse) String() string
func (*BaseResponse) XXX_DiscardUnknown ¶
func (m *BaseResponse) XXX_DiscardUnknown()
func (*BaseResponse) XXX_Marshal ¶
func (m *BaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BaseResponse) XXX_Merge ¶
func (m *BaseResponse) XXX_Merge(src proto.Message)
func (*BaseResponse) XXX_Size ¶
func (m *BaseResponse) XXX_Size() int
func (*BaseResponse) XXX_Unmarshal ¶
func (m *BaseResponse) XXX_Unmarshal(b []byte) error
type SearchUserParam ¶
type SearchUserParam struct { Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` Mobile string `protobuf:"bytes,2,opt,name=Mobile,proto3" json:"Mobile,omitempty"` IdCard string `protobuf:"bytes,3,opt,name=IdCard,proto3" json:"IdCard,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SearchUserParam) Descriptor ¶
func (*SearchUserParam) Descriptor() ([]byte, []int)
func (*SearchUserParam) GetId ¶
func (m *SearchUserParam) GetId() int32
func (*SearchUserParam) GetIdCard ¶
func (m *SearchUserParam) GetIdCard() string
func (*SearchUserParam) GetMobile ¶
func (m *SearchUserParam) GetMobile() string
func (*SearchUserParam) ProtoMessage ¶
func (*SearchUserParam) ProtoMessage()
func (*SearchUserParam) Reset ¶
func (m *SearchUserParam) Reset()
func (*SearchUserParam) String ¶
func (m *SearchUserParam) String() string
func (*SearchUserParam) XXX_DiscardUnknown ¶
func (m *SearchUserParam) XXX_DiscardUnknown()
func (*SearchUserParam) XXX_Marshal ¶
func (m *SearchUserParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SearchUserParam) XXX_Merge ¶
func (m *SearchUserParam) XXX_Merge(src proto.Message)
func (*SearchUserParam) XXX_Size ¶
func (m *SearchUserParam) XXX_Size() int
func (*SearchUserParam) XXX_Unmarshal ¶
func (m *SearchUserParam) XXX_Unmarshal(b []byte) error
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedUserServiceServer) Add ¶
func (*UnimplementedUserServiceServer) Add(ctx context.Context, req *UserAddInfo) (*BaseResponse, error)
func (*UnimplementedUserServiceServer) Get ¶
func (*UnimplementedUserServiceServer) Get(ctx context.Context, req *SearchUserParam) (*User, error)
func (*UnimplementedUserServiceServer) List ¶
func (*UnimplementedUserServiceServer) List(ctx context.Context, req *SearchUserParam) (*UserList, error)
type User ¶
type User struct { Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Age int32 `protobuf:"varint,3,opt,name=Age,proto3" json:"Age,omitempty"` Sex bool `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` Mobile string `protobuf:"bytes,5,opt,name=Mobile,proto3" json:"Mobile,omitempty"` IdCard string `protobuf:"bytes,6,opt,name=IdCard,proto3" json:"IdCard,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*User) Descriptor ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) XXX_DiscardUnknown ¶
func (m *User) XXX_DiscardUnknown()
func (*User) XXX_Unmarshal ¶
type UserAddInfo ¶
type UserAddInfo struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` Age int32 `protobuf:"varint,3,opt,name=Age,proto3" json:"Age,omitempty"` Sex bool `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UserAddInfo) Descriptor ¶
func (*UserAddInfo) Descriptor() ([]byte, []int)
func (*UserAddInfo) GetAge ¶
func (m *UserAddInfo) GetAge() int32
func (*UserAddInfo) GetName ¶
func (m *UserAddInfo) GetName() string
func (*UserAddInfo) GetSex ¶
func (m *UserAddInfo) GetSex() bool
func (*UserAddInfo) ProtoMessage ¶
func (*UserAddInfo) ProtoMessage()
func (*UserAddInfo) Reset ¶
func (m *UserAddInfo) Reset()
func (*UserAddInfo) String ¶
func (m *UserAddInfo) String() string
func (*UserAddInfo) XXX_DiscardUnknown ¶
func (m *UserAddInfo) XXX_DiscardUnknown()
func (*UserAddInfo) XXX_Marshal ¶
func (m *UserAddInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UserAddInfo) XXX_Merge ¶
func (m *UserAddInfo) XXX_Merge(src proto.Message)
func (*UserAddInfo) XXX_Size ¶
func (m *UserAddInfo) XXX_Size() int
func (*UserAddInfo) XXX_Unmarshal ¶
func (m *UserAddInfo) XXX_Unmarshal(b []byte) error
type UserList ¶
type UserList struct { Index int32 `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"` PageSize int32 `protobuf:"varint,3,opt,name=PageSize,proto3" json:"PageSize,omitempty"` Count int32 `protobuf:"varint,4,opt,name=Count,proto3" json:"Count,omitempty"` Users []*User `protobuf:"bytes,5,rep,name=users,proto3" json:"users,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UserList) Descriptor ¶
func (*UserList) GetPageSize ¶
func (*UserList) ProtoMessage ¶
func (*UserList) ProtoMessage()
func (*UserList) XXX_DiscardUnknown ¶
func (m *UserList) XXX_DiscardUnknown()
func (*UserList) XXX_Marshal ¶
func (*UserList) XXX_Unmarshal ¶
type UserService ¶ added in v0.0.8
type UserService struct { }
func (*UserService) Add ¶ added in v0.0.8
func (s *UserService) Add(context.Context, *UserAddInfo) (*BaseResponse, error)
添加用户
func (*UserService) Get ¶ added in v0.0.8
func (s *UserService) Get(context.Context, *SearchUserParam) (*User, error)
获取指定用户接口
func (*UserService) List ¶ added in v0.0.8
func (s *UserService) List(context.Context, *SearchUserParam) (*UserList, error)
获取用户列表,分页
type UserServiceClient ¶
type UserServiceClient interface { //获取指定用户接口 Get(ctx context.Context, in *SearchUserParam, opts ...grpc.CallOption) (*User, error) //获取用户列表,分页 List(ctx context.Context, in *SearchUserParam, opts ...grpc.CallOption) (*UserList, error) //添加用户 Add(ctx context.Context, in *UserAddInfo, opts ...grpc.CallOption) (*BaseResponse, error) }
UserServiceClient is the client API for UserService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUserServiceClient ¶
func NewUserServiceClient(cc *grpc.ClientConn) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { //获取指定用户接口 Get(context.Context, *SearchUserParam) (*User, error) //获取用户列表,分页 List(context.Context, *SearchUserParam) (*UserList, error) //添加用户 Add(context.Context, *UserAddInfo) (*BaseResponse, error) }
UserServiceServer is the server API for UserService service.
Click to show internal directories.
Click to hide internal directories.