Wire native pipeline run commands and invocation-wide overrides
This commit is contained in:
34
internal/cli/options.go
Normal file
34
internal/cli/options.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"go.maximumdirect.net/promptkit"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
LLMClient promptkit.LLMClient
|
||||
LLMRuntime promptkit.RuntimeConfig
|
||||
Catalog pipeline.ModuleCatalog
|
||||
Registries pipeline.Registries
|
||||
RunIDGenerator RunIDGenerator
|
||||
LookupEnv func(string) (string, bool)
|
||||
Now func() time.Time
|
||||
}
|
||||
|
||||
// Defaulting function values is inert; command construction does not acquire
|
||||
// configuration, register modules, resolve credentials, or allocate run storage.
|
||||
func defaultOptions(options Options) Options {
|
||||
if options.LookupEnv == nil {
|
||||
options.LookupEnv = os.LookupEnv
|
||||
}
|
||||
if options.Now == nil {
|
||||
options.Now = time.Now
|
||||
}
|
||||
if options.RunIDGenerator == nil {
|
||||
options.RunIDGenerator = defaultRunIDGenerator
|
||||
}
|
||||
return options
|
||||
}
|
||||
Reference in New Issue
Block a user