2021-01-19 19:41:39 +03:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
2021-10-27 18:27:04 +03:00
|
|
|
"go.unistack.org/micro/v3/broker"
|
|
|
|
"go.unistack.org/micro/v3/client"
|
2021-01-19 19:41:39 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type clientKey struct{}
|
|
|
|
|
|
|
|
// Client to call broker service
|
|
|
|
func Client(c client.Client) broker.Option {
|
|
|
|
return broker.SetOption(clientKey{}, c)
|
|
|
|
}
|
|
|
|
|
|
|
|
type serviceKey struct{}
|
|
|
|
|
|
|
|
// Service to call broker service
|
|
|
|
func Service(name string) broker.Option {
|
|
|
|
return broker.SetOption(serviceKey{}, name)
|
|
|
|
}
|