2023-11-18 16:14:39 +03:00
|
|
|
package base
|
2023-11-17 20:39:00 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/Neur0toxine/sshpoke/internal/config"
|
2023-11-18 12:36:17 +03:00
|
|
|
"github.com/Neur0toxine/sshpoke/pkg/dto"
|
2023-11-18 16:14:39 +03:00
|
|
|
"go.uber.org/zap"
|
2023-11-17 20:39:00 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type DriverConstructor func(ctx context.Context, name string, params config.DriverParams) (Driver, error)
|
2023-11-18 16:14:39 +03:00
|
|
|
type EventStatusCallback func(status dto.EventStatus)
|
2023-11-17 20:39:00 +03:00
|
|
|
|
|
|
|
type Driver interface {
|
2023-11-18 12:36:17 +03:00
|
|
|
Name() string
|
2023-11-18 16:14:39 +03:00
|
|
|
SetEventStatusCallback(callback EventStatusCallback)
|
|
|
|
PushEventStatus(status dto.EventStatus)
|
2023-11-18 12:36:17 +03:00
|
|
|
Handle(event dto.Event) error
|
2023-11-17 20:39:00 +03:00
|
|
|
Driver() config.DriverType
|
2023-11-18 16:14:39 +03:00
|
|
|
Log() *zap.SugaredLogger
|
2023-11-17 20:39:00 +03:00
|
|
|
WaitForShutdown()
|
|
|
|
}
|