sshpoke/pkg/plugin/stream.go

20 lines
396 B
Go

package plugin
import (
"github.com/Neur0toxine/sshpoke/pkg/convert"
"github.com/Neur0toxine/sshpoke/pkg/dto"
"github.com/Neur0toxine/sshpoke/pkg/plugin/pb"
)
type Stream struct {
stream pb.PluginService_EventClient
}
func (s *Stream) Receive() (dto.Event, error) {
data, err := s.stream.Recv()
if err != nil {
return dto.Event{}, err
}
return convert.MessageToAppEvent(data), nil
}