SetRuntimeValue attempts to update the runtime value of this field in the store via the given Mutator.
(ctx context.Context, m Resolver, val T)
| 47 | |
| 48 | // SetRuntimeValue attempts to update the runtime value of this field in the store via the given Mutator. |
| 49 | func (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. |
| 59 | func (e RuntimeEntry[T]) UnsetRuntimeValue(ctx context.Context, m Resolver) error { |