2015-12-19 21:28:08 +03:00
|
|
|
package registry
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2016-01-06 19:25:12 +03:00
|
|
|
|
|
|
|
"golang.org/x/net/context"
|
2015-12-19 21:28:08 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
type Options struct {
|
|
|
|
Timeout time.Duration
|
2016-01-16 23:25:18 +03:00
|
|
|
Secure bool
|
2015-12-31 21:14:40 +03:00
|
|
|
|
2016-01-06 19:25:12 +03:00
|
|
|
// Other options for implementations of the interface
|
|
|
|
// can be stored in a context
|
|
|
|
Context context.Context
|
2015-12-19 21:28:08 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func Timeout(t time.Duration) Option {
|
|
|
|
return func(o *Options) {
|
|
|
|
o.Timeout = t
|
|
|
|
}
|
|
|
|
}
|
2016-01-16 23:25:18 +03:00
|
|
|
|
|
|
|
// Secure communication with the registry
|
|
|
|
func Secure(b bool) Option {
|
|
|
|
return func(o *Options) {
|
|
|
|
o.Secure = b
|
|
|
|
}
|
|
|
|
}
|