Rework client interface

This commit is contained in:
Asim Aslam
2018-04-14 18:06:52 +01:00
parent 07068379c6
commit c2cfe5310c
10 changed files with 87 additions and 127 deletions

View File

@@ -68,7 +68,8 @@ type PublishOptions struct {
}
type RequestOptions struct {
Stream bool
ContentType string
Stream bool
// Other options for implementations of the interface
// can be stored in a context
@@ -290,6 +291,12 @@ func WithDialTimeout(d time.Duration) CallOption {
// Request Options
func WithContentType(ct string) RequestOption {
return func(o *RequestOptions) {
o.ContentType = ct
}
}
func StreamingRequest() RequestOption {
return func(o *RequestOptions) {
o.Stream = true