commands

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadProjectFromDisk added in v1.0.1

func LoadProjectFromDisk(projectFolderPath string) (generator.GoProject, error)

LoadProjectFromDisk loads a Go project from the specified directory path.

func NewGenerateGroupCommand

func NewGenerateGroupCommand() *cobra.Command

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

String provides a string representation of the ParsleyMockAnnotationAttribute enum.

type ProjectLoaderFunc added in v1.0.1

type ProjectLoaderFunc func(projectFolderPath string) (generator.GoProject, error)

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.

Jump to

Keyboard shortcuts

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