Documentation
¶
Index ¶
- Constants
- func CopyAPITo(target string, pkgName string) (string, error)
- func CopyOtelSetupTo(pkgName, target string) (string, error)
- func CopyPkgTo(target string) error
- func FindFileRuleByHash(hash uint64) *api.InstFileRule
- func FindFuncRuleByHash(hash uint64) *api.InstFuncRule
- func FindHookFile(rule *api.InstFuncRule) (string, error)
- func FindRuleByHash(hash uint64) api.InstRule
- func FindRuleDepFile(rule api.InstRule, path string) (string, error)
- func FindRuleFiles(rule api.InstRule) ([]string, error)
- func FindStructRuleByHash(hash uint64) *api.InstStructRule
- func InitRules() error
- func ReadRuleFile(path string) (string, error)
- func StoreRuleBundles(bundles []*RuleBundle) error
- type RuleBundle
- func (rb *RuleBundle) AddFile2FuncRule(file string, rule *api.InstFuncRule)
- func (rb *RuleBundle) AddFile2StructRule(file string, rule *api.InstStructRule)
- func (rb *RuleBundle) AddFileRule(rule *api.InstFileRule)
- func (rb *RuleBundle) IsValid() bool
- func (rb *RuleBundle) Merge(new *RuleBundle) (*RuleBundle, error)
Constants ¶
View Source
const ( RuleFile = "rule.go" UsedRuleJsonFile = "used_rules.json" EmbededFs = "embededfs" )
Variables ¶
This section is empty.
Functions ¶
func CopyOtelSetupTo ¶
func FindFileRuleByHash ¶
func FindFileRuleByHash(hash uint64) *api.InstFileRule
func FindFuncRuleByHash ¶
func FindFuncRuleByHash(hash uint64) *api.InstFuncRule
func FindHookFile ¶ added in v0.0.2
func FindHookFile(rule *api.InstFuncRule) (string, error)
func FindRuleByHash ¶
func FindRuleDepFile ¶ added in v0.0.2
func FindStructRuleByHash ¶
func FindStructRuleByHash(hash uint64) *api.InstStructRule
func ReadRuleFile ¶
func StoreRuleBundles ¶
func StoreRuleBundles(bundles []*RuleBundle) error
Types ¶
type RuleBundle ¶
type RuleBundle struct { PackageName string // Short package name, e.g. "echo" ImportPath string // Full import path, e.g. "github.com/labstack/echo/v4" FileRules []uint64 // File rules File2FuncRules map[string]map[string][]uint64 File2StructRules map[string]map[string][]uint64 }
RuleBundle is a collection of rules that matched with one compilation action
func LoadRuleBundles ¶
func LoadRuleBundles() ([]*RuleBundle, error)
func NewRuleBundle ¶
func NewRuleBundle(importPath string) *RuleBundle
func (*RuleBundle) AddFile2FuncRule ¶
func (rb *RuleBundle) AddFile2FuncRule(file string, rule *api.InstFuncRule)
func (*RuleBundle) AddFile2StructRule ¶
func (rb *RuleBundle) AddFile2StructRule(file string, rule *api.InstStructRule)
func (*RuleBundle) AddFileRule ¶
func (rb *RuleBundle) AddFileRule(rule *api.InstFileRule)
func (*RuleBundle) IsValid ¶
func (rb *RuleBundle) IsValid() bool
func (*RuleBundle) Merge ¶
func (rb *RuleBundle) Merge(new *RuleBundle) (*RuleBundle, error)
Click to show internal directories.
Click to hide internal directories.