diff --git a/eventbus/gcp/eventbus.go b/eventbus/gcp/eventbus.go index 857c91aa..52be8acd 100644 --- a/eventbus/gcp/eventbus.go +++ b/eventbus/gcp/eventbus.go @@ -211,7 +211,7 @@ func (b *EventBus) handle(ctx context.Context, m eh.EventMatcher, h eh.EventHand select { case b.errCh <- eh.EventBusError{Err: err, Ctx: ctx}: default: - log.Printf("missed error in GCP event bus: %s", err) + log.Printf("eventhorizon: missed error in GCP event bus: %s", err) } // Retry the receive loop if there was an error. time.Sleep(time.Second) @@ -230,7 +230,7 @@ func (b *EventBus) handler(m eh.EventMatcher, h eh.EventHandler) func(ctx contex select { case b.errCh <- eh.EventBusError{Err: err, Ctx: ctx}: default: - log.Printf("missed error in GCP event bus: %s", err) + log.Printf("eventhorizon: missed error in GCP event bus: %s", err) } msg.Nack() return @@ -244,7 +244,7 @@ func (b *EventBus) handler(m eh.EventMatcher, h eh.EventHandler) func(ctx contex select { case b.errCh <- eh.EventBusError{Err: err, Ctx: ctx}: default: - log.Printf("missed error in GCP event bus: %s", err) + log.Printf("eventhorizon: missed error in GCP event bus: %s", err) } msg.Nack() return @@ -254,7 +254,7 @@ func (b *EventBus) handler(m eh.EventMatcher, h eh.EventHandler) func(ctx contex select { case b.errCh <- eh.EventBusError{Err: err, Ctx: ctx}: default: - log.Printf("missed error in GCP event bus: %s", err) + log.Printf("eventhorizon: missed error in GCP event bus: %s", err) } msg.Nack() return @@ -277,7 +277,7 @@ func (b *EventBus) handler(m eh.EventMatcher, h eh.EventHandler) func(ctx contex select { case b.errCh <- eh.EventBusError{Err: err, Ctx: ctx, Event: event}: default: - log.Printf("missed error in GCP event bus: %s", err) + log.Printf("eventhorizon: missed error in GCP event bus: %s", err) } msg.Nack() return diff --git a/eventbus/tracing/context.go b/eventbus/tracing/context.go new file mode 100644 index 00000000..f1750874 --- /dev/null +++ b/eventbus/tracing/context.go @@ -0,0 +1,67 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + "encoding/json" + "log" + + eh "github.com/looplab/eventhorizon" + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/ext" +) + +// The string keys to marshal the context. +const ( + tracingSpanKeyStr = "eh_tracing_span" +) + +func init() { + eh.RegisterContextMarshaler(func(ctx context.Context, vals map[string]interface{}) { + if span := opentracing.SpanFromContext(ctx); span != nil { + tracer := opentracing.GlobalTracer() + carrier := opentracing.TextMapCarrier{} + if err := tracer.Inject(span.Context(), opentracing.TextMap, &carrier); err != nil { + log.Printf("eventhorizon: could not inject tracing span: %s", err) + return + } + js, err := json.Marshal(carrier) + if err != nil { + log.Printf("eventhorizon: could not marshal tracing span: %s", err) + return + } + vals[tracingSpanKeyStr] = string(js) + } + }) + eh.RegisterContextUnmarshaler(func(ctx context.Context, vals map[string]interface{}) context.Context { + if js, ok := vals[tracingSpanKeyStr].(string); ok { + tracer := opentracing.GlobalTracer() + carrier := opentracing.TextMapCarrier{} + if err := json.Unmarshal([]byte(js), &carrier); err != nil { + log.Printf("eventhorizon: could not unmarshal tracing span: %s", err) + return ctx + } + parentSpanContext, err := tracer.Extract(opentracing.TextMap, carrier) + if err != nil && err != opentracing.ErrSpanContextNotFound { + log.Printf("eventhorizon: could not extract tracing span: %s", err) + return ctx + } + span := tracer.StartSpan("eventbus", ext.RPCServerOption(parentSpanContext)) + ctx = opentracing.ContextWithSpan(ctx, span) + } + return ctx + }) +} diff --git a/eventbus/tracing/eventbus.go b/eventbus/tracing/eventbus.go new file mode 100644 index 00000000..d93e363b --- /dev/null +++ b/eventbus/tracing/eventbus.go @@ -0,0 +1,53 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + + eh "github.com/looplab/eventhorizon" + "github.com/looplab/eventhorizon/middleware/eventhandler/tracing" +) + +// EventBus is an event bus wrapper that adds tracing. +type EventBus struct { + eh.EventBus + h eh.EventHandler +} + +// NewEventBus creates a EventBus. +func NewEventBus(eventBus eh.EventBus) *EventBus { + return &EventBus{ + EventBus: eventBus, + // Wrap the eh.EventHandler part of the bus with tracing middleware, + // set as producer to set the correct tags. + h: eh.UseEventHandlerMiddleware(eventBus, tracing.NewMiddleware()), + } +} + +// HandleEvent implements the HandleEvent method of the eventhorizon.EventHandler interface. +func (b *EventBus) HandleEvent(ctx context.Context, event eh.Event) error { + return b.h.HandleEvent(ctx, event) +} + +// AddHandler implements the AddHandler method of the eventhorizon.EventBus interface. +func (b *EventBus) AddHandler(ctx context.Context, m eh.EventMatcher, h eh.EventHandler) error { + if h == nil { + return eh.ErrMissingHandler + } + // Wrap the handlers in tracing middleware. + h = eh.UseEventHandlerMiddleware(h, tracing.NewMiddleware()) + return b.EventBus.AddHandler(ctx, m, h) +} diff --git a/eventbus/tracing/eventbus_test.go b/eventbus/tracing/eventbus_test.go new file mode 100644 index 00000000..9f7eef36 --- /dev/null +++ b/eventbus/tracing/eventbus_test.go @@ -0,0 +1,78 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "testing" + "time" + + "github.com/looplab/eventhorizon/eventbus" + "github.com/looplab/eventhorizon/eventbus/local" +) + +func TestEventBus(t *testing.T) { + group := local.NewGroup() + if group == nil { + t.Fatal("there should be a group") + } + innerBus1 := local.NewEventBus(group) + if innerBus1 == nil { + t.Fatal("there should be a bus") + } + innerBus2 := local.NewEventBus(group) + if innerBus2 == nil { + t.Fatal("there should be a bus") + } + + bus1 := NewEventBus(innerBus1) + if bus1 == nil { + t.Fatal("there should be a bus") + } + + bus2 := NewEventBus(innerBus2) + if bus2 == nil { + t.Fatal("there should be a bus") + } + + eventbus.AcceptanceTest(t, bus1, bus2, time.Second) +} + +func TestEventBusLoad(t *testing.T) { + innerBus := local.NewEventBus(nil) + if innerBus == nil { + t.Fatal("there should be a bus") + } + + bus := NewEventBus(innerBus) + if bus == nil { + t.Fatal("there should be a bus") + } + + eventbus.LoadTest(t, bus) +} + +func BenchmarkEventBus(b *testing.B) { + innerBus := local.NewEventBus(nil) + if innerBus == nil { + b.Fatal("there should be a bus") + } + + bus := NewEventBus(innerBus) + if bus == nil { + b.Fatal("there should be a bus") + } + + eventbus.Benchmark(b, bus) +} diff --git a/eventstore/trace/eventstore.go b/eventstore/recorder/eventstore.go similarity index 56% rename from eventstore/trace/eventstore.go rename to eventstore/recorder/eventstore.go index a4430878..f61a66c5 100644 --- a/eventstore/trace/eventstore.go +++ b/eventstore/recorder/eventstore.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package trace +package recorder import ( "context" @@ -21,12 +21,12 @@ import ( eh "github.com/looplab/eventhorizon" ) -// EventStore wraps an EventStore and adds debug tracing. +// EventStore wraps an EventStore and adds debug event recording. type EventStore struct { eh.EventStore - tracing bool - trace []eh.Event - traceMu sync.RWMutex + recording bool + record []eh.Event + recordMu sync.RWMutex } // NewEventStore creates a new EventStore. @@ -37,7 +37,7 @@ func NewEventStore(eventStore eh.EventStore) *EventStore { return &EventStore{ EventStore: eventStore, - trace: make([]eh.Event, 0), + record: make([]eh.Event, 0), } } @@ -47,44 +47,44 @@ func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersio return err } - // Only trace events that are successfully saved. - s.traceMu.Lock() - defer s.traceMu.Unlock() - if s.tracing { - s.trace = append(s.trace, events...) + // Only record events that are successfully saved. + s.recordMu.Lock() + defer s.recordMu.Unlock() + if s.recording { + s.record = append(s.record, events...) } return nil } -// StartTracing starts the tracing of events. -func (s *EventStore) StartTracing() { - s.traceMu.Lock() - defer s.traceMu.Unlock() +// StartRecording starts recording of handled events. +func (s *EventStore) StartRecording() { + s.recordMu.Lock() + defer s.recordMu.Unlock() - s.tracing = true + s.recording = true } -// StopTracing stops the tracing of events. -func (s *EventStore) StopTracing() { - s.traceMu.Lock() - defer s.traceMu.Unlock() +// StopRecording stops recording of handled events. +func (s *EventStore) StopRecording() { + s.recordMu.Lock() + defer s.recordMu.Unlock() - s.tracing = false + s.recording = false } -// GetTrace returns the events that happened during the tracing. -func (s *EventStore) GetTrace() []eh.Event { - s.traceMu.RLock() - defer s.traceMu.RUnlock() +// GetRecord returns the events that happened during the recording. +func (s *EventStore) GetRecord() []eh.Event { + s.recordMu.RLock() + defer s.recordMu.RUnlock() - return s.trace + return s.record } -// ResetTrace resets the trace. +// ResetTrace resets the record. func (s *EventStore) ResetTrace() { - s.traceMu.Lock() - defer s.traceMu.Unlock() + s.recordMu.Lock() + defer s.recordMu.Unlock() - s.trace = make([]eh.Event, 0) + s.record = make([]eh.Event, 0) } diff --git a/eventstore/trace/eventstore_test.go b/eventstore/recorder/eventstore_test.go similarity index 79% rename from eventstore/trace/eventstore_test.go rename to eventstore/recorder/eventstore_test.go index b5cebd63..e3b0c86a 100644 --- a/eventstore/trace/eventstore_test.go +++ b/eventstore/recorder/eventstore_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package trace +package recorder import ( "context" @@ -33,22 +33,22 @@ func TestEventStore(t *testing.T) { t.Fatal("there should be a store") } - // Run the actual test suite, with tracing enabled. - store.StartTracing() + // Run the actual test suite, with recording enabled. + store.StartRecording() savedEvents := eventstore.AcceptanceTest(t, context.Background(), store) - store.StopTracing() + store.StopRecording() - trace := store.GetTrace() - if !reflect.DeepEqual(trace, savedEvents) { - t.Error("there should be events traced:", trace) + record := store.GetRecord() + if !reflect.DeepEqual(record, savedEvents) { + t.Error("there should be events recorded:", record) } - // And then some more tracing specific testing. + // And then some more recording specific testing. store.ResetTrace() - trace = store.GetTrace() - if len(trace) != 0 { - t.Error("there should be no events traced:", trace) + record = store.GetRecord() + if len(record) != 0 { + t.Error("there should be no events recorded:", record) } event1 := savedEvents[0] @@ -70,12 +70,12 @@ func TestEventStore(t *testing.T) { t.Error("there should be no error:", err) } aggregate1events = append(aggregate1events, event1) - trace = store.GetTrace() - if len(trace) != 0 { - t.Error("there should be no events traced:", trace) + record = store.GetRecord() + if len(record) != 0 { + t.Error("there should be no events recorded:", record) } - // Load events without tracing. + // Load events without recording. events, err := store.Load(ctx, event1.AggregateID()) if err != nil { t.Error("there should be no error:", err) diff --git a/eventstore/tracing/eventstore.go b/eventstore/tracing/eventstore.go new file mode 100644 index 00000000..b4fdecf9 --- /dev/null +++ b/eventstore/tracing/eventstore.go @@ -0,0 +1,81 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + + "github.com/google/uuid" + eh "github.com/looplab/eventhorizon" + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/ext" +) + +// EventStore is a EventStore that adds tracing. +type EventStore struct { + eh.EventStore +} + +// NewEventStore creates a new EventStore. +func NewEventStore(eventStore eh.EventStore) *EventStore { + if eventStore == nil { + return nil + } + return &EventStore{ + EventStore: eventStore, + } +} + +// Save implements the Save method of the eventhorizon.EventStore interface. +func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error { + sp, ctx := opentracing.StartSpanFromContext(ctx, "EventStore.Save") + + err := s.EventStore.Save(ctx, events, originalVersion) + + // Use the first event for tracing metadata. + if len(events) > 0 { + sp.SetTag("eh.event_type", events[0].EventType()) + sp.SetTag("eh.aggregate_type", events[0].AggregateType()) + sp.SetTag("eh.aggregate_id", events[0].AggregateID()) + sp.SetTag("eh.version", events[0].Version()) + } + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return err +} + +// Load implements the Load method of the eventhorizon.EventStore interface. +func (s *EventStore) Load(ctx context.Context, id uuid.UUID) ([]eh.Event, error) { + sp, ctx := opentracing.StartSpanFromContext(ctx, "EventStore.Load") + + events, err := s.EventStore.Load(ctx, id) + + // Use the first event for tracing metadata. + if len(events) > 0 { + sp.SetTag("eh.event_type", events[0].EventType()) + sp.SetTag("eh.aggregate_type", events[0].AggregateType()) + sp.SetTag("eh.aggregate_id", events[0].AggregateID()) + sp.SetTag("eh.version", events[0].Version()) + } + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return events, err +} diff --git a/eventstore/tracing/eventstore_test.go b/eventstore/tracing/eventstore_test.go new file mode 100644 index 00000000..ad0c196c --- /dev/null +++ b/eventstore/tracing/eventstore_test.go @@ -0,0 +1,41 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + "testing" + + eh "github.com/looplab/eventhorizon" + "github.com/looplab/eventhorizon/eventstore" + "github.com/looplab/eventhorizon/eventstore/memory" +) + +func TestEventStore(t *testing.T) { + innerStore := memory.NewEventStore() + if innerStore == nil { + t.Fatal("there should be a store") + } + + store := NewEventStore(innerStore) + if store == nil { + t.Fatal("there should be a store") + } + + // Run the actual test suite, both for default and custom namespace. + eventstore.AcceptanceTest(t, context.Background(), store) + ctx := eh.NewContextWithNamespace(context.Background(), "ns") + eventstore.AcceptanceTest(t, ctx, store) +} diff --git a/examples/guestlist/domains/guestlist/projectors.go b/examples/guestlist/domains/guestlist/projectors.go index 887ed64c..03ecccd4 100644 --- a/examples/guestlist/domains/guestlist/projectors.go +++ b/examples/guestlist/domains/guestlist/projectors.go @@ -58,7 +58,7 @@ func NewInvitationProjector() *InvitationProjector { // ProjectorType implements the ProjectorType method of the Projector interface. func (p *InvitationProjector) ProjectorType() projector.Type { - return projector.Type("InvitationProjector") + return projector.Type(InvitationAggregateType.String()) } // Project implements the Project method of the Projector interface. @@ -135,7 +135,7 @@ func NewGuestListProjector(repo eh.ReadWriteRepo, eventID uuid.UUID) *GuestListP // HandlerType implements the HandlerType method of the eventhorizon.EventHandler interface. func (p *GuestListProjector) HandlerType() eh.EventHandlerType { - return eh.EventHandlerType("GuestListProjector") + return eh.EventHandlerType("GuestList") } // HandleEvent implements the HandleEvent method of the EventHandler interface. diff --git a/examples/todomvc/Dockerfile b/examples/todomvc/Dockerfile new file mode 100644 index 00000000..ee17bf50 --- /dev/null +++ b/examples/todomvc/Dockerfile @@ -0,0 +1,36 @@ +FROM golang:1.15-alpine3.12 as builder + +RUN apk -U upgrade && \ + apk add --update ca-certificates tzdata curl gzip + +RUN curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz && \ + gunzip elm.gz && \ + chmod +x elm && \ + mv elm /usr/local/bin/ + +WORKDIR /eventhorizon +COPY go.mod go.mod +RUN go mod download +COPY . . + +# Build frontend. +WORKDIR /eventhorizon/examples/todomvc/frontend +RUN elm make src/Main.elm --output=elm.js + +# Build backend. +WORKDIR /eventhorizon/examples/todomvc/backend +RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build . + +FROM alpine:3.12 + +# Import certs and timezone data. +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ +COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo + +COPY --from=builder /eventhorizon/examples/todomvc/frontend/index.html frontend/ +COPY --from=builder /eventhorizon/examples/todomvc/frontend/elm.js frontend/ +COPY --from=builder /eventhorizon/examples/todomvc/frontend/css/* frontend/css/ + +COPY --from=builder /eventhorizon/examples/todomvc/backend/backend . + +ENTRYPOINT ["/backend"] diff --git a/examples/todomvc/Makefile b/examples/todomvc/Makefile index 2bdc5616..5e23c384 100644 --- a/examples/todomvc/Makefile +++ b/examples/todomvc/Makefile @@ -1,8 +1,24 @@ -default: run +default: build + +.PHONY: build +build: + docker-compose build todomvc .PHONY: run -run: build_frontend - go run backend/main.go +run: + docker-compose up todomvc + +.PHONY: run_services +run_services: + docker-compose up -d mongo gpubsub tracing + +.PHONY: stop +stop: + docker-compose down + +.PHONY: run_backend +run_backend: + go run -v backend/*.go .PHONY: build_frontend build_frontend: diff --git a/examples/todomvc/README.md b/examples/todomvc/README.md index 2388de98..34f89e3c 100644 --- a/examples/todomvc/README.md +++ b/examples/todomvc/README.md @@ -4,28 +4,28 @@ This is a full example of using Event Horizon, including a frontend in Elm. The ## Usage -First run all services from the project root: +To run the example with Docker, which will also compile it: ```bash -make run_services +make run ``` -Run the backend which will also compile the frontend: +Visit http://localhost:8080 for the TodoMVC app and http://localhost:16686 to view the traces. + +Or to run the example locally (requires Elm to be installed): ```bash -make run +make build_frontend run_services run_backend ``` -Visit http://localhost:8080 - -To run the tests (requires that MongoDB is runnng): +To run the tests (requires `make run_services`): ```bash go test ./... ``` -To stop the services from the project root: +To stop the services: ```bash -make stop_services +make stop ``` diff --git a/examples/todomvc/backend/domains/todo/projector.go b/examples/todomvc/backend/domains/todo/projector.go index e5ba319c..45142656 100644 --- a/examples/todomvc/backend/domains/todo/projector.go +++ b/examples/todomvc/backend/domains/todo/projector.go @@ -29,7 +29,7 @@ type Projector struct{} // ProjectorType implements the ProjectorType method of the // eventhorizon.Projector interface. func (p *Projector) ProjectorType() projector.Type { - return projector.Type(AggregateType.String() + "_projector") + return projector.Type(AggregateType.String()) } // Project implements the Project method of the eventhorizon.Projector interface. diff --git a/examples/todomvc/backend/domains/todo/setup.go b/examples/todomvc/backend/domains/todo/setup.go index 4bba690e..2c41a1f8 100644 --- a/examples/todomvc/backend/domains/todo/setup.go +++ b/examples/todomvc/backend/domains/todo/setup.go @@ -7,6 +7,7 @@ import ( eh "github.com/looplab/eventhorizon" "github.com/looplab/eventhorizon/aggregatestore/events" "github.com/looplab/eventhorizon/commandhandler/aggregate" + "github.com/looplab/eventhorizon/commandhandler/bus" "github.com/looplab/eventhorizon/eventhandler/projector" "github.com/looplab/eventhorizon/repo/memory" "github.com/looplab/eventhorizon/repo/mongodb" @@ -15,27 +16,22 @@ import ( // SetupDomain sets up the Todo domain. func SetupDomain( ctx context.Context, + commandBus *bus.CommandHandler, eventStore eh.EventStore, eventBus eh.EventBus, - todoRepo eh.ReadWriteRepo, -) (eh.CommandHandler, error) { - - // Set the entity factory if the repo is a memory repo. - if memoryRepo, ok := todoRepo.(*memory.Repo); ok { - memoryRepo.SetEntityFactory(func() eh.Entity { return &TodoList{} }) - } else if memoryRepo, ok := todoRepo.Parent().(*memory.Repo); ok { - memoryRepo.SetEntityFactory(func() eh.Entity { return &TodoList{} }) - } + repo eh.ReadWriteRepo, +) error { - // Set the entity factory if the repo is a MongoDB repo. - if mongoRepo, ok := todoRepo.(*mongodb.Repo); ok { - mongoRepo.SetEntityFactory(func() eh.Entity { return &TodoList{} }) - } else if mongoRepo, ok := todoRepo.Parent().(*mongodb.Repo); ok { - mongoRepo.SetEntityFactory(func() eh.Entity { return &TodoList{} }) + // Set the entity factory for the base repo. + if repo := memory.Repository(repo); repo != nil { + repo.SetEntityFactory(func() eh.Entity { return &TodoList{} }) + } + if repo := mongodb.Repository(repo); repo != nil { + repo.SetEntityFactory(func() eh.Entity { return &TodoList{} }) } // Create the read model projector. - projector := projector.NewEventHandler(&Projector{}, todoRepo) + projector := projector.NewEventHandler(&Projector{}, repo) projector.SetEntityFactory(func() eh.Entity { return &TodoList{} }) eventBus.AddHandler(ctx, eh.MatchEvents{ Created, @@ -49,14 +45,30 @@ func SetupDomain( // Create the event sourced aggregate repository. aggregateStore, err := events.NewAggregateStore(eventStore, eventBus) if err != nil { - return nil, fmt.Errorf("could not create aggregate store: %w", err) + return fmt.Errorf("could not create aggregate store: %w", err) } // Create the aggregate command handler. commandHandler, err := aggregate.NewCommandHandler(AggregateType, aggregateStore) if err != nil { - return nil, fmt.Errorf("could not create command handler: %w", err) + return fmt.Errorf("could not create command handler: %w", err) + } + + commands := []eh.CommandType{ + CreateCommand, + DeleteCommand, + AddItemCommand, + RemoveItemCommand, + RemoveCompletedItemsCommand, + SetItemDescriptionCommand, + CheckItemCommand, + CheckAllItemsCommand, + } + for _, cmdType := range commands { + if err := commandBus.SetHandler(commandHandler, cmdType); err != nil { + return fmt.Errorf("could not set command handler: %w", err) + } } - return commandHandler, nil + return nil } diff --git a/examples/todomvc/backend/handler/handler.go b/examples/todomvc/backend/handler/handler.go index e9ffbc94..dacc297b 100644 --- a/examples/todomvc/backend/handler/handler.go +++ b/examples/todomvc/backend/handler/handler.go @@ -39,7 +39,7 @@ func NewHandler( // Add the event bus as a websocket that sends the events as JSON. eventBusHandler := httputils.NewEventBusHandler() - observerMiddleware := observer.NewMiddleware(observer.NamedGroup("eventbus-observer")) + observerMiddleware := observer.NewMiddleware(observer.NamedGroup("todomvc")) eventBus.AddHandler(ctx, eh.MatchAll{}, eh.UseEventHandlerMiddleware(eventBusHandler, observerMiddleware)) h.Handle("/api/events/", eventBusHandler) diff --git a/examples/todomvc/backend/handler/handler_test.go b/examples/todomvc/backend/handler/handler_test.go index 876cf51a..a945e0d2 100644 --- a/examples/todomvc/backend/handler/handler_test.go +++ b/examples/todomvc/backend/handler/handler_test.go @@ -28,6 +28,7 @@ import ( "github.com/google/uuid" eh "github.com/looplab/eventhorizon" + "github.com/looplab/eventhorizon/commandhandler/bus" gcpEventBus "github.com/looplab/eventhorizon/eventbus/gcp" localEventBus "github.com/looplab/eventhorizon/eventbus/local" "github.com/looplab/eventhorizon/eventhandler/waiter" @@ -730,11 +731,14 @@ func NewTestSession(ctx context.Context) ( eh.EventBus, eh.ReadWriteRepo, ) { + commandBus := bus.NewCommandHandler() eventStore := memoryEventStore.NewEventStore() eventBus := localEventBus.NewEventBus(nil) todoRepo := memory.NewRepo() - commandHandler, _ := todo.SetupDomain(ctx, eventStore, eventBus, todoRepo) - return commandHandler, eventBus, todoRepo + if err := todo.SetupDomain(ctx, commandBus, eventStore, eventBus, todoRepo); err != nil { + log.Println("could not setup domain:", err) + } + return commandBus, eventBus, todoRepo } func NewIntegrationTestSession(ctx context.Context) ( @@ -750,6 +754,8 @@ func NewIntegrationTestSession(ctx context.Context) ( dbURL = "mongodb://" + dbURL dbPrefix := "todomvc-example" + commandBus := bus.NewCommandHandler() + eventStore, err := mongoEventStore.NewEventStore(dbURL, dbPrefix) if err != nil { log.Fatalf("could not create event store: %s", err) @@ -780,7 +786,9 @@ func NewIntegrationTestSession(ctx context.Context) ( log.Println("could not clear DB:", err) } - commandHandler, _ := todo.SetupDomain(ctx, eventStore, eventBus, todoRepo) + if err := todo.SetupDomain(ctx, commandBus, eventStore, eventBus, todoRepo); err != nil { + log.Println("could not setup domain:", err) + } - return commandHandler, eventBus, todoRepo + return commandBus, eventBus, todoRepo } diff --git a/examples/todomvc/backend/main.go b/examples/todomvc/backend/main.go index 73a9ea14..59f0b9f5 100644 --- a/examples/todomvc/backend/main.go +++ b/examples/todomvc/backend/main.go @@ -24,11 +24,17 @@ import ( "github.com/google/uuid" eh "github.com/looplab/eventhorizon" + "github.com/looplab/eventhorizon/commandhandler/bus" gcpEventBus "github.com/looplab/eventhorizon/eventbus/gcp" + tracingEventBus "github.com/looplab/eventhorizon/eventbus/tracing" mongoEventStore "github.com/looplab/eventhorizon/eventstore/mongodb" + tracingEventStore "github.com/looplab/eventhorizon/eventstore/tracing" + "github.com/looplab/eventhorizon/middleware/commandhandler/tracing" "github.com/looplab/eventhorizon/middleware/eventhandler/observer" - version "github.com/looplab/eventhorizon/repo/cache" - "github.com/looplab/eventhorizon/repo/mongodb" + mongoRepo "github.com/looplab/eventhorizon/repo/mongodb" + tracingRepo "github.com/looplab/eventhorizon/repo/tracing" + "github.com/looplab/eventhorizon/repo/version" + versionRepo "github.com/looplab/eventhorizon/repo/version" "github.com/looplab/eventhorizon/examples/todomvc/backend/domains/todo" "github.com/looplab/eventhorizon/examples/todomvc/backend/handler" @@ -50,78 +56,138 @@ func main() { os.Setenv("PUBSUB_EMULATOR_HOST", "localhost:8793") } - // Create the event store. - eventStore, err := mongoEventStore.NewEventStore(dbURL, dbPrefix) + // Connect to localhost if not running inside docker + tracingURL := os.Getenv("TRACING_URL") + if tracingURL == "" { + tracingURL = "localhost" + } + + traceCloser, err := NewTracer("todomvc", tracingURL) if err != nil { - log.Fatalf("could not create event store: %s", err) + log.Fatal("could not create tracer: ", err) } + // Create an event bus. + commandBus := bus.NewCommandHandler() + + // Create the event store. + var eventStore eh.EventStore + if eventStore, err = mongoEventStore.NewEventStore(dbURL, dbPrefix); err != nil { + log.Fatal("could not create event store: ", err) + } + eventStore = tracingEventStore.NewEventStore(eventStore) + // Create the event bus that distributes events. - eventBus, err := gcpEventBus.NewEventBus("project-id", dbPrefix) - if err != nil { - log.Fatalf("could not create event bus: %s", err) + var eventBus eh.EventBus + if eventBus, err = gcpEventBus.NewEventBus("project-id", dbPrefix); err != nil { + log.Fatal("could not create event bus: ", err) } go func() { - for e := range eventBus.Errors() { - log.Printf("eventbus: %s", e.Error()) + for err := range eventBus.Errors() { + log.Print("eventbus:", err) } }() + // Wrap the event bus to add tracing. + eventBus = tracingEventBus.NewEventBus(eventBus) + ctx, cancel := context.WithCancel(context.Background()) // Add an event logger as an observer. - eventBus.AddHandler(ctx, eh.MatchAll{}, - eh.UseEventHandlerMiddleware(&EventLogger{}, observer.Middleware)) + eventLogger := &EventLogger{} + if err := eventBus.AddHandler(ctx, eh.MatchAll{}, + eh.UseEventHandlerMiddleware(eventLogger, + observer.NewMiddleware(observer.NamedGroup("todomvc")), + ), + ); err != nil { + log.Fatal("could not add event logger: ", err) + } // Create the repository and wrap in a version repository. - repo, err := mongodb.NewRepo(dbURL, dbPrefix, "todos") - if err != nil { - log.Fatalf("could not create invitation repository: %s", err) + var todoRepo eh.ReadWriteRepo + if todoRepo, err = mongoRepo.NewRepo(dbURL, dbPrefix, "todos"); err != nil { + log.Fatal("could not create invitation repository: ", err) } - todoRepo := version.NewRepo(repo) + todoRepo = versionRepo.NewRepo(todoRepo) + todoRepo = tracingRepo.NewRepo(todoRepo) // Setup the Todo domain. - todoCommandHandler, err := todo.SetupDomain(ctx, eventStore, eventBus, todoRepo) - if err != nil { - log.Fatal("could not setup Todo domain:", err) + if err := todo.SetupDomain(ctx, commandBus, eventStore, eventBus, todoRepo); err != nil { + log.Fatal("could not setup Todo domain: ", err) } - // Example of inline logging middleware for the command handler. - loggingMiddleware := func(h eh.CommandHandler) eh.CommandHandler { - return eh.CommandHandlerFunc(func(ctx context.Context, cmd eh.Command) error { - log.Printf("CMD %#v", cmd) - return h.HandleCommand(ctx, cmd) - }) - } - commandHandler := eh.UseCommandHandlerMiddleware(todoCommandHandler, loggingMiddleware) + // Add tracing middleware to init tracing spans, and the logging middleware. + commandHandler := eh.UseCommandHandlerMiddleware(commandBus, + tracing.NewMiddleware(), + CommandLogger, + ) // Setup the HTTP handler for commands, read repo and events. h, err := handler.NewHandler(ctx, commandHandler, eventBus, todoRepo, "frontend") if err != nil { - log.Fatal("could not create handler:", err) + log.Fatal("could not create handler: ", err) } log.Println("adding a todo list with a few example items") + cmdCtx := context.Background() id := uuid.New() - if err := commandHandler.HandleCommand(context.Background(), &todo.Create{ + if err := commandHandler.HandleCommand(cmdCtx, &todo.Create{ + ID: id, + }); err != nil { + log.Fatal("there should be no error: ", err) + } + + // Add some examples and check them off. + if err := commandHandler.HandleCommand(cmdCtx, &todo.AddItem{ + ID: id, + Description: "Build the TodoMVC example", + }); err != nil { + log.Fatal("there should be no error: ", err) + } + if err := commandHandler.HandleCommand(cmdCtx, &todo.AddItem{ + ID: id, + Description: "Run the TodoMVC example", + }); err != nil { + log.Fatal("there should be no error: ", err) + } + findCtx, cancelFind := version.NewContextWithMinVersionWait(cmdCtx, 3) + if _, err := todoRepo.Find(findCtx, id); err != nil { + log.Fatal("could not find created todo list: ", err) + } + cancelFind() + if err := commandHandler.HandleCommand(cmdCtx, &todo.CheckAllItems{ ID: id, }); err != nil { - log.Fatal("there should be no error:", err) + log.Fatal("there should be no error: ", err) } - if err := commandHandler.HandleCommand(context.Background(), &todo.AddItem{ + + // Add some more unchecked example items. + if err := commandHandler.HandleCommand(cmdCtx, &todo.AddItem{ ID: id, Description: "Learn Go", }); err != nil { - log.Fatal("there should be no error:", err) + log.Fatal("there should be no error: ", err) + } + if err := commandHandler.HandleCommand(cmdCtx, &todo.AddItem{ + ID: id, + Description: "Read the Event Horizon source", + }); err != nil { + log.Fatal("there should be no error: ", err) } - if err := commandHandler.HandleCommand(context.Background(), &todo.AddItem{ + if err := commandHandler.HandleCommand(cmdCtx, &todo.AddItem{ ID: id, - Description: "Learn Elm", + Description: "Create a PR", }); err != nil { - log.Fatal("there should be no error:", err) + log.Fatal("there should be no error: ", err) } - log.Printf("\n\nTo start, visit http://localhost:8080 in your browser.\n\n") + log.Printf(` + + To start, visit http://localhost:8080 in your browser. + + Also visit http://localhost:16686 to see tracing spans. + +`) srv := &http.Server{ Addr: ":8080", @@ -133,14 +199,14 @@ func main() { signal.Notify(sigint, os.Interrupt) <-sigint if err := srv.Shutdown(context.Background()); err != nil { - log.Printf("could not shutdown HTTP server: %v", err) + log.Print("could not shutdown HTTP server: ", err) } close(srvClosed) }() log.Println("serving HTTP on :8080") if err := srv.ListenAndServe(); err != http.ErrServerClosed { - log.Fatalf("could not listen HTTP: %v", err) + log.Fatal("could not listen HTTP: ", err) } log.Println("waiting for HTTP request to finish") @@ -151,9 +217,21 @@ func main() { log.Println("waiting for handlers to finish") eventBus.Wait() + if err := traceCloser.Close(); err != nil { + log.Print("could not close tracer: ", err) + } + log.Println("exiting") } +// CommandLogger is an example of a function based logging middleware. +func CommandLogger(h eh.CommandHandler) eh.CommandHandler { + return eh.CommandHandlerFunc(func(ctx context.Context, cmd eh.Command) error { + log.Printf("CMD: %#v", cmd) + return h.HandleCommand(ctx, cmd) + }) +} + // EventLogger is a simple event handler for logging all events. type EventLogger struct{} @@ -164,6 +242,6 @@ func (l *EventLogger) HandlerType() eh.EventHandlerType { // HandleEvent implements the HandleEvent method of the EventHandler interface. func (l *EventLogger) HandleEvent(ctx context.Context, event eh.Event) error { - log.Printf("EVENT %s", event) + log.Printf("EVENT: %s", event) return nil } diff --git a/examples/todomvc/backend/tracing.go b/examples/todomvc/backend/tracing.go new file mode 100644 index 00000000..14050043 --- /dev/null +++ b/examples/todomvc/backend/tracing.go @@ -0,0 +1,37 @@ +package main + +import ( + "fmt" + "io" + + opentracing "github.com/opentracing/opentracing-go" + jaeger "github.com/uber/jaeger-client-go" + "github.com/uber/jaeger-client-go/transport/zipkin" + zk "github.com/uber/jaeger-client-go/zipkin" +) + +// NewTracer creates a new global tracer. It must be closed on service exit +// using the returned io.Closer. +func NewTracer(serviceName, zipkinURL string) (io.Closer, error) { + // Send the tracing in Zipkin format (even if we are using Jaeger as backend). + transport, err := zipkin.NewHTTPTransport("http://" + zipkinURL + ":9411/api/v1/spans") + if err != nil { + return nil, fmt.Errorf("could not init Jaeger Zipkin HTTP transport: %w", err) + } + + // Zipkin shares span ID between client and server spans; it must be enabled via the following option. + zipkinPropagator := zk.NewZipkinB3HTTPHeaderPropagator() + + tracer, closer := jaeger.NewTracer( + serviceName, + jaeger.NewConstSampler(true), // Trace everything for now. + jaeger.NewRemoteReporter(transport), + jaeger.TracerOptions.Injector(opentracing.HTTPHeaders, zipkinPropagator), + jaeger.TracerOptions.Extractor(opentracing.HTTPHeaders, zipkinPropagator), + jaeger.TracerOptions.ZipkinSharedRPCSpan(true), + jaeger.TracerOptions.Gen128Bit(true), + ) + opentracing.SetGlobalTracer(tracer) + + return closer, nil +} diff --git a/examples/todomvc/docker-compose.yml b/examples/todomvc/docker-compose.yml new file mode 100644 index 00000000..cf51fe7e --- /dev/null +++ b/examples/todomvc/docker-compose.yml @@ -0,0 +1,44 @@ +version: "3.4" + +services: + todomvc: + build: + context: ../../ + dockerfile: ./examples/todomvc/Dockerfile + depends_on: + - mongo + - gpubsub + - tracing + ports: + - "8080:8080" + environment: + MONGO_HOST: "mongo:27017" + PUBSUB_EMULATOR_HOST: "gpubsub:8793" + TRACING_URL: "tracing" + + mongo: + image: mongo:4.2 + ports: + - "27017:27017" + + gpubsub: + image: google/cloud-sdk:318.0.0 + ports: + - "8793:8793" + entrypoint: + - gcloud + - beta + - emulators + - pubsub + - start + - "--host-port=0.0.0.0:8793" + + tracing: + image: docker.io/jaegertracing/all-in-one:1.16 + ports: + - "9411:9411" + - "16686:16686" + - "5778:5778" + environment: + # Enable Zipkin collector compatability. + COLLECTOR_ZIPKIN_HTTP_PORT: 9411 diff --git a/go.mod b/go.mod index 078b8cdb..04f938c3 100644 --- a/go.mod +++ b/go.mod @@ -4,12 +4,17 @@ go 1.15 require ( cloud.google.com/go/pubsub v1.8.3 + github.com/HdrHistogram/hdrhistogram-go v1.0.0 // indirect github.com/google/uuid v1.1.2 github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 github.com/gorilla/websocket v1.4.2 github.com/jinzhu/copier v0.0.0-20201025035756-632e723a6687 github.com/jpillora/backoff v1.0.0 github.com/kr/pretty v0.2.1 + github.com/opentracing/opentracing-go v1.2.0 + github.com/uber/jaeger-client-go v2.25.0+incompatible + github.com/uber/jaeger-lib v2.4.0+incompatible // indirect go.mongodb.org/mongo-driver v1.4.2 + go.uber.org/atomic v1.7.0 // indirect google.golang.org/api v0.35.0 ) diff --git a/go.sum b/go.sum index 79af4e56..bb782166 100644 --- a/go.sum +++ b/go.sum @@ -28,6 +28,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= @@ -46,27 +47,82 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Djarvur/go-err113 v0.0.0-20200511133814-5174e21577d5/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/HdrHistogram/hdrhistogram-go v1.0.0 h1:jivTvI9tBw5B8wW9Qd0uoQ2qaajb29y4TPhYTgh8Lb0= +github.com/HdrHistogram/hdrhistogram-go v1.0.0/go.mod h1:YzE1EgsuAz8q9lfGdlxBZo2Ma655+PfKp2mlzcAqIFw= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.34.28 h1:sscPpn/Ns3i0F4HPEWAVcwdIRaZZCuL7llJ2/60yPIk= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/daixiang0/gci v0.2.4/go.mod h1:+AV8KmHTGxxwp/pY84TLQfFKp2vuKXXJVzF3kD/hfR4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denis-tingajkin/go-header v0.3.1/go.mod h1:sq/2IxMhaZX+RRcgHfCRx/m0M5na0fBt4/CRe7Lrji0= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-critic/go-critic v0.5.2/go.mod h1:cc0+HvdE3lFpqLecgqMaJcvWWH77sLdBp+wLGPM1Yyo= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= +github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= +github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= +github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= +github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= +github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= +github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= +github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -91,8 +147,13 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= @@ -124,6 +185,21 @@ github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= +github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= +github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= +github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= +github.com/golangci/gocyclo v0.0.0-20180528144436-0a533e8fa43d/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= +github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= +github.com/golangci/golangci-lint v1.31.0/go.mod h1:aMQuNCA+NDU5+4jLL5pEuFHoue0IznKE2+/GsFvvs8A= +github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= +github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= +github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= +github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= +github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= +github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= +github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= @@ -150,39 +226,81 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gookit/color v1.2.5/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= github.com/jinzhu/copier v0.0.0-20201025035756-632e723a6687 h1:bWXum+xWafUxxJpcXnystwg5m3iVpPYtrGJFc1rjfLc= github.com/jinzhu/copier v0.0.0-20201025035756-632e723a6687/go.mod h1:24xnZezI2Yqac9J61UC6/dG/k76ttpq0DdJI3QmUvro= +github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.9.5 h1:U+CaK85mrNNb4k8BNOfgJtJ/gr6kswUCFj6miSzVC6M= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I= +github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -190,10 +308,61 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kyoh86/exportloopref v0.1.7/go.mod h1:h1rDl2Kdj97+Kwh4gdz3ujE7XHmH51Q0lUiZ1z4NLj8= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= +github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= +github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= +github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -201,33 +370,100 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= +github.com/quasilyte/go-ruleguard v0.2.0/go.mod h1:2RT/tf0Ce0UDj5y243iWKosQogJd8+1G3Rs2fxmlYnw= +github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUccKSJBU0UMXJFVM= +github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/securego/gosec/v2 v2.4.0/go.mod h1:0/Q4cjmlFDfDUj1+Fib61sc+U5IQb2w+Iv9/C3wPVko= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= +github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= +github.com/sourcegraph/go-diff v0.6.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= +github.com/tetafro/godot v0.4.8/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= +github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U= +github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.0+incompatible h1:fY7QsGQWiCt8pajv4r7JEvmATdCVaWxXbjwyYwsNaLQ= +github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.15.1/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= +github.com/valyala/quicktemplate v1.6.2/go.mod h1:mtEJpQtUiBV0SHhMX6RtiJtqxncgrfmjcUy5T68X8TM= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc h1:n+nNi93yXLkJvKwXNP9d55HC7lGK4H/SRcwB5IaUZLo= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.4.2 h1:WlnEglfTg/PfPq4WXs2Vkl/5ICC6hoG8+r+LraPmGk4= go.mongodb.org/mongo-driver v1.4.2/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -239,7 +475,13 @@ go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -285,12 +527,18 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -306,7 +554,9 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -336,9 +586,15 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2By golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -350,10 +606,15 @@ golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -365,7 +626,9 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -383,12 +646,19 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -399,9 +669,13 @@ golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -410,6 +684,7 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -420,13 +695,23 @@ golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d h1:3K34ovZAOnVaUPxanr0j4ghTZTPTA0CnXvjCl+5lZqk= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200321224714-0d839f3cf2ed/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200701041122-1837592efa10/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201030143252-cf7a54d06671/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -504,6 +789,7 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb h1:MoNcrN5yaH+35Ge google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -530,14 +816,27 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -548,6 +847,11 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +mvdan.cc/gofumpt v0.0.0-20200709182408-4fd085cb6d5f/go.mod h1:9VQ397fNXEnF84t90W4r4TRCQK+pg9f8ugVfyj+S26w= +mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= +mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= +mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/httputils/eventbus.go b/httputils/eventbus.go index 4179a373..e41a1394 100644 --- a/httputils/eventbus.go +++ b/httputils/eventbus.go @@ -66,7 +66,7 @@ func (h *EventBusHandler) HandleEvent(ctx context.Context, event eh.Event) error func (h *EventBusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { c, err := h.upgrader.Upgrade(w, r, nil) if err != nil { - log.Print("upgrade:", err) + log.Printf("eventhorizon: could not upgrade websocket: %s", err) return } defer c.Close() @@ -78,7 +78,7 @@ func (h *EventBusHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { for event := range ch { if err := c.WriteMessage(websocket.TextMessage, []byte(event.String())); err != nil { - log.Println("write:", err) + log.Printf("eventhorizon: could not write to websocket: %s", err) break } } diff --git a/middleware/commandhandler/async/commandhandler.go b/middleware/commandhandler/async/middleware.go similarity index 100% rename from middleware/commandhandler/async/commandhandler.go rename to middleware/commandhandler/async/middleware.go diff --git a/middleware/commandhandler/async/commandhandler_test.go b/middleware/commandhandler/async/middleware_test.go similarity index 100% rename from middleware/commandhandler/async/commandhandler_test.go rename to middleware/commandhandler/async/middleware_test.go diff --git a/middleware/commandhandler/scheduler/commandhandler.go b/middleware/commandhandler/scheduler/middleware.go similarity index 100% rename from middleware/commandhandler/scheduler/commandhandler.go rename to middleware/commandhandler/scheduler/middleware.go diff --git a/middleware/commandhandler/scheduler/commandhandler_test.go b/middleware/commandhandler/scheduler/middleware_test.go similarity index 100% rename from middleware/commandhandler/scheduler/commandhandler_test.go rename to middleware/commandhandler/scheduler/middleware_test.go diff --git a/middleware/commandhandler/tracing/middleware.go b/middleware/commandhandler/tracing/middleware.go new file mode 100644 index 00000000..3ea20e5d --- /dev/null +++ b/middleware/commandhandler/tracing/middleware.go @@ -0,0 +1,46 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + "fmt" + + eh "github.com/looplab/eventhorizon" + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/ext" +) + +// NewMiddleware returns a new command handler middleware that adds tracing spans. +func NewMiddleware() eh.CommandHandlerMiddleware { + return eh.CommandHandlerMiddleware(func(h eh.CommandHandler) eh.CommandHandler { + return eh.CommandHandlerFunc(func(ctx context.Context, cmd eh.Command) error { + opName := fmt.Sprintf("Command(%s)", cmd.CommandType()) + sp, ctx := opentracing.StartSpanFromContext(ctx, opName) + + err := h.HandleCommand(ctx, cmd) + + sp.SetTag("eh.command_type", cmd.CommandType()) + sp.SetTag("eh.aggregate_type", cmd.AggregateType()) + sp.SetTag("eh.aggregate_id", cmd.AggregateID()) + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return err + }) + }) +} diff --git a/middleware/commandhandler/validator/commandhandler.go b/middleware/commandhandler/validator/middleware.go similarity index 100% rename from middleware/commandhandler/validator/commandhandler.go rename to middleware/commandhandler/validator/middleware.go diff --git a/middleware/commandhandler/validator/commandhandler_test.go b/middleware/commandhandler/validator/middleware_test.go similarity index 100% rename from middleware/commandhandler/validator/commandhandler_test.go rename to middleware/commandhandler/validator/middleware_test.go diff --git a/middleware/eventhandler/async/eventhandler.go b/middleware/eventhandler/async/middleware.go similarity index 100% rename from middleware/eventhandler/async/eventhandler.go rename to middleware/eventhandler/async/middleware.go diff --git a/middleware/eventhandler/async/eventhandler_test.go b/middleware/eventhandler/async/middleware_test.go similarity index 100% rename from middleware/eventhandler/async/eventhandler_test.go rename to middleware/eventhandler/async/middleware_test.go diff --git a/middleware/eventhandler/observer/eventhandler.go b/middleware/eventhandler/observer/middleware.go similarity index 100% rename from middleware/eventhandler/observer/eventhandler.go rename to middleware/eventhandler/observer/middleware.go diff --git a/middleware/eventhandler/observer/eventhandler_test.go b/middleware/eventhandler/observer/middleware_test.go similarity index 100% rename from middleware/eventhandler/observer/eventhandler_test.go rename to middleware/eventhandler/observer/middleware_test.go diff --git a/middleware/eventhandler/scheduler/eventhandler.go b/middleware/eventhandler/scheduler/middleware.go similarity index 100% rename from middleware/eventhandler/scheduler/eventhandler.go rename to middleware/eventhandler/scheduler/middleware.go diff --git a/middleware/eventhandler/scheduler/eventhandler_test.go b/middleware/eventhandler/scheduler/middleware_test.go similarity index 100% rename from middleware/eventhandler/scheduler/eventhandler_test.go rename to middleware/eventhandler/scheduler/middleware_test.go diff --git a/middleware/eventhandler/tracing/middleware.go b/middleware/eventhandler/tracing/middleware.go new file mode 100644 index 00000000..31aa7a9f --- /dev/null +++ b/middleware/eventhandler/tracing/middleware.go @@ -0,0 +1,54 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + "fmt" + + eh "github.com/looplab/eventhorizon" + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/ext" +) + +// NewMiddleware returns an event handler middleware that adds tracing spans. +func NewMiddleware() eh.EventHandlerMiddleware { + return eh.EventHandlerMiddleware(func(h eh.EventHandler) eh.EventHandler { + return &eventHandler{h} + }) +} + +type eventHandler struct { + eh.EventHandler +} + +// HandleEvent implements the HandleEvent method of the EventHandler. +func (h *eventHandler) HandleEvent(ctx context.Context, event eh.Event) error { + opName := fmt.Sprintf("%s.Event(%s)", h.HandlerType(), event.EventType()) + sp, ctx := opentracing.StartSpanFromContext(ctx, opName) + + err := h.EventHandler.HandleEvent(ctx, event) + + sp.SetTag("eh.event_type", event.EventType()) + sp.SetTag("eh.aggregate_type", event.AggregateType()) + sp.SetTag("eh.aggregate_id", event.AggregateID()) + sp.SetTag("eh.version", event.Version()) + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return err +} diff --git a/repo/cache/repo.go b/repo/cache/repo.go index ba83988d..339b1c10 100644 --- a/repo/cache/repo.go +++ b/repo/cache/repo.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package version +package cache import ( "context" diff --git a/repo/cache/repo_test.go b/repo/cache/repo_test.go index e588cbb0..2e3d9baf 100644 --- a/repo/cache/repo_test.go +++ b/repo/cache/repo_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2014 - The Event Horizon authors. +// Copyright (c) 2020 - The Event Horizon authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,15 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package version +package cache import ( "context" - "reflect" "testing" - "time" - "github.com/google/uuid" eh "github.com/looplab/eventhorizon" "github.com/looplab/eventhorizon/mocks" "github.com/looplab/eventhorizon/repo" @@ -43,159 +40,13 @@ func TestReadRepo(t *testing.T) { // Read repository with default namespace. repo.AcceptanceTest(t, context.Background(), r) - extraRepoTests(t, context.Background()) // Read repository with other namespace. ctx := eh.NewContextWithNamespace(context.Background(), "ns") repo.AcceptanceTest(t, ctx, r) - extraRepoTests(t, ctx) } -func extraRepoTests(t *testing.T, ctx context.Context) { - simpleModel := &mocks.SimpleModel{ - ID: uuid.New(), - Content: "simpleModel", - } - - // Cache on find. - baseRepo := &mocks.Repo{ - Entity: simpleModel, - } - r := NewRepo(baseRepo) - entity, err := r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if !baseRepo.FindCalled { - t.Error("the item should have been read from the store") - } - baseRepo.FindCalled = false - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if baseRepo.FindCalled { - t.Error("the item should have been read from the cache") - } - - // Cache on find all. - baseRepo = &mocks.Repo{ - Entities: []eh.Entity{simpleModel}, - } - r = NewRepo(baseRepo) - entities, err := r.FindAll(ctx) - if err != nil { - t.Error("there should be no error:", err) - } - if !reflect.DeepEqual(entities, []eh.Entity{simpleModel}) { - t.Error("the items should be correct") - } - if !baseRepo.FindAllCalled { - t.Error("the item should have been read from the store") - } - baseRepo.FindCalled = false - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if baseRepo.FindCalled { - t.Error("the item should have been read from the cache") - } - - // Cache bust on save. - baseRepo = &mocks.Repo{ - Entity: simpleModel, - } - r = NewRepo(baseRepo) - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if !baseRepo.FindCalled { - t.Error("the item should have been read from the store") - } - if err := r.Save(ctx, simpleModel); err != nil { - t.Error("there should be no error:", err) - } - if baseRepo.Entity != simpleModel { - t.Error("the item should be saved") - } - baseRepo.FindCalled = false - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if !baseRepo.FindCalled { - t.Error("the item should have been read from the store") - } - - // Cache bust on remove. - baseRepo = &mocks.Repo{ - Entity: simpleModel, - } - r = NewRepo(baseRepo) - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if !baseRepo.FindCalled { - t.Error("the item should have been read from the store") - } - if err := r.Remove(ctx, simpleModel.ID); err != nil { - t.Error("there should be no error:", err) - } - baseRepo.FindCalled = false - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != nil { - t.Error("the item should be correct") - } - if !baseRepo.FindCalled { - t.Error("the item should have been read from the store") - } - - // Cache bust on events. - baseRepo = &mocks.Repo{ - Entity: simpleModel, - } - r = NewRepo(baseRepo) - event := eh.NewEventForAggregate(mocks.EventType, nil, - time.Now(), mocks.AggregateType, simpleModel.EntityID(), 1) - r.HandleEvent(ctx, event) - baseRepo.FindCalled = false - entity, err = r.Find(ctx, simpleModel.ID) - if err != nil { - t.Error("there should be no error:", err) - } - if entity != simpleModel { - t.Error("the item should be correct") - } - if !baseRepo.FindCalled { - t.Error("the item should have been read from the store") - } -} - func TestRepository(t *testing.T) { if r := Repository(nil); r != nil { t.Error("the parent repository should be nil:", r) diff --git a/repo/tracing/repo.go b/repo/tracing/repo.go new file mode 100644 index 00000000..6229284c --- /dev/null +++ b/repo/tracing/repo.go @@ -0,0 +1,114 @@ +// Copyright (c) 2020 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + + "github.com/google/uuid" + eh "github.com/looplab/eventhorizon" + "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/ext" +) + +// Repo is a ReadWriteRepo that adds tracing. +type Repo struct { + eh.ReadWriteRepo +} + +// NewRepo creates a new Repo. +func NewRepo(repo eh.ReadWriteRepo) *Repo { + return &Repo{ + ReadWriteRepo: repo, + } +} + +// Parent implements the Parent method of the eventhorizon.ReadRepo interface. +func (r *Repo) Parent() eh.ReadRepo { + return r.ReadWriteRepo +} + +// Find implements the Find method of the eventhorizon.ReadModel interface. +func (r *Repo) Find(ctx context.Context, id uuid.UUID) (eh.Entity, error) { + sp, ctx := opentracing.StartSpanFromContext(ctx, "Repo.Find") + + entity, err := r.ReadWriteRepo.Find(ctx, id) + + sp.SetTag("eh.aggregate_id", id) + if rrErr, ok := err.(eh.RepoError); err != nil && + !(ok && rrErr.Err == eh.ErrEntityNotFound) { + ext.LogError(sp, err) + } + sp.Finish() + + return entity, err +} + +// FindAll implements the FindAll method of the eventhorizon.ReadRepo interface. +func (r *Repo) FindAll(ctx context.Context) ([]eh.Entity, error) { + sp, ctx := opentracing.StartSpanFromContext(ctx, "Repo.FindAll") + + entities, err := r.ReadWriteRepo.FindAll(ctx) + + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return entities, err +} + +// Save implements the Save method of the eventhorizon.WriteRepo interface. +func (r *Repo) Save(ctx context.Context, entity eh.Entity) error { + sp, ctx := opentracing.StartSpanFromContext(ctx, "Repo.Save") + + err := r.ReadWriteRepo.Save(ctx, entity) + + sp.SetTag("eh.aggregate_id", entity.EntityID()) + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return err +} + +// Remove implements the Remove method of the eventhorizon.WriteRepo interface. +func (r *Repo) Remove(ctx context.Context, id uuid.UUID) error { + sp, ctx := opentracing.StartSpanFromContext(ctx, "Repo.Remove") + + err := r.ReadWriteRepo.Remove(ctx, id) + + sp.SetTag("eh.aggregate_id", id) + if err != nil { + ext.LogError(sp, err) + } + sp.Finish() + + return err +} + +// Repository returns a parent ReadRepo if there is one. +func Repository(repo eh.ReadRepo) *Repo { + if repo == nil { + return nil + } + + if r, ok := repo.(*Repo); ok { + return r + } + + return Repository(repo.Parent()) +} diff --git a/repo/tracing/repo_test.go b/repo/tracing/repo_test.go new file mode 100644 index 00000000..e49226fd --- /dev/null +++ b/repo/tracing/repo_test.go @@ -0,0 +1,65 @@ +// Copyright (c) 2014 - The Event Horizon authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package tracing + +import ( + "context" + "testing" + + eh "github.com/looplab/eventhorizon" + "github.com/looplab/eventhorizon/mocks" + "github.com/looplab/eventhorizon/repo" + "github.com/looplab/eventhorizon/repo/memory" +) + +func TestReadRepo(t *testing.T) { + baseRepo := memory.NewRepo() + baseRepo.SetEntityFactory(func() eh.Entity { + return &mocks.Model{} + }) + + r := NewRepo(baseRepo) + if r == nil { + t.Error("there should be a repository") + } + if parent := r.Parent(); parent != baseRepo { + t.Error("the parent repo should be correct:", parent) + } + + // Read repository with default namespace. + repo.AcceptanceTest(t, context.Background(), r) + + // Read repository with other namespace. + ctx := eh.NewContextWithNamespace(context.Background(), "ns") + repo.AcceptanceTest(t, ctx, r) + +} + +func TestRepository(t *testing.T) { + if r := Repository(nil); r != nil { + t.Error("the parent repository should be nil:", r) + } + + inner := &mocks.Repo{} + if r := Repository(inner); r != nil { + t.Error("the parent repository should be nil:", r) + } + + r := NewRepo(inner) + outer := &mocks.Repo{ParentRepo: r} + if r := Repository(outer); r != r { + t.Error("the parent repository should be correct:", r) + } +}