@cryptotaxi247 / kubo / commits / 289bce6bd

commands: Added Request#SetContext()

Matt Bell committed Oct 27, 2014 at 18:13 UTC 289bce6bdb67fc28ba3c69dcaac01e67ef86b903
1 file changed +5
commands/request.go
+5
@@ -28,6 +28,7 @@ type Request interface {
28 Stream() io.Reader
29 SetStream(io.Reader)
30 Context() *Context
31 + SetContext(Context)
32
33 ConvertOptions(options map[string]Option) error
34 }
@@ -84,6 +85,10 @@ func (r *request) Context() *Context {
85 return &r.ctx
86 }
87
88 +func (r *request) SetContext(ctx Context) {
89 + r.ctx = ctx
90 +}
91 +
92 type converter func(string) (interface{}, error)
93
94 var converters = map[reflect.Kind]converter{