library for now

This commit is contained in:
Jeff Carr 2024-12-17 23:27:17 -06:00
parent af50986812
commit a60188915d
Notes: Jeff Carr 2024-12-17 23:31:12 -06:00
// `autogen:go.mod`

module go.wit.com/lib/protobuf/gitpb

go 1.21

toolchain go1.23.4

require (
	github.com/destel/rill v0.6.0
	github.com/go-cmd/cmd v1.4.3
	go.wit.com/lib/gui/shell v0.22.18
	go.wit.com/log v0.22.9
	google.golang.org/protobuf v1.36.0
)

// `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.18 h1:2z14XRxGrNjRKVsfvlk70sWsRZWoLdnL7z0FS+BFzFM=
go.wit.com/lib/gui/shell v0.22.18/go.mod h1:zduuMSWq+EE7w0xbXn+vkoGZ4HJhURVJpvXw8oK9WAU=
go.wit.com/log v0.22.9 h1:aBM6SI2kxlJcBfS/osFTomJqNhO0hfEo1gk+LCqLk7Y=
go.wit.com/log v0.22.9/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.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=

// `autogen:gitTag.marshal.pb.go`

package gitpb

// This file was autogenerated with autogenpb v0.0.30-1-g84c25d7 DO NOT EDIT
//     go install go.wit.com/apps/autogenpb@latest
//
// You can use it on simple protobuf files
// The .proto file must have a singular and plural form of a message
// (for those of you that know ruby on rails, it's like that)
//
// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for
//
// For an example,
//       go-clone go.wit.com/lib/protobuf/gitpb
//

import (
	"google.golang.org/protobuf/encoding/protojson"
	"google.golang.org/protobuf/encoding/prototext"
	"google.golang.org/protobuf/proto"
)

// human readable JSON
func (v *GitTag) FormatJSON() string {
	return protojson.Format(v)
}

// marshal json
func (v *GitTag) MarshalJSON() ([]byte, error) {
	return protojson.Marshal(v)
}

// unmarshal json
func (v *GitTag) 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 so great for config files, I'm using it by default to try to fix the problems with it
func (v *GitTag) FormatTEXT() string {
	return prototext.Format(v)
}

// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *GitTag) UnmarshalTEXT(data []byte) error {
	return prototext.Unmarshal(data, v)
}

// marshal to wire. This is called winning.
func (v *GitTag) Marshal() ([]byte, error) {
	return proto.Marshal(v)
}

// unmarshal from wire. You have won.
func (v *GitTag) Unmarshal(data []byte) error {
	return proto.Unmarshal(data, v)
}

// 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 so great for config files, I'm using it by default to try to fix the problems with it
func (v *GitTags) FormatTEXT() string {
	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) {
	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 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

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
)

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 GitTag struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Refname     string                 `protobuf:"bytes,1,opt,name=refname,proto3" json:"refname,omitempty"`         // `autogenpb:unique` 	// 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[0]
	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[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 GitTag.ProtoReflect.Descriptor instead.
func (*GitTag) Descriptor() ([]byte, []int) {
	return file_gitTag_proto_rawDescGZIP(), []int{0}
}

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 {
	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"`       // I guess why not just have this on each file
	Version string    `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // maybe can be used for protobuf schema change violations
	GitTags []*GitTag `protobuf:"bytes,3,rep,name=gitTags,proto3" json:"gitTags,omitempty"`
}

func (x *GitTags) Reset() {
	*x = GitTags{}
	mi := &file_gitTag_proto_msgTypes[1]
	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[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 GitTags.ProtoReflect.Descriptor instead.
func (*GitTags) Descriptor() ([]byte, []int) {
	return file_gitTag_proto_rawDescGZIP(), []int{1}
}

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, 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, 2)
var file_gitTag_proto_goTypes = []any{
	(*GitTag)(nil),                // 0: gitpb.GitTag
	(*GitTags)(nil),               // 1: gitpb.GitTags
	(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_gitTag_proto_depIdxs = []int32{
	2, // 0: gitpb.GitTag.creatordate:type_name -> google.protobuf.Timestamp
	2, // 1: gitpb.GitTag.authordate:type_name -> google.protobuf.Timestamp
	0, // 2: gitpb.GitTags.gitTags:type_name -> gitpb.GitTag
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] 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:   2,
			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`

package gitpb

// This file was autogenerated with autogenpb v0.0.30-1-g84c25d7 DO NOT EDIT
//     go install go.wit.com/apps/autogenpb@latest
//
// You can use it on simple protobuf files
// The .proto file must have a singular and plural form of a message
// (for those of you that know ruby on rails, it's like that)
//
// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for
//
// For an example,
//       go-clone go.wit.com/lib/protobuf/gitpb
//

import (
	"fmt"
	"sort"
	"sync"
)

type GitTagIterator struct {
	sync.RWMutex

	packs []*GitTag
	index int
}

// NewGitTagIterator initializes a new iterator.
func NewGitTagIterator(packs []*GitTag) *GitTagIterator {
	return &GitTagIterator{packs: packs}
}

// Scan moves to the next element and returns false if there are no more packs.
// Use Scan() in a loop, similar to a while loop
//
//	for iterator.Scan()
//		d := iterator.Next(
//		fmt.Println("found UUID:", d.Uuid
//	}
func (it *GitTagIterator) Scan() bool {
	if it.index >= len(it.packs) {
		return false
	}
	it.index++
	return true
}

// Next() returns the next thing in the array
func (it *GitTagIterator) Next() *GitTag {
	if it.packs[it.index-1] == nil {
		for i, d := range it.packs {
			fmt.Println("i =", i, d)
		}
		// fmt.Println("protobuf autogenpb sort error len =", len(it.packs))
		// fmt.Println("protobuf autogenpb sort error next == nil", it.index, it.index-1)
	}
	return it.packs[it.index-1]
}

// does not enforce any unique fields
func (all *GitTags) Append(newP *GitTag) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	all.GitTags = append(all.GitTags, newP)
	return true
}

func (all *GitTags) All() *GitTagIterator {
	gitTagPointers := all.selectAllGitTag()

	iterator := NewGitTagIterator(gitTagPointers)
	return iterator
}

func (all *GitTags) Len() int {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	return len(all.GitTags)
}

func (all *GitTags) SortByRefname() *GitTagIterator {
	packs := all.selectAllGitTag()

	sort.Sort(GitTagRefname(packs))

	iterator := NewGitTagIterator(packs)
	return iterator
}

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] }

// enforces Refname is unique
func (all *GitTags) AppendUniqueRefname(newP *GitTag) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GitTags {
		if p.Refname == newP.Refname {
			return false
		}
	}

	all.GitTags = append(all.GitTags, newP)
	return true
}

func (all *GitTags) DeleteByRefname(s string) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GitTags {
		if all.GitTags[i].Refname == s {
			all.GitTags[i] = all.GitTags[len(all.GitTags)-1]
			all.GitTags = all.GitTags[:len(all.GitTags)-1]
			return true
		}
	}
	return false
}

// enforces Refname is unique
func (all *GitTags) ReplaceRefname(newP *GitTag) bool { // todo: make unique name here
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GitTags {
		if p.Refname == newP.Refname {
			return false
		}
	}

	all.GitTags = append(all.GitTags, newP)
	return true
}

// find a dependancy by the go path
func (all *GitTags) FindByRefname(s string) *GitTag {
	if all == nil {
		return nil
	}

	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GitTags {
		if all.GitTags[i].Refname == s {
			return all.GitTags[i]
		}
	}
	return nil
}

func (all *GitTags) SortByHash() *GitTagIterator {
	packs := all.selectAllGitTag()

	sort.Sort(GitTagHash(packs))

	iterator := NewGitTagIterator(packs)
	return iterator
}

type GitTagHash []*GitTag

func (a GitTagHash) Len() int           { return len(a) }
func (a GitTagHash) Less(i, j int) bool { return a[i].Hash < a[j].Hash }
func (a GitTagHash) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// enforces Hash is unique
func (all *GitTags) AppendUniqueHash(newP *GitTag) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GitTags {
		if p.Hash == newP.Hash {
			return false
		}
	}

	all.GitTags = append(all.GitTags, newP)
	return true
}

func (all *GitTags) DeleteByHash(s string) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GitTags {
		if all.GitTags[i].Hash == s {
			all.GitTags[i] = all.GitTags[len(all.GitTags)-1]
			all.GitTags = all.GitTags[:len(all.GitTags)-1]
			return true
		}
	}
	return false
}

// enforces Hash is unique
func (all *GitTags) ReplaceHash(newP *GitTag) bool { // todo: make unique name here
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GitTags {
		if p.Hash == newP.Hash {
			return false
		}
	}

	all.GitTags = append(all.GitTags, newP)
	return true
}

// find a dependancy by the go path
func (all *GitTags) FindByHash(s string) *GitTag {
	if all == nil {
		return nil
	}

	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GitTags {
		if all.GitTags[i].Hash == s {
			return all.GitTags[i]
		}
	}
	return nil
}

// safely returns a slice of pointers to the GitTag protobufs
func (all *GitTags) selectAllGitTag() []*GitTag {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	// Create a new slice to hold pointers to each GitTag
	var aStuff []*GitTag
	aStuff = make([]*GitTag, len(all.GitTags))
	for i, p := range all.GitTags {
		aStuff[i] = p // Copy pointers for safe iteration
	}

	return aStuff
}

// `autogen:goDep.marshal.pb.go`

package gitpb

// This file was autogenerated with autogenpb v0.0.30-1-g84c25d7 DO NOT EDIT
//     go install go.wit.com/apps/autogenpb@latest
//
// You can use it on simple protobuf files
// The .proto file must have a singular and plural form of a message
// (for those of you that know ruby on rails, it's like that)
//
// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for
//
// For an example,
//       go-clone go.wit.com/lib/protobuf/gitpb
//

import (
	"google.golang.org/protobuf/encoding/protojson"
	"google.golang.org/protobuf/encoding/prototext"
	"google.golang.org/protobuf/proto"
)

// human readable JSON
func (v *GoDep) FormatJSON() string {
	return protojson.Format(v)
}

// marshal json
func (v *GoDep) MarshalJSON() ([]byte, error) {
	return protojson.Marshal(v)
}

// unmarshal json
func (v *GoDep) 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 so great for config files, I'm using it by default to try to fix the problems with it
func (v *GoDep) FormatTEXT() string {
	return prototext.Format(v)
}

// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *GoDep) UnmarshalTEXT(data []byte) error {
	return prototext.Unmarshal(data, v)
}

// marshal to wire. This is called winning.
func (v *GoDep) Marshal() ([]byte, error) {
	return proto.Marshal(v)
}

// unmarshal from wire. You have won.
func (v *GoDep) Unmarshal(data []byte) error {
	return proto.Unmarshal(data, v)
}

// human readable JSON
func (v *GoDeps) FormatJSON() string {
	return protojson.Format(v)
}

// marshal json
func (v *GoDeps) MarshalJSON() ([]byte, error) {
	return protojson.Marshal(v)
}

// unmarshal json
func (v *GoDeps) 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 so great for config files, I'm using it by default to try to fix the problems with it
func (v *GoDeps) FormatTEXT() string {
	return prototext.Format(v)
}

// unmarshalTEXT. This reads the .text config file back in after the user edits it
func (v *GoDeps) UnmarshalTEXT(data []byte) error {
	return prototext.Unmarshal(data, v)
}

// marshal to wire. This is called winning.
func (v *GoDeps) Marshal() ([]byte, error) {
	return proto.Marshal(v)
}

// unmarshal from wire. You have won.
func (v *GoDeps) Unmarshal(data []byte) error {
	return proto.Unmarshal(data, v)
}

// `autogen:goDep.pb.go`

// 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

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
)

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 {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Hash      string                 `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`           // `autogenpb:unique`	// 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` 	// "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 {
	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"`       // I guess why not just have this on each file
	Version string   `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // maybe can be used for protobuf schema change violations
	GoDeps  []*GoDep `protobuf:"bytes,3,rep,name=goDeps,proto3" json:"goDeps,omitempty"`
}

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`

package gitpb

// This file was autogenerated with autogenpb v0.0.30-1-g84c25d7 DO NOT EDIT
//     go install go.wit.com/apps/autogenpb@latest
//
// You can use it on simple protobuf files
// The .proto file must have a singular and plural form of a message
// (for those of you that know ruby on rails, it's like that)
//
// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for
//
// For an example,
//       go-clone go.wit.com/lib/protobuf/gitpb
//

import (
	"fmt"
	"sort"
	"sync"
)

type GoDepIterator struct {
	sync.RWMutex

	packs []*GoDep
	index int
}

// NewGoDepIterator initializes a new iterator.
func NewGoDepIterator(packs []*GoDep) *GoDepIterator {
	return &GoDepIterator{packs: packs}
}

// Scan moves to the next element and returns false if there are no more packs.
// Use Scan() in a loop, similar to a while loop
//
//	for iterator.Scan()
//		d := iterator.Next(
//		fmt.Println("found UUID:", d.Uuid
//	}
func (it *GoDepIterator) Scan() bool {
	if it.index >= len(it.packs) {
		return false
	}
	it.index++
	return true
}

// Next() returns the next thing in the array
func (it *GoDepIterator) Next() *GoDep {
	if it.packs[it.index-1] == nil {
		for i, d := range it.packs {
			fmt.Println("i =", i, d)
		}
		// fmt.Println("protobuf autogenpb sort error len =", len(it.packs))
		// fmt.Println("protobuf autogenpb sort error next == nil", it.index, it.index-1)
	}
	return it.packs[it.index-1]
}

// does not enforce any unique fields
func (all *GoDeps) Append(newP *GoDep) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	all.GoDeps = append(all.GoDeps, newP)
	return true
}

func (all *GoDeps) All() *GoDepIterator {
	goDepPointers := all.selectAllGoDep()

	iterator := NewGoDepIterator(goDepPointers)
	return iterator
}

func (all *GoDeps) Len() int {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	return len(all.GoDeps)
}

func (all *GoDeps) SortByHash() *GoDepIterator {
	packs := all.selectAllGoDep()

	sort.Sort(GoDepHash(packs))

	iterator := NewGoDepIterator(packs)
	return iterator
}

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] }

// enforces Hash is unique
func (all *GoDeps) AppendUniqueHash(newP *GoDep) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GoDeps {
		if p.Hash == newP.Hash {
			return false
		}
	}

	all.GoDeps = append(all.GoDeps, newP)
	return true
}

func (all *GoDeps) DeleteByHash(s string) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GoDeps {
		if all.GoDeps[i].Hash == s {
			all.GoDeps[i] = all.GoDeps[len(all.GoDeps)-1]
			all.GoDeps = all.GoDeps[:len(all.GoDeps)-1]
			return true
		}
	}
	return false
}

// enforces Hash is unique
func (all *GoDeps) ReplaceHash(newP *GoDep) bool { // todo: make unique name here
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GoDeps {
		if p.Hash == newP.Hash {
			return false
		}
	}

	all.GoDeps = append(all.GoDeps, newP)
	return true
}

// find a dependancy by the go path
func (all *GoDeps) FindByHash(s string) *GoDep {
	if all == nil {
		return nil
	}

	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GoDeps {
		if all.GoDeps[i].Hash == s {
			return all.GoDeps[i]
		}
	}
	return nil
}

func (all *GoDeps) SortByGoPath() *GoDepIterator {
	packs := all.selectAllGoDep()

	sort.Sort(GoDepGoPath(packs))

	iterator := NewGoDepIterator(packs)
	return iterator
}

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] }

// enforces GoPath is unique
func (all *GoDeps) AppendUniqueGoPath(newP *GoDep) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GoDeps {
		if p.GoPath == newP.GoPath {
			return false
		}
	}

	all.GoDeps = append(all.GoDeps, newP)
	return true
}

func (all *GoDeps) DeleteByGoPath(s string) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GoDeps {
		if all.GoDeps[i].GoPath == s {
			all.GoDeps[i] = all.GoDeps[len(all.GoDeps)-1]
			all.GoDeps = all.GoDeps[:len(all.GoDeps)-1]
			return true
		}
	}
	return false
}

// enforces GoPath is unique
func (all *GoDeps) ReplaceGoPath(newP *GoDep) bool { // todo: make unique name here
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.GoDeps {
		if p.GoPath == newP.GoPath {
			return false
		}
	}

	all.GoDeps = append(all.GoDeps, newP)
	return true
}

// find a dependancy by the go path
func (all *GoDeps) FindByGoPath(s string) *GoDep {
	if all == nil {
		return nil
	}

	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.GoDeps {
		if all.GoDeps[i].GoPath == s {
			return all.GoDeps[i]
		}
	}
	return nil
}

// safely returns a slice of pointers to the GoDep protobufs
func (all *GoDeps) selectAllGoDep() []*GoDep {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	// Create a new slice to hold pointers to each GoDep
	var aStuff []*GoDep
	aStuff = make([]*GoDep, len(all.GoDeps))
	for i, p := range all.GoDeps {
		aStuff[i] = p // Copy pointers for safe iteration
	}

	return aStuff
}

// `autogen:repo.marshal.pb.go`

package gitpb

// This file was autogenerated with autogenpb v0.0.30-1-g84c25d7 DO NOT EDIT
//     go install go.wit.com/apps/autogenpb@latest
//
// You can use it on simple protobuf files
// The .proto file must have a singular and plural form of a message
// (for those of you that know ruby on rails, it's like that)
//
// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for
//
// For an example,
//       go-clone go.wit.com/lib/protobuf/gitpb
//

import (
	"google.golang.org/protobuf/encoding/protojson"
	"google.golang.org/protobuf/encoding/prototext"
	"google.golang.org/protobuf/proto"
)

// 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 so great for config files, I'm using it by default to try to fix the problems with it
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)
}

// 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 so great for config files, I'm using it by default to try to fix the problems with it
func (v *Repos) FormatTEXT() string {
	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) {
	return proto.Marshal(v)
}

// unmarshal from wire. You have won.
func (v *Repos) Unmarshal(data []byte) error {
	return proto.Unmarshal(data, v)
}

// `autogen:repo.pb.go`

// 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

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
)

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 Repo struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	FullPath             string    `protobuf:"bytes,1,opt,name=fullPath,proto3" json:"fullPath,omitempty"`                          // `autogenpb:unique` 	// 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"`                   // reason for state change
	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"`                   //
}

func (x *Repo) Reset() {
	*x = Repo{}
	mi := &file_repo_proto_msgTypes[0]
	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[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 Repo.ProtoReflect.Descriptor instead.
func (*Repo) Descriptor() ([]byte, []int) {
	return file_repo_proto_rawDescGZIP(), []int{0}
}

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 ""
}

type Repos 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"`       // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
	Version string  `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // maybe can be used for protobuf schema change violations
	Repos   []*Repo `protobuf:"bytes,3,rep,name=repos,proto3" json:"repos,omitempty"`
}

func (x *Repos) Reset() {
	*x = Repos{}
	mi := &file_repo_proto_msgTypes[1]
	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[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 Repos.ProtoReflect.Descriptor instead.
func (*Repos) Descriptor() ([]byte, []int) {
	return file_repo_proto_rawDescGZIP(), []int{1}
}

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
}

// should it be done this way?
type GitTimes struct {
	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
}

func (x *GitTimes) Reset() {
	*x = GitTimes{}
	mi := &file_repo_proto_msgTypes[2]
	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[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 GitTimes.ProtoReflect.Descriptor instead.
func (*GitTimes) Descriptor() ([]byte, []int) {
	return file_repo_proto_rawDescGZIP(), []int{2}
}

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
}

// this is probably better. think about moving to this instead
type GoInfo struct {
	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[3]
	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[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 GoInfo.ProtoReflect.Descriptor instead.
func (*GoInfo) Descriptor() ([]byte, []int) {
	return file_repo_proto_rawDescGZIP(), []int{3}
}

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
}

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,
	0xc1, 0x05, 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, 0x22, 0x58, 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, 0x22, 0xdc, 0x03,
	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, 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, 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{
	(*Repo)(nil),                  // 0: gitpb.Repo
	(*Repos)(nil),                 // 1: gitpb.Repos
	(*GitTimes)(nil),              // 2: gitpb.GitTimes
	(*GoInfo)(nil),                // 3: gitpb.GoInfo
	(*GitTags)(nil),               // 4: gitpb.GitTags
	(*GoDeps)(nil),                // 5: gitpb.GoDeps
	(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp
}
var file_repo_proto_depIdxs = []int32{
	4,  // 0: gitpb.Repo.tags:type_name -> gitpb.GitTags
	2,  // 1: gitpb.Repo.times:type_name -> gitpb.GitTimes
	3,  // 2: gitpb.Repo.goInfo:type_name -> gitpb.GoInfo
	5,  // 3: gitpb.Repo.goDeps:type_name -> gitpb.GoDeps
	0,  // 4: gitpb.Repos.repos:type_name -> gitpb.Repo
	6,  // 5: gitpb.GitTimes.lastPull:type_name -> google.protobuf.Timestamp
	6,  // 6: gitpb.GitTimes.lastUpdate:type_name -> google.protobuf.Timestamp
	6,  // 7: gitpb.GitTimes.lastDirty:type_name -> google.protobuf.Timestamp
	6,  // 8: gitpb.GitTimes.mtimeDir:type_name -> google.protobuf.Timestamp
	6,  // 9: gitpb.GitTimes.mtimeHead:type_name -> google.protobuf.Timestamp
	6,  // 10: gitpb.GitTimes.mtimeIndex:type_name -> google.protobuf.Timestamp
	6,  // 11: gitpb.GitTimes.mtimeFetch:type_name -> google.protobuf.Timestamp
	6,  // 12: gitpb.GitTimes.lastGoDep:type_name -> google.protobuf.Timestamp
	5,  // 13: gitpb.GoInfo.goDeps:type_name -> gitpb.GoDeps
	5,  // 14: gitpb.GoInfo.published:type_name -> gitpb.GoDeps
	15, // [15:15] is the sub-list for method output_type
	15, // [15:15] is the sub-list for method input_type
	15, // [15:15] is the sub-list for extension type_name
	15, // [15:15] is the sub-list for extension extendee
	0,  // [0:15] 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`

package gitpb

// This file was autogenerated with autogenpb v0.0.30-1-g84c25d7 DO NOT EDIT
//     go install go.wit.com/apps/autogenpb@latest
//
// You can use it on simple protobuf files
// The .proto file must have a singular and plural form of a message
// (for those of you that know ruby on rails, it's like that)
//
// You can mark which repos you want to auto generate sort.pb.go and marshal.pb.go files for
//
// For an example,
//       go-clone go.wit.com/lib/protobuf/gitpb
//

import (
	"fmt"
	"sort"
	"sync"
)

type RepoIterator struct {
	sync.RWMutex

	packs []*Repo
	index int
}

// NewRepoIterator initializes a new iterator.
func NewRepoIterator(packs []*Repo) *RepoIterator {
	return &RepoIterator{packs: packs}
}

// Scan moves to the next element and returns false if there are no more packs.
// Use Scan() in a loop, similar to a while loop
//
//	for iterator.Scan()
//		d := iterator.Next(
//		fmt.Println("found UUID:", d.Uuid
//	}
func (it *RepoIterator) Scan() bool {
	if it.index >= len(it.packs) {
		return false
	}
	it.index++
	return true
}

// Next() returns the next thing in the array
func (it *RepoIterator) Next() *Repo {
	if it.packs[it.index-1] == nil {
		for i, d := range it.packs {
			fmt.Println("i =", i, d)
		}
		// fmt.Println("protobuf autogenpb sort error len =", len(it.packs))
		// fmt.Println("protobuf autogenpb sort error next == nil", it.index, it.index-1)
	}
	return it.packs[it.index-1]
}

// does not enforce any unique fields
func (all *Repos) Append(newP *Repo) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	all.Repos = append(all.Repos, newP)
	return true
}

func (all *Repos) All() *RepoIterator {
	repoPointers := all.selectAllRepo()

	iterator := NewRepoIterator(repoPointers)
	return iterator
}

func (all *Repos) Len() int {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	return len(all.Repos)
}

func (all *Repos) SortByFullPath() *RepoIterator {
	packs := all.selectAllRepo()

	sort.Sort(RepoFullPath(packs))

	iterator := NewRepoIterator(packs)
	return iterator
}

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] }

// enforces FullPath is unique
func (all *Repos) AppendUniqueFullPath(newP *Repo) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.Repos {
		if p.FullPath == newP.FullPath {
			return false
		}
	}

	all.Repos = append(all.Repos, newP)
	return true
}

func (all *Repos) DeleteByFullPath(s string) bool {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.Repos {
		if all.Repos[i].FullPath == s {
			all.Repos[i] = all.Repos[len(all.Repos)-1]
			all.Repos = all.Repos[:len(all.Repos)-1]
			return true
		}
	}
	return false
}

// enforces FullPath is unique
func (all *Repos) ReplaceFullPath(newP *Repo) bool { // todo: make unique name here
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for _, p := range all.Repos {
		if p.FullPath == newP.FullPath {
			return false
		}
	}

	all.Repos = append(all.Repos, newP)
	return true
}

// find a dependancy by the go path
func (all *Repos) FindByFullPath(s string) *Repo {
	if all == nil {
		return nil
	}

	all.Lock.RLock()
	defer all.Lock.RUnlock()

	for i, _ := range all.Repos {
		if all.Repos[i].FullPath == s {
			return all.Repos[i]
		}
	}
	return nil
}

// safely returns a slice of pointers to the Repo protobufs
func (all *Repos) selectAllRepo() []*Repo {
	all.Lock.RLock()
	defer all.Lock.RUnlock()

	// Create a new slice to hold pointers to each Repo
	var aStuff []*Repo
	aStuff = make([]*Repo, len(all.Repos))
	for i, p := range all.Repos {
		aStuff[i] = p // Copy pointers for safe iteration
	}

	return aStuff
}

// `autogen:`
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ func (repo *Repo) GetRepoType() string {
return "library"
}
// todo: figure out what to do here. for now, binary is easiest
return "binary"
return "library"
}
func (repo *Repo) setRepoType() {