Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { PackageName string `` /* 127-byte string literal not displayed */ Ignores []string `yaml:"ignores,omitempty" mapstructure:"ignores,omitempty" json:"ignores,omitempty" toml:"ignores,omitempty"` Defaults *Defaults `yaml:"defaults,omitempty" mapstructure:"defaults,omitempty" json:"defaults,omitempty" toml:"defaults,omitempty"` Props []*PropsEntry `yaml:"props,omitempty" mapstructure:"props,omitempty" json:"props,omitempty" toml:"props,omitempty"` Packages []*Package `yaml:"packages,omitempty" mapstructure:"packages,omitempty" json:"packages,omitempty" toml:"packages,omitempty"` Types []*TypeRule `yaml:"types,omitempty" mapstructure:"types,omitempty" json:"types,omitempty" toml:"types,omitempty"` Functions []*FuncRule `yaml:"functions,omitempty" mapstructure:"functions,omitempty" json:"functions,omitempty" toml:"functions,omitempty"` Variables []*VarRule `yaml:"variables,omitempty" mapstructure:"variables,omitempty" json:"variables,omitempty" toml:"variables,omitempty"` Constants []*ConstRule `yaml:"constants,omitempty" mapstructure:"constants,omitempty" json:"constants,omitempty" toml:"constants,omitempty"` }
Config is the root of the .adptool.yaml configuration file.
type ConstRule ¶
type ConstRule struct { Name string `yaml:"name" mapstructure:"name" json:"name" toml:"name"` Disabled bool `yaml:"disabled,omitempty" mapstructure:"disabled,omitempty" json:"disabled,omitempty" toml:"disabled,omitempty"` RuleSet `yaml:",inline" mapstructure:",squash" json:",inline" toml:",inline"` }
ConstRule defines the set of rules for a single constant.
func (*ConstRule) GetRuleSet ¶
func (*ConstRule) IsDisabled ¶
type Defaults ¶
type Defaults struct {
Mode *Mode `yaml:"mode,omitempty" mapstructure:"mode,omitempty" json:"mode,omitempty" toml:"mode,omitempty"`
}
Defaults defines the global default behaviors for the entire system.
func NewDefaults ¶
func NewDefaults() *Defaults
NewDefaults creates a new, fully initialized Defaults object.
type ExplicitRule ¶
type ExplicitRule struct { From string `yaml:"from" mapstructure:"from" json:"from" toml:"from"` To string `yaml:"to" mapstructure:"to" json:"to" toml:"to"` }
ExplicitRule defines a direct from/to renaming rule.
type FuncRule ¶
type FuncRule struct { Name string `yaml:"name" mapstructure:"name" json:"name" toml:"name"` Disabled bool `yaml:"disabled,omitempty" mapstructure:"disabled,omitempty" json:"disabled,omitempty" toml:"disabled,omitempty"` Pattern string `yaml:"pattern,omitempty" mapstructure:"pattern,omitempty" json:"pattern,omitempty" toml:"pattern,omitempty"` RuleSet `yaml:",inline" mapstructure:",squash" json:",inline" toml:",inline"` }
FuncRule defines the set of rules for a single function.
func (*FuncRule) GetRuleSet ¶
func (*FuncRule) IsDisabled ¶
type MemberRule ¶
type MemberRule struct { Name string `yaml:"name" mapstructure:"name" json:"name" toml:"name"` Disabled bool `yaml:"disabled,omitempty" mapstructure:"disabled,omitempty" json:"disabled,omitempty" toml:"disabled,omitempty"` RuleSet `yaml:",inline" mapstructure:",squash" json:",inline" toml:",inline"` }
MemberRule defines the set of rules for a type member (method or field).
func (*MemberRule) GetName ¶
func (m *MemberRule) GetName() string
func (*MemberRule) GetRuleSet ¶
func (m *MemberRule) GetRuleSet() *RuleSet
func (*MemberRule) IsDisabled ¶
func (m *MemberRule) IsDisabled() bool
type Mode ¶
type Mode struct { Strategy string `yaml:"strategy,omitempty" mapstructure:"strategy,omitempty" json:"strategy,omitempty" toml:"strategy,omitempty"` Prefix string `yaml:"prefix,omitempty" mapstructure:"prefix,omitempty" json:"prefix,omitempty" toml:"prefix,omitempty"` Suffix string `yaml:"suffix,omitempty" mapstructure:"suffix,omitempty" json:"suffix,omitempty" toml:"suffix,omitempty"` Explicit string `yaml:"explicit,omitempty" mapstructure:"explicit,omitempty" json:"explicit,omitempty" toml:"explicit,omitempty"` Regex string `yaml:"regex,omitempty" mapstructure:"regex,omitempty" json:"regex,omitempty" toml:"regex,omitempty"` Ignores string `yaml:"ignores,omitempty" mapstructure:"ignores,omitempty" json:"ignores,omitempty" toml:"ignores,omitempty"` }
Mode contains key-value pairs where the key is a rule type and the value is the default mode.
type Package ¶
type Package struct { Import string `yaml:"import" mapstructure:"import" json:"import" toml:"import"` Path string `yaml:"path,omitempty" mapstructure:"path,omitempty" json:"path,omitempty" toml:"path,omitempty"` Alias string `yaml:"alias,omitempty" mapstructure:"alias,omitempty" json:"alias,omitempty" toml:"alias,omitempty"` Props []*PropsEntry `yaml:"props,omitempty" mapstructure:"props,omitempty" json:"props,omitempty" toml:"props,omitempty"` Types []*TypeRule `yaml:"types,omitempty" mapstructure:"types,omitempty" json:"types,omitempty" toml:"types,omitempty"` Functions []*FuncRule `yaml:"functions,omitempty" mapstructure:"functions,omitempty" json:"functions,omitempty" toml:"functions,omitempty"` Variables []*VarRule `yaml:"variables,omitempty" mapstructure:"variables,omitempty" json:"variables,omitempty" toml:"variables,omitempty"` Constants []*ConstRule `yaml:"constants,omitempty" mapstructure:"constants,omitempty" json:"constants,omitempty" toml:"constants,omitempty"` }
Package defines rules and variables for a single package.
type PropsEntry ¶
type PropsEntry struct { Name string `yaml:"name" mapstructure:"name" json:"name" toml:"name"` Value string `yaml:"value" mapstructure:"value" json:"value" toml:"value"` }
PropsEntry defines a single variable entry in the config.
type RegexRule ¶
type RegexRule struct { Pattern string `yaml:"pattern" mapstructure:"pattern" json:"pattern" toml:"pattern"` Replace string `yaml:"replace" mapstructure:"replace" json:"replace" toml:"replace"` }
RegexRule defines a regex-based renaming rule.
type RuleHolder ¶
RuleHolder defines the interface for any rule-holding configuration element.
type RuleSet ¶
type RuleSet struct { //Disabled bool `yaml:"disabled,omitempty" mapstructure:"disabled,omitempty" json:"disabled,omitempty" toml:"disabled,omitempty"` Strategy []string `yaml:"strategy,omitempty" mapstructure:"strategy,omitempty" json:"strategy,omitempty" toml:"strategy,omitempty"` Prefix string `yaml:"prefix,omitempty" mapstructure:"prefix,omitempty" json:"prefix,omitempty" toml:"prefix,omitempty"` PrefixMode string `yaml:"prefix_mode,omitempty" mapstructure:"prefix_mode,omitempty" json:"prefix_mode,omitempty" toml:"prefix_mode,omitempty"` Suffix string `yaml:"suffix,omitempty" mapstructure:"suffix,omitempty" json:"suffix,omitempty" toml:"suffix,omitempty"` SuffixMode string `yaml:"suffix_mode,omitempty" mapstructure:"suffix_mode,omitempty" json:"suffix_mode,omitempty" toml:"suffix_mode,omitempty"` Explicit []*ExplicitRule `yaml:"explicit,omitempty" mapstructure:"explicit,omitempty" json:"explicit,omitempty" toml:"explicit,omitempty"` ExplicitMode string `` /* 131-byte string literal not displayed */ Regex []*RegexRule `yaml:"regex,omitempty" mapstructure:"regex,omitempty" json:"regex,omitempty" toml:"regex,omitempty"` RegexMode string `yaml:"regex_mode,omitempty" mapstructure:"regex_mode,omitempty" json:"regex_mode,omitempty" toml:"regex_mode,omitempty"` Ignores []string `yaml:"ignores,omitempty" mapstructure:"ignores,omitempty" json:"ignores,omitempty" toml:"ignores,omitempty"` IgnoresMode string `` /* 127-byte string literal not displayed */ Transforms *Transform `yaml:"transforms,omitempty" mapstructure:"transforms,omitempty" json:"transforms,omitempty" toml:"transforms,omitempty"` // Deprecated: use Transforms instead. TransformBefore string `` /* 143-byte string literal not displayed */ // Deprecated: use Transforms instead. TransformAfter string `` /* 139-byte string literal not displayed */ }
RuleSet is the fundamental, reusable building block for defining transformation rules.
type Transform ¶
type Transform struct { Before string `yaml:"before,omitempty" mapstructure:"before,omitempty" json:"before,omitempty" toml:"before,omitempty"` After string `yaml:"after,omitempty" mapstructure:"after,omitempty" json:"after,omitempty" toml:"after,omitempty"` }
Transform defines the before and after template strings for renaming.
type TypeRule ¶
type TypeRule struct { Name string `yaml:"name" mapstructure:"name" json:"name" toml:"name"` Disabled bool `yaml:"disabled,omitempty" mapstructure:"disabled,omitempty" json:"disabled,omitempty" toml:"disabled,omitempty"` Kind string `yaml:"kind,omitempty" mapstructure:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"` Pattern string `yaml:"pattern,omitempty" mapstructure:"pattern,omitempty" json:"pattern,omitempty" toml:"pattern,omitempty"` Methods []*MemberRule `yaml:"methods,omitempty" mapstructure:"methods,omitempty" json:"methods,omitempty" toml:"methods,omitempty"` Fields []*MemberRule `yaml:"fields,omitempty" mapstructure:"fields,omitempty" json:"fields,omitempty" toml:"fields,omitempty"` RuleSet `yaml:",inline" mapstructure:",squash" json:",inline" toml:",inline"` }
TypeRule defines the set of rules for a single type declaration.
func (*TypeRule) GetRuleSet ¶
func (*TypeRule) IsDisabled ¶
type VarRule ¶
type VarRule struct { Name string `yaml:"name" mapstructure:"name" json:"name" toml:"name"` Disabled bool `yaml:"disabled,omitempty" mapstructure:"disabled,omitempty" json:"disabled,omitempty" toml:"disabled,omitempty"` RuleSet `yaml:",inline" mapstructure:",squash" json:",inline" toml:",inline"` }
VarRule defines the set of rules for a single variable.