MCPcopy
hub / github.com/crowdsecurity/crowdsec / defaults

Method defaults

pkg/database/ent/allowlist_create.go:143–152  ·  view source on GitHub ↗

defaults sets the default values of the builder before save.

()

Source from the content-addressed store, hash-verified

141
142// defaults sets the default values of the builder before save.
143func (_c *AllowListCreate) defaults() {
144 if _, ok := _c.mutation.CreatedAt(); !ok {
145 v := allowlist.DefaultCreatedAt()
146 _c.mutation.SetCreatedAt(v)
147 }
148 if _, ok := _c.mutation.UpdatedAt(); !ok {
149 v := allowlist.DefaultUpdatedAt()
150 _c.mutation.SetUpdatedAt(v)
151 }
152}
153
154// check runs all checks and user-defined validators on the builder.
155func (_c *AllowListCreate) 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