probo/main.go

28 lines
559 B
Go
Raw Normal View History

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"
"git.andreafazzi.eu/andrea/probo/store/memory"
2022-06-23 11:25:35 +02:00
"github.com/sirupsen/logrus"
)
const port = "3000"
func main() {
2022-09-06 14:41:32 +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))
}