This repository was archived by the owner on Jul 4, 2024. It is now read-only.
This repository was archived by the owner on Jul 4, 2024. It is now read-only.
NewApi undefined #2
Open
Description
there is an error "undefined: api.NewApi" when i use api.NewApi, can you give me some guidance. Here's my code snippet:
import (
...
"go-micro.dev/v4"
"go-micro.dev/v4/api"
"go-micro.dev/v4/api/router"
"go-micro.dev/v4/api/router/registry"
)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
r := router.WithRegistry(etcd.NewRegistry(rst.Addrs("127.0.0.1:2379")))
api := api.NewApi(api.WithRouter(registry.NewRouter(r)))
if err := api.Run(ctx); err != nil {
log.Fatal(err)
}
Metadata
Metadata
Assignees
Labels
No labels