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
92
93
|
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
// This file was autogenerated with autogenpb v0.5.14 2025-09-28_00:11:07_UTC
// 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 prep
import (
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
)
// human readable JSON
func (v *Autos) FormatJSON() string {
return protojson.Format(v)
}
// marshal json
func (v *Autos) MarshalJSON() ([]byte, error) {
return protojson.Marshal(v)
}
// unmarshal json
func (v *Autos) 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 *Autos) FormatTEXT() string {
v.fixUuid()
return prototext.Format(v)
}
// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *Autos) UnmarshalTEXT(data []byte) error {
return prototext.Unmarshal(data, v)
}
// marshal to wire. This is called winning.
func (v *Autos) Marshal() ([]byte, error) {
v.fixUuid()
return proto.Marshal(v)
}
// unmarshal from wire. You have won.
func (v *Autos) Unmarshal(data []byte) error {
return proto.Unmarshal(data, v)
}
// human readable JSON
func (v *Auto) FormatJSON() string {
return protojson.Format(v)
}
// marshal json
func (v *Auto) MarshalJSON() ([]byte, error) {
return protojson.Marshal(v)
}
// unmarshal json
func (v *Auto) 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 *Auto) FormatTEXT() string {
return prototext.Format(v)
}
// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *Auto) UnmarshalTEXT(data []byte) error {
return prototext.Unmarshal(data, v)
}
// marshal to wire. This is called winning.
func (v *Auto) Marshal() ([]byte, error) {
return proto.Marshal(v)
}
// unmarshal from wire. You have won.
func (v *Auto) Unmarshal(data []byte) error {
return proto.Unmarshal(data, v)
}
|