feat(storage): add repo and schema protobuf messages with buf config
- commit
- c5c8a63a247e0eb175144fe50129a3720a0eb617
- author
- brice · · 2026-10-10 06:11 UTC
- parent
- c97ed57
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
5 files · +332 -1
A buf.gen.yaml +6 -0
| @@ -0,0 +1,6 @@ | |||
| 1 | + | version: v2 | |
| 2 | + | clean: true | |
| 3 | + | plugins: | |
| 4 | + | - local: [go, tool, protoc-gen-go] | |
| 5 | + | out: gen | |
| 6 | + | opt: paths=source_relative | |
| @@ -0,0 +1,6 @@ | |||||
| 1 | + | version: v2 | |||
| 2 | + | clean: true | |||
| 3 | + | plugins: | |||
| 4 | + | - local: [go, tool, protoc-gen-go] | |||
| 5 | + | out: gen | |||
| 6 | + | opt: paths=source_relative | |||
A buf.yaml +12 -0
| @@ -0,0 +1,12 @@ | |||
| 1 | + | version: v2 | |
| 2 | + | modules: | |
| 3 | + | - path: proto | |
| 4 | + | lint: | |
| 5 | + | use: | |
| 6 | + | - STANDARD | |
| 7 | + | except: | |
| 8 | + | # The storage schema is internal and unversioned (package ermite.storage). | |
| 9 | + | - PACKAGE_VERSION_SUFFIX | |
| 10 | + | breaking: | |
| 11 | + | use: | |
| 12 | + | - FILE | |
| @@ -0,0 +1,12 @@ | |||||
| 1 | + | version: v2 | |||
| 2 | + | modules: | |||
| 3 | + | - path: proto | |||
| 4 | + | lint: | |||
| 5 | + | use: | |||
| 6 | + | - STANDARD | |||
| 7 | + | except: | |||
| 8 | + | # The storage schema is internal and unversioned (package ermite.storage). | |||
| 9 | + | - PACKAGE_VERSION_SUFFIX | |||
| 10 | + | breaking: | |||
| 11 | + | use: | |||
| 12 | + | - FILE | |||
A gen/ermite/storage/repo.pb.go +279 -0
| @@ -0,0 +1,279 @@ | |||
| 1 | + | // SPDX-License-Identifier: AGPL-3.0-or-later | |
| 2 | + | ||
| 3 | + | // Internal, unversioned storage schema of ermite: the values kept in ermite-kv. | |
| 4 | + | ||
| 5 | + | // Code generated by protoc-gen-go. DO NOT EDIT. | |
| 6 | + | // versions: | |
| 7 | + | // protoc-gen-go v1.36.12 | |
| 8 | + | // protoc (unknown) | |
| 9 | + | // source: ermite/storage/repo.proto | |
| 10 | + | ||
| 11 | + | package storagepb | |
| 12 | + | ||
| 13 | + | import ( | |
| 14 | + | protoreflect "google.golang.org/protobuf/reflect/protoreflect" | |
| 15 | + | protoimpl "google.golang.org/protobuf/runtime/protoimpl" | |
| 16 | + | timestamppb "google.golang.org/protobuf/types/known/timestamppb" | |
| 17 | + | reflect "reflect" | |
| 18 | + | sync "sync" | |
| 19 | + | unsafe "unsafe" | |
| 20 | + | ) | |
| 21 | + | ||
| 22 | + | const ( | |
| 23 | + | // Verify that this generated code is sufficiently up-to-date. | |
| 24 | + | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) | |
| 25 | + | // Verify that runtime/protoimpl is sufficiently up-to-date. | |
| 26 | + | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) | |
| 27 | + | ) | |
| 28 | + | ||
| 29 | + | // Visibility is the access level of a repository. | |
| 30 | + | type Visibility int32 | |
| 31 | + | ||
| 32 | + | const ( | |
| 33 | + | // Unset. Readers treat it as private. | |
| 34 | + | Visibility_VISIBILITY_UNSPECIFIED Visibility = 0 | |
| 35 | + | Visibility_VISIBILITY_PRIVATE Visibility = 1 | |
| 36 | + | Visibility_VISIBILITY_PUBLIC Visibility = 2 | |
| 37 | + | ) | |
| 38 | + | ||
| 39 | + | // Enum value maps for Visibility. | |
| 40 | + | var ( | |
| 41 | + | Visibility_name = map[int32]string{ | |
| 42 | + | 0: "VISIBILITY_UNSPECIFIED", | |
| 43 | + | 1: "VISIBILITY_PRIVATE", | |
| 44 | + | 2: "VISIBILITY_PUBLIC", | |
| 45 | + | } | |
| 46 | + | Visibility_value = map[string]int32{ | |
| 47 | + | "VISIBILITY_UNSPECIFIED": 0, | |
| 48 | + | "VISIBILITY_PRIVATE": 1, | |
| 49 | + | "VISIBILITY_PUBLIC": 2, | |
| 50 | + | } | |
| 51 | + | ) | |
| 52 | + | ||
| 53 | + | func (x Visibility) Enum() *Visibility { | |
| 54 | + | p := new(Visibility) | |
| 55 | + | *p = x | |
| 56 | + | return p | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | func (x Visibility) String() string { | |
| 60 | + | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | func (Visibility) Descriptor() protoreflect.EnumDescriptor { | |
| 64 | + | return file_ermite_storage_repo_proto_enumTypes[0].Descriptor() | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | func (Visibility) Type() protoreflect.EnumType { | |
| 68 | + | return &file_ermite_storage_repo_proto_enumTypes[0] | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | func (x Visibility) Number() protoreflect.EnumNumber { | |
| 72 | + | return protoreflect.EnumNumber(x) | |
| 73 | + | } | |
| 74 | + | ||
| 75 | + | // Deprecated: Use Visibility.Descriptor instead. | |
| 76 | + | func (Visibility) EnumDescriptor() ([]byte, []int) { | |
| 77 | + | return file_ermite_storage_repo_proto_rawDescGZIP(), []int{0} | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // Repo is stored under the key "repo/<name>". | |
| 81 | + | type Repo struct { | |
| 82 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 83 | + | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` | |
| 84 | + | Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` | |
| 85 | + | Visibility Visibility `protobuf:"varint,3,opt,name=visibility,proto3,enum=ermite.storage.Visibility" json:"visibility,omitempty"` | |
| 86 | + | CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` | |
| 87 | + | // Unset until the first push. | |
| 88 | + | PushedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=pushed_at,json=pushedAt,proto3" json:"pushed_at,omitempty"` | |
| 89 | + | unknownFields protoimpl.UnknownFields | |
| 90 | + | sizeCache protoimpl.SizeCache | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | func (x *Repo) Reset() { | |
| 94 | + | *x = Repo{} | |
| 95 | + | mi := &file_ermite_storage_repo_proto_msgTypes[0] | |
| 96 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 97 | + | ms.StoreMessageInfo(mi) | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | func (x *Repo) String() string { | |
| 101 | + | return protoimpl.X.MessageStringOf(x) | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | func (*Repo) ProtoMessage() {} | |
| 105 | + | ||
| 106 | + | func (x *Repo) ProtoReflect() protoreflect.Message { | |
| 107 | + | mi := &file_ermite_storage_repo_proto_msgTypes[0] | |
| 108 | + | if x != nil { | |
| 109 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 110 | + | if ms.LoadMessageInfo() == nil { | |
| 111 | + | ms.StoreMessageInfo(mi) | |
| 112 | + | } | |
| 113 | + | return ms | |
| 114 | + | } | |
| 115 | + | return mi.MessageOf(x) | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | // Deprecated: Use Repo.ProtoReflect.Descriptor instead. | |
| 119 | + | func (*Repo) Descriptor() ([]byte, []int) { | |
| 120 | + | return file_ermite_storage_repo_proto_rawDescGZIP(), []int{0} | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | func (x *Repo) GetName() string { | |
| 124 | + | if x != nil { | |
| 125 | + | return x.Name | |
| 126 | + | } | |
| 127 | + | return "" | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | func (x *Repo) GetDescription() string { | |
| 131 | + | if x != nil { | |
| 132 | + | return x.Description | |
| 133 | + | } | |
| 134 | + | return "" | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | func (x *Repo) GetVisibility() Visibility { | |
| 138 | + | if x != nil { | |
| 139 | + | return x.Visibility | |
| 140 | + | } | |
| 141 | + | return Visibility_VISIBILITY_UNSPECIFIED | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | func (x *Repo) GetCreatedAt() *timestamppb.Timestamp { | |
| 145 | + | if x != nil { | |
| 146 | + | return x.CreatedAt | |
| 147 | + | } | |
| 148 | + | return nil | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | func (x *Repo) GetPushedAt() *timestamppb.Timestamp { | |
| 152 | + | if x != nil { | |
| 153 | + | return x.PushedAt | |
| 154 | + | } | |
| 155 | + | return nil | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | // SchemaVersion is stored under the key "meta/schema". | |
| 159 | + | type SchemaVersion struct { | |
| 160 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 161 | + | Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` | |
| 162 | + | unknownFields protoimpl.UnknownFields | |
| 163 | + | sizeCache protoimpl.SizeCache | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | func (x *SchemaVersion) Reset() { | |
| 167 | + | *x = SchemaVersion{} | |
| 168 | + | mi := &file_ermite_storage_repo_proto_msgTypes[1] | |
| 169 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 170 | + | ms.StoreMessageInfo(mi) | |
| 171 | + | } | |
| 172 | + | ||
| 173 | + | func (x *SchemaVersion) String() string { | |
| 174 | + | return protoimpl.X.MessageStringOf(x) | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | func (*SchemaVersion) ProtoMessage() {} | |
| 178 | + | ||
| 179 | + | func (x *SchemaVersion) ProtoReflect() protoreflect.Message { | |
| 180 | + | mi := &file_ermite_storage_repo_proto_msgTypes[1] | |
| 181 | + | if x != nil { | |
| 182 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 183 | + | if ms.LoadMessageInfo() == nil { | |
| 184 | + | ms.StoreMessageInfo(mi) | |
| 185 | + | } | |
| 186 | + | return ms | |
| 187 | + | } | |
| 188 | + | return mi.MessageOf(x) | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // Deprecated: Use SchemaVersion.ProtoReflect.Descriptor instead. | |
| 192 | + | func (*SchemaVersion) Descriptor() ([]byte, []int) { | |
| 193 | + | return file_ermite_storage_repo_proto_rawDescGZIP(), []int{1} | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | func (x *SchemaVersion) GetVersion() uint32 { | |
| 197 | + | if x != nil { | |
| 198 | + | return x.Version | |
| 199 | + | } | |
| 200 | + | return 0 | |
| 201 | + | } | |
| 202 | + | ||
| 203 | + | var File_ermite_storage_repo_proto protoreflect.FileDescriptor | |
| 204 | + | ||
| 205 | + | const file_ermite_storage_repo_proto_rawDesc = "" + | |
| 206 | + | "\n" + | |
| 207 | + | "\x19ermite/storage/repo.proto\x12\x0eermite.storage\x1a\x1fgoogle/protobuf/timestamp.proto\"\xec\x01\n" + | |
| 208 | + | "\x04Repo\x12\x12\n" + | |
| 209 | + | "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + | |
| 210 | + | "\vdescription\x18\x02 \x01(\tR\vdescription\x12:\n" + | |
| 211 | + | "\n" + | |
| 212 | + | "visibility\x18\x03 \x01(\x0e2\x1a.ermite.storage.VisibilityR\n" + | |
| 213 | + | "visibility\x129\n" + | |
| 214 | + | "\n" + | |
| 215 | + | "created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x127\n" + | |
| 216 | + | "\tpushed_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\bpushedAt\")\n" + | |
| 217 | + | "\rSchemaVersion\x12\x18\n" + | |
| 218 | + | "\aversion\x18\x01 \x01(\rR\aversion*W\n" + | |
| 219 | + | "\n" + | |
| 220 | + | "Visibility\x12\x1a\n" + | |
| 221 | + | "\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x16\n" + | |
| 222 | + | "\x12VISIBILITY_PRIVATE\x10\x01\x12\x15\n" + | |
| 223 | + | "\x11VISIBILITY_PUBLIC\x10\x02B/Z-bnema.dev/ermite/gen/ermite/storage;storagepbb\x06proto3" | |
| 224 | + | ||
| 225 | + | var ( | |
| 226 | + | file_ermite_storage_repo_proto_rawDescOnce sync.Once | |
| 227 | + | file_ermite_storage_repo_proto_rawDescData []byte | |
| 228 | + | ) | |
| 229 | + | ||
| 230 | + | func file_ermite_storage_repo_proto_rawDescGZIP() []byte { | |
| 231 | + | file_ermite_storage_repo_proto_rawDescOnce.Do(func() { | |
| 232 | + | file_ermite_storage_repo_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ermite_storage_repo_proto_rawDesc), len(file_ermite_storage_repo_proto_rawDesc))) | |
| 233 | + | }) | |
| 234 | + | return file_ermite_storage_repo_proto_rawDescData | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | var file_ermite_storage_repo_proto_enumTypes = make([]protoimpl.EnumInfo, 1) | |
| 238 | + | var file_ermite_storage_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 2) | |
| 239 | + | var file_ermite_storage_repo_proto_goTypes = []any{ | |
| 240 | + | (Visibility)(0), // 0: ermite.storage.Visibility | |
| 241 | + | (*Repo)(nil), // 1: ermite.storage.Repo | |
| 242 | + | (*SchemaVersion)(nil), // 2: ermite.storage.SchemaVersion | |
| 243 | + | (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp | |
| 244 | + | } | |
| 245 | + | var file_ermite_storage_repo_proto_depIdxs = []int32{ | |
| 246 | + | 0, // 0: ermite.storage.Repo.visibility:type_name -> ermite.storage.Visibility | |
| 247 | + | 3, // 1: ermite.storage.Repo.created_at:type_name -> google.protobuf.Timestamp | |
| 248 | + | 3, // 2: ermite.storage.Repo.pushed_at:type_name -> google.protobuf.Timestamp | |
| 249 | + | 3, // [3:3] is the sub-list for method output_type | |
| 250 | + | 3, // [3:3] is the sub-list for method input_type | |
| 251 | + | 3, // [3:3] is the sub-list for extension type_name | |
| 252 | + | 3, // [3:3] is the sub-list for extension extendee | |
| 253 | + | 0, // [0:3] is the sub-list for field type_name | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | func init() { file_ermite_storage_repo_proto_init() } | |
| 257 | + | func file_ermite_storage_repo_proto_init() { | |
| 258 | + | if File_ermite_storage_repo_proto != nil { | |
| 259 | + | return | |
| 260 | + | } | |
| 261 | + | type x struct{} | |
| 262 | + | out := protoimpl.TypeBuilder{ | |
| 263 | + | File: protoimpl.DescBuilder{ | |
| 264 | + | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), | |
| 265 | + | RawDescriptor: unsafe.Slice(unsafe.StringData(file_ermite_storage_repo_proto_rawDesc), len(file_ermite_storage_repo_proto_rawDesc)), | |
| 266 | + | NumEnums: 1, | |
| 267 | + | NumMessages: 2, | |
| 268 | + | NumExtensions: 0, | |
| 269 | + | NumServices: 0, | |
| 270 | + | }, | |
| 271 | + | GoTypes: file_ermite_storage_repo_proto_goTypes, | |
| 272 | + | DependencyIndexes: file_ermite_storage_repo_proto_depIdxs, | |
| 273 | + | EnumInfos: file_ermite_storage_repo_proto_enumTypes, | |
| 274 | + | MessageInfos: file_ermite_storage_repo_proto_msgTypes, | |
| 275 | + | }.Build() | |
| 276 | + | File_ermite_storage_repo_proto = out.File | |
| 277 | + | file_ermite_storage_repo_proto_goTypes = nil | |
| 278 | + | file_ermite_storage_repo_proto_depIdxs = nil | |
| 279 | + | } | |
| @@ -0,0 +1,279 @@ | |||||
| 1 | + | // SPDX-License-Identifier: AGPL-3.0-or-later | |||
| 2 | + | ||||
| 3 | + | // Internal, unversioned storage schema of ermite: the values kept in ermite-kv. | |||
| 4 | + | ||||
| 5 | + | // Code generated by protoc-gen-go. DO NOT EDIT. | |||
| 6 | + | // versions: | |||
| 7 | + | // protoc-gen-go v1.36.12 | |||
| 8 | + | // protoc (unknown) | |||
| 9 | + | // source: ermite/storage/repo.proto | |||
| 10 | + | ||||
| 11 | + | package storagepb | |||
| 12 | + | ||||
| 13 | + | import ( | |||
| 14 | + | protoreflect "google.golang.org/protobuf/reflect/protoreflect" | |||
| 15 | + | protoimpl "google.golang.org/protobuf/runtime/protoimpl" | |||
| 16 | + | timestamppb "google.golang.org/protobuf/types/known/timestamppb" | |||
| 17 | + | reflect "reflect" | |||
| 18 | + | sync "sync" | |||
| 19 | + | unsafe "unsafe" | |||
| 20 | + | ) | |||
| 21 | + | ||||
| 22 | + | const ( | |||
| 23 | + | // Verify that this generated code is sufficiently up-to-date. | |||
| 24 | + | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) | |||
| 25 | + | // Verify that runtime/protoimpl is sufficiently up-to-date. | |||
| 26 | + | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) | |||
| 27 | + | ) | |||
| 28 | + | ||||
| 29 | + | // Visibility is the access level of a repository. | |||
| 30 | + | type Visibility int32 | |||
| 31 | + | ||||
| 32 | + | const ( | |||
| 33 | + | // Unset. Readers treat it as private. | |||
| 34 | + | Visibility_VISIBILITY_UNSPECIFIED Visibility = 0 | |||
| 35 | + | Visibility_VISIBILITY_PRIVATE Visibility = 1 | |||
| 36 | + | Visibility_VISIBILITY_PUBLIC Visibility = 2 | |||
| 37 | + | ) | |||
| 38 | + | ||||
| 39 | + | // Enum value maps for Visibility. | |||
| 40 | + | var ( | |||
| 41 | + | Visibility_name = map[int32]string{ | |||
| 42 | + | 0: "VISIBILITY_UNSPECIFIED", | |||
| 43 | + | 1: "VISIBILITY_PRIVATE", | |||
| 44 | + | 2: "VISIBILITY_PUBLIC", | |||
| 45 | + | } | |||
| 46 | + | Visibility_value = map[string]int32{ | |||
| 47 | + | "VISIBILITY_UNSPECIFIED": 0, | |||
| 48 | + | "VISIBILITY_PRIVATE": 1, | |||
| 49 | + | "VISIBILITY_PUBLIC": 2, | |||
| 50 | + | } | |||
| 51 | + | ) | |||
| 52 | + | ||||
| 53 | + | func (x Visibility) Enum() *Visibility { | |||
| 54 | + | p := new(Visibility) | |||
| 55 | + | *p = x | |||
| 56 | + | return p | |||
| 57 | + | } | |||
| 58 | + | ||||
| 59 | + | func (x Visibility) String() string { | |||
| 60 | + | return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) | |||
| 61 | + | } | |||
| 62 | + | ||||
| 63 | + | func (Visibility) Descriptor() protoreflect.EnumDescriptor { | |||
| 64 | + | return file_ermite_storage_repo_proto_enumTypes[0].Descriptor() | |||
| 65 | + | } | |||
| 66 | + | ||||
| 67 | + | func (Visibility) Type() protoreflect.EnumType { | |||
| 68 | + | return &file_ermite_storage_repo_proto_enumTypes[0] | |||
| 69 | + | } | |||
| 70 | + | ||||
| 71 | + | func (x Visibility) Number() protoreflect.EnumNumber { | |||
| 72 | + | return protoreflect.EnumNumber(x) | |||
| 73 | + | } | |||
| 74 | + | ||||
| 75 | + | // Deprecated: Use Visibility.Descriptor instead. | |||
| 76 | + | func (Visibility) EnumDescriptor() ([]byte, []int) { | |||
| 77 | + | return file_ermite_storage_repo_proto_rawDescGZIP(), []int{0} | |||
| 78 | + | } | |||
| 79 | + | ||||
| 80 | + | // Repo is stored under the key "repo/<name>". | |||
| 81 | + | type Repo struct { | |||
| 82 | + | state protoimpl.MessageState `protogen:"open.v1"` | |||
| 83 | + | Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` | |||
| 84 | + | Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` | |||
| 85 | + | Visibility Visibility `protobuf:"varint,3,opt,name=visibility,proto3,enum=ermite.storage.Visibility" json:"visibility,omitempty"` | |||
| 86 | + | CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` | |||
| 87 | + | // Unset until the first push. | |||
| 88 | + | PushedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=pushed_at,json=pushedAt,proto3" json:"pushed_at,omitempty"` | |||
| 89 | + | unknownFields protoimpl.UnknownFields | |||
| 90 | + | sizeCache protoimpl.SizeCache | |||
| 91 | + | } | |||
| 92 | + | ||||
| 93 | + | func (x *Repo) Reset() { | |||
| 94 | + | *x = Repo{} | |||
| 95 | + | mi := &file_ermite_storage_repo_proto_msgTypes[0] | |||
| 96 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |||
| 97 | + | ms.StoreMessageInfo(mi) | |||
| 98 | + | } | |||
| 99 | + | ||||
| 100 | + | func (x *Repo) String() string { | |||
| 101 | + | return protoimpl.X.MessageStringOf(x) | |||
| 102 | + | } | |||
| 103 | + | ||||
| 104 | + | func (*Repo) ProtoMessage() {} | |||
| 105 | + | ||||
| 106 | + | func (x *Repo) ProtoReflect() protoreflect.Message { | |||
| 107 | + | mi := &file_ermite_storage_repo_proto_msgTypes[0] | |||
| 108 | + | if x != nil { | |||
| 109 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |||
| 110 | + | if ms.LoadMessageInfo() == nil { | |||
| 111 | + | ms.StoreMessageInfo(mi) | |||
| 112 | + | } | |||
| 113 | + | return ms | |||
| 114 | + | } | |||
| 115 | + | return mi.MessageOf(x) | |||
| 116 | + | } | |||
| 117 | + | ||||
| 118 | + | // Deprecated: Use Repo.ProtoReflect.Descriptor instead. | |||
| 119 | + | func (*Repo) Descriptor() ([]byte, []int) { | |||
| 120 | + | return file_ermite_storage_repo_proto_rawDescGZIP(), []int{0} | |||
| 121 | + | } | |||
| 122 | + | ||||
| 123 | + | func (x *Repo) GetName() string { | |||
| 124 | + | if x != nil { | |||
| 125 | + | return x.Name | |||
| 126 | + | } | |||
| 127 | + | return "" | |||
| 128 | + | } | |||
| 129 | + | ||||
| 130 | + | func (x *Repo) GetDescription() string { | |||
| 131 | + | if x != nil { | |||
| 132 | + | return x.Description | |||
| 133 | + | } | |||
| 134 | + | return "" | |||
| 135 | + | } | |||
| 136 | + | ||||
| 137 | + | func (x *Repo) GetVisibility() Visibility { | |||
| 138 | + | if x != nil { | |||
| 139 | + | return x.Visibility | |||
| 140 | + | } | |||
| 141 | + | return Visibility_VISIBILITY_UNSPECIFIED | |||
| 142 | + | } | |||
| 143 | + | ||||
| 144 | + | func (x *Repo) GetCreatedAt() *timestamppb.Timestamp { | |||
| 145 | + | if x != nil { | |||
| 146 | + | return x.CreatedAt | |||
| 147 | + | } | |||
| 148 | + | return nil | |||
| 149 | + | } | |||
| 150 | + | ||||
| 151 | + | func (x *Repo) GetPushedAt() *timestamppb.Timestamp { | |||
| 152 | + | if x != nil { | |||
| 153 | + | return x.PushedAt | |||
| 154 | + | } | |||
| 155 | + | return nil | |||
| 156 | + | } | |||
| 157 | + | ||||
| 158 | + | // SchemaVersion is stored under the key "meta/schema". | |||
| 159 | + | type SchemaVersion struct { | |||
| 160 | + | state protoimpl.MessageState `protogen:"open.v1"` | |||
| 161 | + | Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` | |||
| 162 | + | unknownFields protoimpl.UnknownFields | |||
| 163 | + | sizeCache protoimpl.SizeCache | |||
| 164 | + | } | |||
| 165 | + | ||||
| 166 | + | func (x *SchemaVersion) Reset() { | |||
| 167 | + | *x = SchemaVersion{} | |||
| 168 | + | mi := &file_ermite_storage_repo_proto_msgTypes[1] | |||
| 169 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |||
| 170 | + | ms.StoreMessageInfo(mi) | |||
| 171 | + | } | |||
| 172 | + | ||||
| 173 | + | func (x *SchemaVersion) String() string { | |||
| 174 | + | return protoimpl.X.MessageStringOf(x) | |||
| 175 | + | } | |||
| 176 | + | ||||
| 177 | + | func (*SchemaVersion) ProtoMessage() {} | |||
| 178 | + | ||||
| 179 | + | func (x *SchemaVersion) ProtoReflect() protoreflect.Message { | |||
| 180 | + | mi := &file_ermite_storage_repo_proto_msgTypes[1] | |||
| 181 | + | if x != nil { | |||
| 182 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |||
| 183 | + | if ms.LoadMessageInfo() == nil { | |||
| 184 | + | ms.StoreMessageInfo(mi) | |||
| 185 | + | } | |||
| 186 | + | return ms | |||
| 187 | + | } | |||
| 188 | + | return mi.MessageOf(x) | |||
| 189 | + | } | |||
| 190 | + | ||||
| 191 | + | // Deprecated: Use SchemaVersion.ProtoReflect.Descriptor instead. | |||
| 192 | + | func (*SchemaVersion) Descriptor() ([]byte, []int) { | |||
| 193 | + | return file_ermite_storage_repo_proto_rawDescGZIP(), []int{1} | |||
| 194 | + | } | |||
| 195 | + | ||||
| 196 | + | func (x *SchemaVersion) GetVersion() uint32 { | |||
| 197 | + | if x != nil { | |||
| 198 | + | return x.Version | |||
| 199 | + | } | |||
| 200 | + | return 0 | |||
| 201 | + | } | |||
| 202 | + | ||||
| 203 | + | var File_ermite_storage_repo_proto protoreflect.FileDescriptor | |||
| 204 | + | ||||
| 205 | + | const file_ermite_storage_repo_proto_rawDesc = "" + | |||
| 206 | + | "\n" + | |||
| 207 | + | "\x19ermite/storage/repo.proto\x12\x0eermite.storage\x1a\x1fgoogle/protobuf/timestamp.proto\"\xec\x01\n" + | |||
| 208 | + | "\x04Repo\x12\x12\n" + | |||
| 209 | + | "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + | |||
| 210 | + | "\vdescription\x18\x02 \x01(\tR\vdescription\x12:\n" + | |||
| 211 | + | "\n" + | |||
| 212 | + | "visibility\x18\x03 \x01(\x0e2\x1a.ermite.storage.VisibilityR\n" + | |||
| 213 | + | "visibility\x129\n" + | |||
| 214 | + | "\n" + | |||
| 215 | + | "created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x127\n" + | |||
| 216 | + | "\tpushed_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\bpushedAt\")\n" + | |||
| 217 | + | "\rSchemaVersion\x12\x18\n" + | |||
| 218 | + | "\aversion\x18\x01 \x01(\rR\aversion*W\n" + | |||
| 219 | + | "\n" + | |||
| 220 | + | "Visibility\x12\x1a\n" + | |||
| 221 | + | "\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x16\n" + | |||
| 222 | + | "\x12VISIBILITY_PRIVATE\x10\x01\x12\x15\n" + | |||
| 223 | + | "\x11VISIBILITY_PUBLIC\x10\x02B/Z-bnema.dev/ermite/gen/ermite/storage;storagepbb\x06proto3" | |||
| 224 | + | ||||
| 225 | + | var ( | |||
| 226 | + | file_ermite_storage_repo_proto_rawDescOnce sync.Once | |||
| 227 | + | file_ermite_storage_repo_proto_rawDescData []byte | |||
| 228 | + | ) | |||
| 229 | + | ||||
| 230 | + | func file_ermite_storage_repo_proto_rawDescGZIP() []byte { | |||
| 231 | + | file_ermite_storage_repo_proto_rawDescOnce.Do(func() { | |||
| 232 | + | file_ermite_storage_repo_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ermite_storage_repo_proto_rawDesc), len(file_ermite_storage_repo_proto_rawDesc))) | |||
| 233 | + | }) | |||
| 234 | + | return file_ermite_storage_repo_proto_rawDescData | |||
| 235 | + | } | |||
| 236 | + | ||||
| 237 | + | var file_ermite_storage_repo_proto_enumTypes = make([]protoimpl.EnumInfo, 1) | |||
| 238 | + | var file_ermite_storage_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 2) | |||
| 239 | + | var file_ermite_storage_repo_proto_goTypes = []any{ | |||
| 240 | + | (Visibility)(0), // 0: ermite.storage.Visibility | |||
| 241 | + | (*Repo)(nil), // 1: ermite.storage.Repo | |||
| 242 | + | (*SchemaVersion)(nil), // 2: ermite.storage.SchemaVersion | |||
| 243 | + | (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp | |||
| 244 | + | } | |||
| 245 | + | var file_ermite_storage_repo_proto_depIdxs = []int32{ | |||
| 246 | + | 0, // 0: ermite.storage.Repo.visibility:type_name -> ermite.storage.Visibility | |||
| 247 | + | 3, // 1: ermite.storage.Repo.created_at:type_name -> google.protobuf.Timestamp | |||
| 248 | + | 3, // 2: ermite.storage.Repo.pushed_at:type_name -> google.protobuf.Timestamp | |||
| 249 | + | 3, // [3:3] is the sub-list for method output_type | |||
| 250 | + | 3, // [3:3] is the sub-list for method input_type | |||
| 251 | + | 3, // [3:3] is the sub-list for extension type_name | |||
| 252 | + | 3, // [3:3] is the sub-list for extension extendee | |||
| 253 | + | 0, // [0:3] is the sub-list for field type_name | |||
| 254 | + | } | |||
| 255 | + | ||||
| 256 | + | func init() { file_ermite_storage_repo_proto_init() } | |||
| 257 | + | func file_ermite_storage_repo_proto_init() { | |||
| 258 | + | if File_ermite_storage_repo_proto != nil { | |||
| 259 | + | return | |||
| 260 | + | } | |||
| 261 | + | type x struct{} | |||
| 262 | + | out := protoimpl.TypeBuilder{ | |||
| 263 | + | File: protoimpl.DescBuilder{ | |||
| 264 | + | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), | |||
| 265 | + | RawDescriptor: unsafe.Slice(unsafe.StringData(file_ermite_storage_repo_proto_rawDesc), len(file_ermite_storage_repo_proto_rawDesc)), | |||
| 266 | + | NumEnums: 1, | |||
| 267 | + | NumMessages: 2, | |||
| 268 | + | NumExtensions: 0, | |||
| 269 | + | NumServices: 0, | |||
| 270 | + | }, | |||
| 271 | + | GoTypes: file_ermite_storage_repo_proto_goTypes, | |||
| 272 | + | DependencyIndexes: file_ermite_storage_repo_proto_depIdxs, | |||
| 273 | + | EnumInfos: file_ermite_storage_repo_proto_enumTypes, | |||
| 274 | + | MessageInfos: file_ermite_storage_repo_proto_msgTypes, | |||
| 275 | + | }.Build() | |||
| 276 | + | File_ermite_storage_repo_proto = out.File | |||
| 277 | + | file_ermite_storage_repo_proto_goTypes = nil | |||
| 278 | + | file_ermite_storage_repo_proto_depIdxs = nil | |||
| 279 | + | } | |||
M go.mod +1 -1
| @@ -12,6 +12,7 @@ tool ( | |||
| 12 | 12 | require ( | |
| 13 | 13 | github.com/bnema/zerowrap v1.4.1 | |
| 14 | 14 | github.com/stretchr/testify v1.12.1 | |
| 15 | + | google.golang.org/protobuf v1.36.12 | |
| 15 | 16 | ) | |
| 16 | 17 | ||
| 17 | 18 | require ( | |
| @@ -125,7 +126,6 @@ require ( | |||
| 125 | 126 | golang.org/x/tools v0.51.0 // indirect | |
| 126 | 127 | google.golang.org/genproto/googleapis/api v0.0.0-20260904194346-d0f1323225a4 // indirect | |
| 127 | 128 | google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4 // indirect | |
| 128 | - | google.golang.org/protobuf v1.36.12 // indirect | |
| 129 | 129 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | |
| 130 | 130 | gopkg.in/yaml.v3 v3.0.1 // indirect | |
| 131 | 131 | mvdan.cc/xurls/v2 v2.6.0 // indirect | |
| @@ -12,6 +12,7 @@ tool ( | |||||
| 12 | require ( | 12 | require ( | ||
| 13 | github.com/bnema/zerowrap v1.4.1 | 13 | github.com/bnema/zerowrap v1.4.1 | ||
| 14 | github.com/stretchr/testify v1.12.1 | 14 | github.com/stretchr/testify v1.12.1 | ||
| 15 | + | google.golang.org/protobuf v1.36.12 | |||
| 15 | ) | 16 | ) | ||
| 16 | 17 | ||||
| 17 | require ( | 18 | require ( | ||
| @@ -125,7 +126,6 @@ require ( | |||||
| 125 | golang.org/x/tools v0.51.0 // indirect | 126 | golang.org/x/tools v0.51.0 // indirect | ||
| 126 | google.golang.org/genproto/googleapis/api v0.0.0-20260904194346-d0f1323225a4 // indirect | 127 | google.golang.org/genproto/googleapis/api v0.0.0-20260904194346-d0f1323225a4 // indirect | ||
| 127 | google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4 // indirect | 128 | google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4 // indirect | ||
| 128 | - | google.golang.org/protobuf v1.36.12 // indirect | |||
| 129 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | 129 | gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect | ||
| 130 | gopkg.in/yaml.v3 v3.0.1 // indirect | 130 | gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| 131 | mvdan.cc/xurls/v2 v2.6.0 // indirect | 131 | mvdan.cc/xurls/v2 v2.6.0 // indirect | ||
A proto/ermite/storage/repo.proto +34 -0
| @@ -0,0 +1,34 @@ | |||
| 1 | + | // SPDX-License-Identifier: AGPL-3.0-or-later | |
| 2 | + | ||
| 3 | + | // Internal, unversioned storage schema of ermite: the values kept in ermite-kv. | |
| 4 | + | ||
| 5 | + | syntax = "proto3"; | |
| 6 | + | ||
| 7 | + | package ermite.storage; | |
| 8 | + | ||
| 9 | + | import "google/protobuf/timestamp.proto"; | |
| 10 | + | ||
| 11 | + | option go_package = "bnema.dev/ermite/gen/ermite/storage;storagepb"; | |
| 12 | + | ||
| 13 | + | // Visibility is the access level of a repository. | |
| 14 | + | enum Visibility { | |
| 15 | + | // Unset. Readers treat it as private. | |
| 16 | + | VISIBILITY_UNSPECIFIED = 0; | |
| 17 | + | VISIBILITY_PRIVATE = 1; | |
| 18 | + | VISIBILITY_PUBLIC = 2; | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | // Repo is stored under the key "repo/<name>". | |
| 22 | + | message Repo { | |
| 23 | + | string name = 1; | |
| 24 | + | string description = 2; | |
| 25 | + | Visibility visibility = 3; | |
| 26 | + | google.protobuf.Timestamp created_at = 4; | |
| 27 | + | // Unset until the first push. | |
| 28 | + | google.protobuf.Timestamp pushed_at = 5; | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | // SchemaVersion is stored under the key "meta/schema". | |
| 32 | + | message SchemaVersion { | |
| 33 | + | uint32 version = 1; | |
| 34 | + | } | |
| @@ -0,0 +1,34 @@ | |||||
| 1 | + | // SPDX-License-Identifier: AGPL-3.0-or-later | |||
| 2 | + | ||||
| 3 | + | // Internal, unversioned storage schema of ermite: the values kept in ermite-kv. | |||
| 4 | + | ||||
| 5 | + | syntax = "proto3"; | |||
| 6 | + | ||||
| 7 | + | package ermite.storage; | |||
| 8 | + | ||||
| 9 | + | import "google/protobuf/timestamp.proto"; | |||
| 10 | + | ||||
| 11 | + | option go_package = "bnema.dev/ermite/gen/ermite/storage;storagepb"; | |||
| 12 | + | ||||
| 13 | + | // Visibility is the access level of a repository. | |||
| 14 | + | enum Visibility { | |||
| 15 | + | // Unset. Readers treat it as private. | |||
| 16 | + | VISIBILITY_UNSPECIFIED = 0; | |||
| 17 | + | VISIBILITY_PRIVATE = 1; | |||
| 18 | + | VISIBILITY_PUBLIC = 2; | |||
| 19 | + | } | |||
| 20 | + | ||||
| 21 | + | // Repo is stored under the key "repo/<name>". | |||
| 22 | + | message Repo { | |||
| 23 | + | string name = 1; | |||
| 24 | + | string description = 2; | |||
| 25 | + | Visibility visibility = 3; | |||
| 26 | + | google.protobuf.Timestamp created_at = 4; | |||
| 27 | + | // Unset until the first push. | |||
| 28 | + | google.protobuf.Timestamp pushed_at = 5; | |||
| 29 | + | } | |||
| 30 | + | ||||
| 31 | + | // SchemaVersion is stored under the key "meta/schema". | |||
| 32 | + | message SchemaVersion { | |||
| 33 | + | uint32 version = 1; | |||
| 34 | + | } | |||