Files
cocos/manager/vm/vm.go
T
Sammy Kerata Oina bceb1727d1 NOISSUE - Use Mockery config (#323)
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
2024-11-28 15:11:13 +01:00

43 lines
961 B
Go

// Copyright (c) Ultraviolet
// SPDX-License-Identifier: Apache-2.0
package vm
import (
"github.com/ultravioletrs/cocos/agent"
pkgmanager "github.com/ultravioletrs/cocos/pkg/manager"
"google.golang.org/protobuf/types/known/timestamppb"
)
// VM represents a virtual machine.
type VM interface {
Start() error
Stop() error
SendAgentConfig(ac agent.Computation) error
SetProcess(pid int) error
GetProcess() int
GetCID() int
Transition(newState pkgmanager.ManagerState) error
State() string
GetConfig() interface{}
}
type Provider func(config interface{}, eventSender EventSender, computationId string) VM
type Event struct {
EventType string
Timestamp *timestamppb.Timestamp
ComputationId string
Details []byte
Originator string
Status string
}
type Log struct {
Message string
ComputationId string
Level string
Timestamp *timestamppb.Timestamp
}
type EventSender func(event interface{}) error