MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / defaults

Method defaults

pkg/database/ent/meta_create.go:133–142  ·  view source on GitHub ↗

defaults sets the default values of the builder before save.

()

Source from the content-addressed store, hash-verified

131
132// defaults sets the default values of the builder before save.
133func (_c *MetaCreate) defaults() {
134 if _, ok := _c.mutation.CreatedAt(); !ok {
135 v := meta.DefaultCreatedAt()
136 _c.mutation.SetCreatedAt(v)
137 }
138 if _, ok := _c.mutation.UpdatedAt(); !ok {
139 v := meta.DefaultUpdatedAt()
140 _c.mutation.SetUpdatedAt(v)
141 }
142}
143
144// check runs all checks and user-defined validators on the builder.
145func (_c *MetaCreate) check() error {

Callers 2

SaveMethod · 0.95
SaveMethod · 0.45

Calls 4

CreatedAtMethod · 0.45
SetCreatedAtMethod · 0.45
UpdatedAtMethod · 0.45
SetUpdatedAtMethod · 0.45

Tested by

no test coverage detected