Skip to content

Instantly share code, notes, and snippets.

@davidbirdsong
Created February 8, 2014 06:48
Show Gist options
  • Select an option

  • Save davidbirdsong/8877708 to your computer and use it in GitHub Desktop.

Select an option

Save davidbirdsong/8877708 to your computer and use it in GitHub Desktop.
decoder based protobuf Marshal
//ev.Event.Value is []byte array from kakfa
messageLen := len(ev.Event.Value)
if messageLen > cap(pack.MsgBytes) {
pack.MsgBytes = make([]byte, messageLen)
}
copy(pack.MsgBytes, ev.Event.Value)
dRunner.InChan() <- pack
}
ev.Recycle()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment