mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
cd1b613352
* Update AWS SDK to use PCA features. * Add AWS PCA provider * Add plumbing for config, config validation tests, add test for inheriting existing CA resources created by user * Unparallel the tests so we don't exhaust PCA limits * Merge updates * More aggressive polling; rate limit pass through on sign; Timeout on Sign and CA create * Add AWS PCA docs * Fix Vault doc typo too * Doc typo * Apply suggestions from code review Co-Authored-By: R.B. Boyer <rb@hashicorp.com> Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com> * Doc fixes; tests for erroring if State is modified via API * More review cleanup * Uncomment tests! * Minor suggested clean ups
46 lines
962 B
Go
46 lines
962 B
Go
package ini
|
|
|
|
// skipper is used to skip certain blocks of an ini file.
|
|
// Currently skipper is used to skip nested blocks of ini
|
|
// files. See example below
|
|
//
|
|
// [ foo ]
|
|
// nested = ; this section will be skipped
|
|
// a=b
|
|
// c=d
|
|
// bar=baz ; this will be included
|
|
type skipper struct {
|
|
shouldSkip bool
|
|
TokenSet bool
|
|
prevTok Token
|
|
}
|
|
|
|
func newSkipper() skipper {
|
|
return skipper{
|
|
prevTok: emptyToken,
|
|
}
|
|
}
|
|
|
|
func (s *skipper) ShouldSkip(tok Token) bool {
|
|
// should skip state will be modified only if previous token was new line (NL);
|
|
// and the current token is not WhiteSpace (WS).
|
|
if s.shouldSkip &&
|
|
s.prevTok.Type() == TokenNL &&
|
|
tok.Type() != TokenWS {
|
|
s.Continue()
|
|
return false
|
|
}
|
|
s.prevTok = tok
|
|
return s.shouldSkip
|
|
}
|
|
|
|
func (s *skipper) Skip() {
|
|
s.shouldSkip = true
|
|
}
|
|
|
|
func (s *skipper) Continue() {
|
|
s.shouldSkip = false
|
|
// empty token is assigned as we return to default state, when should skip is false
|
|
s.prevTok = emptyToken
|
|
}
|