2019-12-30 21:33:21 +03:00
|
|
|
package micro
|
|
|
|
|
|
|
|
import (
|
2020-01-14 16:23:16 +03:00
|
|
|
"github.com/micro/go-micro/broker"
|
2019-12-30 21:33:21 +03:00
|
|
|
"github.com/micro/go-micro/client"
|
|
|
|
"github.com/micro/go-micro/server"
|
2020-01-10 22:13:55 +03:00
|
|
|
"github.com/micro/go-micro/store"
|
2019-12-30 21:33:21 +03:00
|
|
|
|
|
|
|
// set defaults
|
2020-01-14 16:23:16 +03:00
|
|
|
"github.com/micro/go-micro/broker/nats"
|
2019-12-30 21:33:21 +03:00
|
|
|
gcli "github.com/micro/go-micro/client/grpc"
|
|
|
|
gsrv "github.com/micro/go-micro/server/grpc"
|
2020-01-10 22:13:55 +03:00
|
|
|
memStore "github.com/micro/go-micro/store/memory"
|
2019-12-30 21:33:21 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2020-01-14 16:23:16 +03:00
|
|
|
// default broker
|
|
|
|
broker.DefaultBroker = nats.NewBroker(
|
|
|
|
// embedded nats server
|
|
|
|
nats.LocalServer(),
|
|
|
|
)
|
2020-01-18 22:53:51 +03:00
|
|
|
// new client initialisation
|
|
|
|
client.NewClient = gcli.NewClient
|
|
|
|
// new server initialisation
|
|
|
|
server.NewServer = gsrv.NewServer
|
2019-12-30 21:33:21 +03:00
|
|
|
// default client
|
|
|
|
client.DefaultClient = gcli.NewClient()
|
|
|
|
// default server
|
|
|
|
server.DefaultServer = gsrv.NewServer()
|
2020-01-10 22:13:55 +03:00
|
|
|
// default store
|
|
|
|
store.DefaultStore = memStore.NewStore()
|
2019-12-30 21:33:21 +03:00
|
|
|
}
|