Skip to content

Commit bd83843

Browse files
committed
goimports all code
1 parent b0dd393 commit bd83843

18 files changed

+51
-33
lines changed

cmd/alertmanager/alerts.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"strings"
7+
"time"
8+
69
"github.com/function61/eventhorizon/pkg/ehevent"
710
"github.com/function61/gokit/ossignal"
811
"github.com/function61/gokit/stringutils"
912
"github.com/function61/lambda-alertmanager/pkg/amdomain"
1013
"github.com/function61/lambda-alertmanager/pkg/amstate"
1114
"github.com/scylladb/termtables"
1215
"github.com/spf13/cobra"
13-
"strings"
14-
"time"
1516
)
1617

1718
func alertEntry() *cobra.Command {

cmd/alertmanager/deadmansswitches.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"time"
7+
68
"github.com/function61/eventhorizon/pkg/ehevent"
79
"github.com/function61/gokit/ossignal"
810
"github.com/function61/lambda-alertmanager/pkg/amdomain"
911
"github.com/function61/lambda-alertmanager/pkg/amstate"
1012
"github.com/scylladb/termtables"
1113
"github.com/spf13/cobra"
12-
"time"
1314
)
1415

1516
func deadMansSwitchEntry() *cobra.Command {

cmd/alertmanager/deadmansswitches_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ package main
22

33
import (
44
"context"
5+
"strings"
6+
"testing"
7+
"time"
8+
59
"github.com/function61/eventhorizon/pkg/ehclient"
610
"github.com/function61/eventhorizon/pkg/ehevent"
711
"github.com/function61/eventhorizon/pkg/ehreader"
812
"github.com/function61/eventhorizon/pkg/ehreader/ehreadertest"
913
"github.com/function61/gokit/assert"
1014
"github.com/function61/lambda-alertmanager/pkg/amdomain"
1115
"github.com/function61/lambda-alertmanager/pkg/amstate"
12-
"strings"
13-
"testing"
14-
"time"
1516
)
1617

1718
func TestDeadmansswitchCheckin(t *testing.T) {

cmd/alertmanager/httpmonitors.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"time"
7+
68
"github.com/function61/eventhorizon/pkg/ehevent"
79
"github.com/function61/gokit/ossignal"
810
"github.com/function61/gokit/stringutils"
911
"github.com/function61/lambda-alertmanager/pkg/amdomain"
1012
"github.com/function61/lambda-alertmanager/pkg/amstate"
1113
"github.com/scylladb/termtables"
1214
"github.com/spf13/cobra"
13-
"time"
1415
)
1516

1617
func httpMonitorEntry() *cobra.Command {

cmd/alertmanager/httpmonitorscanner.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package main
33
import (
44
"context"
55
"fmt"
6-
"github.com/function61/gokit/ezhttp"
7-
"github.com/function61/gokit/logex"
8-
"github.com/function61/lambda-alertmanager/pkg/amstate"
96
"io/ioutil"
107
"log"
118
"net/http"
129
"strings"
1310
"sync"
1411
"time"
12+
13+
"github.com/function61/gokit/ezhttp"
14+
"github.com/function61/gokit/logex"
15+
"github.com/function61/lambda-alertmanager/pkg/amstate"
1516
)
1617

1718
type monitorFailure struct {

cmd/alertmanager/httpmonitorscanner_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"testing"
7+
68
"github.com/function61/gokit/assert"
79
"github.com/function61/lambda-alertmanager/pkg/amstate"
8-
"testing"
910
)
1011

1112
func TestOneFails(t *testing.T) {

cmd/alertmanager/ingest.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ package main
55

66
import (
77
"context"
8+
"os"
9+
"strconv"
10+
811
"github.com/aws/aws-lambda-go/events"
912
"github.com/function61/eventhorizon/pkg/ehevent"
1013
"github.com/function61/gokit/logex"
1114
"github.com/function61/lambda-alertmanager/pkg/amdomain"
1215
"github.com/function61/lambda-alertmanager/pkg/amstate"
13-
"os"
14-
"strconv"
1516
)
1617

1718
// invoked for "AlertManager-ingest" SNS topic

cmd/alertmanager/lambdahandler.go

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"errors"
6+
67
"github.com/aws/aws-lambda-go/events"
78
"github.com/aws/aws-lambda-go/lambda"
89
"github.com/function61/gokit/aws/lambdautils"

cmd/alertmanager/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"os"
7+
"time"
8+
69
"github.com/function61/eventhorizon/pkg/ehcli"
710
"github.com/function61/eventhorizon/pkg/ehreader"
811
"github.com/function61/gokit/aws/lambdautils"
@@ -11,8 +14,6 @@ import (
1114
"github.com/function61/gokit/ossignal"
1215
"github.com/function61/lambda-alertmanager/pkg/amstate"
1316
"github.com/spf13/cobra"
14-
"os"
15-
"time"
1617
)
1718

1819
func main() {

cmd/alertmanager/restapi.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"log"
8+
"net/http"
9+
"os"
10+
"time"
11+
712
"github.com/function61/gokit/httputils"
813
"github.com/function61/gokit/jsonfile"
914
"github.com/function61/gokit/logex"
@@ -12,10 +17,6 @@ import (
1217
"github.com/function61/lambda-alertmanager/pkg/alertmanagertypes"
1318
"github.com/function61/lambda-alertmanager/pkg/amstate"
1419
"github.com/spf13/cobra"
15-
"log"
16-
"net/http"
17-
"os"
18-
"time"
1920
)
2021

2122
func newRestApi(ctx context.Context) http.Handler {

cmd/alertmanager/scheduled.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
"github.com/function61/eventhorizon/pkg/ehevent"
8-
"github.com/function61/lambda-alertmanager/pkg/amdomain"
9-
"github.com/function61/lambda-alertmanager/pkg/amstate"
107
"regexp"
118
"strconv"
129
"strings"
1310
"time"
11+
12+
"github.com/function61/eventhorizon/pkg/ehevent"
13+
"github.com/function61/lambda-alertmanager/pkg/amdomain"
14+
"github.com/function61/lambda-alertmanager/pkg/amstate"
1415
)
1516

1617
// runs every minute

cmd/alertmanager/scheduled_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"os"
8+
"testing"
9+
"time"
10+
711
"github.com/function61/eventhorizon/pkg/ehevent"
812
"github.com/function61/eventhorizon/pkg/ehreader"
913
"github.com/function61/eventhorizon/pkg/ehreader/ehreadertest"
1014
"github.com/function61/gokit/assert"
1115
"github.com/function61/lambda-alertmanager/pkg/amdomain"
1216
"github.com/function61/lambda-alertmanager/pkg/amstate"
13-
"os"
14-
"testing"
15-
"time"
1617
)
1718

1819
var t0 = time.Date(2019, 9, 7, 12, 0, 0, 0, time.UTC)

cmd/alertmanager/sns.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"encoding/json"
5+
56
"github.com/aws/aws-sdk-go/aws"
67
"github.com/aws/aws-sdk-go/aws/session"
78
"github.com/aws/aws-sdk-go/service/sns"

pkg/alertmanagerclient/client.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package alertmanagerclient
22

33
import (
44
"context"
5+
56
"github.com/function61/gokit/ezhttp"
67
"github.com/function61/lambda-alertmanager/pkg/alertmanagertypes"
78
)

pkg/amdomain/events.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
package amdomain
33

44
import (
5-
"github.com/function61/eventhorizon/pkg/ehevent"
65
"time"
6+
7+
"github.com/function61/eventhorizon/pkg/ehevent"
78
)
89

910
var Types = ehevent.Allocators{

pkg/amstate/store.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package amstate
33
import (
44
"context"
55
"encoding/json"
6+
"log"
7+
"sort"
8+
"sync"
9+
"time"
10+
611
"github.com/function61/eventhorizon/pkg/ehclient"
712
"github.com/function61/eventhorizon/pkg/ehevent"
813
"github.com/function61/eventhorizon/pkg/ehreader"
914
"github.com/function61/gokit/logex"
1015
"github.com/function61/lambda-alertmanager/pkg/amdomain"
11-
"log"
12-
"sort"
13-
"sync"
14-
"time"
1516
)
1617

1718
const (

pkg/amstate/store_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package amstate
22

33
import (
44
"context"
5+
"testing"
6+
"time"
7+
58
"github.com/function61/eventhorizon/pkg/ehevent"
69
"github.com/function61/eventhorizon/pkg/ehreader"
710
"github.com/function61/eventhorizon/pkg/ehreader/ehreadertest"
811
"github.com/function61/gokit/assert"
912
"github.com/function61/lambda-alertmanager/pkg/amdomain"
10-
"testing"
11-
"time"
1213
)
1314

1415
const (

pkg/amstate/utils.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package amstate
22

33
import (
4-
"github.com/function61/gokit/cryptorandombytes"
54
"time"
5+
6+
"github.com/function61/gokit/cryptorandombytes"
67
)
78

89
func FindAlertWithSubject(subject string, alerts []Alert) *Alert {

0 commit comments

Comments
 (0)