package config import "reflect" // JSCKSourceSleeper is the sleeper source's configuration key. const JSCKSourceSleeper string = "sleeper" // JSCSourceSleeper configures the sleeper, a test source that // simulates work by sleeping. With BlockShutdown its work ignores // cancellation, to test shutdown waiting on a non-cooperative task. type JSCSourceSleeper struct { JSCSourcesSource BlockShutdown bool `cfg:"block_shutdown"` } // ---------- Section methods (see Section) ---------- // Map implements Section. func (c JSCSourceSleeper) Map() map[string]any { return mapOf(c) } // Flatten implements Section. func (c JSCSourceSleeper) Flatten() map[string]any { return flattenOf(JSCKSourceSleeper, c) } // TypeOf implements Section. func (c JSCSourceSleeper) TypeOf(key string) (reflect.Kind, error) { return typeOf(c, key) } // ValueOf implements Section. func (c JSCSourceSleeper) ValueOf(key string) (any, error) { return valueOf(c, key) } // SetValue implements Section. func (c *JSCSourceSleeper) SetValue(key string, value any) error { return setValue(c, key, value) }