diff options
| author | Jeff Carr <[email protected]> | 2024-11-21 19:00:08 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-21 19:00:08 -0600 |
| commit | 1f0a18a0a8e21a831dbc002b8b4110298739b875 (patch) | |
| tree | 0b8981422d4722f76590f762b1a0a93f437b5cb5 /helpers.go | |
| parent | 5581a4eb9c500b9fede39cb5b0202b53ba66fbc2 (diff) | |
prepare to autogen these files
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'helpers.go')
| -rw-r--r-- | helpers.go | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/helpers.go b/helpers.go deleted file mode 100644 index 390da5c..0000000 --- a/helpers.go +++ /dev/null @@ -1,63 +0,0 @@ -package zoopb - -// 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 *Packages) 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() -func (p *Packages) FormatTEXT() string { - return prototext.Format(p) -} - -// marshal json -func (p *Packages) MarshalJSON() ([]byte, error) { - return protojson.Marshal(p) -} - -// unmarshal -func (p *Packages) UnmarshalJSON(data []byte) error { - return protojson.Unmarshal(data, p) -} - -// marshal to wire -func (p *Packages) Marshal() ([]byte, error) { - return proto.Marshal(p) -} - -// unmarshal from wire -func (p *Packages) Unmarshal(data []byte) error { - return proto.Unmarshal(data, p) -} - -// marshal to wire -func (m *Machine) Marshal() ([]byte, error) { - return proto.Marshal(m) -} - -// unmarshal from wire -func (m *Machine) Unmarshal(data []byte) error { - return proto.Unmarshal(data, m) -} - -// marshal to wire -func (m *Machines) Marshal() ([]byte, error) { - return proto.Marshal(m) -} - -// unmarshal from wire -func (m *Machines) Unmarshal(data []byte) error { - return proto.Unmarshal(data, m) -} |
