compilermanager

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicCompiler

type BasicCompiler struct {
	logger.Logger
	// contains filtered or unexported fields
}

BasicCompiler is the basic implement of Compiler

func NewBasicCompiler

func NewBasicCompiler(
	ctx context.Context,
	log logger.Logger,
	pluginManager pluginmanager.PluginManager,
	config configs.ConfigItem,
) (*BasicCompiler, error)

NewBasicCompiler is used to create a basic compiler

func (*BasicCompiler) BatchCompile

func (b *BasicCompiler) BatchCompile(ctx context.Context, protoFilePaths []string) error

BatchCompile is used to compile a batch of proto files

func (*BasicCompiler) Compile

func (b *BasicCompiler) Compile(ctx context.Context, protoFilePath string) error

Compile is used to compile proto file

func (*BasicCompiler) GetConfig

func (b *BasicCompiler) GetConfig(ctx context.Context) configs.ConfigItem

GetConfig is used to return config that the compiler used

type BasicCompilerManager

type BasicCompilerManager struct {
	logger.Logger
	// contains filtered or unexported fields
}

BasicCompilerManager is the basic implement of CompilerManager

func NewBasicCompilerManager

func NewBasicCompilerManager(ctx context.Context,
	log logger.Logger,
	configManager configmanager.ConfigManager,
	pluginManager pluginmanager.PluginManager,
) (*BasicCompilerManager, error)

NewBasicCompilerManager is used to create basic CompilerManager

func (*BasicCompilerManager) GetBatchCompiler

func (b *BasicCompilerManager) GetBatchCompiler(ctx context.Context, protoFilePaths []string) (Compiler, error)

func (*BasicCompilerManager) GetCompiler

func (b *BasicCompilerManager) GetCompiler(ctx context.Context, protoFilePath string) (Compiler, error)

GetCompiler is used to get compiler of specified proto file path

type Compiler

type Compiler interface {
	// Compile is used to compile proto file
	Compile(ctx context.Context, protoFilePath string) error
	// BatchCompile is used to compile a batch of proto files
	BatchCompile(ctx context.Context, protoFilePaths []string) error
	// GetConfig is used to return config that the compiler used
	GetConfig(ctx context.Context) configs.ConfigItem
}

Compiler is used to compile proto file

func NewCompiler

func NewCompiler(
	ctx context.Context,
	log logger.Logger,
	pluginManager pluginmanager.PluginManager,
	config configs.ConfigItem,
) (Compiler, error)

NewCompiler is used to create a compiler

type CompilerManager

type CompilerManager interface {
	// GetCompiler is used to get compiler of specified proto file path
	GetCompiler(ctx context.Context, protoFilePath string) (Compiler, error)
	// GetBatchCompiler is used to get compiler of batch proto file paths
	GetBatchCompiler(ctx context.Context, protoFilePaths []string) (Compiler, error)
}

CompilerManager is to manage compiler

func NewCompilerManager

func NewCompilerManager(ctx context.Context,
	log logger.Logger,
	configManager configmanager.ConfigManager,
	pluginManager pluginmanager.PluginManager,
) (CompilerManager, error)

NewCompilerManager is used to create CompilerManager

type ErrCompile

type ErrCompile struct {
	*command.ErrCommandExec
}

ErrCompile defines the compile error

Jump to

Keyboard shortcuts

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