Comments (3)
Hi @mrkagelui, thanks for the question.
It's much more common to register a variable named now
(type timestamp
) and provide an updated value for the variable on each evaluation. From CEL's perspective, a function like now()
which fetches the latest timestamp would lead to subtle bugs related to differences in time between calls:
// Note, the duration calculation on the order of days needs to be modified as well
user.registered_at - now < duration(string(90*24) + "h")
Hopefully, that answers your question.
-Tristan
from cel-spec.
oh, sorry I'm a newbie here, let me try to spell this.
so in my use case, I'd need to somehow add the Now
in my user struct, and then
user.registered_at - user.now < duration(string(90*24) + "h")
?
from cel-spec.
I mean, I'm not sure how exactly to register a variable in every evaluation
from cel-spec.
Related Issues (20)
- Function Definitions and Variables HOT 2
- Protobuf extensions HOT 2
- Checking for undeclared reference HOT 1
- hobo HOT 1
- Monaco Editor language support HOT 4
- What does the `~*` mean? HOT 1
- [question] Duplicate/unique check expression HOT 2
- Bzlmod for v0.14.0
- Add access to the descriptor (of a protobuf message). HOT 1
- .
- Pięknie chyba się udalo
- Będzie dobrze
- Internet, telefonia i telewizja | Plus
- Should `optional.none()` == `null` ? HOT 2
- is this a good language to use a FaaS solution?
- Does the getHours() method use Winter or Daylight Saving Time? HOT 1
- Proper bazel support HOT 1
- Clarify Interoperability between binary formats? HOT 2
- Document cost system of CEL HOT 1
- Document opt-in instruction for available features
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cel-spec.