func (e *loggingEmitter) Emit(data []byte) (err error) {
	envelope := new(events.Envelope)
	err = proto.Unmarshal(data, envelope)
	if err != nil {
		return
	}

	log.Printf("Emitting %s\n", proto.CompactTextString(envelope))
	return
}
示例#2
0
func TestFooProtoCompactText(t *testing2.T) {
	popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano()))
	p := NewPopulatedFoo(popr, true)
	data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p)
	msg := &Foo{}
	if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil {
		panic(err)
	}
	if !p.Equal(msg) {
		t.Fatalf("%#v !Proto %#v", msg, p)
	}
}
示例#3
0
func TestPreAcceptReplyProtoCompactText(t *testing2.T) {
	popr := math_rand2.New(math_rand2.NewSource(time2.Now().UnixNano()))
	p := NewPopulatedPreAcceptReply(popr, true)
	data := code_google_com_p_gogoprotobuf_proto1.CompactTextString(p)
	msg := &PreAcceptReply{}
	if err := code_google_com_p_gogoprotobuf_proto1.UnmarshalText(data, msg); err != nil {
		panic(err)
	}
	if err := p.VerboseEqual(msg); err != nil {
		t.Fatalf("%#v !VerboseProto %#v, since %v", msg, p, err)
	}
	if !p.Equal(msg) {
		t.Fatalf("%#v !Proto %#v", msg, p)
	}
}
示例#4
0
func (m *CDOTAClientMsg_SearchString) String() string { return proto.CompactTextString(m) }
示例#5
0
func (m *CDOTAClientMsg_RecordVote) String() string { return proto.CompactTextString(m) }
示例#6
0
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
示例#7
0
func (m *StreamInResponse) String() string { return proto.CompactTextString(m) }
示例#8
0
func (m *CDOTAClientMsg_BroadcasterUsingAssistedCameraOperator) String() string {
	return proto.CompactTextString(m)
}
示例#9
0
func (m *LogMessage) String() string { return proto.CompactTextString(m) }
示例#10
0
func (m *CDOTAClientMsg_RequestGraphUpdate) String() string { return proto.CompactTextString(m) }
示例#11
0
func (m *CDOTAClientMsg_CameraZoomAmount) String() string { return proto.CompactTextString(m) }
示例#12
0
func (m *CDOTAClientMsg_SwapAccept) String() string { return proto.CompactTextString(m) }
示例#13
0
func (m *CDOTAClientMsg_WorldLine) String() string { return proto.CompactTextString(m) }
示例#14
0
func (m *CDOTAClientMsg_SetUnitShareFlag) String() string { return proto.CompactTextString(m) }
示例#15
0
func (m *CDOTAClientMsg_ShopViewMode) String() string { return proto.CompactTextString(m) }
示例#16
0
func (m *CDOTAClientMsg_Pause) String() string { return proto.CompactTextString(m) }
示例#17
0
func (m *CDOTAClientMsg_WillPurchaseAlert) String() string { return proto.CompactTextString(m) }
示例#18
0
func (m *CDOTAClientMsg_ChatWheel) String() string { return proto.CompactTextString(m) }
示例#19
0
func (m *CDOTAClientMsg_PlayerShowCase) String() string { return proto.CompactTextString(m) }
示例#20
0
func (m *CDOTAClientMsg_SendStatPopup) String() string { return proto.CompactTextString(m) }
示例#21
0
func (m *CDOTAClientMsg_BroadcasterUsingCameraman) String() string { return proto.CompactTextString(m) }
示例#22
0
func (m *CDOTAClientMsg_BeginLastHitChallenge) String() string { return proto.CompactTextString(m) }
示例#23
0
文件: text_test.go 项目: hail100/cli
func TestCompactText(t *testing.T) {
	s := proto.CompactTextString(newTestMessage())
	if s != compactText {
		t.Errorf("Got:\n===\n%v===\nExpected:\n===\n%v\n===\n", s, compactText)
	}
}
示例#24
0
func (m *CDOTAClientMsg_UpdateQuickBuy) String() string { return proto.CompactTextString(m) }
示例#25
0
func (m *ListRequest) String() string { return proto.CompactTextString(m) }
示例#26
0
func (m *CDOTAClientMsg_AutoPurchaseItems) String() string { return proto.CompactTextString(m) }
示例#27
0
func (m *StreamInRequest) String() string { return proto.CompactTextString(m) }
示例#28
0
func (m *CDOTAClientMsg_CoachHUDPing) String() string { return proto.CompactTextString(m) }
示例#29
0
func (m *CDOTAClientMsg_UpdateCoachListen) String() string { return proto.CompactTextString(m) }
示例#30
0
func (m *CDOTAClientMsg_TestItems) String() string { return proto.CompactTextString(m) }