-
Notifications
You must be signed in to change notification settings - Fork 86
/
types.go
36 lines (30 loc) · 1.09 KB
/
types.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
34
35
36
package publisher
import (
"context"
"github.com/bacalhau-project/bacalhau/pkg/lib/provider"
"github.com/bacalhau-project/bacalhau/pkg/models"
)
// PublisherProvider returns a publisher for the given publisher type
type PublisherProvider = provider.Provider[Publisher]
// Publisher is the interface for publishing results of a job
// The job spec will choose which publisher(s) it wants to use
// (there can be multiple publishers configured)
type Publisher interface {
provider.Providable
// Validate the job's publisher configuration
ValidateJob(ctx context.Context, j models.Job) error
// compute node
//
// once the results have been verified we publish them
// this will result in a "publish" event that will keep track
// of the details of the storage spec where the results live
// the returned storage spec might be nill as jobs
// can have multiple publishers and some publisher
// implementations don't concern themselves with storage
// (e.g. notify slack)
PublishResult(
ctx context.Context,
execution *models.Execution,
resultPath string,
) (models.SpecConfig, error)
}