resource

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuleFile         = "rule.go"
	UsedRuleJsonFile = "used_rules.json"
	EmbededFs        = "embededfs"
)

Variables

This section is empty.

Functions

func CopyAPITo

func CopyAPITo(target string, pkgName string) (string, error)

func CopyOtelSetupTo

func CopyOtelSetupTo(pkgName, target string) (string, error)

func CopyPkgTo

func CopyPkgTo(target string) error

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 FindRuleByHash(hash uint64) api.InstRule

func FindRuleDepFile added in v0.0.2

func FindRuleDepFile(rule api.InstRule, path string) (string, error)

func FindRuleFiles

func FindRuleFiles(rule api.InstRule) ([]string, error)

func FindStructRuleByHash

func FindStructRuleByHash(hash uint64) *api.InstStructRule

func InitRules

func InitRules() error

func ReadRuleFile

func ReadRuleFile(path string) (string, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL