diff --git a/010791e82809c068a6a70a103d96596450eefc42 b/010791e82809c068a6a70a103d96596450eefc42 deleted file mode 100644 index a1d36ce..0000000 --- a/010791e82809c068a6a70a103d96596450eefc42 +++ /dev/null @@ -1,2826 +0,0 @@ -// `autogen:go.mod` - -module go.wit.com/lib/protobuf/gitpb - -go 1.22 - -toolchain go1.23.6 - -require ( - github.com/destel/rill v0.7.0 - github.com/go-cmd/cmd v1.4.3 - go.wit.com/lib/gui/shell v0.22.26 - go.wit.com/log v0.22.16 - google.golang.org/protobuf v1.36.5 -) - -// `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= -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/log v0.22.16 h1:E0Vd0Z2ILtfjhs7J/CQ4g13DK1jtQiYl6l5KOBGsZoA= -go.wit.com/log v0.22.16/go.mod h1:/c5Uj30sWRQ4B5ei2ElB6Q8Si/cK6v+KbxnH208KD84= -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:gitTag.marshal.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.49-2-g9a0e4a6 2025.02.01_0732 -// 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 gitpb - -import ( - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" -) - -// human readable JSON -func (v *GitTags) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *GitTags) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *GitTags) 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 *GitTags) FormatTEXT() string { - v.fixUuid() - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *GitTags) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *GitTags) Marshal() ([]byte, error) { - v.fixUuid() - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *GitTags) Unmarshal(data []byte) error { - return proto.Unmarshal(data, v) -} - -// `autogen:gitTag.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.49-2-g9a0e4a6 2025.02.01_0732 -// 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: gitTag.proto - -package gitpb // 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) -) - -type GitRemote struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Fetch string `protobuf:"bytes,2,opt,name=fetch,proto3" json:"fetch,omitempty"` -} - -func (x *GitRemote) Reset() { - *x = GitRemote{} - mi := &file_gitTag_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GitRemote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitRemote) ProtoMessage() {} - -func (x *GitRemote) ProtoReflect() protoreflect.Message { - mi := &file_gitTag_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 GitRemote.ProtoReflect.Descriptor instead. -func (*GitRemote) Descriptor() ([]byte, []int) { - return file_gitTag_proto_rawDescGZIP(), []int{0} -} - -func (x *GitRemote) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *GitRemote) GetFetch() string { - if x != nil { - return x.Fetch - } - return "" -} - -type GitBranch struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Remote string `protobuf:"bytes,1,opt,name=remote,proto3" json:"remote,omitempty"` // the name of the remote repo - Merge string `protobuf:"bytes,2,opt,name=merge,proto3" json:"merge,omitempty"` // the merge path from the config file - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // the branch name from the config file -} - -func (x *GitBranch) Reset() { - *x = GitBranch{} - mi := &file_gitTag_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GitBranch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitBranch) ProtoMessage() {} - -func (x *GitBranch) ProtoReflect() protoreflect.Message { - mi := &file_gitTag_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 GitBranch.ProtoReflect.Descriptor instead. -func (*GitBranch) Descriptor() ([]byte, []int) { - return file_gitTag_proto_rawDescGZIP(), []int{1} -} - -func (x *GitBranch) GetRemote() string { - if x != nil { - return x.Remote - } - return "" -} - -func (x *GitBranch) GetMerge() string { - if x != nil { - return x.Merge - } - return "" -} - -func (x *GitBranch) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// readGitConfig reads and parses the .git/config file -type GitConfig struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Core map[string]string `protobuf:"bytes,1,rep,name=core,proto3" json:"core,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map[origin] = "https:/git.wit.org/gui/gadgets" - Remotes map[string]*GitRemote `protobuf:"bytes,2,rep,name=remotes,proto3" json:"remotes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map[origin] = "https:/git.wit.org/gui/gadgets" - Branches map[string]*GitBranch `protobuf:"bytes,3,rep,name=branches,proto3" json:"branches,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // map[guimaster] = origin guimaster - Submodules map[string]string `protobuf:"bytes,4,rep,name=submodules,proto3" json:"submodules,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Hashes map[string]string `protobuf:"bytes,5,rep,name=hashes,proto3" json:"hashes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Versions map[string]string `protobuf:"bytes,6,rep,name=versions,proto3" json:"versions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Local []*GitBranch `protobuf:"bytes,7,rep,name=local,proto3" json:"local,omitempty"` // move this this and away from the map<> variables -} - -func (x *GitConfig) Reset() { - *x = GitConfig{} - mi := &file_gitTag_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GitConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitConfig) ProtoMessage() {} - -func (x *GitConfig) ProtoReflect() protoreflect.Message { - mi := &file_gitTag_proto_msgTypes[2] - 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 GitConfig.ProtoReflect.Descriptor instead. -func (*GitConfig) Descriptor() ([]byte, []int) { - return file_gitTag_proto_rawDescGZIP(), []int{2} -} - -func (x *GitConfig) GetCore() map[string]string { - if x != nil { - return x.Core - } - return nil -} - -func (x *GitConfig) GetRemotes() map[string]*GitRemote { - if x != nil { - return x.Remotes - } - return nil -} - -func (x *GitConfig) GetBranches() map[string]*GitBranch { - if x != nil { - return x.Branches - } - return nil -} - -func (x *GitConfig) GetSubmodules() map[string]string { - if x != nil { - return x.Submodules - } - return nil -} - -func (x *GitConfig) GetHashes() map[string]string { - if x != nil { - return x.Hashes - } - return nil -} - -func (x *GitConfig) GetVersions() map[string]string { - if x != nil { - return x.Versions - } - return nil -} - -func (x *GitConfig) GetLocal() []*GitBranch { - if x != nil { - return x.Local - } - return nil -} - -type GitTag struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Refname string `protobuf:"bytes,1,opt,name=refname,proto3" json:"refname,omitempty"` // `autogenpb:unique` `autogenpb:sort` // tag name. treated as unique - Creatordate *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=creatordate,proto3" json:"creatordate,omitempty"` // git creatordate - Authordate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=authordate,proto3" json:"authordate,omitempty"` // git author date - Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` // `autogenpb:unique` // git hash - Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"` // git tag subject -} - -func (x *GitTag) Reset() { - *x = GitTag{} - mi := &file_gitTag_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GitTag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitTag) ProtoMessage() {} - -func (x *GitTag) ProtoReflect() protoreflect.Message { - mi := &file_gitTag_proto_msgTypes[3] - 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 GitTag.ProtoReflect.Descriptor instead. -func (*GitTag) Descriptor() ([]byte, []int) { - return file_gitTag_proto_rawDescGZIP(), []int{3} -} - -func (x *GitTag) GetRefname() string { - if x != nil { - return x.Refname - } - return "" -} - -func (x *GitTag) GetCreatordate() *timestamppb.Timestamp { - if x != nil { - return x.Creatordate - } - return nil -} - -func (x *GitTag) GetAuthordate() *timestamppb.Timestamp { - if x != nil { - return x.Authordate - } - return nil -} - -func (x *GitTag) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -func (x *GitTag) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -type GitTags 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:ffdff813-0316-4372-9e82-4c1c7d202526` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.47` - GitTags []*GitTag `protobuf:"bytes,3,rep,name=gitTags,proto3" json:"gitTags,omitempty"` -} - -func (x *GitTags) Reset() { - *x = GitTags{} - mi := &file_gitTag_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GitTags) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitTags) ProtoMessage() {} - -func (x *GitTags) ProtoReflect() protoreflect.Message { - mi := &file_gitTag_proto_msgTypes[4] - 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 GitTags.ProtoReflect.Descriptor instead. -func (*GitTags) Descriptor() ([]byte, []int) { - return file_gitTag_proto_rawDescGZIP(), []int{4} -} - -func (x *GitTags) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *GitTags) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *GitTags) GetGitTags() []*GitTag { - if x != nil { - return x.GitTags - } - return nil -} - -var File_gitTag_proto protoreflect.FileDescriptor - -var file_gitTag_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x67, 0x69, 0x74, 0x54, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, - 0x67, 0x69, 0x74, 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, 0x33, 0x0a, 0x09, 0x47, 0x69, 0x74, 0x52, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x65, 0x74, 0x63, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x65, 0x74, 0x63, 0x68, 0x22, 0x4d, 0x0a, 0x09, 0x47, - 0x69, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x99, 0x06, 0x0a, 0x09, 0x47, - 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x65, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, - 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, - 0x62, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x08, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x40, 0x0a, - 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0a, 0x73, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, - 0x34, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, - 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, - 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x26, 0x0a, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x42, 0x72, 0x61, 0x6e, - 0x63, 0x68, 0x52, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x1a, 0x37, 0x0a, 0x09, 0x43, 0x6f, 0x72, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x4c, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x52, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x1a, 0x4d, 0x0a, 0x0d, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x3d, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, - 0x0a, 0x0b, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xca, 0x01, 0x0a, 0x06, 0x47, 0x69, 0x74, 0x54, 0x61, - 0x67, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 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, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x6f, 0x72, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x0a, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 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, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x64, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x22, 0x60, 0x0a, 0x07, 0x47, 0x69, 0x74, 0x54, 0x61, 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, 0x27, 0x0a, 0x07, - 0x67, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x54, 0x61, 0x67, 0x52, 0x07, 0x67, 0x69, - 0x74, 0x54, 0x61, 0x67, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_gitTag_proto_rawDescOnce sync.Once - file_gitTag_proto_rawDescData = file_gitTag_proto_rawDesc -) - -func file_gitTag_proto_rawDescGZIP() []byte { - file_gitTag_proto_rawDescOnce.Do(func() { - file_gitTag_proto_rawDescData = protoimpl.X.CompressGZIP(file_gitTag_proto_rawDescData) - }) - return file_gitTag_proto_rawDescData -} - -var file_gitTag_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_gitTag_proto_goTypes = []any{ - (*GitRemote)(nil), // 0: gitpb.GitRemote - (*GitBranch)(nil), // 1: gitpb.GitBranch - (*GitConfig)(nil), // 2: gitpb.GitConfig - (*GitTag)(nil), // 3: gitpb.GitTag - (*GitTags)(nil), // 4: gitpb.GitTags - nil, // 5: gitpb.GitConfig.CoreEntry - nil, // 6: gitpb.GitConfig.RemotesEntry - nil, // 7: gitpb.GitConfig.BranchesEntry - nil, // 8: gitpb.GitConfig.SubmodulesEntry - nil, // 9: gitpb.GitConfig.HashesEntry - nil, // 10: gitpb.GitConfig.VersionsEntry - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp -} -var file_gitTag_proto_depIdxs = []int32{ - 5, // 0: gitpb.GitConfig.core:type_name -> gitpb.GitConfig.CoreEntry - 6, // 1: gitpb.GitConfig.remotes:type_name -> gitpb.GitConfig.RemotesEntry - 7, // 2: gitpb.GitConfig.branches:type_name -> gitpb.GitConfig.BranchesEntry - 8, // 3: gitpb.GitConfig.submodules:type_name -> gitpb.GitConfig.SubmodulesEntry - 9, // 4: gitpb.GitConfig.hashes:type_name -> gitpb.GitConfig.HashesEntry - 10, // 5: gitpb.GitConfig.versions:type_name -> gitpb.GitConfig.VersionsEntry - 1, // 6: gitpb.GitConfig.local:type_name -> gitpb.GitBranch - 11, // 7: gitpb.GitTag.creatordate:type_name -> google.protobuf.Timestamp - 11, // 8: gitpb.GitTag.authordate:type_name -> google.protobuf.Timestamp - 3, // 9: gitpb.GitTags.gitTags:type_name -> gitpb.GitTag - 0, // 10: gitpb.GitConfig.RemotesEntry.value:type_name -> gitpb.GitRemote - 1, // 11: gitpb.GitConfig.BranchesEntry.value:type_name -> gitpb.GitBranch - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_gitTag_proto_init() } -func file_gitTag_proto_init() { - if File_gitTag_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_gitTag_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_gitTag_proto_goTypes, - DependencyIndexes: file_gitTag_proto_depIdxs, - MessageInfos: file_gitTag_proto_msgTypes, - }.Build() - File_gitTag_proto = out.File - file_gitTag_proto_rawDesc = nil - file_gitTag_proto_goTypes = nil - file_gitTag_proto_depIdxs = nil -} - -// `autogen:gitTag.sort.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.49-2-g9a0e4a6 2025.02.01_0732 -// 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 gitpb - -import ( - "fmt" - "sort" - "sync" -) - -// a simple global lock -var gitTagMu sync.RWMutex - -func (x *GitTags) fixUuid() { - if x == nil { - return - } - if x.Uuid == "ffdff813-0316-4372-9e82-4c1c7d202526" { - return - } - x.Uuid = "ffdff813-0316-4372-9e82-4c1c7d202526" - x.Version = "v0.0.47 go.wit.com/lib/protobuf/gitpb" -} - -func NewGitTags() *GitTags { - x := new(GitTags) - x.Uuid = "ffdff813-0316-4372-9e82-4c1c7d202526" - x.Version = "v0.0.47 go.wit.com/lib/protobuf/gitpb" - return x -} - -// START SORT - -// DEFINE THE GitTags ITERATOR. -// itializes a new iterator. -func newGitTagsIterator(things []*GitTags) *GitTagsIterator { - return &GitTagsIterator{things: things} -} - -type GitTagsIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GitTags - index int -} - -func (it *GitTagsIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GitTagsIterator) Next() *GitTags { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GitTagsIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GitTag ITERATOR. -// itializes a new iterator. -func newGitTagIterator(things []*GitTag) *GitTagIterator { - return &GitTagIterator{things: things} -} - -type GitTagIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GitTag - index int -} - -func (it *GitTagIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GitTagIterator) Next() *GitTag { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GitTagIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GitRemote ITERATOR. -// itializes a new iterator. -func newGitRemoteIterator(things []*GitRemote) *GitRemoteIterator { - return &GitRemoteIterator{things: things} -} - -type GitRemoteIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GitRemote - index int -} - -func (it *GitRemoteIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GitRemoteIterator) Next() *GitRemote { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GitRemoteIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GitBranch ITERATOR. -// itializes a new iterator. -func newGitBranchIterator(things []*GitBranch) *GitBranchIterator { - return &GitBranchIterator{things: things} -} - -type GitBranchIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GitBranch - index int -} - -func (it *GitBranchIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GitBranchIterator) Next() *GitBranch { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GitBranchIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GitConfig ITERATOR. -// itializes a new iterator. -func newGitConfigIterator(things []*GitConfig) *GitConfigIterator { - return &GitConfigIterator{things: things} -} - -type GitConfigIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GitConfig - index int -} - -func (it *GitConfigIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GitConfigIterator) Next() *GitConfig { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GitConfigIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// sort struct by Refname -type GitTagRefname []*GitTag - -func (a GitTagRefname) Len() int { return len(a) } -func (a GitTagRefname) Less(i, j int) bool { return a[i].Refname < a[j].Refname } -func (a GitTagRefname) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *GitTags) allGitTags() []*GitTag { - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*GitTag - tmp = make([]*GitTag, len(x.GitTags)) - for i, p := range x.GitTags { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *GitConfig) allLocal() []*GitBranch { - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*GitBranch - tmp = make([]*GitBranch, len(x.Local)) - for i, p := range x.Local { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the GitTag protobufs -func (x *GitTags) selectAllGitTags() []*GitTag { - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - // Create a new slice to hold pointers to each GitTag - var tmp []*GitTag - tmp = make([]*GitTag, len(x.GitTags)) - for i, p := range x.GitTags { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the GitBranch protobufs -func (x *GitConfig) selectAllLocal() []*GitBranch { - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - // Create a new slice to hold pointers to each GitBranch - var tmp []*GitBranch - tmp = make([]*GitBranch, len(x.Local)) - for i, p := range x.Local { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} -func (x *GitTags) SortByRefname() *GitTagIterator { - // copy the pointers as fast as possible. - things := x.selectAllGitTags() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(GitTagRefname(things)) - // slices.SortFunc(things, func(a, b *GitTags) bool { - // return a.Refname < b.Refname // Sort by ??. let the compiler work it out?? - // }) - return newGitTagIterator(things) -} - -// END SORT - -func (x *GitTags) Len() int { - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - return len(x.GitTags) -} - -// just a simple Append() shortcut (but still uses the mutex lock) -func (x *GitTags) Append(y *GitTag) { - gitTagMu.Lock() - defer gitTagMu.Unlock() - - x.GitTags = append(x.GitTags, y) -} - -func (x *GitTags) All() *GitTagIterator { - GitTagPointers := x.selectAllGitTags() - - iterator := newGitTagIterator(GitTagPointers) - return iterator -} - -func (x *GitTags) Delete(y *GitTag) bool { - gitTagMu.Lock() - defer gitTagMu.Unlock() - - for i, _ := range x.GitTags { - if x.GitTags[i] == y { - x.GitTags[i] = x.GitTags[len(x.GitTags)-1] - x.GitTags = x.GitTags[:len(x.GitTags)-1] - return true - } - } - return false -} - -// lookup a GitTags by the Refname -func (x *GitTags) FindByRefname(s string) *GitTag { - if x == nil { - return nil - } - - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - for i, _ := range x.GitTags { - if x.GitTags[i].Refname == s { - return x.GitTags[i] - } - } - return nil -} - -// lookup a GitTags by the Hash -func (x *GitTags) FindByHash(s string) *GitTag { - if x == nil { - return nil - } - - gitTagMu.RLock() - defer gitTagMu.RUnlock() - - for i, _ := range x.GitTags { - if x.GitTags[i].Hash == s { - return x.GitTags[i] - } - } - return nil -} - -func (x *GitTags) DeleteByRefname(s string) bool { - gitTagMu.Lock() - defer gitTagMu.Unlock() - - for i, _ := range x.GitTags { - if x.GitTags[i].Refname == s { - x.GitTags[i] = x.GitTags[len(x.GitTags)-1] - x.GitTags = x.GitTags[:len(x.GitTags)-1] - return true - } - } - return false -} - -func (x *GitTags) DeleteByHash(s string) bool { - gitTagMu.Lock() - defer gitTagMu.Unlock() - - for i, _ := range x.GitTags { - if x.GitTags[i].Hash == s { - x.GitTags[i] = x.GitTags[len(x.GitTags)-1] - x.GitTags = x.GitTags[:len(x.GitTags)-1] - return true - } - } - return false -} - -func (x *GitTags) AppendByRefname(y *GitTag) bool { - gitTagMu.Lock() - defer gitTagMu.Unlock() - - for _, p := range x.GitTags { - if p.Refname == y.Refname { - return false - } - } - - x.GitTags = append(x.GitTags, y) - return true -} - -func (x *GitTags) AppendByHash(y *GitTag) bool { - gitTagMu.Lock() - defer gitTagMu.Unlock() - - for _, p := range x.GitTags { - if p.Hash == y.Hash { - return false - } - } - - x.GitTags = append(x.GitTags, y) - return true -} - -// `autogen:goDep.marshal.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.49-2-g9a0e4a6 2025.02.01_0732 -// 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 gitpb - -// `autogen:goDep.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.49-2-g9a0e4a6 2025.02.01_0732 -// 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: goDep.proto - -// store go dependancies - -package gitpb // 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) -) - -type GoDep struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // `autogenpb:unique` `autogenpb:sort` // md5sum/hash value from the go.sum file - Ctime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=ctime,proto3" json:"ctime,omitempty"` // get the go date from 'go list' ? - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` // v1.2.2 - GoPath string `protobuf:"bytes,4,opt,name=goPath,proto3" json:"goPath,omitempty"` // `autogenpb:unique` `autogenpb:sort` // "go.wit.com/lib/foo" - GoVersion string `protobuf:"bytes,5,opt,name=goVersion,proto3" json:"goVersion,omitempty"` // version of golang the developer used to make this package version -} - -func (x *GoDep) Reset() { - *x = GoDep{} - mi := &file_goDep_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GoDep) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoDep) ProtoMessage() {} - -func (x *GoDep) ProtoReflect() protoreflect.Message { - mi := &file_goDep_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 GoDep.ProtoReflect.Descriptor instead. -func (*GoDep) Descriptor() ([]byte, []int) { - return file_goDep_proto_rawDescGZIP(), []int{0} -} - -func (x *GoDep) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -func (x *GoDep) GetCtime() *timestamppb.Timestamp { - if x != nil { - return x.Ctime - } - return nil -} - -func (x *GoDep) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *GoDep) GetGoPath() string { - if x != nil { - return x.GoPath - } - return "" -} - -func (x *GoDep) GetGoVersion() string { - if x != nil { - return x.GoVersion - } - return "" -} - -type GoDeps 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:7de62c09-b335-4d80-902d-08552c501b7c` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.51` - GoDeps []*GoDep `protobuf:"bytes,3,rep,name=goDeps,proto3" json:"goDeps,omitempty"` // `autogenpb:unique` `autogenpb:sort` -} - -func (x *GoDeps) Reset() { - *x = GoDeps{} - mi := &file_goDep_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GoDeps) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoDeps) ProtoMessage() {} - -func (x *GoDeps) ProtoReflect() protoreflect.Message { - mi := &file_goDep_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 GoDeps.ProtoReflect.Descriptor instead. -func (*GoDeps) Descriptor() ([]byte, []int) { - return file_goDep_proto_rawDescGZIP(), []int{1} -} - -func (x *GoDeps) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *GoDeps) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *GoDeps) GetGoDeps() []*GoDep { - if x != nil { - return x.GoDeps - } - return nil -} - -var File_goDep_proto protoreflect.FileDescriptor - -var file_goDep_proto_rawDesc = []byte{ - 0x0a, 0x0b, 0x67, 0x6f, 0x44, 0x65, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x67, - 0x69, 0x74, 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, 0x9d, 0x01, 0x0a, 0x05, 0x47, 0x6f, 0x44, 0x65, 0x70, 0x12, - 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, - 0x61, 0x73, 0x68, 0x12, 0x30, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 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, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x50, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x67, 0x6f, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x06, 0x47, 0x6f, 0x44, 0x65, 0x70, 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, 0x24, 0x0a, - 0x06, 0x67, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x44, 0x65, 0x70, 0x52, 0x06, 0x67, 0x6f, 0x44, - 0x65, 0x70, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_goDep_proto_rawDescOnce sync.Once - file_goDep_proto_rawDescData = file_goDep_proto_rawDesc -) - -func file_goDep_proto_rawDescGZIP() []byte { - file_goDep_proto_rawDescOnce.Do(func() { - file_goDep_proto_rawDescData = protoimpl.X.CompressGZIP(file_goDep_proto_rawDescData) - }) - return file_goDep_proto_rawDescData -} - -var file_goDep_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_goDep_proto_goTypes = []any{ - (*GoDep)(nil), // 0: gitpb.GoDep - (*GoDeps)(nil), // 1: gitpb.GoDeps - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp -} -var file_goDep_proto_depIdxs = []int32{ - 2, // 0: gitpb.GoDep.ctime:type_name -> google.protobuf.Timestamp - 0, // 1: gitpb.GoDeps.goDeps:type_name -> gitpb.GoDep - 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_goDep_proto_init() } -func file_goDep_proto_init() { - if File_goDep_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_goDep_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_goDep_proto_goTypes, - DependencyIndexes: file_goDep_proto_depIdxs, - MessageInfos: file_goDep_proto_msgTypes, - }.Build() - File_goDep_proto = out.File - file_goDep_proto_rawDesc = nil - file_goDep_proto_goTypes = nil - file_goDep_proto_depIdxs = nil -} - -// `autogen:goDep.sort.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.49-2-g9a0e4a6 2025.02.01_0732 -// 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 gitpb - -import ( - "fmt" - "sort" - "sync" -) - -// a simple global lock -var goDepMu sync.RWMutex - -func (x *GoDeps) fixUuid() { - if x == nil { - return - } - if x.Uuid == "7de62c09-b335-4d80-902d-08552c501b7c" { - return - } - x.Uuid = "7de62c09-b335-4d80-902d-08552c501b7c" - x.Version = "v0.0.51 go.wit.com/lib/protobuf/gitpb" -} - -func NewGoDeps() *GoDeps { - x := new(GoDeps) - x.Uuid = "7de62c09-b335-4d80-902d-08552c501b7c" - x.Version = "v0.0.51 go.wit.com/lib/protobuf/gitpb" - return x -} - -// START SORT - -// DEFINE THE GoDeps ITERATOR. -// itializes a new iterator. -func newGoDepsIterator(things []*GoDeps) *GoDepsIterator { - return &GoDepsIterator{things: things} -} - -type GoDepsIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GoDeps - index int -} - -func (it *GoDepsIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GoDepsIterator) Next() *GoDeps { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GoDepsIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GoDep ITERATOR. -// itializes a new iterator. -func newGoDepIterator(things []*GoDep) *GoDepIterator { - return &GoDepIterator{things: things} -} - -type GoDepIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GoDep - index int -} - -func (it *GoDepIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GoDepIterator) Next() *GoDep { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GoDepIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// sort struct by Hash -type GoDepHash []*GoDep - -func (a GoDepHash) Len() int { return len(a) } -func (a GoDepHash) Less(i, j int) bool { return a[i].Hash < a[j].Hash } -func (a GoDepHash) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// sort struct by GoPath -type GoDepGoPath []*GoDep - -func (a GoDepGoPath) Len() int { return len(a) } -func (a GoDepGoPath) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath } -func (a GoDepGoPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *GoDeps) allGoDeps() []*GoDep { - goDepMu.RLock() - defer goDepMu.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*GoDep - tmp = make([]*GoDep, len(x.GoDeps)) - for i, p := range x.GoDeps { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the GoDep protobufs -func (x *GoDeps) selectAllGoDeps() []*GoDep { - goDepMu.RLock() - defer goDepMu.RUnlock() - - // Create a new slice to hold pointers to each GoDep - var tmp []*GoDep - tmp = make([]*GoDep, len(x.GoDeps)) - for i, p := range x.GoDeps { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} -func (x *GoDeps) SortByHash() *GoDepIterator { - // copy the pointers as fast as possible. - things := x.selectAllGoDeps() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(GoDepHash(things)) - // slices.SortFunc(things, func(a, b *GoDeps) bool { - // return a.Hash < b.Hash // Sort by ??. let the compiler work it out?? - // }) - return newGoDepIterator(things) -} -func (x *GoDeps) SortByGoPath() *GoDepIterator { - // copy the pointers as fast as possible. - things := x.selectAllGoDeps() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(GoDepGoPath(things)) - // slices.SortFunc(things, func(a, b *GoDeps) bool { - // return a.GoPath < b.GoPath // Sort by ??. let the compiler work it out?? - // }) - return newGoDepIterator(things) -} - -// END SORT - -func (x *GoDeps) Len() int { - goDepMu.RLock() - defer goDepMu.RUnlock() - - return len(x.GoDeps) -} - -// just a simple Append() shortcut (but still uses the mutex lock) -func (x *GoDeps) Append(y *GoDep) { - goDepMu.Lock() - defer goDepMu.Unlock() - - x.GoDeps = append(x.GoDeps, y) -} - -func (x *GoDeps) All() *GoDepIterator { - GoDepPointers := x.selectAllGoDeps() - - iterator := newGoDepIterator(GoDepPointers) - return iterator -} - -func (x *GoDeps) Delete(y *GoDep) bool { - goDepMu.Lock() - defer goDepMu.Unlock() - - for i, _ := range x.GoDeps { - if x.GoDeps[i] == y { - x.GoDeps[i] = x.GoDeps[len(x.GoDeps)-1] - x.GoDeps = x.GoDeps[:len(x.GoDeps)-1] - return true - } - } - return false -} - -// lookup a GoDeps by the Hash -func (x *GoDeps) FindByHash(s string) *GoDep { - if x == nil { - return nil - } - - goDepMu.RLock() - defer goDepMu.RUnlock() - - for i, _ := range x.GoDeps { - if x.GoDeps[i].Hash == s { - return x.GoDeps[i] - } - } - return nil -} - -// lookup a GoDeps by the GoPath -func (x *GoDeps) FindByGoPath(s string) *GoDep { - if x == nil { - return nil - } - - goDepMu.RLock() - defer goDepMu.RUnlock() - - for i, _ := range x.GoDeps { - if x.GoDeps[i].GoPath == s { - return x.GoDeps[i] - } - } - return nil -} - -func (x *GoDeps) DeleteByHash(s string) bool { - goDepMu.Lock() - defer goDepMu.Unlock() - - for i, _ := range x.GoDeps { - if x.GoDeps[i].Hash == s { - x.GoDeps[i] = x.GoDeps[len(x.GoDeps)-1] - x.GoDeps = x.GoDeps[:len(x.GoDeps)-1] - return true - } - } - return false -} - -func (x *GoDeps) DeleteByGoPath(s string) bool { - goDepMu.Lock() - defer goDepMu.Unlock() - - for i, _ := range x.GoDeps { - if x.GoDeps[i].GoPath == s { - x.GoDeps[i] = x.GoDeps[len(x.GoDeps)-1] - x.GoDeps = x.GoDeps[:len(x.GoDeps)-1] - return true - } - } - return false -} - -func (x *GoDeps) AppendByHash(y *GoDep) bool { - goDepMu.Lock() - defer goDepMu.Unlock() - - for _, p := range x.GoDeps { - if p.Hash == y.Hash { - return false - } - } - - x.GoDeps = append(x.GoDeps, y) - return true -} - -func (x *GoDeps) AppendByGoPath(y *GoDep) bool { - goDepMu.Lock() - defer goDepMu.Unlock() - - for _, p := range x.GoDeps { - if p.GoPath == y.GoPath { - return false - } - } - - x.GoDeps = append(x.GoDeps, y) - return true -} - -// `autogen:repo.marshal.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.49-2-g9a0e4a6 2025.02.01_0732 -// 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 gitpb - -import ( - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" -) - -// human readable JSON -func (v *Repos) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *Repos) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *Repos) 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 *Repos) FormatTEXT() string { - v.fixUuid() - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *Repos) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *Repos) Marshal() ([]byte, error) { - v.fixUuid() - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *Repos) Unmarshal(data []byte) error { - return proto.Unmarshal(data, v) -} - -// human readable JSON -func (v *Repo) FormatJSON() string { - return protojson.Format(v) -} - -// marshal json -func (v *Repo) MarshalJSON() ([]byte, error) { - return protojson.Marshal(v) -} - -// unmarshal json -func (v *Repo) 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 *Repo) FormatTEXT() string { - return prototext.Format(v) -} - -// unmarshalTEXT. This reads the .text config file back in after the user edits it -func (v *Repo) UnmarshalTEXT(data []byte) error { - return prototext.Unmarshal(data, v) -} - -// marshal to wire. This is called winning. -func (v *Repo) Marshal() ([]byte, error) { - return proto.Marshal(v) -} - -// unmarshal from wire. You have won. -func (v *Repo) Unmarshal(data []byte) error { - return proto.Unmarshal(data, v) -} - -// `autogen:repo.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.49-2-g9a0e4a6 2025.02.01_0732 -// 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: repo.proto - -package gitpb // 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) -) - -// should it be done this way? -type GitTimes struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LastPull *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=lastPull,proto3" json:"lastPull,omitempty"` // last time a git pull was done - LastUpdate *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lastUpdate,proto3" json:"lastUpdate,omitempty"` // when was ReloadGit() last done - LastDirty *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lastDirty,proto3" json:"lastDirty,omitempty"` // last time CheckDirty() was run - MtimeDir *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=mtimeDir,proto3" json:"mtimeDir,omitempty"` // mtime for ./git // maybe useful to track - MtimeHead *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=mtimeHead,proto3" json:"mtimeHead,omitempty"` // mtime for ./git/HEAD // these two mtimes allow really fast checks to see if git has changed - MtimeIndex *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=mtimeIndex,proto3" json:"mtimeIndex,omitempty"` // mtime for ./git/HEAD // probably always in sync with HEAD - MtimeFetch *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=mtimeFetch,proto3" json:"mtimeFetch,omitempty"` // mtime for ./git/FETCH_HEAD // last time 'git fetch' or 'git pull' was run on current branch? - LastGoDep *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=lastGoDep,proto3" json:"lastGoDep,omitempty"` // mtime for last go.sum scan - NewestCommit *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=newestCommit,proto3" json:"newestCommit,omitempty"` // when the newest commit was - MtimeConfig *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=mtimeConfig,proto3" json:"mtimeConfig,omitempty"` // mtime for the .git/config file -} - -func (x *GitTimes) Reset() { - *x = GitTimes{} - mi := &file_repo_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GitTimes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitTimes) ProtoMessage() {} - -func (x *GitTimes) ProtoReflect() protoreflect.Message { - mi := &file_repo_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 GitTimes.ProtoReflect.Descriptor instead. -func (*GitTimes) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{0} -} - -func (x *GitTimes) GetLastPull() *timestamppb.Timestamp { - if x != nil { - return x.LastPull - } - return nil -} - -func (x *GitTimes) GetLastUpdate() *timestamppb.Timestamp { - if x != nil { - return x.LastUpdate - } - return nil -} - -func (x *GitTimes) GetLastDirty() *timestamppb.Timestamp { - if x != nil { - return x.LastDirty - } - return nil -} - -func (x *GitTimes) GetMtimeDir() *timestamppb.Timestamp { - if x != nil { - return x.MtimeDir - } - return nil -} - -func (x *GitTimes) GetMtimeHead() *timestamppb.Timestamp { - if x != nil { - return x.MtimeHead - } - return nil -} - -func (x *GitTimes) GetMtimeIndex() *timestamppb.Timestamp { - if x != nil { - return x.MtimeIndex - } - return nil -} - -func (x *GitTimes) GetMtimeFetch() *timestamppb.Timestamp { - if x != nil { - return x.MtimeFetch - } - return nil -} - -func (x *GitTimes) GetLastGoDep() *timestamppb.Timestamp { - if x != nil { - return x.LastGoDep - } - return nil -} - -func (x *GitTimes) GetNewestCommit() *timestamppb.Timestamp { - if x != nil { - return x.NewestCommit - } - return nil -} - -func (x *GitTimes) GetMtimeConfig() *timestamppb.Timestamp { - if x != nil { - return x.MtimeConfig - } - return nil -} - -// this is probably better. think about moving to this instead -type GoInfo 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"` // the logical path as used by golang: 'go.wit.com/apps/helloworld' - Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` // what is this repo? - GoLibrary bool `protobuf:"varint,3,opt,name=goLibrary,proto3" json:"goLibrary,omitempty"` // is this a golang library? - GoBinary bool `protobuf:"varint,4,opt,name=goBinary,proto3" json:"goBinary,omitempty"` // is this a golang binary? - GoPrimitive bool `protobuf:"varint,5,opt,name=goPrimitive,proto3" json:"goPrimitive,omitempty"` // if this is a golang primitive (only has go.mod) - GoPlugin bool `protobuf:"varint,6,opt,name=goPlugin,proto3" json:"goPlugin,omitempty"` // is this a golang plugin? - GoProtobuf bool `protobuf:"varint,7,opt,name=goProtobuf,proto3" json:"goProtobuf,omitempty"` // autogen go files from .proto - GoDeps *GoDeps `protobuf:"bytes,8,opt,name=goDeps,proto3" json:"goDeps,omitempty"` // what is in the go.sum file - Published *GoDeps `protobuf:"bytes,9,opt,name=published,proto3" json:"published,omitempty"` // the last published go.mod/go.sum - GoMod []byte `protobuf:"bytes,10,opt,name=goMod,proto3" json:"goMod,omitempty"` // the last go.mod file - GoSum []byte `protobuf:"bytes,11,opt,name=goSum,proto3" json:"goSum,omitempty"` // the last go.sum file - GitIgnoresGoSum bool `protobuf:"varint,12,opt,name=gitIgnoresGoSum,proto3" json:"gitIgnoresGoSum,omitempty"` // does .gitignore ignore go.mod & go.sum? -} - -func (x *GoInfo) Reset() { - *x = GoInfo{} - mi := &file_repo_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GoInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoInfo) ProtoMessage() {} - -func (x *GoInfo) ProtoReflect() protoreflect.Message { - mi := &file_repo_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 GoInfo.ProtoReflect.Descriptor instead. -func (*GoInfo) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{1} -} - -func (x *GoInfo) GetGoPath() string { - if x != nil { - return x.GoPath - } - return "" -} - -func (x *GoInfo) GetDesc() string { - if x != nil { - return x.Desc - } - return "" -} - -func (x *GoInfo) GetGoLibrary() bool { - if x != nil { - return x.GoLibrary - } - return false -} - -func (x *GoInfo) GetGoBinary() bool { - if x != nil { - return x.GoBinary - } - return false -} - -func (x *GoInfo) GetGoPrimitive() bool { - if x != nil { - return x.GoPrimitive - } - return false -} - -func (x *GoInfo) GetGoPlugin() bool { - if x != nil { - return x.GoPlugin - } - return false -} - -func (x *GoInfo) GetGoProtobuf() bool { - if x != nil { - return x.GoProtobuf - } - return false -} - -func (x *GoInfo) GetGoDeps() *GoDeps { - if x != nil { - return x.GoDeps - } - return nil -} - -func (x *GoInfo) GetPublished() *GoDeps { - if x != nil { - return x.Published - } - return nil -} - -func (x *GoInfo) GetGoMod() []byte { - if x != nil { - return x.GoMod - } - return nil -} - -func (x *GoInfo) GetGoSum() []byte { - if x != nil { - return x.GoSum - } - return nil -} - -func (x *GoInfo) GetGitIgnoresGoSum() bool { - if x != nil { - return x.GitIgnoresGoSum - } - return false -} - -type Repo struct { - // sync.RWMutex // skipped. protobuf file has `autogenpb:nomutex` - - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FullPath string `protobuf:"bytes,1,opt,name=fullPath,proto3" json:"fullPath,omitempty"` // `autogenpb:unique` `autogenpb:sort` // the actual path to the .git directory: '/home/devel/golang.org/x/tools' - MasterBranchName string `protobuf:"bytes,3,opt,name=masterBranchName,proto3" json:"masterBranchName,omitempty"` // git 'main' or 'master' branch name - DevelBranchName string `protobuf:"bytes,4,opt,name=develBranchName,proto3" json:"develBranchName,omitempty"` // whatever the git 'devel' branch name is - UserBranchName string `protobuf:"bytes,5,opt,name=userBranchName,proto3" json:"userBranchName,omitempty"` // whatever your username branch is - Dirty bool `protobuf:"varint,6,opt,name=dirty,proto3" json:"dirty,omitempty"` // if git says things have been changed - URL string `protobuf:"bytes,7,opt,name=URL,proto3" json:"URL,omitempty"` // the URL - Tags *GitTags `protobuf:"bytes,8,opt,name=tags,proto3" json:"tags,omitempty"` // known tags - Times *GitTimes `protobuf:"bytes,9,opt,name=times,proto3" json:"times,omitempty"` // store all the mtime values here. these are temporary - GoInfo *GoInfo `protobuf:"bytes,10,opt,name=goInfo,proto3" json:"goInfo,omitempty"` // put all the go specifcs here - GoDeps *GoDeps `protobuf:"bytes,11,opt,name=goDeps,proto3" json:"goDeps,omitempty"` // what is in the go.sum file - CurrentBranchName string `protobuf:"bytes,12,opt,name=currentBranchName,proto3" json:"currentBranchName,omitempty"` // the branch currently checked out - CurrentBranchVersion string `protobuf:"bytes,13,opt,name=currentBranchVersion,proto3" json:"currentBranchVersion,omitempty"` // the branch currently checked out - LastTag string `protobuf:"bytes,14,opt,name=lastTag,proto3" json:"lastTag,omitempty"` // the oldest tag - TargetVersion string `protobuf:"bytes,15,opt,name=targetVersion,proto3" json:"targetVersion,omitempty"` // useful during the package release process - ReadOnly bool `protobuf:"varint,16,opt,name=readOnly,proto3" json:"readOnly,omitempty"` // tracks access to 'git push' - Desc string `protobuf:"bytes,17,opt,name=desc,proto3" json:"desc,omitempty"` // what is this repo? - StateChange string `protobuf:"bytes,18,opt,name=stateChange,proto3" json:"stateChange,omitempty"` // used for debugging tool logic - MasterVersion string `protobuf:"bytes,19,opt,name=masterVersion,proto3" json:"masterVersion,omitempty"` // just store this for now - DevelVersion string `protobuf:"bytes,20,opt,name=develVersion,proto3" json:"develVersion,omitempty"` // - UserVersion string `protobuf:"bytes,21,opt,name=userVersion,proto3" json:"userVersion,omitempty"` // - DirtyList []string `protobuf:"bytes,22,rep,name=dirtyList,proto3" json:"dirtyList,omitempty"` // store the list from git status --porcelain - State string `protobuf:"bytes,23,opt,name=state,proto3" json:"state,omitempty"` // status or state. useful for building tooling - CurrentTag *GitTag `protobuf:"bytes,24,opt,name=currentTag,proto3" json:"currentTag,omitempty"` // used to examine repo branches - GitConfig *GitConfig `protobuf:"bytes,25,opt,name=gitConfig,proto3" json:"gitConfig,omitempty"` // protobuf of the current .git/config -} - -func (x *Repo) Reset() { - *x = Repo{} - mi := &file_repo_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Repo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Repo) ProtoMessage() {} - -func (x *Repo) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[2] - 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 Repo.ProtoReflect.Descriptor instead. -func (*Repo) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{2} -} - -func (x *Repo) GetFullPath() string { - if x != nil { - return x.FullPath - } - return "" -} - -func (x *Repo) GetMasterBranchName() string { - if x != nil { - return x.MasterBranchName - } - return "" -} - -func (x *Repo) GetDevelBranchName() string { - if x != nil { - return x.DevelBranchName - } - return "" -} - -func (x *Repo) GetUserBranchName() string { - if x != nil { - return x.UserBranchName - } - return "" -} - -func (x *Repo) GetDirty() bool { - if x != nil { - return x.Dirty - } - return false -} - -func (x *Repo) GetURL() string { - if x != nil { - return x.URL - } - return "" -} - -func (x *Repo) GetTags() *GitTags { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Repo) GetTimes() *GitTimes { - if x != nil { - return x.Times - } - return nil -} - -func (x *Repo) GetGoInfo() *GoInfo { - if x != nil { - return x.GoInfo - } - return nil -} - -func (x *Repo) GetGoDeps() *GoDeps { - if x != nil { - return x.GoDeps - } - return nil -} - -func (x *Repo) GetCurrentBranchName() string { - if x != nil { - return x.CurrentBranchName - } - return "" -} - -func (x *Repo) GetCurrentBranchVersion() string { - if x != nil { - return x.CurrentBranchVersion - } - return "" -} - -func (x *Repo) GetLastTag() string { - if x != nil { - return x.LastTag - } - return "" -} - -func (x *Repo) GetTargetVersion() string { - if x != nil { - return x.TargetVersion - } - return "" -} - -func (x *Repo) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -func (x *Repo) GetDesc() string { - if x != nil { - return x.Desc - } - return "" -} - -func (x *Repo) GetStateChange() string { - if x != nil { - return x.StateChange - } - return "" -} - -func (x *Repo) GetMasterVersion() string { - if x != nil { - return x.MasterVersion - } - return "" -} - -func (x *Repo) GetDevelVersion() string { - if x != nil { - return x.DevelVersion - } - return "" -} - -func (x *Repo) GetUserVersion() string { - if x != nil { - return x.UserVersion - } - return "" -} - -func (x *Repo) GetDirtyList() []string { - if x != nil { - return x.DirtyList - } - return nil -} - -func (x *Repo) GetState() string { - if x != nil { - return x.State - } - return "" -} - -func (x *Repo) GetCurrentTag() *GitTag { - if x != nil { - return x.CurrentTag - } - return nil -} - -func (x *Repo) GetGitConfig() *GitConfig { - if x != nil { - return x.GitConfig - } - return nil -} - -type Repos 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:8daaeba1-fb1f-4762-ae6e-95a55d352673` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v3` - Repos []*Repo `protobuf:"bytes,3,rep,name=repos,proto3" json:"repos,omitempty"` // `autogenpb:append` // generate AppendUnique() function for this - HasFullScan bool `protobuf:"varint,4,opt,name=hasFullScan,proto3" json:"hasFullScan,omitempty"` // a full repo scan has been saved to disk - FullScan *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=fullScan,proto3" json:"fullScan,omitempty"` // mtime of the last full scan saved to disk -} - -func (x *Repos) Reset() { - *x = Repos{} - mi := &file_repo_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Repos) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Repos) ProtoMessage() {} - -func (x *Repos) ProtoReflect() protoreflect.Message { - mi := &file_repo_proto_msgTypes[3] - 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 Repos.ProtoReflect.Descriptor instead. -func (*Repos) Descriptor() ([]byte, []int) { - return file_repo_proto_rawDescGZIP(), []int{3} -} - -func (x *Repos) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -func (x *Repos) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Repos) GetRepos() []*Repo { - if x != nil { - return x.Repos - } - return nil -} - -func (x *Repos) GetHasFullScan() bool { - if x != nil { - return x.HasFullScan - } - return false -} - -func (x *Repos) GetFullScan() *timestamppb.Timestamp { - if x != nil { - return x.FullScan - } - return nil -} - -var File_repo_proto protoreflect.FileDescriptor - -var file_repo_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x67, 0x69, - 0x74, 0x70, 0x62, 0x1a, 0x0c, 0x67, 0x69, 0x74, 0x54, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x0b, 0x67, 0x6f, 0x44, 0x65, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, - 0xda, 0x04, 0x0a, 0x08, 0x47, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x36, 0x0a, 0x08, - 0x6c, 0x61, 0x73, 0x74, 0x50, 0x75, 0x6c, 0x6c, 0x18, 0x01, 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, 0x6c, 0x61, 0x73, 0x74, - 0x50, 0x75, 0x6c, 0x6c, 0x12, 0x3a, 0x0a, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x18, 0x02, 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, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x12, 0x38, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x44, 0x69, 0x72, 0x74, 0x79, 0x18, 0x03, 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, - 0x09, 0x6c, 0x61, 0x73, 0x74, 0x44, 0x69, 0x72, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x08, 0x6d, 0x74, - 0x69, 0x6d, 0x65, 0x44, 0x69, 0x72, 0x18, 0x04, 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, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x44, - 0x69, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x65, 0x61, 0x64, 0x18, - 0x05, 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, 0x09, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x65, 0x61, 0x64, 0x12, 0x3a, 0x0a, 0x0a, - 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 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, 0x0a, 0x6d, 0x74, - 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x74, 0x69, 0x6d, - 0x65, 0x46, 0x65, 0x74, 0x63, 0x68, 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, 0x0a, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x46, - 0x65, 0x74, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x47, 0x6f, 0x44, 0x65, - 0x70, 0x18, 0x08, 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, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x47, 0x6f, 0x44, 0x65, 0x70, 0x12, 0x3e, - 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x09, - 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, 0x0c, 0x6e, 0x65, 0x77, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x3c, - 0x0a, 0x0b, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 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, - 0x0b, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xf6, 0x02, 0x0a, - 0x06, 0x47, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 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, - 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, - 0x65, 0x73, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x6f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x67, 0x6f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x67, 0x6f, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, - 0x0b, 0x67, 0x6f, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x67, 0x6f, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x67, 0x6f, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x67, 0x6f, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x67, - 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x67, 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x12, 0x25, 0x0a, 0x06, 0x67, - 0x6f, 0x44, 0x65, 0x70, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x52, 0x06, 0x67, 0x6f, 0x44, 0x65, - 0x70, 0x73, 0x12, 0x2b, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x6f, - 0x44, 0x65, 0x70, 0x73, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, - 0x14, 0x0a, 0x05, 0x67, 0x6f, 0x4d, 0x6f, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x67, 0x6f, 0x4d, 0x6f, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x6f, 0x53, 0x75, 0x6d, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x67, 0x6f, 0x53, 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x0f, 0x67, - 0x69, 0x74, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x73, 0x47, 0x6f, 0x53, 0x75, 0x6d, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x69, 0x74, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x73, - 0x47, 0x6f, 0x53, 0x75, 0x6d, 0x22, 0xd4, 0x06, 0x0a, 0x04, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x1a, - 0x0a, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x61, - 0x73, 0x74, 0x65, 0x72, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 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, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x69, 0x72, 0x74, - 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x69, 0x72, 0x74, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x55, 0x52, 0x4c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x52, 0x4c, - 0x12, 0x22, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, - 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x54, 0x61, 0x67, 0x73, 0x52, 0x04, - 0x74, 0x61, 0x67, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x52, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x06, 0x67, - 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x67, 0x6f, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x06, 0x67, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x44, 0x65, 0x70, - 0x73, 0x52, 0x06, 0x67, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6c, - 0x61, 0x73, 0x74, 0x54, 0x61, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x61, - 0x73, 0x74, 0x54, 0x61, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, - 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, - 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x20, 0x0a, 0x0b, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x24, 0x0a, - 0x0d, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x13, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x76, 0x65, 0x6c, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, - 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x69, 0x72, - 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x64, 0x69, - 0x72, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2d, 0x0a, - 0x0a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x54, 0x61, 0x67, - 0x52, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x67, 0x12, 0x2e, 0x0a, 0x09, - 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xb2, 0x01, 0x0a, - 0x05, 0x52, 0x65, 0x70, 0x6f, 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, 0x21, 0x0a, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x6f, - 0x52, 0x05, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x68, 0x61, 0x73, 0x46, 0x75, - 0x6c, 0x6c, 0x53, 0x63, 0x61, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x68, 0x61, - 0x73, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x63, 0x61, 0x6e, 0x12, 0x36, 0x0a, 0x08, 0x66, 0x75, 0x6c, - 0x6c, 0x53, 0x63, 0x61, 0x6e, 0x18, 0x05, 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, 0x66, 0x75, 0x6c, 0x6c, 0x53, 0x63, 0x61, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_repo_proto_rawDescOnce sync.Once - file_repo_proto_rawDescData = file_repo_proto_rawDesc -) - -func file_repo_proto_rawDescGZIP() []byte { - file_repo_proto_rawDescOnce.Do(func() { - file_repo_proto_rawDescData = protoimpl.X.CompressGZIP(file_repo_proto_rawDescData) - }) - return file_repo_proto_rawDescData -} - -var file_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_repo_proto_goTypes = []any{ - (*GitTimes)(nil), // 0: gitpb.GitTimes - (*GoInfo)(nil), // 1: gitpb.GoInfo - (*Repo)(nil), // 2: gitpb.Repo - (*Repos)(nil), // 3: gitpb.Repos - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp - (*GoDeps)(nil), // 5: gitpb.GoDeps - (*GitTags)(nil), // 6: gitpb.GitTags - (*GitTag)(nil), // 7: gitpb.GitTag - (*GitConfig)(nil), // 8: gitpb.GitConfig -} -var file_repo_proto_depIdxs = []int32{ - 4, // 0: gitpb.GitTimes.lastPull:type_name -> google.protobuf.Timestamp - 4, // 1: gitpb.GitTimes.lastUpdate:type_name -> google.protobuf.Timestamp - 4, // 2: gitpb.GitTimes.lastDirty:type_name -> google.protobuf.Timestamp - 4, // 3: gitpb.GitTimes.mtimeDir:type_name -> google.protobuf.Timestamp - 4, // 4: gitpb.GitTimes.mtimeHead:type_name -> google.protobuf.Timestamp - 4, // 5: gitpb.GitTimes.mtimeIndex:type_name -> google.protobuf.Timestamp - 4, // 6: gitpb.GitTimes.mtimeFetch:type_name -> google.protobuf.Timestamp - 4, // 7: gitpb.GitTimes.lastGoDep:type_name -> google.protobuf.Timestamp - 4, // 8: gitpb.GitTimes.newestCommit:type_name -> google.protobuf.Timestamp - 4, // 9: gitpb.GitTimes.mtimeConfig:type_name -> google.protobuf.Timestamp - 5, // 10: gitpb.GoInfo.goDeps:type_name -> gitpb.GoDeps - 5, // 11: gitpb.GoInfo.published:type_name -> gitpb.GoDeps - 6, // 12: gitpb.Repo.tags:type_name -> gitpb.GitTags - 0, // 13: gitpb.Repo.times:type_name -> gitpb.GitTimes - 1, // 14: gitpb.Repo.goInfo:type_name -> gitpb.GoInfo - 5, // 15: gitpb.Repo.goDeps:type_name -> gitpb.GoDeps - 7, // 16: gitpb.Repo.currentTag:type_name -> gitpb.GitTag - 8, // 17: gitpb.Repo.gitConfig:type_name -> gitpb.GitConfig - 2, // 18: gitpb.Repos.repos:type_name -> gitpb.Repo - 4, // 19: gitpb.Repos.fullScan:type_name -> google.protobuf.Timestamp - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name -} - -func init() { file_repo_proto_init() } -func file_repo_proto_init() { - if File_repo_proto != nil { - return - } - file_gitTag_proto_init() - file_goDep_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_repo_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_repo_proto_goTypes, - DependencyIndexes: file_repo_proto_depIdxs, - MessageInfos: file_repo_proto_msgTypes, - }.Build() - File_repo_proto = out.File - file_repo_proto_rawDesc = nil - file_repo_proto_goTypes = nil - file_repo_proto_depIdxs = nil -} - -// `autogen:repo.sort.pb.go` - -// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. -// This file was autogenerated with autogenpb v0.0.49-2-g9a0e4a6 2025.02.01_0732 -// 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 gitpb - -import ( - "fmt" - "sort" - "sync" -) - -// a simple global lock -var repoMu sync.RWMutex - -func (x *Repos) fixUuid() { - if x == nil { - return - } - if x.Uuid == "8daaeba1-fb1f-4762-ae6e-95a55d352673" { - return - } - x.Uuid = "8daaeba1-fb1f-4762-ae6e-95a55d352673" - x.Version = "v3 go.wit.com/lib/protobuf/gitpb" -} - -func NewRepos() *Repos { - x := new(Repos) - x.Uuid = "8daaeba1-fb1f-4762-ae6e-95a55d352673" - x.Version = "v3 go.wit.com/lib/protobuf/gitpb" - return x -} - -// START SORT - -// DEFINE THE Repos ITERATOR. -// itializes a new iterator. -func newReposIterator(things []*Repos) *ReposIterator { - return &ReposIterator{things: things} -} - -type ReposIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Repos - index int -} - -func (it *ReposIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *ReposIterator) Next() *Repos { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in ReposIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE Repo ITERATOR. -// itializes a new iterator. -func newRepoIterator(things []*Repo) *RepoIterator { - return &RepoIterator{things: things} -} - -type RepoIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*Repo - index int -} - -func (it *RepoIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *RepoIterator) Next() *Repo { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in RepoIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GitTimes ITERATOR. -// itializes a new iterator. -func newGitTimesIterator(things []*GitTimes) *GitTimesIterator { - return &GitTimesIterator{things: things} -} - -type GitTimesIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GitTimes - index int -} - -func (it *GitTimesIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GitTimesIterator) Next() *GitTimes { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GitTimesIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// DEFINE THE GoInfo ITERATOR. -// itializes a new iterator. -func newGoInfoIterator(things []*GoInfo) *GoInfoIterator { - return &GoInfoIterator{things: things} -} - -type GoInfoIterator struct { - sync.RWMutex // this isn't getting used properly yet? - - things []*GoInfo - index int -} - -func (it *GoInfoIterator) Scan() bool { - if it.index >= len(it.things) { - return false - } - it.index++ - return true -} - -// Next() returns the next thing in the array -func (it *GoInfoIterator) Next() *GoInfo { - if it.things[it.index-1] == nil { - fmt.Println("Next() error in GoInfoIterator", it.index) - } - return it.things[it.index-1] -} - -// END DEFINE THE ITERATOR - -// sort struct by FullPath -type RepoFullPath []*Repo - -func (a RepoFullPath) Len() int { return len(a) } -func (a RepoFullPath) Less(i, j int) bool { return a[i].FullPath < a[j].FullPath } -func (a RepoFullPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -// safely returns a slice of pointers to the FRUIT protobufs -func (x *Repos) allRepos() []*Repo { - repoMu.RLock() - defer repoMu.RUnlock() - - // Create a new slice to hold pointers to each FRUIT - var tmp []*Repo - tmp = make([]*Repo, len(x.Repos)) - for i, p := range x.Repos { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} - -// safely returns a slice of pointers to the Repo protobufs -func (x *Repos) selectAllRepos() []*Repo { - repoMu.RLock() - defer repoMu.RUnlock() - - // Create a new slice to hold pointers to each Repo - var tmp []*Repo - tmp = make([]*Repo, len(x.Repos)) - for i, p := range x.Repos { - tmp[i] = p // Copy pointers for safe iteration - } - - return tmp -} -func (x *Repos) SortByFullPath() *RepoIterator { - // copy the pointers as fast as possible. - things := x.selectAllRepos() - - // todo: try slices.SortFunc() instead to see what happens - sort.Sort(RepoFullPath(things)) - // slices.SortFunc(things, func(a, b *Repos) bool { - // return a.FullPath < b.FullPath // Sort by ??. let the compiler work it out?? - // }) - return newRepoIterator(things) -} - -// END SORT - -func (x *Repos) Len() int { - repoMu.RLock() - defer repoMu.RUnlock() - - return len(x.Repos) -} - -// just a simple Append() shortcut (but still uses the mutex lock) -func (x *Repos) Append(y *Repo) { - repoMu.Lock() - defer repoMu.Unlock() - - x.Repos = append(x.Repos, y) -} - -func (x *Repos) All() *RepoIterator { - RepoPointers := x.selectAllRepos() - - iterator := newRepoIterator(RepoPointers) - return iterator -} - -func (x *Repos) Delete(y *Repo) bool { - repoMu.Lock() - defer repoMu.Unlock() - - for i, _ := range x.Repos { - if x.Repos[i] == y { - x.Repos[i] = x.Repos[len(x.Repos)-1] - x.Repos = x.Repos[:len(x.Repos)-1] - return true - } - } - return false -} - -// lookup a Repos by the FullPath -func (x *Repos) FindByFullPath(s string) *Repo { - if x == nil { - return nil - } - - repoMu.RLock() - defer repoMu.RUnlock() - - for i, _ := range x.Repos { - if x.Repos[i].FullPath == s { - return x.Repos[i] - } - } - return nil -} - -func (x *Repos) DeleteByFullPath(s string) bool { - repoMu.Lock() - defer repoMu.Unlock() - - for i, _ := range x.Repos { - if x.Repos[i].FullPath == s { - x.Repos[i] = x.Repos[len(x.Repos)-1] - x.Repos = x.Repos[:len(x.Repos)-1] - return true - } - } - return false -} - -func (x *Repos) AppendByFullPath(y *Repo) bool { - repoMu.Lock() - defer repoMu.Unlock() - - for _, p := range x.Repos { - if p.FullPath == y.FullPath { - return false - } - } - - x.Repos = append(x.Repos, y) - return true -} - -// `autogen:`