Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавить возможность проверки текущего времени в ответах #257

Open
leorush opened this issue Feb 21, 2025 · 0 comments

Comments

@leorush
Copy link
Contributor

leorush commented Feb 21, 2025

Сейчас время проверяется через регексп. Пример:
"created_at": "$matchRegexp(^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) [0-9]{1,2}:[0-9]{2}:[0-9]{2}$)"

Идея состоит в том, чтобы добавить возможность проверять соответствие значения,
с текущем датой/временем в определённом формате, плос дельта.
В yaml это может выглядеть так:

"created_at": "$matchTime(2006-01-02T15:04:05-0700, 5)"

Gonkey берёт текущее время, парсит значение по написанному формату, и вычисляет разницу между ними.
Если значение больше дельты (в примере 5 секунд) - возвращаем ошибку.
Если формат не соответствует значению - тоже возвращаем ошибку.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant