91 lines
2.9 KiB
Plaintext
91 lines
2.9 KiB
Plaintext
// `autogen:go.mod`
|
|
|
|
module go.wit.com/toolkits/tree
|
|
|
|
go 1.22
|
|
|
|
toolchain go1.23.6
|
|
|
|
require (
|
|
go.wit.com/lib/protobuf/guipb v0.0.2
|
|
go.wit.com/log v0.22.16
|
|
go.wit.com/widget v1.1.29
|
|
google.golang.org/protobuf v1.36.5
|
|
)
|
|
|
|
// `autogen:go.sum`
|
|
|
|
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
go.wit.com/lib/protobuf/guipb v0.0.2 h1:ZR4cLy+XheRQEFLlissBmASJDqiLfHaAluF6wYbVuOo=
|
|
go.wit.com/lib/protobuf/guipb v0.0.2/go.mod h1:mZsirb7zRgsE2IGHuvHkG7j85hkrGZl3NAALOEkjowA=
|
|
go.wit.com/log v0.22.16 h1:E0Vd0Z2ILtfjhs7J/CQ4g13DK1jtQiYl6l5KOBGsZoA=
|
|
go.wit.com/log v0.22.16/go.mod h1:/c5Uj30sWRQ4B5ei2ElB6Q8Si/cK6v+KbxnH208KD84=
|
|
go.wit.com/widget v1.1.29 h1:rURM/N1hbrl0btGlBIUx0SCre9jj+hshvkBLMMa008I=
|
|
go.wit.com/widget v1.1.29/go.mod h1:wj7TpAr2gk7Poa+v8XQkH1aidnTdgAa/a8GxrMtcztw=
|
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
|
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
|
|
// `autogen:toolkitConfig.marshal.pb.go`
|
|
|
|
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
|
|
// This file was autogenerated with autogenpb v0.0.52-1-g4fdcc99 2025.02.12_1512
|
|
// 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 tree
|
|
|
|
import (
|
|
"google.golang.org/protobuf/encoding/protojson"
|
|
"google.golang.org/protobuf/encoding/prototext"
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
// human readable JSON
|
|
func (v *ToolkitConfigs) FormatJSON() string {
|
|
return protojson.Format(v)
|
|
}
|
|
|
|
// marshal json
|
|
func (v *ToolkitConfigs) MarshalJSON() ([]byte, error) {
|
|
return protojson.Marshal(v)
|
|
}
|
|
|
|
// unmarshal json
|
|
func (v *ToolkitConfigs) 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 *ToolkitConfigs) FormatTEXT() string {
|
|
v.fixUuid()
|
|
return prototext.Format(v)
|
|
}
|
|
|
|
// unmarshalTEXT. This reads the .text config file back in after the user edits it
|
|
func (v *ToolkitConfigs) UnmarshalTEXT(data []byte) error {
|
|
return prototext.Unmarshal(data, v)
|
|
}
|
|
|
|
// marshal to wire. This is called winning.
|
|
func (v *ToolkitConfigs) Marshal() ([]byte, error) {
|
|
v.fixUuid()
|
|
return proto.Marshal(v)
|
|
}
|
|
|
|
// unmarshal from wire. You have won.
|
|
func (v *ToolkitConfigs) Unmarshal(data []byte) error {
|
|
return proto.Unmarshal(data, v)
|
|
}
|
|
|
|
// `autogen:toolkitConfig.pb.go`
|