feat: define browser domain and application contracts
This commit is contained in:
+1
-27
@@ -4,33 +4,7 @@ MVP 首先提供本地 Go application service 和 CLI;是否增加 loopback HT
|
||||
|
||||
## 核心类型
|
||||
|
||||
```go
|
||||
type BrowserKind string
|
||||
const (
|
||||
BrowserChrome BrowserKind = "chrome"
|
||||
BrowserEdge BrowserKind = "edge"
|
||||
)
|
||||
|
||||
type LaunchSpec struct {
|
||||
Kind BrowserKind
|
||||
Executable string
|
||||
UserDataDir string
|
||||
ProfileDirectory string
|
||||
TargetURL string
|
||||
ProxyServer string
|
||||
Headless bool
|
||||
ExtraArgs []string
|
||||
}
|
||||
|
||||
type InstanceView struct {
|
||||
ID string
|
||||
Kind BrowserKind
|
||||
PID int
|
||||
UserDataDir string
|
||||
Status string
|
||||
ExitCode *int
|
||||
}
|
||||
```
|
||||
代码权威类型位于 `internal/domain/browser.go`:`BrowserKind`、`LaunchSpec`、`InstanceStatus`、`InstanceView`、`BrowserEvent` 和稳定错误码。`LaunchSpec.Normalize()` 负责当前已确定的 browser kind、绝对 user data dir 和 http/https URL 校验。
|
||||
|
||||
## Application service
|
||||
|
||||
|
||||
Reference in New Issue
Block a user