summaryrefslogtreecommitdiff
path: root/blah_marshal
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-29 12:03:35 -0600
committerJeff Carr <[email protected]>2024-11-29 12:03:35 -0600
commit45b343bee8b1b38ad89899f31624613925bb408e (patch)
tree8a159e6eadc7b186a5c130928b858162a5addf5a /blah_marshal
parent69093ef5de0eb6a5f78ff55e3e28c416224e8232 (diff)
might be pretty good stuff
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'blah_marshal')
-rw-r--r--blah_marshal42
1 files changed, 0 insertions, 42 deletions
diff --git a/blah_marshal b/blah_marshal
deleted file mode 100644
index 738ae35..0000000
--- a/blah_marshal
+++ /dev/null
@@ -1,42 +0,0 @@
-package gitpb
-
-// todo: autogen this
-// functions to import and export the protobuf
-
-import (
- "google.golang.org/protobuf/encoding/protojson"
- "google.golang.org/protobuf/encoding/prototext"
- "google.golang.org/protobuf/proto"
-)
-
-// human readable JSON
-func (r *Repo) FormatJSON() string {
- return protojson.Format(r)
-}
-
-// apparently this isn't supposed to be used?
-// https://protobuf.dev/reference/go/faq/#unstable-text
-// this is a shame because this is much nicer output than JSON Format()
-func (r *Repo) FormatTEXT() string {
- return prototext.Format(r)
-}
-
-// marshal json
-func (r *Repo) MarshalJSON() ([]byte, error) {
- return protojson.Marshal(r)
-}
-
-// unmarshal
-func (r *Repo) UnmarshalJSON(data []byte) error {
- return protojson.Unmarshal(data, r)
-}
-
-// marshal to wire
-func (r *Repo) Marshal() ([]byte, error) {
- return proto.Marshal(r)
-}
-
-// unmarshal from wire
-func (r *Repo) Unmarshal(data []byte) error {
- return proto.Unmarshal(data, r)
-}