Documentation
¶
Index ¶
Constants ¶
const ( VersionLatest = config.VersionLatest // Latest supported version VersionUnknown = config.VersionUnknown // Used when version is not specified )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Runner)
Option represents a functional option for configuring Runner.
func WithConfigCallback ¶
func WithConfigCallback(callback func() *pb.ServerConfig) Option
WithConfigCallback sets the function that will be called to load or reload configuration. This option is required when creating a new Runner.
func WithContext ¶
WithContext sets a custom context for the Runner instance. This allows for more granular control over cancellation and timeouts.
func WithLogHandler ¶
WithLogHandler sets a custom slog handler for the Runner instance. For example, to use a custom JSON handler with debug level:
handler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug})
func WithLogger ¶
WithLogger sets a logger for the Runner instance.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner implements the supervisor.Runnable and supervisor.Reloadable interfaces.
func (*Runner) Reload ¶
func (r *Runner) Reload()
Reload implements the Reloadable interface and reloads the Runner with the latest configuration