sshpoke/internal/server/driver/base/iface.go

23 lines
550 B
Go
Raw Normal View History

package base
2023-11-17 20:39:00 +03:00
import (
"context"
"github.com/Neur0toxine/sshpoke/internal/config"
"github.com/Neur0toxine/sshpoke/pkg/dto"
"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)
type EventStatusCallback func(status dto.EventStatus)
2023-11-17 20:39:00 +03:00
type Driver interface {
Name() string
SetEventStatusCallback(callback EventStatusCallback)
PushEventStatus(status dto.EventStatus)
Handle(event dto.Event) error
2023-11-17 20:39:00 +03:00
Driver() config.DriverType
Log() *zap.SugaredLogger
2023-11-17 20:39:00 +03:00
WaitForShutdown()
}