node_checker

package
v0.0.0-...-f734696 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseClockUTC

func ParseClockUTC(s string) (time.Time, error)

func ParseDateValue

func ParseDateValue(value string) string

func RunCheckTasks

func RunCheckTasks(configFilePath string)

func RunNodeChecker

func RunNodeChecker(checker *NodeChecker)

Types

type ConditionStatus

type ConditionStatus uint
const (
	UnChecked ConditionStatus = iota
	ConditionFit
	ConditionUnFit
)

func (ConditionStatus) String

func (status ConditionStatus) String() string

type Config

type Config struct {
	EcflowConfig *EcflowServerConfig
	Config       ConfigDict
	Checkers     []*NodeChecker
}

func (*Config) ReadCheckTaskList

func (config *Config) ReadCheckTaskList() error

func (*Config) ReadConfig

func (config *Config) ReadConfig(path string) error

func (*Config) ReadEcflowServerConfig

func (config *Config) ReadEcflowServerConfig()

type ConfigArray

type ConfigArray []interface{}

type ConfigDict

type ConfigDict map[interface{}]interface{}

type EcflowServerConfig

type EcflowServerConfig struct {
	Target string
	Owner  string
	Repo   string
	Host   string
	Port   string
}

type NodeCheckItem

type NodeCheckItem struct {
	workflowmodel.WorkflowNodeCondition
	ConditionFlag ConditionStatus
}

func (*NodeCheckItem) CheckCondition

func (item *NodeCheckItem) CheckCondition(node *workflowmodel.WorkflowNode)

type NodeCheckTask

type NodeCheckTask struct {
	Name           string
	Triggers       []Trigger
	NodeCheckItems []NodeCheckItem

	TriggerFlag TriggerStatus
}

func (*NodeCheckTask) Check

func (task *NodeCheckTask) Check(node *workflowmodel.WorkflowNode) ConditionStatus

func (*NodeCheckTask) Evaluate

func (task *NodeCheckTask) Evaluate() TriggerStatus

func (*NodeCheckTask) IsAllFit

func (task *NodeCheckTask) IsAllFit() ConditionStatus

type NodeChecker

type NodeChecker struct {
	Name string
	EcflowServerConfig

	NodePath string

	CheckTasks []NodeCheckTask
	// contains filtered or unexported fields
}

func (*NodeChecker) CheckAll

func (checker *NodeChecker) CheckAll()

func (*NodeChecker) EvaluateAll

func (checker *NodeChecker) EvaluateAll() bool

func (*NodeChecker) FetchWorkflowNode

func (checker *NodeChecker) FetchWorkflowNode() error

type TimeTrigger

type TimeTrigger struct {
	BeginTime time.Time
	EndTime   time.Time
}

func (*TimeTrigger) Evaluate

func (t *TimeTrigger) Evaluate() bool

type Trigger

type Trigger interface {
	Evaluate() bool
}

type TriggerStatus

type TriggerStatus uint
const (
	UnEvaluated TriggerStatus = iota
	EvaluatedFit
	EvaluatedUnFit
)

func (TriggerStatus) String

func (status TriggerStatus) String() string

Jump to

Keyboard shortcuts

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