Provision sets the module properties.
(ctx *gotenberg.Context)
| 70 | |
| 71 | // Provision sets the module properties. |
| 72 | func (w *Webhook) Provision(ctx *gotenberg.Context) error { |
| 73 | flags := ctx.ParsedFlags() |
| 74 | w.enableSyncMode = flags.MustBool("webhook-enable-sync-mode") |
| 75 | w.allowList = flags.MustRegexpSlice("webhook-allow-list") |
| 76 | w.denyList = flags.MustRegexpSlice("webhook-deny-list") |
| 77 | w.errorAllowList = flags.MustDeprecatedRegexpSlice("webhook-error-allow-list", "webhook-allow-list") |
| 78 | w.errorDenyList = flags.MustDeprecatedRegexpSlice("webhook-error-deny-list", "webhook-deny-list") |
| 79 | w.denyPrivateIPs = flags.MustBool("webhook-deny-private-ips") |
| 80 | w.denyPublicIPs = flags.MustBool("webhook-deny-public-ips") |
| 81 | w.maxRetry = flags.MustInt("webhook-max-retry") |
| 82 | w.retryMinWait = flags.MustDuration("webhook-retry-min-wait") |
| 83 | w.retryMaxWait = flags.MustDuration("webhook-retry-max-wait") |
| 84 | w.clientTimeout = flags.MustDuration("webhook-client-timeout") |
| 85 | w.disable = flags.MustBool("webhook-disable") |
| 86 | w.asyncCount.Store(0) |
| 87 | |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | // Middlewares returns the middleware. |
| 92 | func (w *Webhook) Middlewares() ([]api.Middleware, error) { |
nothing calls this directly
no test coverage detected