add observer
This commit is contained in:
22
observer/observer.go
Normal file
22
observer/observer.go
Normal file
@ -0,0 +1,22 @@
|
||||
package observer
|
||||
|
||||
import "context"
|
||||
|
||||
type Options struct{}
|
||||
|
||||
type Option func(opts *Options)
|
||||
|
||||
type Observer interface {
|
||||
Observe(ctx context.Context, events []Event, opts ...Option) error
|
||||
}
|
||||
|
||||
type EventType string
|
||||
|
||||
const (
|
||||
EventStatus EventType = "status"
|
||||
EventStats EventType = "stats"
|
||||
)
|
||||
|
||||
type Event interface {
|
||||
Type() EventType
|
||||
}
|
Reference in New Issue
Block a user