Golang RegisterType示例

说明

golang registertype示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Golang

命名空间/包名称: github.com/golang/protobuf/proto

示例#1
文件: persist.pb.go 项目: klucar/pachyderm

func init() {
	proto.RegisterType((*JobInfo)(nil), "pachyderm.pps.persist.JobInfo")
	proto.RegisterType((*JobInfos)(nil), "pachyderm.pps.persist.JobInfos")
	proto.RegisterType((*JobOutput)(nil), "pachyderm.pps.persist.JobOutput")
	proto.RegisterType((*PipelineInfo)(nil), "pachyderm.pps.persist.PipelineInfo")
	proto.RegisterType((*PipelineInfos)(nil), "pachyderm.pps.persist.PipelineInfos")
}

示例#2
文件: errorpb.pb.go 项目: anywhy/tidb

func init() {
	proto.RegisterType((*NotLeader)(nil), "errorpb.NotLeader")
	proto.RegisterType((*RegionNotFound)(nil), "errorpb.RegionNotFound")
	proto.RegisterType((*KeyNotInRegion)(nil), "errorpb.KeyNotInRegion")
	proto.RegisterType((*StaleEpoch)(nil), "errorpb.StaleEpoch")
	proto.RegisterType((*Error)(nil), "errorpb.Error")
}

示例#3
文件: route_guide.pb.go 项目: CocoaWang/grpc-go

func init() {
	proto.RegisterType((*Point)(nil), "routeguide.Point")
	proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle")
	proto.RegisterType((*Feature)(nil), "routeguide.Feature")
	proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote")
	proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary")
}

示例#4
文件: gelm.pb.go 项目: tiziano88/gelm

func init() {
	proto.RegisterType((*SubMessage)(nil), "SubMessage")
	proto.RegisterType((*Message)(nil), "Message")
	proto.RegisterType((*Address)(nil), "Address")
	proto.RegisterType((*User)(nil), "User")
	proto.RegisterEnum("Enum", Enum_name, Enum_value)
}

示例#5
文件: table.pb.go 项目: hyperledger/fabric

func init() {
	proto.RegisterType((*ColumnDefinition)(nil), "shim.ColumnDefinition")
	proto.RegisterType((*Table)(nil), "shim.Table")
	proto.RegisterType((*Column)(nil), "shim.Column")
	proto.RegisterType((*Row)(nil), "shim.Row")
	proto.RegisterEnum("shim.ColumnDefinition_Type", ColumnDefinition_Type_name, ColumnDefinition_Type_value)
}

示例#6
文件: device_address.pb.go 项目: TheThingsNetwork/ttn

func init() {
	proto.RegisterType((*PrefixesRequest)(nil), "lorawan.PrefixesRequest")
	proto.RegisterType((*PrefixesResponse)(nil), "lorawan.PrefixesResponse")
	proto.RegisterType((*PrefixesResponse_PrefixMapping)(nil), "lorawan.PrefixesResponse.PrefixMapping")
	proto.RegisterType((*DevAddrRequest)(nil), "lorawan.DevAddrRequest")
	proto.RegisterType((*DevAddrResponse)(nil), "lorawan.DevAddrResponse")
}

示例#7
文件: Blobs.pb.go 项目: contester/runlib

func init() {
	proto.RegisterType((*Blob)(nil), "contester.proto.Blob")
	proto.RegisterType((*Blob_CompressionInfo)(nil), "contester.proto.Blob.CompressionInfo")
	proto.RegisterType((*Module)(nil), "contester.proto.Module")
	proto.RegisterType((*FileBlob)(nil), "contester.proto.FileBlob")
	proto.RegisterEnum("contester.proto.Blob_CompressionInfo_CompressionType", Blob_CompressionInfo_CompressionType_name, Blob_CompressionInfo_CompressionType_value)
}

示例#8
文件: filetree.pb.go 项目: bowlofstew/kythe

func init() {
	proto.RegisterType((*CorpusRootsRequest)(nil), "kythe.proto.CorpusRootsRequest")
	proto.RegisterType((*CorpusRootsReply)(nil), "kythe.proto.CorpusRootsReply")
	proto.RegisterType((*CorpusRootsReply_Corpus)(nil), "kythe.proto.CorpusRootsReply.Corpus")
	proto.RegisterType((*DirectoryRequest)(nil), "kythe.proto.DirectoryRequest")
	proto.RegisterType((*DirectoryReply)(nil), "kythe.proto.DirectoryReply")
}

示例#9
文件: profile.pb.go 项目: kynrai/go-micro-services

func init() {
	proto.RegisterType((*Request)(nil), "profile.Request")
	proto.RegisterType((*Result)(nil), "profile.Result")
	proto.RegisterType((*Hotel)(nil), "profile.Hotel")
	proto.RegisterType((*Address)(nil), "profile.Address")
	proto.RegisterType((*Image)(nil), "profile.Image")
}

示例#10
文件: Config.pb.go 项目: davyxu/tabtoy

func init() {
	proto.RegisterType((*Config)(nil), "gamedef.Config")
	proto.RegisterType((*Prop)(nil), "gamedef.Prop")
	proto.RegisterType((*SampleDefine)(nil), "gamedef.SampleDefine")
	proto.RegisterType((*ExpDefine)(nil), "gamedef.ExpDefine")
	proto.RegisterEnum("gamedef.ActorType", ActorType_name, ActorType_value)
}

示例#11
文件: status_service.pb.go 项目: benjyw/kythe

func init() {
	proto.RegisterType((*StatusRequest)(nil), "kythe.proto.StatusRequest")
	proto.RegisterType((*StatusReply)(nil), "kythe.proto.StatusReply")
	proto.RegisterType((*StatusReply_Origin)(nil), "kythe.proto.StatusReply.Origin")
	proto.RegisterType((*StatusReply_Language)(nil), "kythe.proto.StatusReply.Language")
	proto.RegisterEnum("kythe.proto.StatusReply_Language_Support", StatusReply_Language_Support_name, StatusReply_Language_Support_value)
}

示例#12
文件: protocol.pb.go 项目: disorganizer/brig

func init() {
	proto.RegisterType((*Request)(nil), "brig.transfer.Request")
	proto.RegisterType((*StoreVersionResponse)(nil), "brig.transfer.StoreVersionResponse")
	proto.RegisterType((*FetchResponse)(nil), "brig.transfer.FetchResponse")
	proto.RegisterType((*Response)(nil), "brig.transfer.Response")
	proto.RegisterEnum("brig.transfer.RequestType", RequestType_name, RequestType_value)
}

示例#13
文件: auth.pb.go 项目: golang/gddo

func init() {
	proto.RegisterType((*Authentication)(nil), "google.api.Authentication")
	proto.RegisterType((*AuthenticationRule)(nil), "google.api.AuthenticationRule")
	proto.RegisterType((*AuthProvider)(nil), "google.api.AuthProvider")
	proto.RegisterType((*OAuthRequirements)(nil), "google.api.OAuthRequirements")
	proto.RegisterType((*AuthRequirement)(nil), "google.api.AuthRequirement")
}

示例#14
文件: silence.pb.go 项目: farcaller/alertmanager

func init() {
	proto.RegisterType((*Matcher)(nil), "silencepb.Matcher")
	proto.RegisterType((*Comment)(nil), "silencepb.Comment")
	proto.RegisterType((*Silence)(nil), "silencepb.Silence")
	proto.RegisterType((*MeshSilence)(nil), "silencepb.MeshSilence")
	proto.RegisterEnum("silencepb.Matcher_Type", Matcher_Type_name, Matcher_Type_value)
}

示例#15
文件: content_manifest.pb.go 项目: Slacki/go-steam

func init() {
	proto.RegisterType((*ContentManifestPayload)(nil), "ContentManifestPayload")
	proto.RegisterType((*ContentManifestPayload_FileMapping)(nil), "ContentManifestPayload.FileMapping")
	proto.RegisterType((*ContentManifestPayload_FileMapping_ChunkData)(nil), "ContentManifestPayload.FileMapping.ChunkData")
	proto.RegisterType((*ContentManifestMetadata)(nil), "ContentManifestMetadata")
	proto.RegisterType((*ContentManifestSignature)(nil), "ContentManifestSignature")
}

示例#16
文件: schema.pb.go 项目: libreoscar/btcwatch

func init() {
	proto.RegisterType((*ValueTransfer)(nil), "message.ValueTransfer")
	proto.RegisterType((*OpReturnMsg)(nil), "message.OpReturnMsg")
	proto.RegisterType((*TxResult)(nil), "message.TxResult")
	proto.RegisterType((*ProcessedTx)(nil), "message.ProcessedTx")
	proto.RegisterType((*ProcessedBlock)(nil), "message.ProcessedBlock")
}

示例#17
文件: notification_service.pb.go 项目: HearthSim/hs-proto-go

func init() {
	proto.RegisterType((*Notification)(nil), "notification_service.Notification")
	proto.RegisterType((*FindClientRequest)(nil), "notification_service.FindClientRequest")
	proto.RegisterType((*FindClientResponse)(nil), "notification_service.FindClientResponse")
	proto.RegisterType((*RegisterClientRequest)(nil), "notification_service.RegisterClientRequest")
	proto.RegisterType((*UnregisterClientRequest)(nil), "notification_service.UnregisterClientRequest")
}

示例#18
文件: channel_service.pb.go 项目: David-Shibley/goPlayground

func init() {
	proto.RegisterType((*ChannelServiceError)(nil), "appengine.ChannelServiceError")
	proto.RegisterType((*CreateChannelRequest)(nil), "appengine.CreateChannelRequest")
	proto.RegisterType((*CreateChannelResponse)(nil), "appengine.CreateChannelResponse")
	proto.RegisterType((*SendMessageRequest)(nil), "appengine.SendMessageRequest")
	proto.RegisterEnum("appengine.ChannelServiceError_ErrorCode", ChannelServiceError_ErrorCode_name, ChannelServiceError_ErrorCode_value)
}

示例#19
文件: crawl.pb.go 项目: vkey24/zerg

func init() {
	proto.RegisterType((*CrawlRequest)(nil), "protos.CrawlRequest")
	proto.RegisterType((*KV)(nil), "protos.KV")
	proto.RegisterType((*CrawlResponse)(nil), "protos.CrawlResponse")
	proto.RegisterType((*Metadata)(nil), "protos.Metadata")
	proto.RegisterEnum("protos.Method", Method_name, Method_value)
}

示例#20
文件: channel_invitation_types.pb.go 项目: HearthSim/hs-proto-go

func init() {
	proto.RegisterType((*ChannelInvitation)(nil), "channel_invitation_types.ChannelInvitation")
	proto.RegisterType((*ChannelInvitationParams)(nil), "channel_invitation_types.ChannelInvitationParams")
	proto.RegisterType((*InvitationCollection)(nil), "channel_invitation_types.InvitationCollection")
	proto.RegisterExtension(E_ChannelInvitation_ChannelInvitation)
	proto.RegisterExtension(E_ChannelInvitationParams_ChannelParams)
}

示例#21
文件: metapb.pb.go 项目: yubobo/tidb

func init() {
	proto.RegisterType((*Cluster)(nil), "metapb.Cluster")
	proto.RegisterType((*Store)(nil), "metapb.Store")
	proto.RegisterType((*RegionEpoch)(nil), "metapb.RegionEpoch")
	proto.RegisterType((*Region)(nil), "metapb.Region")
	proto.RegisterType((*Peer)(nil), "metapb.Peer")
}

示例#22
文件: dht_message.pb.go 项目: hamersaw/coteriego

func init() {
	proto.RegisterType((*DHTMsg)(nil), "dht.DHTMsg")
	proto.RegisterType((*HeartbeatMsg)(nil), "dht.HeartbeatMsg")
	proto.RegisterType((*LookupTableDumpMsg)(nil), "dht.LookupTableDumpMsg")
	proto.RegisterType((*ResultMsg)(nil), "dht.ResultMsg")
	proto.RegisterEnum("dht.DHTMsg_Type", DHTMsg_Type_name, DHTMsg_Type_value)
}

示例#23
文件: trace.pb.go 项目: ZhuJingfa/go-platform

func init() {
	proto.RegisterType((*Annotation)(nil), "go.micro.platform.trace.Annotation")
	proto.RegisterType((*Span)(nil), "go.micro.platform.trace.Span")
	proto.RegisterType((*Service)(nil), "go.micro.platform.trace.Service")
	proto.RegisterType((*Node)(nil), "go.micro.platform.trace.Node")
	proto.RegisterEnum("go.micro.platform.trace.Annotation_Type", Annotation_Type_name, Annotation_Type_value)
}

示例#24
文件: networksystem_protomessages.pb.go 项目: HighGroundVision/Manta

func init() {
	proto.RegisterType((*NetMessageSplitscreenUserChanged)(nil), "dota.NetMessageSplitscreenUserChanged")
	proto.RegisterType((*NetMessageConnectionClosed)(nil), "dota.NetMessageConnectionClosed")
	proto.RegisterType((*NetMessageConnectionCrashed)(nil), "dota.NetMessageConnectionCrashed")
	proto.RegisterType((*NetMessagePacketStart)(nil), "dota.NetMessagePacketStart")
	proto.RegisterType((*NetMessagePacketEnd)(nil), "dota.NetMessagePacketEnd")
}

示例#25
文件: pkggraph.pb.go 项目: peter-edge/pkg-go

func init() {
	proto.RegisterType((*NodeWaiting)(nil), "pkggraph.NodeWaiting")
	proto.RegisterType((*NodeFinishedWaiting)(nil), "pkggraph.NodeFinishedWaiting")
	proto.RegisterType((*NodeStarting)(nil), "pkggraph.NodeStarting")
	proto.RegisterType((*NodeFinished)(nil), "pkggraph.NodeFinished")
	proto.RegisterType((*NodeSending)(nil), "pkggraph.NodeSending")
}

示例#26
文件: mail_service.pb.go 项目: David-Shibley/goPlayground

func init() {
	proto.RegisterType((*MailServiceError)(nil), "appengine.MailServiceError")
	proto.RegisterType((*MailAttachment)(nil), "appengine.MailAttachment")
	proto.RegisterType((*MailHeader)(nil), "appengine.MailHeader")
	proto.RegisterType((*MailMessage)(nil), "appengine.MailMessage")
	proto.RegisterEnum("appengine.MailServiceError_ErrorCode", MailServiceError_ErrorCode_name, MailServiceError_ErrorCode_value)
}

示例#27
文件: peer-rpc.pb.go 项目: kshlm/glusterd2

func init() {
	proto.RegisterType((*PeerAddReq)(nil), "peercommands.PeerAddReq")
	proto.RegisterType((*PeerAddResp)(nil), "peercommands.PeerAddResp")
	proto.RegisterType((*PeerGenericResp)(nil), "peercommands.PeerGenericResp")
	proto.RegisterType((*PeerDeleteReq)(nil), "peercommands.PeerDeleteReq")
	proto.RegisterType((*EtcdConfigReq)(nil), "peercommands.EtcdConfigReq")
}

示例#28
文件: remote_api.pb.go 项目: David-Shibley/goPlayground

func init() {
	proto.RegisterType((*Request)(nil), "appengine.ext.remote_api.Request")
	proto.RegisterType((*ApplicationError)(nil), "appengine.ext.remote_api.ApplicationError")
	proto.RegisterType((*RpcError)(nil), "appengine.ext.remote_api.RpcError")
	proto.RegisterType((*Response)(nil), "appengine.ext.remote_api.Response")
	proto.RegisterEnum("appengine.ext.remote_api.RpcError_ErrorCode", RpcError_ErrorCode_name, RpcError_ErrorCode_value)
}

示例#29
文件: flow_combination.pb.go 项目: JohanSJA/grpc-gateway

func init() {
	proto.RegisterType((*EmptyProto)(nil), "gengo.grpc.gateway.examples.examplepb.EmptyProto")
	proto.RegisterType((*NonEmptyProto)(nil), "gengo.grpc.gateway.examples.examplepb.NonEmptyProto")
	proto.RegisterType((*UnaryProto)(nil), "gengo.grpc.gateway.examples.examplepb.UnaryProto")
	proto.RegisterType((*NestedProto)(nil), "gengo.grpc.gateway.examples.examplepb.NestedProto")
	proto.RegisterType((*SingleNestedProto)(nil), "gengo.grpc.gateway.examples.examplepb.SingleNestedProto")
}

示例#30
文件: flow.pb.go 项目: mestery/skydive

func init() {
	proto.RegisterType((*FlowEndpointStatistics)(nil), "flow.FlowEndpointStatistics")
	proto.RegisterType((*FlowEndpointsStatistics)(nil), "flow.FlowEndpointsStatistics")
	proto.RegisterType((*FlowStatistics)(nil), "flow.FlowStatistics")
	proto.RegisterType((*Flow)(nil), "flow.Flow")
	proto.RegisterEnum("flow.FlowEndpointType", FlowEndpointType_name, FlowEndpointType_value)
}

展开阅读全文