Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.
(hooks ...Hook)
| 238 | // Use adds the mutation hooks to all the entity clients. |
| 239 | // In order to add hooks to a specific client, call: `client.Node.Use(...)`. |
| 240 | func (c *Client) Use(hooks ...Hook) { |
| 241 | for _, n := range []interface{ Use(...Hook) }{ |
| 242 | c.Alert, c.AllowList, c.AllowListItem, c.Bouncer, c.ConfigItem, c.Decision, |
| 243 | c.Event, c.Lock, c.Machine, c.Meta, c.Metric, |
| 244 | } { |
| 245 | n.Use(hooks...) |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // Intercept adds the query interceptors to all the entity clients. |
| 250 | // In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`. |