parser

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAbsolutePath

func GetAbsolutePath(path string) (string, error)

GetAbsolutePath returns the absolute path for a given file path

Types

type FieldInfo

type FieldInfo struct {
	Name      string // Field name
	Type      string // Field type as string
	Tag       string // Complete struct tag
	LogTag    string // Value of the log tag (e.g., "redact", "-")
	IsPointer bool   // Whether the field is a pointer type
}

FieldInfo represents information about a struct field

type ParseResult

type ParseResult struct {
	Structs []StructInfo // Structs that need LogValue generation
	Errors  []error      // Any parsing errors encountered
}

ParseResult represents the result of parsing Go source files

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles parsing Go source files for Oak directives

func New

func New() *Parser

New creates a new Parser instance

func (*Parser) ParseFile

func (p *Parser) ParseFile(filePath string) (*ParseResult, error)

ParseFile parses a single Go source file for Oak directives

func (*Parser) ParsePackage

func (p *Parser) ParsePackage(packagePath string) (*ParseResult, error)

ParsePackage parses all Go files in a package directory for Oak directives

type StructInfo

type StructInfo struct {
	Name        string      // Name of the struct
	PackageName string      // Package name
	Fields      []FieldInfo // List of fields in the struct
	FilePath    string      // Path to the source file
}

StructInfo represents information about a struct that needs LogValue generation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL