Documentation ¶
Index ¶
- Constants
- Variables
- func CleanAllRule(stage *log.Stage)
- func LoadRuleWithDir(stage *log.Stage, dir string) error
- func LoadRuleWithLocal(stage *log.Stage, path string) error
- func ReLoadRuleWithDir(stage *log.Stage, dir string) error
- func RegistryRule(stage *log.Stage, info Info)
- func RegistryRuleAndStoreToLocal(stage *log.Stage, info Info) error
- type Golang
- func (g *Golang) AddRelyOn(recipient string, dependency action.Action) error
- func (g *Golang) Compile() error
- func (g *Golang) Do(ctx context.Context) error
- func (g *Golang) Get(name string) (*action.Value, error)
- func (g *Golang) Info() Info
- func (g *Golang) Set(recipient string, value *action.Value) error
- func (g *Golang) SetError(i interface{})
- type GolangAction
- type Info
- type Rule
- type RuleConfig
- type RuleType
Constants ¶
View Source
const ( RULE_TAG_NAME = "rule_name" RULE_TAG_RELY_ON = "rule_rely_on" // json format RULE_TAG_VERSION = "rule_version" RULE_TAG_DESCRIPTION = "rule_description" RULE_TAG_PARAMS = "rule_params" //json format )
View Source
const (
ConfigTag = "//--config--"
)
View Source
const (
RuleTypeGo = "go"
)
Variables ¶
Functions ¶
func CleanAllRule ¶
func RegistryRule ¶
Types ¶
type Golang ¶
type Golang struct {
// contains filtered or unexported fields
}
type GolangAction ¶
type GolangAction struct {
// contains filtered or unexported fields
}
func (*GolangAction) Description ¶
func (g *GolangAction) Description() string
func (*GolangAction) Func ¶
func (g *GolangAction) Func() func(params ...interface{}) (map[string]*action.Value, error)
func (*GolangAction) Name ¶
func (g *GolangAction) Name() string
func (*GolangAction) Version ¶
func (g *GolangAction) Version() float32
type Info ¶
type Info interface { Name() string Description() string Version() float32 OriginalContent() string Author() string RuleType() RuleType GetRelyOn() map[string]string // map[recipient]dependency GetParams() map[string]*action.Value // the dynamic parameters and default values that the rule can accept are recorded here Key() string }
type Rule ¶
type Rule interface { Info() Info Set(recipient string, value *action.Value) error AddRelyOn(recipient string, dependency action.Action) error Get(name string) (*action.Value, error) // Generally, you can get it after the rule is executed. Do(ctx context.Context) error Compile() error // be careful not to recompile }
type RuleConfig ¶
type RuleConfig map[string]interface{}
Click to show internal directories.
Click to hide internal directories.