config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: BSD-3-Clause Imports: 10 Imported by: 9

Documentation

Index

Constants

View Source
const (
	RESTYPE_RULESESSION = "rulesession"
)

Variables

This section is empty.

Functions

func GetActionFunction

func GetActionFunction(id string) model.ActionFunction

GetActionFunction gets specified ActionFunction

func GetActionFunctionID added in v0.1.1

func GetActionFunctionID(actionFn model.ActionFunction) string

GetActionFunctionID get ActionFunction id based on the function reference

func GetConditionEvaluator

func GetConditionEvaluator(id string) model.ConditionEvaluator

GetConditionEvaluator gets specified ConditionEvaluator

func GetConditionEvaluatorID added in v0.1.1

func GetConditionEvaluatorID(conditionEvaluator model.ConditionEvaluator) string

GetConditionEvaluatorID gets ConditionEvaluator Id based on the function reference

func GetStartupRSFunction

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

GetStartupRSFunction gets registered StartupRSFunction

func RegisterActionFunction

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

RegisterActionFunction registers the specified ActionFunction

func RegisterConditionEvaluator

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

RegisterConditionEvaluator registers the specified ConditionEvaluator

func RegisterStartupRSFunction

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

RegisterStartupRSFunction registers the specified StartupRSFunction

Types

type ConditionDescriptor added in v0.1.1

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

ConditionDescriptor defines a condition in a rule

func (*ConditionDescriptor) MarshalJSON added in v0.1.1

func (c *ConditionDescriptor) MarshalJSON() ([]byte, error)

func (*ConditionDescriptor) UnmarshalJSON added in v0.1.1

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

type DefinitionConfig added in v0.1.1

type DefinitionConfig struct {
	Name     string               `json:"name"`
	Metadata *metadata.IOMetadata `json:"metadata"`
	Rules    []*RuleDescriptor    `json:"rules"`
}

metadata support

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) GetRuleActionDescriptor added in v0.1.1

func (m *ResourceManager) GetRuleActionDescriptor(uri string) (*RuleActionDescriptor, error)

func (*ResourceManager) GetRuleSessionDescriptor added in v0.1.1

func (m *ResourceManager) GetRuleSessionDescriptor(uri string) (*RuleSessionDescriptor, error)

func (*ResourceManager) LoadResource

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

type RuleActionDescriptor added in v0.1.1

type RuleActionDescriptor struct {
	Name       string               `json:"name"`
	IOMetadata *metadata.IOMetadata `json:"metadata"`
	Rules      []*RuleDescriptor    `json:"rules"`
}

type RuleDescriptor added in v0.1.1

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

RuleDescriptor defines a rule

func (*RuleDescriptor) MarshalJSON added in v0.1.1

func (c *RuleDescriptor) MarshalJSON() ([]byte, error)

func (*RuleDescriptor) UnmarshalJSON added in v0.1.1

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

type RuleSessionDescriptor added in v0.1.1

type RuleSessionDescriptor struct {
	Rules []*RuleDescriptor `json:"rules"`
}

Jump to

Keyboard shortcuts

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