Skip to content

Commit 1560eef

Browse files
Merge branch 'main' of github.com:fabricekabongo/loggerhead
2 parents 61d3fe8 + 9608905 commit 1560eef

5 files changed

Lines changed: 21 additions & 17 deletions

File tree

admin/ops.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package admin
33
import (
44
"embed"
55
"encoding/json"
6-
"github.com/fabricekabongo/loggerhead/clustering"
7-
"github.com/fabricekabongo/loggerhead/config"
8-
"github.com/prometheus/client_golang/prometheus/promhttp"
96
"html/template"
107
"log"
118
"net/http"
129
"runtime"
10+
11+
"github.com/fabricekabongo/loggerhead/clustering"
12+
"github.com/fabricekabongo/loggerhead/config"
13+
"github.com/prometheus/client_golang/prometheus/promhttp"
1314
)
1415

1516
var (
@@ -128,8 +129,8 @@ func (o *OpsServer) AdminData() http.Handler {
128129
})
129130
}
130131

131-
func (o *OpsServer) AdminUI() http.Handler {
132-
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
132+
func (*OpsServer) AdminUI() http.Handler {
133+
return http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
133134
err := TMPL.Execute(w, nil)
134135
if err != nil {
135136
http.Error(w, err.Error(), http.StatusInternalServerError)

clustering/broadcast-delegate.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package clustering
22

33
import (
4+
"log"
5+
"os"
6+
47
"github.com/fabricekabongo/loggerhead/query"
58
"github.com/fabricekabongo/loggerhead/world"
69
"github.com/hashicorp/memberlist"
710
"github.com/prometheus/client_golang/prometheus"
811
"github.com/prometheus/client_golang/prometheus/promauto"
9-
"log"
10-
"os"
1112
)
1213

1314
var (
@@ -52,7 +53,7 @@ func newBroadcastDelegate(engine *query.Engine, broadcasts *memberlist.TransmitL
5253
}
5354
}
5455

55-
func (d *BroadcastDelegate) NodeMeta(limit int) []byte {
56+
func (*BroadcastDelegate) NodeMeta(_ int) []byte {
5657
return []byte{}
5758
}
5859

query/query.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func (p *GetQueryProcessor) Execute(query string) string {
206206
return stringBuilder.String()
207207
}
208208

209-
func (p *GetQueryProcessor) CanProcess(query string) bool {
209+
func (*GetQueryProcessor) CanProcess(query string) bool {
210210
chunks := strings.Split(query, " ")
211211
if len(chunks) != 3 {
212212
return false
@@ -249,7 +249,7 @@ func (p *DeleteQueryProcessor) Execute(query string) string {
249249
return version + ",deleted\n"
250250
}
251251

252-
func (p *DeleteQueryProcessor) CanProcess(query string) bool {
252+
func (*DeleteQueryProcessor) CanProcess(query string) bool {
253253
chunks := strings.Split(query, " ")
254254
if len(chunks) != 3 {
255255
return false
@@ -306,7 +306,7 @@ func (p *SaveQueryProcessor) Execute(query string) string {
306306
return version + ",saved\n"
307307
}
308308

309-
func (p *SaveQueryProcessor) CanProcess(query string) bool {
309+
func (*SaveQueryProcessor) CanProcess(query string) bool {
310310
chunks := strings.Split(query, " ")
311311
if len(chunks) != 5 {
312312
return false
@@ -371,7 +371,7 @@ func (p *PolyQueryProcessor) Execute(query string) string {
371371
return result.String()
372372
}
373373

374-
func (p *PolyQueryProcessor) CanProcess(query string) bool {
374+
func (*PolyQueryProcessor) CanProcess(query string) bool {
375375
chunks := strings.Split(query, " ")
376376
if len(chunks) != 6 {
377377
return false

world/location.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import (
44
"encoding/gob"
55
"errors"
66
"fmt"
7+
"time"
8+
79
"github.com/prometheus/client_golang/prometheus"
810
"github.com/prometheus/client_golang/prometheus/promauto"
9-
"time"
1011
)
1112

1213
var (
@@ -58,7 +59,7 @@ func NewLocation(ns string, id string, lat float64, lon float64) (*Location, err
5859
return loc, nil
5960
}
6061

61-
func (l *Location) init(ns string, id string, lat float64, lon float64) (*Location, error) {
62+
func (*Location) init(ns string, id string, lat float64, lon float64) (*Location, error) {
6263
if len(id) == 0 {
6364
validationOps.Inc()
6465
return nil, LocationErrorRequiredId

world/tree.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package world
22

33
import (
44
"errors"
5-
"github.com/prometheus/client_golang/prometheus"
6-
"github.com/prometheus/client_golang/prometheus/promauto"
75
"math"
86
"sync"
7+
8+
"github.com/prometheus/client_golang/prometheus"
9+
"github.com/prometheus/client_golang/prometheus/promauto"
910
)
1011

1112
var (
@@ -155,7 +156,7 @@ func (node *TreeNode) divide() {
155156
node.mu.Unlock()
156157
}
157158

158-
func (q *QuadTree) reBalance() {
159+
func (*QuadTree) reBalance() {
159160
// TODO: Implement rebalancing
160161
}
161162

0 commit comments

Comments
 (0)