func (e *encoderDecoder) marshal(tStruct thrift.TStruct) ([]byte, error) { tMemoryBuffer := thrift.NewTMemoryBuffer() tProtocol := e.tProtocolFactory.GetProtocol(tMemoryBuffer) if err := tStruct.Write(tProtocol); err != nil { return nil, err } return tMemoryBuffer.Bytes(), nil }
func SerializeSpan(s *zipkincore.Span) ([]byte, error) { t := thrift.NewTMemoryBuffer() p := thrift.NewTBinaryProtocolTransport(t) err := s.Write(p) if err != nil { return nil, err } return t.Buffer.Bytes(), nil }
func (c *UDPCollector) send(s *zipkin.Span) error { t := thrift.NewTMemoryBuffer() p := thrift.NewTBinaryProtocolTransport(t) err := s.Write(p) if err != nil { return err } _, err = c.conn.WriteToUDP(t.Buffer.Bytes(), c.addr) return err }
// Collect will serialize and send a zipkin.Span to the configured Scribe // endpoint func (c *ScribeCollector) Collect(s *zipkin.Span) { t := thrift.NewTMemoryBuffer() p := thrift.NewTBinaryProtocolTransport(t) err := s.Write(p) if err != nil { logger.Errore(err) } else { logger.Errore(c.CollectSerialized(t.Buffer.Bytes())) } }