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 ¶
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 ¶
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 ¶
type TrimResultInfo ¶
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 ¶
func (t *TrimResultInfo) FieldTrimmedPercentage() float64
func (*TrimResultInfo) FieldsLeft ¶
func (t *TrimResultInfo) FieldsLeft() int
func (*TrimResultInfo) StructTrimmedPercentage ¶
func (t *TrimResultInfo) StructTrimmedPercentage() float64
func (*TrimResultInfo) StructsLeft ¶
func (t *TrimResultInfo) StructsLeft() int
type YamlArguments ¶
type YamlArguments struct { Methods []string `yaml:"methods,omitempty"` Preserve *bool `yaml:"preserve,omitempty"` PreservedStructs []string `yaml:"preserved_structs,omitempty"` MatchGoName *bool `yaml:"match_go_name,omitempty"` }
func ParseYamlConfig ¶
func ParseYamlConfig(path string) *YamlArguments
Click to show internal directories.
Click to hide internal directories.