Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrGoNotFound is returned when a Go binary hasn't been found ErrGoNotFound = errors.New("go binary not found") )
View Source
var ErrInvalidGoMod = errors.New("invalid gomod specification for module")
ErrInvalidGoMod indicates an invalid gomod
Functions ¶
func GenerateAndCompile ¶
GenerateAndCompile will generate the source files based on the given configuration, update go mod, and will compile into a binary
func GetModules ¶
GetModules retrieves the go modules, updating go.mod and go.sum in the process
Types ¶
type Config ¶
type Config struct { Logger *zap.Logger SkipCompilation bool `mapstructure:"-"` SkipGetModules bool `mapstructure:"-"` LDFlags string `mapstructure:"-"` Distribution Distribution `mapstructure:"dist"` Exporters []Module `mapstructure:"exporters"` Extensions []Module `mapstructure:"extensions"` Receivers []Module `mapstructure:"receivers"` Processors []Module `mapstructure:"processors"` Connectors []Module `mapstructure:"connectors"` Replaces []string `mapstructure:"replaces"` Excludes []string `mapstructure:"excludes"` }
Config holds the builder's configuration
func NewDefaultConfig ¶ added in v0.46.0
func NewDefaultConfig() Config
NewDefaultConfig creates a new config, with default values
func (*Config) ParseModules ¶
ParseModules will parse the Modules entries and populate the missing values
type Distribution ¶
type Distribution struct { Module string `mapstructure:"module"` Name string `mapstructure:"name"` Go string `mapstructure:"go"` Description string `mapstructure:"description"` OtelColVersion string `mapstructure:"otelcol_version"` OutputPath string `mapstructure:"output_path"` Version string `mapstructure:"version"` BuildTags string `mapstructure:"build_tags"` DebugCompilation bool `mapstructure:"debug_compilation"` }
Distribution holds the parameters for the final binary
type Module ¶
type Module struct { Name string `mapstructure:"name"` // if not specified, this is package part of the go mod (last part of the path) Import string `mapstructure:"import"` // if not specified, this is the path part of the go mods GoMod string `mapstructure:"gomod"` // a gomod-compatible spec for the module Path string `mapstructure:"path"` // an optional path to the local version of this module }
Module represents a receiver, exporter, processor or extension for the distribution
Click to show internal directories.
Click to hide internal directories.