parser

package
v0.0.0-...-f5740b0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

func NewParser

func NewParser(cfg *config.Config, logger *slog.Logger) *Parser

func (*Parser) ParseFile

func (p *Parser) ParseFile() (map[string][]StructField, error)

ParseFile parses the file at the configured InputPath and returns a map of struct names to their fields.

type StructField

type StructField struct {
	Name     string
	Type     string
	MockTags map[string]string // parsed "mock" tags
}

StructField is a parsed field of an struct

func (StructField) ToGenerator

func (f StructField) ToGenerator(seed int64, logger *slog.Logger) (generator.AnyGenerator, error)

ToGenerator converts a StructField to an AnyGenerator

Jump to

Keyboard shortcuts

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