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" "log"
"sync" "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" prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
) )

View File

@ -6,7 +6,7 @@ import (
"log" "log"
"time" "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" prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
) )

View File

@ -7,7 +7,7 @@ import (
"net/url" "net/url"
"time" "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" prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
mongoEvent "go.mongodb.org/mongo-driver/event" mongoEvent "go.mongodb.org/mongo-driver/event"

View File

@ -5,7 +5,7 @@ import (
"log" "log"
"time" "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" "github.com/jtagcat/util"
prom "github.com/prometheus/client_golang/prometheus" prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"

View File

@ -9,7 +9,7 @@ import (
"os" "os"
"time" "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" "github.com/jtagcat/util"
prom "github.com/prometheus/client_golang/prometheus" prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"

View File

@ -10,7 +10,7 @@ import (
"sync" "sync"
"time" "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" "github.com/fsnotify/fsnotify"
prom "github.com/prometheus/client_golang/prometheus" prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
@ -20,6 +20,8 @@ import (
const DatabaseCommandTimeout = 10 * time.Second const DatabaseCommandTimeout = 10 * time.Second
const PrometheusPrefix = "logmower" // TODO:
// wrapper to force copying before use // wrapper to force copying before use
func defaultBackoff() wait.Backoff { func defaultBackoff() wait.Backoff {
return wait.Backoff{ return wait.Backoff{

View File

@ -1,4 +1,4 @@
package logmower package main
import ( import (
"errors" "errors"
@ -7,12 +7,12 @@ import (
"net/http" "net/http"
"os" "os"
"git.k-space.ee/k-space/logmower-shipper/logmower"
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
) )
const PrometheusPrefix = "logmower" const PrometheusPrefix = "logmower" // TODO:
// TODO:
func main() { func main() {
go func() { go func() {
metricsPort := 2112 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) 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 ( import (
"time" "time"

View File

@ -1,4 +1,4 @@
package mongoStruct package mongo_struct
import ( import (
"context" "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 ( import (
"fmt" "fmt"