mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 11:15:12 +00:00
* fixup streams stuff * use cache instead of pg in streams * hash out issuer streams test * fix compile error
34 lines
627 B
Go
34 lines
627 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/micro/micro/v3/service"
|
|
"github.com/micro/micro/v3/service/events"
|
|
"github.com/micro/micro/v3/service/logger"
|
|
"github.com/micro/services/pkg/cache"
|
|
"github.com/micro/services/streams/handler"
|
|
pb "github.com/micro/services/streams/proto"
|
|
)
|
|
|
|
func main() {
|
|
// Create service
|
|
srv := service.New(
|
|
service.Name("streams"),
|
|
)
|
|
|
|
h := &handler.Streams{
|
|
Cache: cache.DefaultCache,
|
|
Events: events.DefaultStream,
|
|
Time: time.Now,
|
|
}
|
|
|
|
// Register handler
|
|
pb.RegisterStreamsHandler(srv.Server(), h)
|
|
|
|
// Run service
|
|
if err := srv.Run(); err != nil {
|
|
logger.Fatal(err)
|
|
}
|
|
}
|