config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RESTYPE_RULESESSION = "rulesession"
)

Variables

This section is empty.

Functions

func GetActionFunction

func GetActionFunction(id string) model.ActionFunction

Get gets specified ActionFunction

func GetConditionEvaluator

func GetConditionEvaluator(id string) model.ConditionEvaluator

Get gets specified ConditionEvaluator

func GetOrCreateRuleSessionFromConfig

func GetOrCreateRuleSessionFromConfig(name string, config *RuleSession) (model.RuleSession, error)

todo this should probably move to ruleapi

func GetStartupRSFunction

func GetStartupRSFunction(rsName string) (startupFn model.StartupRSFunction)

func RegisterActionFunction

func RegisterActionFunction(id string, actionFunction model.ActionFunction) error

Register registers the specified ActionFunction

func RegisterConditionEvaluator

func RegisterConditionEvaluator(id string, conditionEvaluator model.ConditionEvaluator) error

Register registers the specified ConditionEvaluator

func RegisterStartupRSFunction

func RegisterStartupRSFunction(rsName string, startupFn model.StartupRSFunction) error

Register registers the specified StartupRSFunction

Types

type Condition

type Condition struct {
	Name        string
	Identifiers []string
	Evaluator   model.ConditionEvaluator
}

func (*Condition) UnmarshalJSON

func (c *Condition) UnmarshalJSON(d []byte) error

type ResourceManager

type ResourceManager struct {
	// contains filtered or unexported fields
}

func NewResourceManager

func NewResourceManager() *ResourceManager

func (*ResourceManager) GetResource

func (m *ResourceManager) GetResource(id string) interface{}

func (*ResourceManager) GetRuleSessionConfig

func (m *ResourceManager) GetRuleSessionConfig(uri string) (*RuleSession, error)

func (*ResourceManager) LoadResource

func (m *ResourceManager) LoadResource(resConfig *resource.Config) error

type Rule

type Rule struct {
	Name       string
	Conditions []*Condition
	ActionFunc model.ActionFunction
	Priority   int
}

func (*Rule) UnmarshalJSON

func (c *Rule) UnmarshalJSON(d []byte) error

type RuleSession

type RuleSession struct {
	Rules []*Rule `json:"rules"`
}

Jump to

Keyboard shortcuts

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