Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogOptions ¶
type LogOptions struct {
// The log output type.
Output LogOutput
// The log format.
Format LogFormat
// The log level.
Level string
// The log file path. Only used if Output is LogOutputFile.
FilePath string
}
LogOptions contains options for logging.
type LogOutput ¶
type LogOutput string
const ( // LogOutputStdout indicates that logs should be written to stdout. LogOutputStdout LogOutput = "stdout" // LogOutputStderr indicates that logs should be written to stderr. LogOutputStderr LogOutput = "stderr" // LogOutputFile indicates that logs should be written to a file. LogOutputFile LogOutput = "file" // LogOutputNone indicates that no logs should be written. LogOutputNone LogOutput = "none" )
type OnErrorStrategy ¶
type OnErrorStrategy int
const ( // OnErrorExit causes the process to exit if its internal function returns an error. OnErrorExit OnErrorStrategy = iota // OnErrorRestart causes the process to be restarted if its internal function returns an error. OnErrorRestart )
type Options ¶
type Options struct {
// The logging configuration.
Log LogOptions
// The pubsub configuration.
PubSub PubSubOptions
// Whether to enable opentelemetry.
// If nil, opentelemetry is disabled.
Telemetry *telemetry.Options
}
Options contains options for the runtime.
type Proc ¶
type Proc interface {
Spawn(ctx context.Context, fn ProcessFn, opts SpawnOptions) ProcessHandle
}
type ProcessFn ¶
type ProcessFn func(state *ProcessState) error
type ProcessHandle ¶
type PubSubOptions ¶
type PubSubOptions struct {
MaxBufferSize uint32
}
PubSubOptions contains options for the pubsub system.
type Scheduler ¶
type Scheduler interface {
Schedule(process ProcessFn, opts SpawnOptions, interval time.Duration)
}
type SpawnOptions ¶
type SpawnOptions struct {
// The error handling strategy for the process.
OnError OnErrorStrategy
// The name of the process.
Name string
// Whether to create a telemetry span for the process.
Instrument bool
}
type SubscriptionHandle ¶
type SubscriptionHandle interface {
Data() <-chan any
Close()
}
Click to show internal directories.
Click to hide internal directories.