forked from stripe/veneur
/
options.go
38 lines (32 loc) · 845 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package proxysrv
import (
"time"
"github.com/sirupsen/logrus"
"github.com/stripe/veneur/trace"
)
// WithForwardTimeout sets the time after which an individual RPC to a
// downstream Veneur times out
func WithForwardTimeout(d time.Duration) Option {
return func(opts *options) {
opts.forwardTimeout = d
}
}
// WithLog sets the logger entry used in the object.
func WithLog(e *logrus.Entry) Option {
return func(opts *options) {
opts.log = e
}
}
// WithStatsInterval sets the time interval at which diagnostic metrics about
// the server will be emitted.
func WithStatsInterval(d time.Duration) Option {
return func(opts *options) {
opts.statsInterval = d
}
}
// WithTraceClient sets the trace client used by the server.
func WithTraceClient(c *trace.Client) Option {
return func(opts *options) {
opts.traceClient = c
}
}