Documentation ¶
Overview ¶
Package idcardpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterIDCardServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterIDCardServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IDCardServiceClient) error
- func RegisterIDCardServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterIDCardServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IDCardServiceServer) error
- func RegisterIDCardServiceServer(s *grpc.Server, srv IDCardServiceServer)
- type GetIdInfoRequest
- func (*GetIdInfoRequest) Descriptor() ([]byte, []int)
- func (*GetIdInfoRequest) ProtoMessage()
- func (m *GetIdInfoRequest) Reset()
- func (m *GetIdInfoRequest) String() string
- func (m *GetIdInfoRequest) XXX_DiscardUnknown()
- func (m *GetIdInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetIdInfoRequest) XXX_Merge(src proto.Message)
- func (m *GetIdInfoRequest) XXX_Size() int
- func (m *GetIdInfoRequest) XXX_Unmarshal(b []byte) error
- type GetIdInfoResponse
- func (*GetIdInfoResponse) Descriptor() ([]byte, []int)
- func (m *GetIdInfoResponse) GetIdInfo() *IdInfo
- func (*GetIdInfoResponse) ProtoMessage()
- func (m *GetIdInfoResponse) Reset()
- func (m *GetIdInfoResponse) String() string
- func (m *GetIdInfoResponse) XXX_DiscardUnknown()
- func (m *GetIdInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetIdInfoResponse) XXX_Merge(src proto.Message)
- func (m *GetIdInfoResponse) XXX_Size() int
- func (m *GetIdInfoResponse) XXX_Unmarshal(b []byte) error
- type IDCardServiceClient
- type IDCardServiceServer
- type IDCardService_GetIdInfoClient
- type IDCardService_GetIdInfoServer
- type IdInfo
- func (*IdInfo) Descriptor() ([]byte, []int)
- func (m *IdInfo) GetAddress() string
- func (m *IdInfo) GetBirthday() string
- func (m *IdInfo) GetEndDate() string
- func (m *IdInfo) GetGender() string
- func (m *IdInfo) GetId() string
- func (m *IdInfo) GetName() string
- func (m *IdInfo) GetNational() string
- func (m *IdInfo) GetPhoto() []byte
- func (m *IdInfo) GetSignOrganization() string
- func (m *IdInfo) GetStartDate() string
- func (*IdInfo) ProtoMessage()
- func (m *IdInfo) Reset()
- func (m *IdInfo) String() string
- func (m *IdInfo) XXX_DiscardUnknown()
- func (m *IdInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *IdInfo) XXX_Merge(src proto.Message)
- func (m *IdInfo) XXX_Size() int
- func (m *IdInfo) XXX_Unmarshal(b []byte) error
- type UnimplementedIDCardServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterIDCardServiceHandler ¶
func RegisterIDCardServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterIDCardServiceHandler registers the http handlers for service IDCardService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterIDCardServiceHandlerClient ¶
func RegisterIDCardServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IDCardServiceClient) error
RegisterIDCardServiceHandlerClient registers the http handlers for service IDCardService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IDCardServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IDCardServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "IDCardServiceClient" to call the correct interceptors.
func RegisterIDCardServiceHandlerFromEndpoint ¶
func RegisterIDCardServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterIDCardServiceHandlerFromEndpoint is same as RegisterIDCardServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterIDCardServiceHandlerServer ¶
func RegisterIDCardServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IDCardServiceServer) error
RegisterIDCardServiceHandlerServer registers the http handlers for service IDCardService to "mux". UnaryRPC :call IDCardServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterIDCardServiceServer ¶
func RegisterIDCardServiceServer(s *grpc.Server, srv IDCardServiceServer)
Types ¶
type GetIdInfoRequest ¶
type GetIdInfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
获取读卡数据流请求
func (*GetIdInfoRequest) Descriptor ¶
func (*GetIdInfoRequest) Descriptor() ([]byte, []int)
func (*GetIdInfoRequest) ProtoMessage ¶
func (*GetIdInfoRequest) ProtoMessage()
func (*GetIdInfoRequest) Reset ¶
func (m *GetIdInfoRequest) Reset()
func (*GetIdInfoRequest) String ¶
func (m *GetIdInfoRequest) String() string
func (*GetIdInfoRequest) XXX_DiscardUnknown ¶
func (m *GetIdInfoRequest) XXX_DiscardUnknown()
func (*GetIdInfoRequest) XXX_Marshal ¶
func (m *GetIdInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetIdInfoRequest) XXX_Merge ¶
func (m *GetIdInfoRequest) XXX_Merge(src proto.Message)
func (*GetIdInfoRequest) XXX_Size ¶
func (m *GetIdInfoRequest) XXX_Size() int
func (*GetIdInfoRequest) XXX_Unmarshal ¶
func (m *GetIdInfoRequest) XXX_Unmarshal(b []byte) error
type GetIdInfoResponse ¶
type GetIdInfoResponse struct { // 身份证数据 IdInfo *IdInfo `protobuf:"bytes,1,opt,name=id_info,json=idInfo,proto3" json:"id_info,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
获取读卡数据流结果
func (*GetIdInfoResponse) Descriptor ¶
func (*GetIdInfoResponse) Descriptor() ([]byte, []int)
func (*GetIdInfoResponse) GetIdInfo ¶
func (m *GetIdInfoResponse) GetIdInfo() *IdInfo
func (*GetIdInfoResponse) ProtoMessage ¶
func (*GetIdInfoResponse) ProtoMessage()
func (*GetIdInfoResponse) Reset ¶
func (m *GetIdInfoResponse) Reset()
func (*GetIdInfoResponse) String ¶
func (m *GetIdInfoResponse) String() string
func (*GetIdInfoResponse) XXX_DiscardUnknown ¶
func (m *GetIdInfoResponse) XXX_DiscardUnknown()
func (*GetIdInfoResponse) XXX_Marshal ¶
func (m *GetIdInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetIdInfoResponse) XXX_Merge ¶
func (m *GetIdInfoResponse) XXX_Merge(src proto.Message)
func (*GetIdInfoResponse) XXX_Size ¶
func (m *GetIdInfoResponse) XXX_Size() int
func (*GetIdInfoResponse) XXX_Unmarshal ¶
func (m *GetIdInfoResponse) XXX_Unmarshal(b []byte) error
type IDCardServiceClient ¶
type IDCardServiceClient interface { // GetIdInfo 监听读取身份证数据 // // 开发管理平台功能参考: http://10.10.10.2/id_card GetIdInfo(ctx context.Context, in *GetIdInfoRequest, opts ...grpc.CallOption) (IDCardService_GetIdInfoClient, error) }
IDCardServiceClient is the client API for IDCardService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewIDCardServiceClient ¶
func NewIDCardServiceClient(cc grpc.ClientConnInterface) IDCardServiceClient
type IDCardServiceServer ¶
type IDCardServiceServer interface { // GetIdInfo 监听读取身份证数据 // // 开发管理平台功能参考: http://10.10.10.2/id_card GetIdInfo(*GetIdInfoRequest, IDCardService_GetIdInfoServer) error }
IDCardServiceServer is the server API for IDCardService service.
type IDCardService_GetIdInfoClient ¶
type IDCardService_GetIdInfoClient interface { Recv() (*GetIdInfoResponse, error) grpc.ClientStream }
type IDCardService_GetIdInfoServer ¶
type IDCardService_GetIdInfoServer interface { Send(*GetIdInfoResponse) error grpc.ServerStream }
type IdInfo ¶
type IdInfo 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"` // 性别 Gender string `protobuf:"bytes,3,opt,name=gender,proto3" json:"gender,omitempty"` // 民族 National string `protobuf:"bytes,4,opt,name=national,proto3" json:"national,omitempty"` // 出生日期 Birthday string `protobuf:"bytes,5,opt,name=birthday,proto3" json:"birthday,omitempty"` // 地址 Address string `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"` // 发证机关 SignOrganization string `protobuf:"bytes,7,opt,name=sign_organization,json=signOrganization,proto3" json:"sign_organization,omitempty"` // 有效期开始日期 StartDate string `protobuf:"bytes,8,opt,name=start_date,json=startDate,proto3" json:"start_date,omitempty"` // 有效期截止日期 EndDate string `protobuf:"bytes,9,opt,name=end_date,json=endDate,proto3" json:"end_date,omitempty"` // 身份证头像图片数据 Photo []byte `protobuf:"bytes,10,opt,name=photo,proto3" json:"photo,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
身份证数据
func (*IdInfo) Descriptor ¶
func (*IdInfo) GetAddress ¶
func (*IdInfo) GetBirthday ¶
func (*IdInfo) GetEndDate ¶
func (*IdInfo) GetNational ¶
func (*IdInfo) GetSignOrganization ¶
func (*IdInfo) GetStartDate ¶
func (*IdInfo) ProtoMessage ¶
func (*IdInfo) ProtoMessage()
func (*IdInfo) XXX_DiscardUnknown ¶
func (m *IdInfo) XXX_DiscardUnknown()
func (*IdInfo) XXX_Marshal ¶
func (*IdInfo) XXX_Unmarshal ¶
type UnimplementedIDCardServiceServer ¶
type UnimplementedIDCardServiceServer struct { }
UnimplementedIDCardServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedIDCardServiceServer) GetIdInfo ¶
func (*UnimplementedIDCardServiceServer) GetIdInfo(req *GetIdInfoRequest, srv IDCardService_GetIdInfoServer) error