summaryrefslogtreecommitdiff
path: root/helpers.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-27 21:21:06 -0600
committerJeff Carr <[email protected]>2024-11-27 21:21:06 -0600
commitf5ad4a7a41deb9f8b35c39c46d6ae31276c1e117 (patch)
tree13b669b29cf973cdd46063479e42533acb203829 /helpers.go
parent0fc7c2d753bc6cfdc4d64425da1a23c3735b8409 (diff)
geez
Diffstat (limited to 'helpers.go')
-rw-r--r--helpers.go60
1 files changed, 0 insertions, 60 deletions
diff --git a/helpers.go b/helpers.go
deleted file mode 100644
index 8dc71e9..0000000
--- a/helpers.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package forgepb
-
-// TODO: autogen this
-// functions to import and export the protobuf
-// data to and from config files
-
-import (
- "google.golang.org/protobuf/encoding/protojson"
- "google.golang.org/protobuf/encoding/prototext"
- "google.golang.org/protobuf/proto"
- // "google.golang.org/protobuf/proto"
-)
-
-// human readable JSON
-func (p *Repos) FormatJSON() string {
- return protojson.Format(p)
-}
-
-// 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()
-// TODO: fix things so this is the default
-func (p *Repos) FormatTEXT() string {
- return prototext.Format(p)
-}
-
-// unmarshalTEXT
-func (p *Repos) UnmarshalTEXT(data []byte) error {
- return prototext.Unmarshal(data, p)
-}
-
-// marshal json
-func (p *Repos) MarshalJSON() ([]byte, error) {
- return protojson.Marshal(p)
-}
-
-// unmarshal
-func (p *Repos) UnmarshalJSON(data []byte) error {
- return protojson.Unmarshal(data, p)
-}
-
-// marshal to wire
-func (m *Repo) Marshal() ([]byte, error) {
- return proto.Marshal(m)
-}
-
-// unmarshal from wire
-func (m *Repo) Unmarshal(data []byte) error {
- return proto.Unmarshal(data, m)
-}
-
-// marshal to wire
-func (m *Repos) Marshal() ([]byte, error) {
- return proto.Marshal(m)
-}
-
-// unmarshal from wire
-func (m *Repos) Unmarshal(data []byte) error {
- return proto.Unmarshal(data, m)
-}