diff --git a/7900b1416e94feeadf133232e33f2938b672702f b/7900b1416e94feeadf133232e33f2938b672702f deleted file mode 100644 index 8d0bc00..0000000 --- a/7900b1416e94feeadf133232e33f2938b672702f +++ /dev/null @@ -1,2067 +0,0 @@ -// `autogen:go.mod` - -module go.wit.com/lib/protobuf/forgepb - -go 1.22 - -toolchain go1.23.6 - -require ( - github.com/destel/rill v0.7.0 - github.com/google/uuid v1.6.0 - go.wit.com/lib/gui/shell v0.22.26 - go.wit.com/lib/protobuf/gitpb v0.0.78 - go.wit.com/lib/protobuf/zoopb v0.0.26 - go.wit.com/log v0.22.16 - google.golang.org/protobuf v1.36.5 -) - -require ( - github.com/go-cmd/cmd v1.4.3 // indirect - golang.org/x/sys v0.30.0 // indirect -) - -// `autogen:go.sum` - -github.com/destel/rill v0.7.0 h1:LJUbeMACaO+/e8rUNk940kYVESD/dbrhAp6M14IjQ0c= -github.com/destel/rill v0.7.0/go.mod h1:srKuXzvGqINUEGYR5b/iwvW+L9/S35RxVHWGYbXNoO4= -github.com/go-cmd/cmd v1.4.3 h1:6y3G+3UqPerXvPcXvj+5QNPHT02BUw7p6PsqRxLNA7Y= -github.com/go-cmd/cmd v1.4.3/go.mod h1:u3hxg/ry+D5kwh8WvUkHLAMe2zQCaXd00t35WfQaOFk= -github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= -github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= -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= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -go.wit.com/lib/gui/shell v0.22.26 h1:F+7aadEujsTgyBEs5ptKGL6N72reDkGd/7b0Ju4HeTU= -go.wit.com/lib/gui/shell v0.22.26/go.mod h1:Km5o+DLU5up5jvTEum9wiTdsZZG/EUNERVzn2wJ6DBE= -go.wit.com/lib/protobuf/gitpb v0.0.78 h1:tOO8D//jmacp2Chx7Fz1MZo9snxIq4F5qH9Mlm+n+qw= -go.wit.com/lib/protobuf/gitpb v0.0.78/go.mod h1:fsefHgERvcJpQ4YMGYOVM7lep+yYH+LsLJolhVWCrjc= -go.wit.com/lib/protobuf/zoopb v0.0.26 h1:sdw6FKummoMegxgHw3b+PtyAXZWCU1zOw+77fCoM2mg= -go.wit.com/lib/protobuf/zoopb v0.0.26/go.mod h1:CNZmHSG+H41Gw1xuJvW1E4ef5eQCPptzIg1U5nfSGV4= -go.wit.com/log v0.22.16 h1:E0Vd0Z2ILtfjhs7J/CQ4g13DK1jtQiYl6l5KOBGsZoA= -go.wit.com/log v0.22.16/go.mod h1:/c5Uj30sWRQ4B5ei2ElB6Q8Si/cK6v+KbxnH208KD84= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -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:forgeConfig.marshal.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.54 2025-02-15_02:56:28_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 forgepb - -import ( - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" -) - -// human readable JSON -func (v *ForgeConfigs) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *ForgeConfigs) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *ForgeConfigs) 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 *ForgeConfigs) FormatTEXT() string { - v.fixUuid() - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *ForgeConfigs) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *ForgeConfigs) Marshal() ([]byte, error) { - v.fixUuid() - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *ForgeConfigs) Unmarshal(data []byte) error { - return proto.Unmarshal(data, v) -} - -// `autogen:forgeConfig.pb.go` - -// Code modified by go.wit.com/apps/autogenpb DO NOT EDIT. -// -// user defined Mutex locks were auto added -// -// autogenpb version & build time: v0.0.54 2025-02-15_02:56:28_UTC -// autogenpb auto generates Sort(), Unique() and Marshal() functions -// go install go.wit.com/apps/autogenpb@latest - -// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v3.21.12 -// source: forgeConfig.proto - -package forgepb // autogenpb changed the package name - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// define 3 branches. that is all that is supported -// the term 'master' is used in the code because 'main' is a reserved word in golang already -// allow 'read only' and 'private' flags -// package names sometimes must be different than the binary name -// for example 'zookeeper' is packaged as 'zookeeper-go' -// -// due to the prior apache foundation project. This happens and is ok! -type ForgeConfig struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GoPath string `protobuf:"bytes,1,opt,name=goPath,proto3" json:"goPath,omitempty"` // `autogenpb:unique` `autogenpb:sort` // Examples: 'go.wit.com/apps/go-clone' or "~/mythings" or "/home/src/foo" - Writable bool `protobuf:"varint,2,opt,name=writable,proto3" json:"writable,omitempty"` // if you have write access to the repo - ReadOnly bool `protobuf:"varint,3,opt,name=readOnly,proto3" json:"readOnly,omitempty"` // the opposite, but needed for now because I don't know what I'm doing - Private bool `protobuf:"varint,4,opt,name=private,proto3" json:"private,omitempty"` // if the repo can be published - Directory bool `protobuf:"varint,5,opt,name=directory,proto3" json:"directory,omitempty"` // everything in this directory should use these writable & private values - Favorite bool `protobuf:"varint,6,opt,name=favorite,proto3" json:"favorite,omitempty"` // you like this. always git clone/go clone this repo - Interesting bool `protobuf:"varint,7,opt,name=interesting,proto3" json:"interesting,omitempty"` // this is something interesting you found and want to remember it - MasterBranchName string `protobuf:"bytes,8,opt,name=masterBranchName,proto3" json:"masterBranchName,omitempty"` // git 'main' or 'master' branch name - DevelBranchName string `protobuf:"bytes,9,opt,name=develBranchName,proto3" json:"develBranchName,omitempty"` // whatever the git 'devel' branch name is - UserBranchName string `protobuf:"bytes,10,opt,name=userBranchName,proto3" json:"userBranchName,omitempty"` // whatever your username branch is - DebName string `protobuf:"bytes,11,opt,name=debName,proto3" json:"debName,omitempty"` // the actual name used with 'apt install' (or distro apt equivalent. - Verstamp *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=verstamp,proto3" json:"verstamp,omitempty"` // the git commit timestamp of the version - GoSrc string `protobuf:"bytes,13,opt,name=goSrc,proto3" json:"goSrc,omitempty"` // is ~/go/src unless a go.work file is found -} - -func (x *ForgeConfig) Reset() { - *x = ForgeConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_forgeConfig_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ForgeConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ForgeConfig) ProtoMessage() {} - -func (x *ForgeConfig) ProtoReflect() protoreflect.Message { - mi := &file_forgeConfig_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ForgeConfig.ProtoReflect.Descriptor instead. -func (*ForgeConfig) Descriptor() ([]byte, []int) { - return file_forgeConfig_proto_rawDescGZIP(), []int{0} -} - -func (x *ForgeConfig) GetGoPath() string { - if x != nil { - return x.GoPath - } - return "" -} - -func (x *ForgeConfig) GetWritable() bool { - if x != nil { - return x.Writable - } - return false -} - -func (x *ForgeConfig) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -func (x *ForgeConfig) GetPrivate() bool { - if x != nil { - return x.Private - } - return false -} - -func (x *ForgeConfig) GetDirectory() bool { - if x != nil { - return x.Directory - } - return false -} - -func (x *ForgeConfig) GetFavorite() bool { - if x != nil { - return x.Favorite - } - return false -} - -func (x *ForgeConfig) GetInteresting() bool { - if x != nil { - return x.Interesting - } - return false -} - -func (x *ForgeConfig) GetMasterBranchName() string { - if x != nil { - return x.MasterBranchName - } - return "" -} - -func (x *ForgeConfig) GetDevelBranchName() string { - if x != nil { - return x.DevelBranchName - } - return "" -} - -func (x *ForgeConfig) GetUserBranchName() string { - if x != nil { - return x.UserBranchName - } - return "" -} - -func (x *ForgeConfig) GetDebName() string { - if x != nil { - return x.DebName - } - return "" -} - -func (x *ForgeConfig) GetVerstamp() *timestamppb.Timestamp { - if x != nil { - return x.Verstamp - } - return nil -} - -func (x *ForgeConfig) GetGoSrc() string { - if x != nil { - return x.GoSrc - } - return "" -} - -type ForgeConfigs struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:1941cd4f-1cfd-4bf6-aa75-c2c391907e81` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.47` - ForgeConfigs []*ForgeConfig `protobuf:"bytes,3,rep,name=ForgeConfigs,proto3" json:"ForgeConfigs,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` // what to use for the user branch (default ENV{USER}) - Xterm string `protobuf:"bytes,5,opt,name=xterm,proto3" json:"xterm,omitempty"` // what xterm the user wants as the default - XtermArgv []string `protobuf:"bytes,6,rep,name=xtermArgv,proto3" json:"xtermArgv,omitempty"` // the argv line for xterm - DefaultGui string `protobuf:"bytes,7,opt,name=defaultGui,proto3" json:"defaultGui,omitempty"` // default GUI plugin to use -} - -func (x *ForgeConfigs) Reset() { - *x = ForgeConfigs{} - if protoimpl.UnsafeEnabled { - mi := &file_forgeConfig_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ForgeConfigs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ForgeConfigs) ProtoMessage() {} - -func (x *ForgeConfigs) ProtoReflect() protoreflect.Message { - mi := &file_forgeConfig_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ForgeConfigs.ProtoReflect.Descriptor instead. -func (*ForgeConfigs) Descriptor() ([]byte, []int) { - return file_forgeConfig_proto_rawDescGZIP(), []int{1} -} - -func (x *ForgeConfigs) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *ForgeConfigs) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ForgeConfigs) GetForgeConfigs() []*ForgeConfig { - if x != nil { - return x.ForgeConfigs - } - return nil -} - -func (x *ForgeConfigs) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ForgeConfigs) GetXterm() string { - if x != nil { - return x.Xterm - } - return "" -} - -func (x *ForgeConfigs) GetXtermArgv() []string { - if x != nil { - return x.XtermArgv - } - return nil -} - -func (x *ForgeConfigs) GetDefaultGui() string { - if x != nil { - return x.DefaultGui - } - return "" -} - -var File_forgeConfig_proto protoreflect.FileDescriptor - -var file_forgeConfig_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x03, - 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, - 0x06, 0x67, 0x6f, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, - 0x6f, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x77, 0x72, 0x69, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x72, 0x69, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x18, 0x0a, - 0x07, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x67, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, - 0x61, 0x73, 0x74, 0x65, 0x72, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x42, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x75, 0x73, 0x65, - 0x72, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x62, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x76, - 0x65, 0x72, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x6f, 0x53, 0x72, 0x63, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x67, 0x6f, 0x53, 0x72, 0x63, 0x22, 0xe6, 0x01, 0x0a, 0x0c, 0x46, 0x6f, - 0x72, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0c, 0x46, 0x6f, 0x72, 0x67, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x72, 0x67, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x46, 0x6f, 0x72, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x78, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x78, - 0x74, 0x65, 0x72, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x74, 0x65, 0x72, 0x6d, 0x41, 0x72, 0x67, - 0x76, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x78, 0x74, 0x65, 0x72, 0x6d, 0x41, 0x72, - 0x67, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x75, 0x69, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, - 0x75, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_forgeConfig_proto_rawDescOnce sync.Once - file_forgeConfig_proto_rawDescData = file_forgeConfig_proto_rawDesc -) - -func file_forgeConfig_proto_rawDescGZIP() []byte { - file_forgeConfig_proto_rawDescOnce.Do(func() { - file_forgeConfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_forgeConfig_proto_rawDescData) - }) - return file_forgeConfig_proto_rawDescData -} - -var file_forgeConfig_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_forgeConfig_proto_goTypes = []interface{}{ - (*ForgeConfig)(nil), // 0: forgepb.ForgeConfig - (*ForgeConfigs)(nil), // 1: forgepb.ForgeConfigs - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp -} -var file_forgeConfig_proto_depIdxs = []int32{ - 2, // 0: forgepb.ForgeConfig.verstamp:type_name -> google.protobuf.Timestamp - 0, // 1: forgepb.ForgeConfigs.ForgeConfigs:type_name -> forgepb.ForgeConfig - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_forgeConfig_proto_init() } -func file_forgeConfig_proto_init() { - if File_forgeConfig_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_forgeConfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForgeConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_forgeConfig_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForgeConfigs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_forgeConfig_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_forgeConfig_proto_goTypes, - DependencyIndexes: file_forgeConfig_proto_depIdxs, - MessageInfos: file_forgeConfig_proto_msgTypes, - }.Build() - File_forgeConfig_proto = out.File - file_forgeConfig_proto_rawDesc = nil - file_forgeConfig_proto_goTypes = nil - file_forgeConfig_proto_depIdxs = nil -} - -// `autogen:forgeConfig.sort.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.54 2025-02-15_02:56:28_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 forgepb - -import ( - "fmt" - "sort" - "sync" -) - -// a simple global lock -var forgeConfigMu sync.RWMutex - -func (x *ForgeConfigs) fixUuid() { - if x == nil { - return - } - if x.Uuid == "1941cd4f-1cfd-4bf6-aa75-c2c391907e81" { - return - } - x.Uuid = "1941cd4f-1cfd-4bf6-aa75-c2c391907e81" - x.Version = "v0.0.47 go.wit.com/lib/protobuf/forgepb" -} - -func NewForgeConfigs() *ForgeConfigs { - x := new(ForgeConfigs) - x.Uuid = "1941cd4f-1cfd-4bf6-aa75-c2c391907e81" - x.Version = "v0.0.47 go.wit.com/lib/protobuf/forgepb" - return x -} - -// START SORT - -// DEFINE THE ForgeConfigs ITERATOR. -// itializes a new iterator. -func newForgeConfigsIterator(things []*ForgeConfigs) *ForgeConfigsIterator { - return &ForgeConfigsIterator{things: things} -} - -type ForgeConfigsIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*ForgeConfigs - index int -} - -func (it *ForgeConfigsIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *ForgeConfigsIterator) Next() *ForgeConfigs { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in ForgeConfigsIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE ForgeConfig ITERATOR. -// itializes a new iterator. -func newForgeConfigIterator(things []*ForgeConfig) *ForgeConfigIterator { - return &ForgeConfigIterator{things: things} -} - -type ForgeConfigIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*ForgeConfig - index int -} - -func (it *ForgeConfigIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *ForgeConfigIterator) Next() *ForgeConfig { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in ForgeConfigIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// sort struct by GoPath -type ForgeConfigGoPath []*ForgeConfig - -func (a ForgeConfigGoPath) Len() int { return len(a) } -func (a ForgeConfigGoPath) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath } -func (a ForgeConfigGoPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *ForgeConfigs) allForgeConfigs() []*ForgeConfig { - forgeConfigMu.RLock() - defer forgeConfigMu.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*ForgeConfig - tmp = make([]*ForgeConfig, len(x.ForgeConfigs)) - for i, p := range x.ForgeConfigs { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the ForgeConfig protobufs -func (x *ForgeConfigs) selectAllForgeConfigs() []*ForgeConfig { - forgeConfigMu.RLock() - defer forgeConfigMu.RUnlock() - - // Create a new slice to hold pointers to each ForgeConfig - var tmp []*ForgeConfig - tmp = make([]*ForgeConfig, len(x.ForgeConfigs)) - for i, p := range x.ForgeConfigs { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} -func (x *ForgeConfigs) SortByGoPath() *ForgeConfigIterator { - // copy the pointers as fast as possible. - things := x.selectAllForgeConfigs() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(ForgeConfigGoPath(things)) - // slices.SortFunc(things, func(a, b *ForgeConfigs) bool { - // return a.GoPath < b.GoPath // Sort by ??. let the compiler work it out?? - // }) - return newForgeConfigIterator(things) -} - -// END SORT - -func (x *ForgeConfigs) Len() int { - forgeConfigMu.RLock() - defer forgeConfigMu.RUnlock() - - return len(x.ForgeConfigs) -} - -// just a simple Append() shortcut (but still uses the mutex lock) -func (x *ForgeConfigs) Append(y *ForgeConfig) { - forgeConfigMu.Lock() - defer forgeConfigMu.Unlock() - - x.ForgeConfigs = append(x.ForgeConfigs, y) -} - -func (x *ForgeConfigs) All() *ForgeConfigIterator { - ForgeConfigPointers := x.selectAllForgeConfigs() - - iterator := newForgeConfigIterator(ForgeConfigPointers) - return iterator -} - -func (x *ForgeConfigs) Delete(y *ForgeConfig) bool { - forgeConfigMu.Lock() - defer forgeConfigMu.Unlock() - - for i, _ := range x.ForgeConfigs { - if x.ForgeConfigs[i] == y { - x.ForgeConfigs[i] = x.ForgeConfigs[len(x.ForgeConfigs)-1] - x.ForgeConfigs = x.ForgeConfigs[:len(x.ForgeConfigs)-1] - return true - } - } - return false -} - -// lookup a ForgeConfigs by the GoPath -func (x *ForgeConfigs) FindByGoPath(s string) *ForgeConfig { - if x == nil { - return nil - } - - forgeConfigMu.RLock() - defer forgeConfigMu.RUnlock() - - for i, _ := range x.ForgeConfigs { - if x.ForgeConfigs[i].GoPath == s { - return x.ForgeConfigs[i] - } - } - return nil -} - -func (x *ForgeConfigs) DeleteByGoPath(s string) bool { - forgeConfigMu.Lock() - defer forgeConfigMu.Unlock() - - for i, _ := range x.ForgeConfigs { - if x.ForgeConfigs[i].GoPath == s { - x.ForgeConfigs[i] = x.ForgeConfigs[len(x.ForgeConfigs)-1] - x.ForgeConfigs = x.ForgeConfigs[:len(x.ForgeConfigs)-1] - return true - } - } - return false -} - -func (x *ForgeConfigs) AppendByGoPath(y *ForgeConfig) bool { - forgeConfigMu.Lock() - defer forgeConfigMu.Unlock() - - for _, p := range x.ForgeConfigs { - if p.GoPath == y.GoPath { - return false - } - } - - x.ForgeConfigs = append(x.ForgeConfigs, y) - return true -} - -// `autogen:patchset.marshal.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.54 2025-02-15_02:56:28_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 forgepb - -import ( - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" -) - -// human readable JSON -func (v *Patchsets) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *Patchsets) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *Patchsets) 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 *Patchsets) FormatTEXT() string { - v.fixUuid() - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *Patchsets) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *Patchsets) Marshal() ([]byte, error) { - v.fixUuid() - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *Patchsets) Unmarshal(data []byte) error { - return proto.Unmarshal(data, v) -} - -// human readable JSON -func (v *Patchset) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *Patchset) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *Patchset) 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 *Patchset) FormatTEXT() string { - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *Patchset) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *Patchset) Marshal() ([]byte, error) { - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *Patchset) 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) -} - -// human readable JSON -func (v *Patches) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *Patches) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *Patches) 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 *Patches) FormatTEXT() string { - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *Patches) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *Patches) Marshal() ([]byte, error) { - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *Patches) Unmarshal(data []byte) error { - return proto.Unmarshal(data, v) -} - -// `autogen:patchset.pb.go` - -// Code modified by go.wit.com/apps/autogenpb DO NOT EDIT. -// -// user defined Mutex locks were auto added -// -// autogenpb version & build time: v0.0.54 2025-02-15_02:56:28_UTC -// autogenpb auto generates Sort(), Unique() and Marshal() functions -// go install go.wit.com/apps/autogenpb@latest - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc v3.21.12 -// source: patchset.proto - -package forgepb // autogenpb changed the package name - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// this generic message is used by autogen to identify and -// then dump the uuid and version from any arbitrary .pb file -type Identify struct { - sync.RWMutex // auto-added by go.wit.com/apps/autogenpb - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // -} - -func (x *Identify) Reset() { - *x = Identify{} - if protoimpl.UnsafeEnabled { - mi := &file_patchset_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Identify) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Identify) ProtoMessage() {} - -func (x *Identify) ProtoReflect() protoreflect.Message { - mi := &file_patchset_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Identify.ProtoReflect.Descriptor instead. -func (*Identify) Descriptor() ([]byte, []int) { - return file_patchset_proto_rawDescGZIP(), []int{0} -} - -func (x *Identify) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *Identify) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type Patch struct { - sync.RWMutex // auto-added by go.wit.com/apps/autogenpb - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // `autogenpb:unique` `autogenpb:sort` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // - RepoPath string `protobuf:"bytes,3,opt,name=repoPath,proto3" json:"repoPath,omitempty"` // path to the git repo - BranchName string `protobuf:"bytes,4,opt,name=branchName,proto3" json:"branchName,omitempty"` // - BranchHash string `protobuf:"bytes,5,opt,name=branchHash,proto3" json:"branchHash,omitempty"` // - Ctime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=ctime,proto3" json:"ctime,omitempty"` // the git commit timestamp of this patch - CommitHash string `protobuf:"bytes,8,opt,name=commitHash,proto3" json:"commitHash,omitempty"` // the git commit hash of this patch - StartHash string `protobuf:"bytes,9,opt,name=startHash,proto3" json:"startHash,omitempty"` // the start commit hash - Files []string `protobuf:"bytes,10,rep,name=Files,proto3" json:"Files,omitempty"` // the filenames this patch changes - Comment string `protobuf:"bytes,11,opt,name=comment,proto3" json:"comment,omitempty"` // the git commit message (in patch form) - RepoNamespace string `protobuf:"bytes,12,opt,name=repoNamespace,proto3" json:"repoNamespace,omitempty"` // the base repo git URL - NewHash string `protobuf:"bytes,13,opt,name=newHash,proto3" json:"newHash,omitempty"` // new hash after git am -} - -func (x *Patch) Reset() { - *x = Patch{} - if protoimpl.UnsafeEnabled { - mi := &file_patchset_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Patch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Patch) ProtoMessage() {} - -func (x *Patch) ProtoReflect() protoreflect.Message { - mi := &file_patchset_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Patch.ProtoReflect.Descriptor instead. -func (*Patch) Descriptor() ([]byte, []int) { - return file_patchset_proto_rawDescGZIP(), []int{1} -} - -func (x *Patch) GetFilename() string { - if x != nil { - return x.Filename - } - return "" -} - -func (x *Patch) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Patch) GetRepoPath() string { - if x != nil { - return x.RepoPath - } - return "" -} - -func (x *Patch) GetBranchName() string { - if x != nil { - return x.BranchName - } - return "" -} - -func (x *Patch) GetBranchHash() string { - if x != nil { - return x.BranchHash - } - return "" -} - -func (x *Patch) GetCtime() *timestamppb.Timestamp { - if x != nil { - return x.Ctime - } - return nil -} - -func (x *Patch) GetCommitHash() string { - if x != nil { - return x.CommitHash - } - return "" -} - -func (x *Patch) GetStartHash() string { - if x != nil { - return x.StartHash - } - return "" -} - -func (x *Patch) GetFiles() []string { - if x != nil { - return x.Files - } - return nil -} - -func (x *Patch) GetComment() string { - if x != nil { - return x.Comment - } - return "" -} - -func (x *Patch) GetRepoNamespace() string { - if x != nil { - return x.RepoNamespace - } - return "" -} - -func (x *Patch) GetNewHash() string { - if x != nil { - return x.NewHash - } - return "" -} - -type Patches struct { - sync.RWMutex // auto-added by go.wit.com/apps/autogenpb - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:be926ad9-1111-484c-adf2-d96eeabf3079` // todo: add autogenpb support for this - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.45` // todo: add autogenpb support for this - Patches []*Patch `protobuf:"bytes,3,rep,name=Patches,proto3" json:"Patches,omitempty"` -} - -func (x *Patches) Reset() { - *x = Patches{} - if protoimpl.UnsafeEnabled { - mi := &file_patchset_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Patches) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Patches) ProtoMessage() {} - -func (x *Patches) ProtoReflect() protoreflect.Message { - mi := &file_patchset_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Patches.ProtoReflect.Descriptor instead. -func (*Patches) Descriptor() ([]byte, []int) { - return file_patchset_proto_rawDescGZIP(), []int{2} -} - -func (x *Patches) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *Patches) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Patches) GetPatches() []*Patch { - if x != nil { - return x.Patches - } - return nil -} - -type Patchset struct { - sync.RWMutex // auto-added by go.wit.com/apps/autogenpb - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Patches *Patches `protobuf:"bytes,1,opt,name=patches,proto3" json:"patches,omitempty"` // `autogenpb:unique` `autogenpb:sort` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // `autogenpb:sort` - Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` // - GitAuthorName string `protobuf:"bytes,4,opt,name=gitAuthorName,proto3" json:"gitAuthorName,omitempty"` // `autogenpb:sort` - GitAuthorEmail string `protobuf:"bytes,5,opt,name=gitAuthorEmail,proto3" json:"gitAuthorEmail,omitempty"` // - Ctime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=ctime,proto3" json:"ctime,omitempty"` // create time of this patchset - TmpDir string `protobuf:"bytes,7,opt,name=tmpDir,proto3" json:"tmpDir,omitempty"` // temp dir - StartBranchName string `protobuf:"bytes,8,opt,name=startBranchName,proto3" json:"startBranchName,omitempty"` // - EndBranchName string `protobuf:"bytes,9,opt,name=endBranchName,proto3" json:"endBranchName,omitempty"` // - StartBranchHash string `protobuf:"bytes,10,opt,name=startBranchHash,proto3" json:"startBranchHash,omitempty"` // - EndBranchHash string `protobuf:"bytes,11,opt,name=endBranchHash,proto3" json:"endBranchHash,omitempty"` // - State string `protobuf:"bytes,12,opt,name=state,proto3" json:"state,omitempty"` // the state of the patch - Uuid string `protobuf:"bytes,13,opt,name=uuid,proto3" json:"uuid,omitempty"` // identify each patchset somehow -} - -func (x *Patchset) Reset() { - *x = Patchset{} - if protoimpl.UnsafeEnabled { - mi := &file_patchset_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Patchset) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Patchset) ProtoMessage() {} - -func (x *Patchset) ProtoReflect() protoreflect.Message { - mi := &file_patchset_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Patchset.ProtoReflect.Descriptor instead. -func (*Patchset) Descriptor() ([]byte, []int) { - return file_patchset_proto_rawDescGZIP(), []int{3} -} - -func (x *Patchset) GetPatches() *Patches { - if x != nil { - return x.Patches - } - return nil -} - -func (x *Patchset) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Patchset) GetComment() string { - if x != nil { - return x.Comment - } - return "" -} - -func (x *Patchset) GetGitAuthorName() string { - if x != nil { - return x.GitAuthorName - } - return "" -} - -func (x *Patchset) GetGitAuthorEmail() string { - if x != nil { - return x.GitAuthorEmail - } - return "" -} - -func (x *Patchset) GetCtime() *timestamppb.Timestamp { - if x != nil { - return x.Ctime - } - return nil -} - -func (x *Patchset) GetTmpDir() string { - if x != nil { - return x.TmpDir - } - return "" -} - -func (x *Patchset) GetStartBranchName() string { - if x != nil { - return x.StartBranchName - } - return "" -} - -func (x *Patchset) GetEndBranchName() string { - if x != nil { - return x.EndBranchName - } - return "" -} - -func (x *Patchset) GetStartBranchHash() string { - if x != nil { - return x.StartBranchHash - } - return "" -} - -func (x *Patchset) GetEndBranchHash() string { - if x != nil { - return x.EndBranchHash - } - return "" -} - -func (x *Patchset) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *Patchset) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -type Patchsets struct { - sync.RWMutex // auto-added by go.wit.com/apps/autogenpb - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079` // todo: add autogenpb support for this - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.45` // todo: add autogenpb support for this - Patchsets []*Patchset `protobuf:"bytes,3,rep,name=Patchsets,proto3" json:"Patchsets,omitempty"` -} - -func (x *Patchsets) Reset() { - *x = Patchsets{} - if protoimpl.UnsafeEnabled { - mi := &file_patchset_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Patchsets) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Patchsets) ProtoMessage() {} - -func (x *Patchsets) ProtoReflect() protoreflect.Message { - mi := &file_patchset_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Patchsets.ProtoReflect.Descriptor instead. -func (*Patchsets) Descriptor() ([]byte, []int) { - return file_patchset_proto_rawDescGZIP(), []int{4} -} - -func (x *Patchsets) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *Patchsets) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Patchsets) GetPatchsets() []*Patchset { - if x != nil { - return x.Patchsets - } - return nil -} - -var File_patchset_proto protoreflect.FileDescriptor - -var file_patchset_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x70, 0x61, 0x74, 0x63, 0x68, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x07, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x38, 0x0a, 0x08, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf3, 0x02, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1a, - 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x50, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x63, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x46, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x46, 0x69, 0x6c, 0x65, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, - 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x77, 0x48, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x48, 0x61, 0x73, 0x68, 0x22, 0x61, 0x0a, 0x07, 0x50, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x07, 0x50, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x50, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x07, 0x50, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0xc6, 0x03, - 0x0a, 0x08, 0x50, 0x61, 0x74, 0x63, 0x68, 0x73, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x66, 0x6f, - 0x72, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x07, 0x70, - 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x67, 0x69, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x69, 0x74, - 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x67, 0x69, - 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x67, 0x69, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x45, 0x6d, 0x61, - 0x69, 0x6c, 0x12, 0x30, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x05, 0x63, - 0x74, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6d, 0x70, 0x44, 0x69, 0x72, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6d, 0x70, 0x44, 0x69, 0x72, 0x12, 0x28, 0x0a, 0x0f, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x72, 0x61, 0x6e, - 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, - 0x6e, 0x64, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x42, 0x72, 0x61, 0x6e, - 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x65, 0x6e, 0x64, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, - 0x6e, 0x64, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x09, 0x50, 0x61, 0x74, 0x63, 0x68, 0x73, - 0x65, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x2f, 0x0a, 0x09, 0x50, 0x61, 0x74, 0x63, 0x68, 0x73, 0x65, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x70, 0x62, 0x2e, 0x50, - 0x61, 0x74, 0x63, 0x68, 0x73, 0x65, 0x74, 0x52, 0x09, 0x50, 0x61, 0x74, 0x63, 0x68, 0x73, 0x65, - 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_patchset_proto_rawDescOnce sync.Once - file_patchset_proto_rawDescData = file_patchset_proto_rawDesc -) - -func file_patchset_proto_rawDescGZIP() []byte { - file_patchset_proto_rawDescOnce.Do(func() { - file_patchset_proto_rawDescData = protoimpl.X.CompressGZIP(file_patchset_proto_rawDescData) - }) - return file_patchset_proto_rawDescData -} - -var file_patchset_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_patchset_proto_goTypes = []interface{}{ - (*Identify)(nil), // 0: forgepb.Identify - (*Patch)(nil), // 1: forgepb.Patch - (*Patches)(nil), // 2: forgepb.Patches - (*Patchset)(nil), // 3: forgepb.Patchset - (*Patchsets)(nil), // 4: forgepb.Patchsets - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp -} -var file_patchset_proto_depIdxs = []int32{ - 5, // 0: forgepb.Patch.ctime:type_name -> google.protobuf.Timestamp - 1, // 1: forgepb.Patches.Patches:type_name -> forgepb.Patch - 2, // 2: forgepb.Patchset.patches:type_name -> forgepb.Patches - 5, // 3: forgepb.Patchset.ctime:type_name -> google.protobuf.Timestamp - 3, // 4: forgepb.Patchsets.Patchsets:type_name -> forgepb.Patchset - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_patchset_proto_init() } -func file_patchset_proto_init() { - if File_patchset_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_patchset_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Identify); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_patchset_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Patch); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_patchset_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Patches); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_patchset_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Patchset); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_patchset_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Patchsets); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_patchset_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_patchset_proto_goTypes, - DependencyIndexes: file_patchset_proto_depIdxs, - MessageInfos: file_patchset_proto_msgTypes, - }.Build() - File_patchset_proto = out.File - file_patchset_proto_rawDesc = nil - file_patchset_proto_goTypes = nil - file_patchset_proto_depIdxs = nil -} - -// `autogen:patchset.sort.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.54 2025-02-15_02:56:28_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 forgepb - -import ( - "fmt" - "sort" - "sync" -) - -// a simple global lock -var patchsetMu sync.RWMutex - -func (x *Patchsets) fixUuid() { - if x == nil { - return - } - if x.Uuid == "be926ad9-f07f-484c-adf2-d96eeabf3079" { - return - } - x.Uuid = "be926ad9-f07f-484c-adf2-d96eeabf3079" - x.Version = "v0.0.45 go.wit.com/lib/protobuf/forgepb" -} - -func NewPatchsets() *Patchsets { - x := new(Patchsets) - x.Uuid = "be926ad9-f07f-484c-adf2-d96eeabf3079" - x.Version = "v0.0.45 go.wit.com/lib/protobuf/forgepb" - return x -} - -// START SORT - -// DEFINE THE Patchsets ITERATOR. -// itializes a new iterator. -func newPatchsetsIterator(things []*Patchsets) *PatchsetsIterator { - return &PatchsetsIterator{things: things} -} - -type PatchsetsIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Patchsets - index int -} - -func (it *PatchsetsIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *PatchsetsIterator) Next() *Patchsets { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in PatchsetsIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE Patchset ITERATOR. -// itializes a new iterator. -func newPatchsetIterator(things []*Patchset) *PatchsetIterator { - return &PatchsetIterator{things: things} -} - -type PatchsetIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Patchset - index int -} - -func (it *PatchsetIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *PatchsetIterator) Next() *Patchset { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in PatchsetIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE Identify ITERATOR. -// itializes a new iterator. -func newIdentifyIterator(things []*Identify) *IdentifyIterator { - return &IdentifyIterator{things: things} -} - -type IdentifyIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Identify - index int -} - -func (it *IdentifyIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *IdentifyIterator) Next() *Identify { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in IdentifyIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE Patch ITERATOR. -// itializes a new iterator. -func newPatchIterator(things []*Patch) *PatchIterator { - return &PatchIterator{things: things} -} - -type PatchIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Patch - index int -} - -func (it *PatchIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *PatchIterator) Next() *Patch { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in PatchIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE Patches ITERATOR. -// itializes a new iterator. -func newPatchesIterator(things []*Patches) *PatchesIterator { - return &PatchesIterator{things: things} -} - -type PatchesIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Patches - index int -} - -func (it *PatchesIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *PatchesIterator) Next() *Patches { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in PatchesIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// sort struct by Name -type PatchsetName []*Patchset - -func (a PatchsetName) Len() int { return len(a) } -func (a PatchsetName) Less(i, j int) bool { return a[i].Name < a[j].Name } -func (a PatchsetName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// sort struct by GitAuthorName -type PatchsetGitAuthorName []*Patchset - -func (a PatchsetGitAuthorName) Len() int { return len(a) } -func (a PatchsetGitAuthorName) Less(i, j int) bool { return a[i].GitAuthorName < a[j].GitAuthorName } -func (a PatchsetGitAuthorName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// sort struct by Filename -type PatchFilename []*Patch - -func (a PatchFilename) Len() int { return len(a) } -func (a PatchFilename) Less(i, j int) bool { return a[i].Filename < a[j].Filename } -func (a PatchFilename) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *Patchsets) allPatchsets() []*Patchset { - x.RLock() - defer x.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*Patchset - tmp = make([]*Patchset, len(x.Patchsets)) - for i, p := range x.Patchsets { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *Patches) allPatches() []*Patch { - x.RLock() - defer x.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*Patch - tmp = make([]*Patch, len(x.Patches)) - for i, p := range x.Patches { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the Patchset protobufs -func (x *Patchsets) selectAllPatchsets() []*Patchset { - x.RLock() - defer x.RUnlock() - - // Create a new slice to hold pointers to each Patchset - var tmp []*Patchset - tmp = make([]*Patchset, len(x.Patchsets)) - for i, p := range x.Patchsets { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the Patch protobufs -func (x *Patches) selectAllPatches() []*Patch { - x.RLock() - defer x.RUnlock() - - // Create a new slice to hold pointers to each Patch - var tmp []*Patch - tmp = make([]*Patch, len(x.Patches)) - for i, p := range x.Patches { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} -func (x *Patchsets) SortByName() *PatchsetIterator { - // copy the pointers as fast as possible. - things := x.selectAllPatchsets() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(PatchsetName(things)) - // slices.SortFunc(things, func(a, b *Patchsets) bool { - // return a.Name < b.Name // Sort by ??. let the compiler work it out?? - // }) - return newPatchsetIterator(things) -} -func (x *Patchsets) SortByGitAuthorName() *PatchsetIterator { - // copy the pointers as fast as possible. - things := x.selectAllPatchsets() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(PatchsetGitAuthorName(things)) - // slices.SortFunc(things, func(a, b *Patchsets) bool { - // return a.GitAuthorName < b.GitAuthorName // Sort by ??. let the compiler work it out?? - // }) - return newPatchsetIterator(things) -} -func (x *Patches) SortByFilename() *PatchIterator { - // copy the pointers as fast as possible. - things := x.selectAllPatches() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(PatchFilename(things)) - // slices.SortFunc(things, func(a, b *Patches) bool { - // return a.Filename < b.Filename // Sort by ??. let the compiler work it out?? - // }) - return newPatchIterator(things) -} - -// END SORT - -func (x *Patchsets) Len() int { - x.RLock() - defer x.RUnlock() - - return len(x.Patchsets) -} - -// just a simple Append() shortcut (but still uses the mutex lock) -func (x *Patchsets) Append(y *Patchset) { - x.Lock() - defer x.Unlock() - - x.Patchsets = append(x.Patchsets, y) -} - -func (x *Patches) Len() int { - x.RLock() - defer x.RUnlock() - - return len(x.Patches) -} - -// just a simple Append() shortcut (but still uses the mutex lock) -func (x *Patches) Append(y *Patch) { - x.Lock() - defer x.Unlock() - - x.Patches = append(x.Patches, y) -} - -func (x *Patchsets) All() *PatchsetIterator { - PatchsetPointers := x.selectAllPatchsets() - - iterator := newPatchsetIterator(PatchsetPointers) - return iterator -} - -func (x *Patches) All() *PatchIterator { - PatchPointers := x.selectAllPatches() - - iterator := newPatchIterator(PatchPointers) - return iterator -} - -func (x *Patchsets) Delete(y *Patchset) bool { - x.Lock() - defer x.Unlock() - - for i, _ := range x.Patchsets { - if x.Patchsets[i] == y { - x.Patchsets[i] = x.Patchsets[len(x.Patchsets)-1] - x.Patchsets = x.Patchsets[:len(x.Patchsets)-1] - return true - } - } - return false -} - -func (x *Patches) Delete(y *Patch) bool { - x.Lock() - defer x.Unlock() - - for i, _ := range x.Patches { - if x.Patches[i] == y { - x.Patches[i] = x.Patches[len(x.Patches)-1] - x.Patches = x.Patches[:len(x.Patches)-1] - return true - } - } - return false -} - -// lookup a Patches by the Filename -func (x *Patches) FindByFilename(s string) *Patch { - if x == nil { - return nil - } - - x.RLock() - defer x.RUnlock() - - for i, _ := range x.Patches { - if x.Patches[i].Filename == s { - return x.Patches[i] - } - } - return nil -} - -func (x *Patches) DeleteByFilename(s string) bool { - x.Lock() - defer x.Unlock() - - for i, _ := range x.Patches { - if x.Patches[i].Filename == s { - x.Patches[i] = x.Patches[len(x.Patches)-1] - x.Patches = x.Patches[:len(x.Patches)-1] - return true - } - } - return false -} - -func (x *Patches) AppendByFilename(y *Patch) bool { - x.Lock() - defer x.Unlock() - - for _, p := range x.Patches { - if p.Filename == y.Filename { - return false - } - } - - x.Patches = append(x.Patches, y) - return true -} - -// `autogen:`