internal

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDeprecatedFlagAndBind

func AddDeprecatedFlagAndBind[T any](v *viper.Viper, fs *pflag.FlagSet, pfn FlagFunc[T], name, bind string, value T, usage string)

AddDeprecatedFlagAndBind similar to AddFlagAndBind but deprecate the flag.

func AddDeprecatedHackedStringSlice

func AddDeprecatedHackedStringSlice(fs *pflag.FlagSet, name, usage string)

AddDeprecatedHackedStringSlice similar to AddHackedStringSlice but deprecate the flag.

func AddFlagAndBind

func AddFlagAndBind[T any](v *viper.Viper, fs *pflag.FlagSet, pfn FlagFunc[T], name, bind string, value T, usage string)

AddFlagAndBind adds a Cobra/pflag flag and binds it with Viper.

func AddFlagAndBindP

func AddFlagAndBindP[T any](v *viper.Viper, fs *pflag.FlagSet, pfn FlagPFunc[T], name, shorthand, bind string, value T, usage string)

AddFlagAndBindP adds a Cobra/pflag flag and binds it with Viper.

func AddHackedStringSlice

func AddHackedStringSlice(fs *pflag.FlagSet, name, usage string)

AddHackedStringSlice Hack for slice, see Loader.applyStringSliceHack.

func AddHackedStringSliceP

func AddHackedStringSliceP(fs *pflag.FlagSet, name, shorthand, usage string)

AddHackedStringSliceP Hack for slice, see Loader.applyStringSliceHack.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder runs all the required commands to build a binary.

func NewBuilder

func NewBuilder(logger logutils.Log, cfg *Configuration, root string) *Builder

NewBuilder creates a new Builder.

func (Builder) Build

func (b Builder) Build(ctx context.Context) error

Build builds the custom binary.

type Configuration

type Configuration struct {
	// golangci-lint version.
	Version string `yaml:"version"`

	// Name of the binary.
	Name string `yaml:"name,omitempty"`

	// Destination is the path to a directory to store the binary.
	Destination string `yaml:"destination,omitempty"`

	// Plugins information.
	Plugins []*Plugin `yaml:"plugins,omitempty"`
}

Configuration represents the configuration file.

func LoadConfiguration

func LoadConfiguration() (*Configuration, error)

func (*Configuration) Validate

func (c *Configuration) Validate() error

Validate checks and clean the configuration.

type FlagFunc

type FlagFunc[T any] func(name string, value T, usage string) *T

type FlagPFunc

type FlagPFunc[T any] func(name, shorthand string, value T, usage string) *T

type Plugin

type Plugin struct {
	// Module name.
	Module string `yaml:"module"`

	// Import to use.
	Import string `yaml:"import,omitempty"`

	// Version of the module.
	// Only for module available through a Go proxy.
	Version string `yaml:"version,omitempty"`

	// Path to the local module.
	// Only for local module.
	Path string `yaml:"path,omitempty"`
}

Plugin represents information about a plugin.

Jump to

Keyboard shortcuts

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