devicegroups

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const LAST_CALL_INFO = "lastcall."
View Source
const METADATA_KEY_PREFIX = "meta."
View Source
const RESULT_KEY_PREFIX = "result."
View Source
const SUB_TASK_STATE_KEY_PREFIX = "ststate."
View Source
const Seperator = "$"

Variables

View Source
var ErrNotFount = memcache.ErrCacheMiss
View Source
var LocalDbSize = 100 * 1024 * 1024 //100MB
View Source
var MaxRetries = 10

Functions

func DecodeModifierParameter

func DecodeModifierParameter(parameter string) (result map[string][]string, err error)

func EncodeModifierParameter

func EncodeModifierParameter(parameter map[string][]string) (result string)

func SplitModifier

func SplitModifier(id string) (pureId string, modifier map[string][]string)

Types

type Callback

type Callback = func(command messages.Command, task messages.CamundaExternalTask) (request *messages.KafkaMessage, event *messages.EventRequest, err error)

Callback is implemented by: lib.CmdWorker::CreateProtocolMessage()

type DbInterface

type DbInterface interface {
	Get(key string) (*memcache.Item, error)
	Set(item *memcache.Item) error
	Delete(key string) error
}

type DeviceGroups

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

func New

func New(scheduler string, camunda interfaces.CamundaInterface, devicerepo devicerepository.RepoInterface, protocolMessageCallback Callback, currentlyRunningTimeoutInMs int64, expirationInSeconds int32, memcachedUrls []string, memcachedTimeout string, memcachedMaxIdleConns int64, filterEvents bool) *DeviceGroups

func NewWithKeyValueStore

func NewWithKeyValueStore(scheduler string, camunda interfaces.CamundaInterface, devicerepo devicerepository.RepoInterface, protocolMessageCallback Callback, currentlyRunningTimeoutInMs int64, expirationInSeconds int32, db DbInterface, filterEvents bool) *DeviceGroups

func (*DeviceGroups) GetEmptyServiceSubTasks

func (this *DeviceGroups) GetEmptyServiceSubTasks(request messages.Command, task messages.CamundaExternalTask) (result []messages.GroupTaskMetadataElement, err error)

func (*DeviceGroups) GetGroupSubTasks

func (this *DeviceGroups) GetGroupSubTasks(request messages.Command, task messages.CamundaExternalTask) (result []messages.GroupTaskMetadataElement, err error)

func (*DeviceGroups) GetSubTasks

func (this *DeviceGroups) GetSubTasks(request messages.Command, task messages.CamundaExternalTask) (result []messages.GroupTaskMetadataElement, err error)

func (*DeviceGroups) ProcessCommand

func (this *DeviceGroups) ProcessCommand(command messages.Command, task messages.CamundaExternalTask, caller string) (completed bool, nextMessages messages.RequestInfoList, finishedResults []interface{}, err error)

func (*DeviceGroups) ProcessResponse

func (this *DeviceGroups) ProcessResponse(subTaskId string, subResult interface{}) (parent messages.GroupTaskMetadataElement, results []interface{}, finished bool, err error)

type LastCallInfo

type LastCallInfo struct {
	Caller string    `json:"caller"`
	Time   time.Time `json:"time"`
}

type LocalDb

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

func NewLocalDb

func NewLocalDb() *LocalDb

func (*LocalDb) Delete

func (this *LocalDb) Delete(key string) error

func (*LocalDb) Get

func (this *LocalDb) Get(key string) (result *memcache.Item, err error)

func (*LocalDb) Set

func (this *LocalDb) Set(item *memcache.Item) error

type MessageWithState

type MessageWithState struct {
	Message messages.KafkaMessage
	State   SubTaskState
}

type RequestInfo

type RequestInfo = messages.RequestInfo

type RequestInfoList

type RequestInfoList = messages.RequestInfoList

type SubResultWrapper

type SubResultWrapper struct {
	Failed bool
	Value  interface{}
}

type SubTaskState

type SubTaskState = messages.SubTaskState

Jump to

Keyboard shortcuts

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