Add notification hook and run summary
This commit is contained in:
9
internal/notify/noop.go
Normal file
9
internal/notify/noop.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package notify
|
||||
|
||||
import "context"
|
||||
|
||||
type Noop struct{}
|
||||
|
||||
func (Noop) Notify(ctx context.Context, event Event) error {
|
||||
return ctx.Err()
|
||||
}
|
||||
25
internal/notify/notify.go
Normal file
25
internal/notify/notify.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package notify
|
||||
|
||||
import "context"
|
||||
|
||||
type Event struct {
|
||||
PipelineID string
|
||||
DestinationID string
|
||||
BundleID string
|
||||
BundlePath string
|
||||
Action string
|
||||
Outputs []Output
|
||||
}
|
||||
|
||||
type Output struct {
|
||||
Path string
|
||||
Kind string
|
||||
SourcePath string
|
||||
Transform string
|
||||
SHA256 string
|
||||
Size int64
|
||||
}
|
||||
|
||||
type Notifier interface {
|
||||
Notify(ctx context.Context, event Event) error
|
||||
}
|
||||
Reference in New Issue
Block a user