config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFileName = "easyp.yaml"
)

Variables

View Source
var (
	FlagCfg = &cli.StringFlag{
		Name:       "cfg",
		Usage:      "set config file path",
		Required:   true,
		HasBeenSet: true,
		Value:      DefaultConfigFileName,
		Aliases:    []string{"config"},
		EnvVars:    []string{"EASYP_CFG"},
	}

	FlagDebug = &cli.BoolFlag{
		Name:       "debug",
		Usage:      "set config file path",
		Required:   false,
		HasBeenSet: false,
		Value:      false,
		Aliases:    []string{"d"},
		EnvVars:    []string{"DEBUG"},
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// LintConfig is the lint configuration.
	Lint LintConfig `json:"lint" yaml:"lint"`

	// Deps is the dependencies repositories
	Deps []string `json:"deps" yaml:"deps"`

	// Generate is the generate configuration.
	Generate Generate `json:"generate" yaml:"generate"`
}

Config is the configuration of easyp.

func ReadConfig

func ReadConfig(ctx *cli.Context) (*Config, error)

ReadConfig reads the configuration from the file.

func (*Config) BuildLinterRules

func (cfg *Config) BuildLinterRules() ([]lint.Rule, error)

type DependencyEntryPoint added in v0.4.2

type DependencyEntryPoint struct {
	Dep  string `json:"dep" yaml:"dep"`
	Path string `json:"path" yaml:"path"`
}

DependencyEntryPoint part for generate code from dep

type Generate added in v0.4.0

type Generate struct {
	DependencyEntryPoint *DependencyEntryPoint `json:"dependency_entry_point" yaml:"dependency_entry_point"`
	Plugins              []Plugin              `json:"plugins" yaml:"plugins"`
}

Generate is the configuration of the generate command.

type LintConfig

type LintConfig struct {
	Use                       []string `json:"use" yaml:"use" env:"USE"`                                                                       // Use rules for linter.
	EnumZeroValueSuffixPrefix string   `json:"enumZeroValueSuffixPrefix" yaml:"enumZeroValueSuffixPrefix" env:"ENUM_ZERO_VALUE_SUFFIX_PREFIX"` // Enum zero value suffix prefix.
	ServiceSuffixSuffix       string   `json:"serviceSuffixSuffix" yaml:"serviceSuffixSuffix" env:"SERVICE_SUFFIX_SUFFIX"`                     // Service suffix suffix.
	Ignore                    []string `json:"ignore" yaml:"ignore" env:"IGNORE"`                                                              // Ignore dirs with proto file.
}

LintConfig contains linter configuration.

type Plugin added in v0.4.0

type Plugin struct {
	Name string            `json:"name" yaml:"name"`
	Out  string            `json:"out" yaml:"out"`
	Opts map[string]string `json:"opts" yaml:"opts"`
}

Plugin is the configuration of the plugin.

Jump to

Keyboard shortcuts

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