Add deadline option
This commit is contained in:
parent
32f9546ed5
commit
5b034ba253
@ -11,7 +11,8 @@ type Options struct {
|
|||||||
Addrs []string
|
Addrs []string
|
||||||
Secure bool
|
Secure bool
|
||||||
TLSConfig *tls.Config
|
TLSConfig *tls.Config
|
||||||
|
// Deadline sets the time to wait to Send/Recv
|
||||||
|
Deadline time.Duration
|
||||||
// Other options for implementations of the interface
|
// Other options for implementations of the interface
|
||||||
// can be stored in a context
|
// can be stored in a context
|
||||||
Context context.Context
|
Context context.Context
|
||||||
@ -45,6 +46,13 @@ func Addrs(addrs ...string) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deadline sets the time to wait for Send/Recv execution
|
||||||
|
func Deadline(t time.Duration) Option {
|
||||||
|
return func(o *Options) {
|
||||||
|
o.Deadline = t
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Use secure communication. If TLSConfig is not specified we
|
// Use secure communication. If TLSConfig is not specified we
|
||||||
// use InsecureSkipVerify and generate a self signed cert
|
// use InsecureSkipVerify and generate a self signed cert
|
||||||
func Secure(b bool) Option {
|
func Secure(b bool) Option {
|
||||||
|
Loading…
Reference in New Issue
Block a user