Use go-events package
TBD: Queue not converted yet Signed-off-by: Elliot Pahl <elliot.pahl@gmail.com>
This commit is contained in:
parent
2d1126ecc1
commit
800cb95821
25 changed files with 1354 additions and 530 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/docker/distribution/configuration"
|
||||
events "github.com/docker/go-events"
|
||||
)
|
||||
|
||||
// EndpointConfig covers the optional configuration parameters for an active
|
||||
|
@ -42,7 +43,7 @@ func (ec *EndpointConfig) defaults() {
|
|||
// services when events are written. Writes are non-blocking and always
|
||||
// succeed for callers but events may be queued internally.
|
||||
type Endpoint struct {
|
||||
Sink
|
||||
events.Sink
|
||||
url string
|
||||
name string
|
||||
|
||||
|
@ -64,7 +65,7 @@ func NewEndpoint(name, url string, config EndpointConfig) *Endpoint {
|
|||
endpoint.Sink = newHTTPSink(
|
||||
endpoint.url, endpoint.Timeout, endpoint.Headers,
|
||||
endpoint.Transport, endpoint.metrics.httpStatusListener())
|
||||
endpoint.Sink = newRetryingSink(endpoint.Sink, endpoint.Threshold, endpoint.Backoff)
|
||||
endpoint.Sink = events.NewRetryingSink(endpoint.Sink, events.NewBreaker(endpoint.Threshold, endpoint.Backoff))
|
||||
endpoint.Sink = newEventQueue(endpoint.Sink, endpoint.metrics.eventQueueListener())
|
||||
mediaTypes := append(config.Ignore.MediaTypes, config.IgnoredMediaTypes...)
|
||||
endpoint.Sink = newIgnoredSink(endpoint.Sink, mediaTypes, config.Ignore.Actions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue