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) }