Documentation
¶
Index ¶
- Variables
- func Trim(files, includeDir []string, outDir string) error
- func TrimBatchContent(mainIDLFilePath string, IDLFileContentMap map[string]string) (map[string]string, error)
- func TrimBatchContentWithConfig(mainIDLFilePath string, IDLFileContentMap map[string]string, ...) (map[string]string, error)
- type TrimASTArg
- type TrimResultInfo
- type Trimmer
- type YamlArguments
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultYamlFileName = "trim_config.yaml"
Functions ¶
func TrimBatchContent ¶ added in v0.3.14
func TrimBatchContent(mainIDLFilePath string, IDLFileContentMap map[string]string) (map[string]string, error)
TrimBatchContent receives a group of thrift idl as map[path]content and mainIDLPath, and return the result as the same format.
func TrimBatchContentWithConfig ¶ added in v0.3.14
func TrimBatchContentWithConfig(mainIDLFilePath string, IDLFileContentMap map[string]string, trimArgs TrimASTArg) (map[string]string, error)
TrimBatchContentWithConfig does the same work with TrimBatchContent, but can extra receive a trimArgs
Types ¶
type TrimASTArg ¶ added in v0.3.3
type TrimResultInfo ¶ added in v0.3.15
type TrimResultInfo struct {
StructsTrimmed int
FieldsTrimmed int
StructsTotal int
FieldsTotal int
}
func TrimAST ¶
func TrimAST(arg *TrimASTArg) (trimResultInfo *TrimResultInfo, err error)
TrimAST parse the cfg and trim the single AST
func (*TrimResultInfo) FieldTrimmedPercentage ¶ added in v0.3.15
func (t *TrimResultInfo) FieldTrimmedPercentage() float64
func (*TrimResultInfo) FieldsLeft ¶ added in v0.3.15
func (t *TrimResultInfo) FieldsLeft() int
func (*TrimResultInfo) StructTrimmedPercentage ¶ added in v0.3.15
func (t *TrimResultInfo) StructTrimmedPercentage() float64
func (*TrimResultInfo) StructsLeft ¶ added in v0.3.15
func (t *TrimResultInfo) StructsLeft() int
type Trimmer ¶
type Trimmer struct {
PreservedFiles []string
// contains filtered or unexported fields
}
type YamlArguments ¶ added in v0.3.3
type YamlArguments struct {
Methods []string `yaml:"methods,omitempty"`
Preserve *bool `yaml:"preserve,omitempty"`
PreservedStructs []string `yaml:"preserved_structs,omitempty"`
DisablePreserveComment *bool `yaml:"disable_preserve_comment,omitempty"`
MatchGoName *bool `yaml:"match_go_name,omitempty"`
PreservedFiles []string `yaml:"preserved_files,omitempty"`
}
func ParseYamlConfig ¶ added in v0.3.3
func ParseYamlConfig(path string) *YamlArguments
Click to show internal directories.
Click to hide internal directories.