2022-06-23 11:25:35 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
|
2022-06-24 18:56:06 +02:00
|
|
|
"git.andreafazzi.eu/andrea/probo/hasher/sha256"
|
2023-06-28 17:21:59 +02:00
|
|
|
"git.andreafazzi.eu/andrea/probo/logger"
|
2022-06-24 18:56:06 +02:00
|
|
|
"git.andreafazzi.eu/andrea/probo/store/memory"
|
2022-06-23 11:25:35 +02:00
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2022-10-12 09:14:31 +02:00
|
|
|
const port = "8080"
|
2022-06-23 11:25:35 +02:00
|
|
|
|
|
|
|
func main() {
|
2023-06-28 17:21:59 +02:00
|
|
|
logger.SetLevel(logger.DebugLevel)
|
2022-06-23 11:25:35 +02:00
|
|
|
|
2022-06-29 16:08:55 +02:00
|
|
|
server := NewProboCollectorServer(
|
|
|
|
memory.NewMemoryProboCollectorStore(
|
2022-06-24 18:56:06 +02:00
|
|
|
sha256.NewDefault256Hasher(sha256.DefaultSHA256HashingFn),
|
|
|
|
),
|
|
|
|
)
|
2022-06-23 11:25:35 +02:00
|
|
|
|
2022-06-24 18:56:06 +02:00
|
|
|
addr := "http://localhost:" + port
|
|
|
|
logrus.WithField("address", addr).Info("Probo Collector is up&running...")
|
2022-06-23 11:25:35 +02:00
|
|
|
|
|
|
|
log.Fatal(http.ListenAndServe(":"+port, server))
|
|
|
|
}
|