Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Envelope ¶
type Envelope struct {
OK bool `json:"ok"`
Data interface{} `json:"data,omitempty"`
Error *ErrorInfo `json:"error,omitempty"`
Meta *Meta `json:"meta,omitempty"`
}
Envelope 是 CLI 对 Agent/脚本的统一输出契约(对齐 gitlink-cli)。
func FromServer ¶
func FromServer(status int, raw json.RawMessage) *Envelope
FromServer 把服务端响应映射为 Envelope。兼容:
- 标准壳 {code, message, data, timestamp}(internal/pkg/response)
- 错误体 {code, message} / {status, message}
- 裸 JSON(列表包装 list/tasks/items/... 会拍平到 data + meta)
Click to show internal directories.
Click to hide internal directories.