client: add select options (#1786)

This commit is contained in:
ben-toogood
2020-07-02 17:03:08 +01:00
committed by GitHub
parent 6898a65508
commit b021546c09
3 changed files with 11 additions and 2 deletions

View File

@@ -60,6 +60,8 @@ type CallOptions struct {
Router router.Router
// Selector to use for the call
Selector selector.Selector
// SelectOptions to use when selecting a route
SelectOptions []selector.SelectOption
// Stream timeout for the stream
StreamTimeout time.Duration
// Use the services own auth token
@@ -360,6 +362,13 @@ func WithSelector(s selector.Selector) CallOption {
}
}
// WithSelectOptions sets the options to pass to the selector for this call
func WithSelectOptions(sops ...selector.SelectOption) CallOption {
return func(o *CallOptions) {
o.SelectOptions = sops
}
}
func WithMessageContentType(ct string) MessageOption {
return func(o *MessageOptions) {
o.ContentType = ct