1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-05 10:20:53 +02:00
go-micro/examples/heartbeat/main.go
2020-12-26 15:17:20 +00:00

22 lines
349 B
Go

package main
import (
"time"
"github.com/micro/go-micro/v2"
"github.com/micro/go-micro/v2/util/log"
)
func main() {
service := micro.NewService(
micro.Name("com.example.srv.foo"),
micro.RegisterTTL(time.Second*30),
micro.RegisterInterval(time.Second*15),
)
service.Init()
if err := service.Run(); err != nil {
log.Fatal(err)
}
}