mirror of
https://github.com/go-micro/go-micro.git
synced 2025-01-05 10:20:53 +02:00
22 lines
349 B
Go
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)
|
|
}
|
|
}
|