MCPcopy Index your code
hub / github.com/coder/coder / SetRuntimeValue

Method SetRuntimeValue

coderd/runtimeconfig/entry.go:49–56  ·  view source on GitHub ↗

SetRuntimeValue attempts to update the runtime value of this field in the store via the given Mutator.

(ctx context.Context, m Resolver, val T)

Source from the content-addressed store, hash-verified

47
48// SetRuntimeValue attempts to update the runtime value of this field in the store via the given Mutator.
49func (e RuntimeEntry[T]) SetRuntimeValue(ctx context.Context, m Resolver, val T) error {
50 name, err := e.name()
51 if err != nil {
52 return xerrors.Errorf("set runtime: %w", err)
53 }
54
55 return m.UpsertRuntimeConfig(ctx, name, val.String())
56}
57
58// UnsetRuntimeValue removes the runtime value from the store.
59func (e RuntimeEntry[T]) UnsetRuntimeValue(ctx context.Context, m Resolver) error {

Callers 6

TestEntryFunction · 0.80
SetupOrganizationFunction · 0.80
TestGetGroupSyncSettingsFunction · 0.80

Calls 4

nameMethod · 0.95
UpsertRuntimeConfigMethod · 0.65
ErrorfMethod · 0.45
StringMethod · 0.45

Tested by 3

TestEntryFunction · 0.64
SetupOrganizationFunction · 0.64
TestGetGroupSyncSettingsFunction · 0.64