feat: rest validation on http requests (#3041)

This commit is contained in:
Kevin Wan
2023-03-19 20:04:18 +08:00
committed by GitHub
parent 18d163c4f7
commit 6170d7b790
4 changed files with 32 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ func (pe *PeriodicalExecutor) Flush() bool {
}())
}
// Sync lets caller to run fn thread-safe with pe, especially for the underlying container.
// Sync lets caller run fn thread-safe with pe, especially for the underlying container.
func (pe *PeriodicalExecutor) Sync(fn func()) {
pe.lock.Lock()
defer pe.lock.Unlock()

View File

@@ -0,0 +1,7 @@
package validation
// Validator represents a validator.
type Validator interface {
// Validate validates the value.
Validate() error
}