core

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 8 Imported by: 16

Documentation

Index

Constants

View Source
const (
	PLUGIN_EVENT_START = iota
	PLUGIN_EVENT_STOP
	PLUGIN_EVENT_STATUS
)
View Source
const (
	TRCSHHIVEK_CERT = "Common/servicecert.crt.mf.tmpl"
	TRCSHHIVEK_KEY  = "Common/servicekey.key.mf.tmpl"
)
View Source
const CHAT_BROADCAST_CHANNEL = "ChatBroadcastChannel"
View Source
const CHAT_CHANNEL = "ChatChannel"
View Source
const CMD_CHANNEL = "CommandChannel"
View Source
const DATA_FLOW_STAT_CHANNEL = "DataFlowStatisticsChannel"
View Source
const ERROR_CHANNEL = "ErrorChannel"
View Source
const PLUGIN_CHANNEL_EVENT_IN = "PluginChannelEventIn"
View Source
const PLUGIN_CHANNEL_EVENT_OUT = "PluginChannelEventOut"
View Source
const PLUGIN_EVENT_CHANNELS_MAP_KEY = "PluginEventChannelsMap"
View Source
const RFC_ISO_8601 = "2006-01-02 15:04:05 -0700 MST"

Variables

This section is empty.

Functions

func SanitizeForLogging added in v2.1.2

func SanitizeForLogging(errMsg string) string

Types

type ChatMsg added in v2.0.6

type ChatMsg struct {
	ChatId      *string
	Name        *string //plugin name
	KernelId    *string
	IsBroadcast bool
	Query       *[]string
	Response    *string
}

type ConfigContext added in v2.0.4

type ConfigContext struct {
	Config            *map[string]interface{}
	Env               string // Env being processed
	Region            string // Region processed
	Start             func(string)
	ChatSenderChan    *chan *ChatMsg
	ChatReceiverChan  *chan *ChatMsg
	ChatBroadcastChan *chan *ChatMsg
	CmdSenderChan     *chan KernelCmd
	CmdReceiverChan   *chan KernelCmd
	ErrorChan         *chan error     // Channel for sending errors
	DfsChan           *chan *TTDINode // Channel for sending data flow statistics
	ArgosId           string          // Identifier for data flow statistics
	ConfigCerts       *map[string][]byte
	Log               *log.Logger
}

func Init added in v2.0.5

func Init(properties *map[string]interface{},
	commonCertPath string,
	commonKeyPath string,
	commonPath string,
	dfsKeyHeader string,
	startHandler func(string),
	receiverHandler func(chan KernelCmd),
	chatHandler func(chan *ChatMsg),
) (*ConfigContext, error)

type DeliverStatCtx

type DeliverStatCtx struct {
	FlowGroup string
	FlowName  string
	StateCode string
	StateName string
	LogStat   bool
	LogFunc   *func(string, error)
	//TODO: Make not interface
	TimeStart      interface{} //either string or time.Time
	LastTestedDate interface{} //either string or time.Time
	TimeSplit      interface{} //either float64 or time.Duration
	Mode           interface{} //either float64 or int
}

func (*DeliverStatCtx) GetElapsedTimeStr

func (dsc *DeliverStatCtx) GetElapsedTimeStr() string

func (*DeliverStatCtx) GetLastTestedDateStr

func (dsc *DeliverStatCtx) GetLastTestedDateStr() string

func (*DeliverStatCtx) GetModeInt

func (dsc *DeliverStatCtx) GetModeInt() int

type KernelCmd added in v2.1.1

type KernelCmd struct {
	PluginName string
	Command    int
}

type TTDINode

type TTDINode struct {
	*mashupsdk.MashupDetailedElement
	ChildNodes []*TTDINode
}

func InitDataFlow

func InitDataFlow(logF func(string, error), name string, logS bool) *TTDINode

func (*TTDINode) EfficientLog

func (dfs *TTDINode) EfficientLog(statMap map[string]interface{}, logF func(string, error))

Doesn't deserialize statistic data for updatedataflowstatistic

func (*TTDINode) FinishStatistic

func (dfs *TTDINode) FinishStatistic(id string, indexPath string, idName string, logger *log.Logger, vaultWriteBack bool, dsc *DeliverStatCtx) map[string]interface{}

func (*TTDINode) FinishStatisticLog

func (dfs *TTDINode) FinishStatisticLog()

Set logFunc and logStat = false to use this otherwise it logs as states change with logStat = true

func (*TTDINode) GetDeliverStatCtx

func (dfs *TTDINode) GetDeliverStatCtx(decodedMap ...map[string]interface{}) (*DeliverStatCtx, map[string]interface{}, error)

func (*TTDINode) Log

func (dfs *TTDINode) Log()

func (*TTDINode) MapStatistic

func (dfs *TTDINode) MapStatistic(data map[string]interface{}, logger *log.Logger)

func (*TTDINode) StatisticToMap

func (dfs *TTDINode) StatisticToMap() map[string]interface{}

Creating map representation for easier use by persistence functions

func (*TTDINode) UpdateDataFlowStatistic

func (dfs *TTDINode) UpdateDataFlowStatistic(flowG string, flowN string, stateN string, stateC string, mode int, logF func(string, error))

func (*TTDINode) UpdateDataFlowStatisticWithTime

func (dfs *TTDINode) UpdateDataFlowStatisticWithTime(flowG string, flowN string, stateN string, stateC string, mode int, elapsedTime time.Duration)

Jump to

Keyboard shortcuts

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