Shift embedded nats to the default

This commit is contained in:
Asim Aslam
2020-01-19 00:55:01 +00:00
parent 105596a0e5
commit 11b104677a
11 changed files with 1265 additions and 823 deletions

View File

@@ -15,25 +15,6 @@ type svc struct {
runtime pb.RuntimeService
}
// NewRuntime creates new service runtime and returns it
func NewRuntime(opts ...runtime.Option) runtime.Runtime {
// get default options
options := runtime.Options{}
// apply requested options
for _, o := range opts {
o(&options)
}
// create default client
cli := client.DefaultClient
return &svc{
options: options,
runtime: pb.NewRuntimeService(runtime.DefaultName, cli),
}
}
// Init initializes runtime with given options
func (s *svc) Init(opts ...runtime.Option) error {
s.Lock()
@@ -183,3 +164,23 @@ func (s *svc) Stop() error {
func (s *svc) String() string {
return "service"
}
// NewRuntime creates new service runtime and returns it
func NewRuntime(opts ...runtime.Option) runtime.Runtime {
// get default options
options := runtime.Options{}
// apply requested options
for _, o := range opts {
o(&options)
}
// create default client
cli := client.DefaultClient
return &svc{
options: options,
runtime: pb.NewRuntimeService(runtime.DefaultName, cli),
}
}