blob: fd6d5057ce8ff08eddebe7dd4f541198645adde8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
// This file was autogenerated with autogenpb v0.0.42-1-gf74f364 2025.01.13_0345
// go install go.wit.com/apps/autogenpb@latest
//
// define which structs (messages) you want to use in the .proto file
// Then sort.pb.go and marshal.pb.go files are autogenerated
//
// autogenpb uses it and has an example .proto file with instructions
//
package main
import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
)
// human readable JSON
func (v *Files) FormatJSON() string {
return protojson.Format(v)
}
// marshal json
func (v *Files) MarshalJSON() ([]byte, error) {
return protojson.Marshal(v)
}
// unmarshal json
func (v *Files) UnmarshalJSON(data []byte) error {
return protojson.Unmarshal(data, v)
}
// apparently this isn't stable, but it's awesomely better
// https://protobuf.dev/reference/go/faq/#unstable-text
// it's brilliant for config files!
func (v *Files) FormatTEXT() string {
return prototext.Format(v)
}
// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *Files) UnmarshalTEXT(data []byte) error {
return prototext.Unmarshal(data, v)
}
// marshal to wire. This is called winning.
func (v *Files) Marshal() ([]byte, error) {
return proto.Marshal(v)
}
// unmarshal from wire. You have won.
func (v *Files) Unmarshal(data []byte) error {
return proto.Unmarshal(data, v)
}
// human readable JSON
func (v *Identify) FormatJSON() string {
return protojson.Format(v)
}
// marshal json
func (v *Identify) MarshalJSON() ([]byte, error) {
return protojson.Marshal(v)
}
// unmarshal json
func (v *Identify) UnmarshalJSON(data []byte) error {
return protojson.Unmarshal(data, v)
}
// apparently this isn't stable, but it's awesomely better
// https://protobuf.dev/reference/go/faq/#unstable-text
// it's brilliant for config files!
func (v *Identify) FormatTEXT() string {
return prototext.Format(v)
}
// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *Identify) UnmarshalTEXT(data []byte) error {
return prototext.Unmarshal(data, v)
}
// marshal to wire. This is called winning.
func (v *Identify) Marshal() ([]byte, error) {
return proto.Marshal(v)
}
// unmarshal from wire. You have won.
func (v *Identify) Unmarshal(data []byte) error {
return proto.Unmarshal(data, v)
}
|