forgepb/ed92f1d99dd3f5cdcc9fbae396d...

663 lines
22 KiB
Plaintext

// `autogen:go.mod`
module go.wit.com/lib/protobuf/forgepb
go 1.21
toolchain go1.23.4
require (
github.com/destel/rill v0.6.0
go.wit.com/lib/gui/shell v0.22.20
go.wit.com/lib/protobuf/gitpb v0.0.49
go.wit.com/lib/protobuf/zoopb v0.0.21
go.wit.com/log v0.22.10
google.golang.org/protobuf v1.36.2
)
require github.com/go-cmd/cmd v1.4.3 // indirect
// `autogen:go.sum`
github.com/destel/rill v0.6.0 h1:8MQRzS6k0akKmwNZFahKIhG1dkBeNxMoWKSfOxkaJNw=
github.com/destel/rill v0.6.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=
go.wit.com/lib/gui/shell v0.22.20 h1:iVPXL1h1Qri1WrymjfgTy0gRGEepj6+w2e6kSVaBtUk=
go.wit.com/lib/gui/shell v0.22.20/go.mod h1:zduuMSWq+EE7w0xbXn+vkoGZ4HJhURVJpvXw8oK9WAU=
go.wit.com/lib/protobuf/gitpb v0.0.49 h1:dBCULy/qCtyR/lQ+GnN87YRqsjbyXKsG4pHE7g9eJ/I=
go.wit.com/lib/protobuf/gitpb v0.0.49/go.mod h1:HvJ8tvVDy2sQRfUiOT17mMWKOlEoQJPqkt+9kMuw4hs=
go.wit.com/lib/protobuf/zoopb v0.0.21 h1:ZCgEB6wEv9VLW4DbBGwwS1nGZLWXcQ1lMhrRhztO/Fk=
go.wit.com/lib/protobuf/zoopb v0.0.21/go.mod h1:Sw47KomE+5nzioBTC/Gf8iV3p8gidB7uVoeyAtPvWi4=
go.wit.com/log v0.22.10 h1:rlSgaYjvxbpcmi9UBQO3ESmbd/jiyFdRQFoGOvpCEUc=
go.wit.com/log v0.22.10/go.mod h1:4uNPFBqhsAh8zNF+zxVEmC3c/9AZ8JeTfUUvRpddvLQ=
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.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
// `autogen:forgeConfig.find.pb.go`
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
// This file was autogenerated with autogenpb v0.0.40-19-gfed674d 2025.01.11_0448
// 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 (
"sync"
)
// a simple global lock
var forgeConfigMu sync.RWMutex
// just a simple Append() shortcut (but still uses the mutex lock)
func (x *ForgeConfigs) Append(y *ForgeConfig) {
x.Lock.Lock()
defer x.Lock.Unlock()
x.ForgeConfigs = append(x.ForgeConfigs, y)
}
// lookup a ForgeConfigs by the GoPath
func (x *ForgeConfigs) FindByGoPath(s string) *ForgeConfig {
if x == nil {
return nil
}
x.Lock.RLock()
defer x.Lock.RUnlock()
for i, _ := range x.ForgeConfigs {
if x.ForgeConfigs[i].GoPath == s {
return x.ForgeConfigs[i]
}
}
return nil
}
// enforces ForgeConfig.GoPath is unique in ForgeConfigs.ForgeConfigs
func (x *ForgeConfigs) AppendUniqueGoPath(newP *ForgeConfig) bool {
forgeConfigMu.Lock()
defer forgeConfigMu.Unlock()
for _, p := range x.ForgeConfigs {
if p.GoPath == newP.GoPath {
return false
}
}
x.ForgeConfigs = append(x.ForgeConfigs, newP)
return true
}
// enforces ForgeConfig is unique in ForgeConfigs.ForgeConfigs
func (x *ForgeConfigs) AppendUnique(newP *ForgeConfig) bool {
forgeConfigMu.Lock()
defer forgeConfigMu.Unlock()
for _, p := range x.ForgeConfigs {
if p.GoPath == newP.GoPath {
return false
}
}
x.ForgeConfigs = append(x.ForgeConfigs, newP)
return true
}
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
}
// returns an ForgeConfig if GoPath matches, otherwise create
func (x *ForgeConfigs) InsertByGoPath(y string) *ForgeConfig {
forgeConfigMu.Lock()
defer forgeConfigMu.Unlock()
for _, p := range x.ForgeConfigs {
if p.GoPath == y {
return p
}
}
z := new(ForgeConfig)
z.GoPath = y
x.ForgeConfigs = append(x.ForgeConfigs, z)
return z
}
// `autogen:forgeConfig.marshal.pb.go`
// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT.
// This file was autogenerated with autogenpb v0.0.40-19-gfed674d 2025.01.11_0448
// 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 {
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) {
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.40-19-gfed674d 2025.01.11_0448
// 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.35.2-devel
// protoc v3.21.12
// source: forgeConfig.proto
package forgepb
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 {
Lock sync.RWMutex // auto-added by go.wit.com/apps/autogenpb
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{}
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 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 {
Lock 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"` // could be useful for /usr/share/file/magic someday?
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // could be used for protobuf schema change violations?
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})
}
func (x *ForgeConfigs) Reset() {
*x = ForgeConfigs{}
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 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 ""
}
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, 0x92, 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, 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 = []any{
(*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
}
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.40-19-gfed674d 2025.01.11_0448
// 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"
)
type ForgeConfigIterator struct {
sync.RWMutex
things []*ForgeConfig
index int
}
// NewForgeConfigIterator initializes a new iterator.
func NewForgeConfigIterator(things []*ForgeConfig) *ForgeConfigIterator {
return &ForgeConfigIterator{things: things}
}
// Scan moves to the next element and returns false if there are no more things.
// Use Scan() in a loop, similar to a while loop
//
// for iterator.Scan()
// d := iterator.Next(
// fmt.Println("found UUID:", d.Uuid
// }
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 {
for i, d := range it.things {
fmt.Println("i =", i, d)
}
}
return it.things[it.index-1]
}
func (x *ForgeConfigs) All() *ForgeConfigIterator {
ForgeConfigPointers := x.selectAllForgeConfig()
iterator := NewForgeConfigIterator(ForgeConfigPointers)
return iterator
}
func (x *ForgeConfigs) Len() int {
x.Lock.RLock()
defer x.Lock.RUnlock()
return len(x.ForgeConfigs)
}
// safely returns a slice of pointers to the ForgeConfig protobufs
func (x *ForgeConfigs) selectAllForgeConfig() []*ForgeConfig {
x.Lock.RLock()
defer x.Lock.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 {
things := x.selectAllForgeConfig()
sort.Sort(ForgeConfigGoPath(things))
iterator := NewForgeConfigIterator(things)
return iterator
}
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] }
// `autogen:patchset.find.pb.go`