idcardpb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package idcardpb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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.

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

func (*IdInfo) GetAddress

func (m *IdInfo) GetAddress() string

func (*IdInfo) GetBirthday

func (m *IdInfo) GetBirthday() string

func (*IdInfo) GetEndDate

func (m *IdInfo) GetEndDate() string

func (*IdInfo) GetGender

func (m *IdInfo) GetGender() string

func (*IdInfo) GetId

func (m *IdInfo) GetId() string

func (*IdInfo) GetName

func (m *IdInfo) GetName() string

func (*IdInfo) GetNational

func (m *IdInfo) GetNational() string

func (*IdInfo) GetPhoto

func (m *IdInfo) GetPhoto() []byte

func (*IdInfo) GetSignOrganization

func (m *IdInfo) GetSignOrganization() string

func (*IdInfo) GetStartDate

func (m *IdInfo) GetStartDate() string

func (*IdInfo) ProtoMessage

func (*IdInfo) ProtoMessage()

func (*IdInfo) Reset

func (m *IdInfo) Reset()

func (*IdInfo) String

func (m *IdInfo) String() string

func (*IdInfo) XXX_DiscardUnknown

func (m *IdInfo) XXX_DiscardUnknown()

func (*IdInfo) XXX_Marshal

func (m *IdInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IdInfo) XXX_Merge

func (m *IdInfo) XXX_Merge(src proto.Message)

func (*IdInfo) XXX_Size

func (m *IdInfo) XXX_Size() int

func (*IdInfo) XXX_Unmarshal

func (m *IdInfo) XXX_Unmarshal(b []byte) error

type UnimplementedIDCardServiceServer

type UnimplementedIDCardServiceServer struct {
}

UnimplementedIDCardServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedIDCardServiceServer) GetIdInfo

Jump to

Keyboard shortcuts

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