mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-05 02:30:26 +08:00
- Move all source files to internal/{app,backend,config,executor,logger,parser,utils}
- Integrate third-party libraries: zerolog, goccy/go-json, gopsutil, cobra/viper
- Add comprehensive unit tests for utils package (94.3% coverage)
- Add performance benchmarks for string operations
- Fix error display: cleanup warnings no longer pollute Recent Errors
- Add GitHub Actions CI workflow
- Add Makefile for build automation
- Add README documentation
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
30 lines
597 B
Go
30 lines
597 B
Go
package backend
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
var registry = map[string]Backend{
|
|
"codex": CodexBackend{},
|
|
"claude": ClaudeBackend{},
|
|
"gemini": GeminiBackend{},
|
|
"opencode": OpencodeBackend{},
|
|
}
|
|
|
|
// Registry exposes the available backends. Intended for internal inspection/tests.
|
|
func Registry() map[string]Backend {
|
|
return registry
|
|
}
|
|
|
|
func Select(name string) (Backend, error) {
|
|
key := strings.ToLower(strings.TrimSpace(name))
|
|
if key == "" {
|
|
key = "codex"
|
|
}
|
|
if backend, ok := registry[key]; ok {
|
|
return backend, nil
|
|
}
|
|
return nil, fmt.Errorf("unsupported backend %q", name)
|
|
}
|