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

Method SetConfigItem

pkg/database/config.go:24–37  ·  view source on GitHub ↗
(ctx context.Context, key string, value string)

Source from the content-addressed store, hash-verified

22}
23
24func (c *Client) SetConfigItem(ctx context.Context, key string, value string) error {
25 err := c.Ent.ConfigItem.
26 Create().
27 SetName(key).
28 SetValue(value).
29 OnConflictColumns(configitem.FieldName).
30 UpdateNewValues().
31 Exec(ctx)
32 if err != nil {
33 return fmt.Errorf("insert/update config item: %w", err)
34 }
35
36 return nil
37}

Callers 3

SaveAPICTokenMethod · 0.95
updateBlocklistMethod · 0.80
PullMethod · 0.80

Calls 6

ExecMethod · 0.45
UpdateNewValuesMethod · 0.45
OnConflictColumnsMethod · 0.45
SetValueMethod · 0.45
SetNameMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected