rework service options #24
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
rework service options struct and methods to get:
so service acts as container for primitives
how to deal with top level options in micro like micro.Address or micro.Broker ?
as we can have multiple brokers that will be used for specific client and server we need to configure each client and server individually not via single micro.Broker option
Broker/Registry/Address options will be changed to following signature
func Broker(id string, b broker.Broker) (Option, error)
all Option will be changed to func(xxx) (Option, error) to allow validation
extend server/client/broker/registry with ID() method that returns configured id
also options must have ID string field.
So when you want to publish you can call svc.Client(ID).Publish(xxx, client.PublishBroker(ID))
or subscribe
svc.Server(ID).Subscrbe(xxx, server.SubscribeBroker(ID))