app

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	checker.Module,
	formatter.Module,
	tools.Module,
	unpack.Module,
	fx.WithLogger(func() fxevent.Logger { return fxevent.NopLogger }),
	fx.Provide(
		NewCliOptions,
		NewConfig,
		NewYaml,
		NewFormatterParams,
		NewToolsParams,
		NewLogger,
		func(logger *zap.Logger) *zap.SugaredLogger { return logger.Sugar() },
		command.NewCommand,
	),
	fx.Invoke(func(cfg core.Config) {
		color.NoColor = !cfg.WithColors()
	}),
)

Functions

func Main

func Main(env command.Env) error

func NewConfig

func NewConfig(cliOpts CliOptions, yaml *config.YAML) (core.Config, error)

func NewFormatterParams

func NewFormatterParams(config core.Config) formatter.Params

func NewLogger

func NewLogger(env command.Env) (*zap.Logger, error)

func NewToolsParams

func NewToolsParams(config core.Config, unpacker unpack.Unpacker, logger *zap.SugaredLogger) tools.Params

func NewYaml

func NewYaml(options CliOptions) (*config.YAML, error)

Types

type CliOptions

type CliOptions struct {
	InputFile   string
	Format      string
	OutputFile  string
	ConfigFile  string
	VendorDir   string
	FailOnError bool
	NoColor     *bool
	// Trace is not really used, but we generate flag for help entry
	// --trace is checked in NewLogger function, as CliOptions can't be provided
	// before Logger.
	Trace bool
	// contains filtered or unexported fields
}

func NewCliOptions

func NewCliOptions(env command.Env) (CliOptions, command.Type, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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