2023-03-28 22:48:58 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 22:48:58 +00:00
|
|
|
|
2020-07-23 15:24:20 +00:00
|
|
|
package pbautoconf
|
2020-06-05 19:56:19 +00:00
|
|
|
|
2021-05-27 21:29:43 +00:00
|
|
|
import "time"
|
|
|
|
|
2020-06-05 19:56:19 +00:00
|
|
|
func (req *AutoConfigRequest) RequestDatacenter() string {
|
|
|
|
return req.Datacenter
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req *AutoConfigRequest) IsRead() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req *AutoConfigRequest) AllowStaleRead() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req *AutoConfigRequest) TokenSecret() string {
|
|
|
|
return req.ConsulToken
|
|
|
|
}
|
|
|
|
|
|
|
|
func (req *AutoConfigRequest) SetTokenSecret(token string) {
|
|
|
|
req.ConsulToken = token
|
|
|
|
}
|
2021-05-27 21:29:43 +00:00
|
|
|
|
2022-10-18 19:05:09 +00:00
|
|
|
func (req *AutoConfigRequest) HasTimedOut(start time.Time, rpcHoldTimeout, _, _ time.Duration) (bool, error) {
|
|
|
|
return time.Since(start) > rpcHoldTimeout, nil
|
2021-05-27 21:29:43 +00:00
|
|
|
}
|