noop impl (#32)

* improve logger usage
* add noop client and server

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-09-05 02:11:29 +03:00
committed by GitHub
parent c062aab1a9
commit c576749b57
24 changed files with 418 additions and 140 deletions

View File

@@ -105,8 +105,8 @@ type RequestOptions struct {
Context context.Context
}
func NewOptions(options ...Option) Options {
opts := Options{
func NewOptions(opts ...Option) Options {
options := Options{
Cache: NewCache(),
Context: context.Background(),
ContentType: "application/protobuf",
@@ -122,13 +122,15 @@ func NewOptions(options ...Option) Options {
PoolSize: DefaultPoolSize,
PoolTTL: DefaultPoolTTL,
Selector: random.NewSelector(),
Logger: logger.DefaultLogger,
Broker: broker.DefaultBroker,
}
for _, o := range options {
o(&opts)
for _, o := range opts {
o(&options)
}
return opts
return options
}
// Broker to be used for pub/sub