MCPcopy Create free account
hub / github.com/gotenberg/gotenberg / Duration

Method Duration

pkg/modules/api/formdata.go:152–154  ·  view source on GitHub ↗

Duration binds a form field to a time.Duration variable. It populates an error if the form field is not time.Duration. var foo time.Duration ctx.FormData().Duration("foo", &foo, time.Duration(2) * time.Second)

(key string, target *time.Duration, defaultValue time.Duration)

Source from the content-addressed store, hash-verified

150//
151// ctx.FormData().Duration("foo", &foo, time.Duration(2) * time.Second)
152func (form *FormData) Duration(key string, target *time.Duration, defaultValue time.Duration) *FormData {
153 return form.mustValue(key, target, defaultValue)
154}
155
156// MandatoryDuration binds a form field to a time.Duration variable. It
157// populates an error if the value is not time.Duration, or is empty, or the

Callers 15

TestFilterDeadlineFunction · 0.80
DescriptorMethod · 0.80
DescriptorMethod · 0.80
StartMethod · 0.80
TestFormData_DurationFunction · 0.80
newContextFunction · 0.80

Calls 1

mustValueMethod · 0.95