-
Notifications
You must be signed in to change notification settings - Fork 145
/
stream_event.go
33 lines (24 loc) · 939 Bytes
/
stream_event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package repository
import (
"context"
"time"
"github.com/hatchet-dev/hatchet/internal/repository/prisma/dbsqlc"
)
type CreateStreamEventOpts struct {
// The step run id
StepRunId string `validate:"required,uuid"`
// (optional) The time when the StreamEvent was created.
CreatedAt *time.Time
// (required) The message of the Stream Event.
Message []byte `validate:"required,min=1"`
// (optional) The metadata of the Stream Event.
Metadata []byte
}
type StreamEventsEngineRepository interface {
// PutStreamEvent creates a new StreamEvent line.
PutStreamEvent(ctx context.Context, tenantId string, opts *CreateStreamEventOpts) (*dbsqlc.StreamEvent, error)
// GetStreamEvent returns a StreamEvent line by id.
GetStreamEvent(ctx context.Context, tenantId string, streamEventId int64) (*dbsqlc.StreamEvent, error)
// CleanupStreamEvents deletes all stale StreamEvents.
CleanupStreamEvents(ctx context.Context) error
}