Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Common Export `yaml:"common"` // Common export configuration
Exports []*Export `yaml:"exports"` // List of export configurations
}
Config represents the overall configuration for the re-exporter.
type Exclusion ¶
type Exclusion struct {
Types bool `yaml:"types"` // Do not export types
Variables bool `yaml:"variables"` // Do not export variables
Constants bool `yaml:"constants"` // Do not export constants
Functions bool `yaml:"functions"` // Do not export functions
Names []Matcher `yaml:"names"` // Do not export names matching these filters
Files []Matcher `yaml:"files"` // Do not export names from file matching these filters (file name only without extension)
}
Exclusion defines what kinds of symbols to exclude from re-exporting.
type Export ¶
type Export struct {
Import string `yaml:"import"` // Module import path
Output string `yaml:"output"` // Output file name
Exclude Exclusion `yaml:"exclude"` // Exclusion rules for re-exports
Rename map[Matcher]string `yaml:"rename"` // Rename symbol name during re-export
}
Export represents the export configuration for a specific module.
func (*Export) ExportAs ¶
ExportAs determines the export name for a given identifier based on the export configuration. It returns the new name and a boolean indicating whether the identifier should be exported.
func (*Export) IncludeFile ¶
IncludeFile checks if the given file name is allowed based on the exclusion rules. It returns true if the file is included, false if excluded.
type ExportType ¶
type ExportType string
const ( ExportTypeType ExportType = "type" ExportTypeVariable ExportType = "variable" ExportTypeConstant ExportType = "constant" ExportTypeFunction ExportType = "function" )
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher can match exact text or a regular expression.
Regular expressions must be enclosed in slashes (e.g., /pattern/).
func (*Matcher) UnmarshalText ¶
UnmarshalText unmarshals the filter from text.
type Replacer ¶
type Replacer struct {
// contains filtered or unexported fields
}
Filter represents a filter that can match exact text or a regular expression.
Regular expressions must be enclosed in slashes (e.g., /pattern/).
func (*Replacer) UnmarshalText ¶
UnmarshalText unmarshals the filter from text.