Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFieldTags ¶
ApplyFieldTags applies the run.tags extension to existing struct tags
func ToCamelCase ¶
ToCamelCase converts snake_case to CamelCase (for reverse matching)
Types ¶
type FieldMatcher ¶
type FieldMatcher struct {
// contains filtered or unexported fields
}
FieldMatcher matches proto fields to Go struct fields
func NewFieldMatcher ¶
func NewFieldMatcher() *FieldMatcher
NewFieldMatcher creates a new FieldMatcher
func (*FieldMatcher) FindProtoField ¶
func (m *FieldMatcher) FindProtoField( goMessageName string, goFieldName string, tagsMap FieldTagsMap, ) string
FindProtoField finds the proto key for a Go struct field Returns the key in format "proto.package.Message.field_name" or empty string if not found
type FieldTagsMap ¶
FieldTagsMap maps proto field identifiers to their tag directives Key format: "package.Message.field_name"
type GoFileEditor ¶
type GoFileEditor struct {
// contains filtered or unexported fields
}
GoFileEditor modifies pb.go files to inject custom struct tags
func NewGoFileEditor ¶
func NewGoFileEditor(log logger.Logger) *GoFileEditor
NewGoFileEditor creates a new GoFileEditor with the provided logger
func (*GoFileEditor) EditGoFile ¶
func (e *GoFileEditor) EditGoFile(goFile string, matcher *FieldMatcher, tagsMap FieldTagsMap) error
EditGoFile modifies a single Go file with the provided field tags
func (*GoFileEditor) ProcessString ¶
func (e *GoFileEditor) ProcessString(content string, matcher *FieldMatcher, tagsMap FieldTagsMap, filename string) (string, error)
ProcessString processes Go source code from a string and returns the modified string This is used by the buf plugin which works with in-memory content
type ProtoReader ¶
type ProtoReader struct {
// contains filtered or unexported fields
}
ProtoReader reads proto files and extracts run.tags extensions
func NewProtoReader ¶
func NewProtoReader(log logger.Logger, includePaths []string) *ProtoReader
NewProtoReader creates a new ProtoReader
func (*ProtoReader) ReadProtoFiles ¶
func (r *ProtoReader) ReadProtoFiles(protoFiles []string) (FieldTagsMap, error)
ReadProtoFiles reads proto files and extracts field tags