Refactored, added comprehensive testing.
All checks were successful
Release / release (push) Successful in 3m17s
All checks were successful
Release / release (push) Successful in 3m17s
This commit is contained in:
71
config/types.go
Normal file
71
config/types.go
Normal file
@@ -0,0 +1,71 @@
|
||||
package config
|
||||
|
||||
type APIProtocol int
|
||||
|
||||
const (
|
||||
ProtocolOpenAI APIProtocol = iota
|
||||
ProtocolOllama
|
||||
)
|
||||
|
||||
type ConfigData struct {
|
||||
// Input
|
||||
FilePaths []string
|
||||
PromptFlags []string
|
||||
PromptPaths []string
|
||||
StdinAsFile bool
|
||||
|
||||
// System
|
||||
SystemPrompt string
|
||||
|
||||
// API
|
||||
Protocol APIProtocol
|
||||
URL string
|
||||
APIKey string
|
||||
|
||||
// Models
|
||||
Model string
|
||||
FallbackModels []string
|
||||
|
||||
// Output
|
||||
Output string
|
||||
Quiet bool
|
||||
Verbose bool
|
||||
}
|
||||
|
||||
type flagValues struct {
|
||||
files []string
|
||||
prompts []string
|
||||
promptFile string
|
||||
system string
|
||||
systemFile string
|
||||
key string
|
||||
keyFile string
|
||||
protocol string
|
||||
url string
|
||||
model string
|
||||
fallback string
|
||||
output string
|
||||
config string
|
||||
stdinFile bool
|
||||
quiet bool
|
||||
verbose bool
|
||||
version bool
|
||||
}
|
||||
|
||||
type envValues struct {
|
||||
protocol string
|
||||
url string
|
||||
key string
|
||||
model string
|
||||
fallback string
|
||||
system string
|
||||
}
|
||||
|
||||
type fileValues struct {
|
||||
protocol string
|
||||
url string
|
||||
keyFile string
|
||||
model string
|
||||
fallback string
|
||||
systemFile string
|
||||
}
|
||||
Reference in New Issue
Block a user