Documentation ¶
Index ¶
- func LoadProjectFromDisk(projectFolderPath string) (generator.GoProject, error)
- func NewGenerateGroupCommand() *cobra.Command
- func NewGenerateMocksCommand(fileAccessor reflection.AstFileAccessor, ...) *cobra.Command
- func NewGenerateProxyCommand(fileAccessor reflection.AstFileAccessor, ...) *cobra.Command
- func NewInitCommand(writerFactoryFunc ScaffoldingFileWriterFactoryFunc, ...) *cobra.Command
- func NewProjectFileScaffoldingWriterFactory(projectFolderPath string) generator.ScaffoldingFileWriterFunc
- func NewVersionCommand(httpClient utils.HttpClient) *cobra.Command
- type MocksGeneratorBehavior
- type ParsleyMockAnnotationAttribute
- type ProjectLoaderFunc
- type ScaffoldingFileWriterFactoryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadProjectFromDisk ¶ added in v1.0.1
LoadProjectFromDisk loads a Go project from the specified directory path.
func NewGenerateGroupCommand ¶
func NewGenerateMocksCommand ¶ added in v0.9.0
func NewGenerateMocksCommand(fileAccessor reflection.AstFileAccessor, outputWriterFactory generator.OutputWriterFactory) *cobra.Command
NewGenerateMocksCommand creates a new cobra command to generate mock implementations for interfaces. This command uses the provided file accessor to read the source file and the output writer factory to write the generated mocks.
func NewGenerateProxyCommand ¶
func NewGenerateProxyCommand(fileAccessor reflection.AstFileAccessor, outputWriterFactory generator.OutputWriterFactory) *cobra.Command
NewGenerateProxyCommand creates a new cobra.Command for generating proxy code, enabling method call interception for interfaces.
func NewInitCommand ¶
func NewInitCommand( writerFactoryFunc ScaffoldingFileWriterFactoryFunc, projectLoaderFunc ProjectLoaderFunc) *cobra.Command
func NewProjectFileScaffoldingWriterFactory ¶ added in v1.0.1
func NewProjectFileScaffoldingWriterFactory(projectFolderPath string) generator.ScaffoldingFileWriterFunc
NewProjectFileScaffoldingWriterFactory creates a factory for generating file writers in a specified project directory.
func NewVersionCommand ¶ added in v0.9.2
func NewVersionCommand(httpClient utils.HttpClient) *cobra.Command
NewVersionCommand creates a new cobra.Command that displays the current version of the Parsley CLI and checks for updates.
Types ¶
type MocksGeneratorBehavior ¶ added in v0.9.3
type MocksGeneratorBehavior int
MocksGeneratorBehavior defines different behaviors for mock generation, which influence how mocks are handled based on annotations.
const ( Default MocksGeneratorBehavior = iota OnlyMarked ExcludeIgnored )
type ParsleyMockAnnotationAttribute ¶ added in v0.9.3
type ParsleyMockAnnotationAttribute int
ParsleyMockAnnotationAttribute represents an attribute used to manage the behavior of mocking annotations during code generation, such as including or ignoring specified interface mocks based on annotations.
const ( Mock ParsleyMockAnnotationAttribute = iota + 1 Ignore )
func (ParsleyMockAnnotationAttribute) String ¶ added in v0.9.3
func (p ParsleyMockAnnotationAttribute) String() string
String provides a string representation of the ParsleyMockAnnotationAttribute enum.
type ProjectLoaderFunc ¶ added in v1.0.1
ProjectLoaderFunc is a function type that loads a Go project given a project folder path.
type ScaffoldingFileWriterFactoryFunc ¶ added in v1.0.1
type ScaffoldingFileWriterFactoryFunc func(projectFolder string) (generator.ScaffoldingFileWriterFunc, error)
ScaffoldingFileWriterFactoryFunc defines a function type that returns a generator.ScaffoldingFileWriterFunc.