rename mongoStruct to mongo_struct

This commit is contained in:
rasmus 2022-11-09 16:00:44 +02:00
parent 69e0230949
commit 33471fac2d
11 changed files with 32 additions and 13 deletions

View File

@ -4,7 +4,7 @@ import (
"log"
"sync"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongoStruct"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongo_struct"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)

View File

@ -6,7 +6,7 @@ import (
"log"
"time"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongoStruct"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongo_struct"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)

View File

@ -7,7 +7,7 @@ import (
"net/url"
"time"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongoStruct"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongo_struct"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
mongoEvent "go.mongodb.org/mongo-driver/event"

View File

@ -5,7 +5,7 @@ import (
"log"
"time"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongoStruct"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongo_struct"
"github.com/jtagcat/util"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

View File

@ -9,7 +9,7 @@ import (
"os"
"time"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongoStruct"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongo_struct"
"github.com/jtagcat/util"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

View File

@ -10,7 +10,7 @@ import (
"sync"
"time"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongoStruct"
ms "git.k-space.ee/k-space/logmower-shipper/pkg/mongo_struct"
"github.com/fsnotify/fsnotify"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
@ -20,6 +20,8 @@ import (
const DatabaseCommandTimeout = 10 * time.Second
const PrometheusPrefix = "logmower" // TODO:
// wrapper to force copying before use
func defaultBackoff() wait.Backoff {
return wait.Backoff{

View File

@ -1,4 +1,4 @@
package logmower
package main
import (
"errors"
@ -7,12 +7,12 @@ import (
"net/http"
"os"
"git.k-space.ee/k-space/logmower-shipper/logmower"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
const PrometheusPrefix = "logmower"
const PrometheusPrefix = "logmower" // TODO:
// TODO:
func main() {
go func() {
metricsPort := 2112
@ -26,7 +26,7 @@ func main() {
}
}()
if err := App.Run(os.Args); err != nil {
if err := logmower.App.Run(os.Args); err != nil {
log.Fatal(err)
}
}

15
pkg/ctx_keys/ctx_keys.go Normal file
View File

@ -0,0 +1,15 @@
package ctx_keys
// type Key uint32
// // The operations fsnotify can trigger; see the documentation on [Watcher] for a
// // full description, and check them with [Event.Has].
// const (
// PrometheusPrefix Key = 1 << iota
// )
// var keyMap = map[Key]reflect.Type{}
// func get(ctx context.Context, key Key) (val any, ok bool) {
// ctx.Value()
// }

View File

@ -1,4 +1,4 @@
package mongoStruct
package mongo_struct
import (
"time"

View File

@ -1,4 +1,4 @@
package mongoStruct
package mongo_struct
import (
"context"

View File

@ -1,4 +1,6 @@
package mongoStruct
package mongo_struct
// TODO: this is misc collection of stuff not really fitting in here
import (
"fmt"