Files
EasyTier/easytier-go/proto/easytier/annotations.pb.go
T
Luna YaoandClaude Code 250c2ad8d6 refactor(config): preserve explicit flags with FlagsPatch and derive CLI arguments from schema (#2585)
This PR refactors EasyTier's configuration flags system across protobuf definitions, TOML/API persistence, runtime reconciliation, and the CLI.

It introduces a synthesized FlagsPatch protobuf message with optionize and pbjson support to track field presence reliably, replaces manual CLI flag boilerplate with dynamic schema-driven clap argument generation, and
establishes Flags::resolve(patch) as the single source of truth for runtime defaults.

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-10-10 22:11:08 +08:00

243 lines
7.3 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v7.36.1
// source: annotations.proto
package easytier
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
descriptorpb "google.golang.org/protobuf/types/descriptorpb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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)
)
// The name the management API spells a flag with, where it differs from the
// flag's own, and whether that field is the flag's negation.
type ApiSpelling struct {
state protoimpl.MessageState `protogen:"open.v1"`
Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
Negate bool `protobuf:"varint,2,opt,name=negate,proto3" json:"negate,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ApiSpelling) Reset() {
*x = ApiSpelling{}
mi := &file_annotations_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ApiSpelling) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ApiSpelling) ProtoMessage() {}
func (x *ApiSpelling) ProtoReflect() protoreflect.Message {
mi := &file_annotations_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 ApiSpelling.ProtoReflect.Descriptor instead.
func (*ApiSpelling) Descriptor() ([]byte, []int) {
return file_annotations_proto_rawDescGZIP(), []int{0}
}
func (x *ApiSpelling) GetField() string {
if x != nil {
return x.Field
}
return ""
}
func (x *ApiSpelling) GetNegate() bool {
if x != nil {
return x.Negate
}
return false
}
// What a flag is worth and how the layers around it name it.
//
// `default` holds the value the core runs for a flag a configuration does not
// state, written the way the flag's own type reads; an `optional` flag leaves
// it out, which is what "unset" means. A form has a non-boolean control for
// `form`; boolean flags need no marker, since the type says so.
type FlagMeta struct {
state protoimpl.MessageState `protogen:"open.v1"`
Default *string `protobuf:"bytes,1,opt,name=default,proto3,oneof" json:"default,omitempty"`
Api *ApiSpelling `protobuf:"bytes,2,opt,name=api,proto3" json:"api,omitempty"`
Form bool `protobuf:"varint,3,opt,name=form,proto3" json:"form,omitempty"`
Deprecated bool `protobuf:"varint,4,opt,name=deprecated,proto3" json:"deprecated,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FlagMeta) Reset() {
*x = FlagMeta{}
mi := &file_annotations_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FlagMeta) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FlagMeta) ProtoMessage() {}
func (x *FlagMeta) ProtoReflect() protoreflect.Message {
mi := &file_annotations_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 FlagMeta.ProtoReflect.Descriptor instead.
func (*FlagMeta) Descriptor() ([]byte, []int) {
return file_annotations_proto_rawDescGZIP(), []int{1}
}
func (x *FlagMeta) GetDefault() string {
if x != nil && x.Default != nil {
return *x.Default
}
return ""
}
func (x *FlagMeta) GetApi() *ApiSpelling {
if x != nil {
return x.Api
}
return nil
}
func (x *FlagMeta) GetForm() bool {
if x != nil {
return x.Form
}
return false
}
func (x *FlagMeta) GetDeprecated() bool {
if x != nil {
return x.Deprecated
}
return false
}
var file_annotations_proto_extTypes = []protoimpl.ExtensionInfo{
{
ExtendedType: (*descriptorpb.FieldOptions)(nil),
ExtensionType: (*FlagMeta)(nil),
Field: 50001,
Name: "easytier.flag",
Tag: "bytes,50001,opt,name=flag",
Filename: "annotations.proto",
},
}
// Extension fields to descriptorpb.FieldOptions.
var (
// optional easytier.FlagMeta flag = 50001;
E_Flag = &file_annotations_proto_extTypes[0]
)
var File_annotations_proto protoreflect.FileDescriptor
const file_annotations_proto_rawDesc = "" +
"\n" +
"\x11annotations.proto\x12\beasytier\x1a google/protobuf/descriptor.proto\";\n" +
"\vApiSpelling\x12\x14\n" +
"\x05field\x18\x01 \x01(\tR\x05field\x12\x16\n" +
"\x06negate\x18\x02 \x01(\bR\x06negate\"\x92\x01\n" +
"\bFlagMeta\x12\x1d\n" +
"\adefault\x18\x01 \x01(\tH\x00R\adefault\x88\x01\x01\x12'\n" +
"\x03api\x18\x02 \x01(\v2\x15.easytier.ApiSpellingR\x03api\x12\x12\n" +
"\x04form\x18\x03 \x01(\bR\x04form\x12\x1e\n" +
"\n" +
"deprecated\x18\x04 \x01(\bR\n" +
"deprecatedB\n" +
"\n" +
"\b_default:G\n" +
"\x04flag\x12\x1d.google.protobuf.FieldOptions\x18ц\x03 \x01(\v2\x12.easytier.FlagMetaR\x04flagb\x06proto3"
var (
file_annotations_proto_rawDescOnce sync.Once
file_annotations_proto_rawDescData []byte
)
func file_annotations_proto_rawDescGZIP() []byte {
file_annotations_proto_rawDescOnce.Do(func() {
file_annotations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_annotations_proto_rawDesc), len(file_annotations_proto_rawDesc)))
})
return file_annotations_proto_rawDescData
}
var file_annotations_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_annotations_proto_goTypes = []any{
(*ApiSpelling)(nil), // 0: easytier.ApiSpelling
(*FlagMeta)(nil), // 1: easytier.FlagMeta
(*descriptorpb.FieldOptions)(nil), // 2: google.protobuf.FieldOptions
}
var file_annotations_proto_depIdxs = []int32{
0, // 0: easytier.FlagMeta.api:type_name -> easytier.ApiSpelling
2, // 1: easytier.flag:extendee -> google.protobuf.FieldOptions
1, // 2: easytier.flag:type_name -> easytier.FlagMeta
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
2, // [2:3] is the sub-list for extension type_name
1, // [1:2] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_annotations_proto_init() }
func file_annotations_proto_init() {
if File_annotations_proto != nil {
return
}
file_annotations_proto_msgTypes[1].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_annotations_proto_rawDesc), len(file_annotations_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 1,
NumServices: 0,
},
GoTypes: file_annotations_proto_goTypes,
DependencyIndexes: file_annotations_proto_depIdxs,
MessageInfos: file_annotations_proto_msgTypes,
ExtensionInfos: file_annotations_proto_extTypes,
}.Build()
File_annotations_proto = out.File
file_annotations_proto_goTypes = nil
file_annotations_proto_depIdxs = nil
}