RegisterFlags registers flags.
(f *flag.FlagSet)
| 34 | |
| 35 | // RegisterFlags registers flags. |
| 36 | func (cfg *Config) RegisterFlags(f *flag.FlagSet) { |
| 37 | cfg.GRPCClientConfig.RegisterFlagsWithPrefix("livestore.client", f) |
| 38 | |
| 39 | f.DurationVar(&cfg.PoolConfig.HealthCheckTimeout, "livestore.client.healthcheck-timeout", 1*time.Second, "Timeout for healthcheck rpcs.") |
| 40 | f.DurationVar(&cfg.PoolConfig.CheckInterval, "livestore.client.healthcheck-interval", 15*time.Second, "Interval to healthcheck livestores") |
| 41 | f.BoolVar(&cfg.PoolConfig.HealthCheckEnabled, "livestore.client.healthcheck-enabled", true, "Healthcheck livestores.") |
| 42 | f.DurationVar(&cfg.RemoteTimeout, "livestore.client.timeout", 5*time.Second, "Timeout for livestore client RPCs.") |
| 43 | } |
| 44 | |
| 45 | // New returns a new livestore client. |
| 46 | func New(addr string, cfg Config) (*Client, error) { |
no test coverage detected