summaryrefslogtreecommitdiff
path: root/identify.go
diff options
context:
space:
mode:
Diffstat (limited to 'identify.go')
-rw-r--r--identify.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/identify.go b/identify.go
new file mode 100644
index 0000000..c84f385
--- /dev/null
+++ b/identify.go
@@ -0,0 +1,17 @@
+package forgepb
+
+import (
+ "go.wit.com/log"
+)
+
+// print the protobuf in human form
+func IdentifyProtobuf(data []byte) error {
+ var pb *Identify
+ pb = new(Identify)
+ if err := pb.Unmarshal(data); err != nil {
+ log.Info("data can't be identified as a standard protobuf. len =", len(data))
+ return err
+ }
+ log.Info("Identify protobuf file uuid =", pb.Uuid, "version =", pb.Version)
+ return nil
+}