mirror of
https://gitee.com/chuangxxt/share-copilot
synced 2025-04-16 10:13:26 +00:00
40 lines
893 B
Go
40 lines
893 B
Go
package main
|
|
|
|
import (
|
|
"github.com/nsf/termbox-go"
|
|
"sync"
|
|
)
|
|
|
|
type Config struct {
|
|
Server struct {
|
|
Domain string `json:"domain"`
|
|
Host string `json:"host"`
|
|
Port int `json:"port"`
|
|
CertPath string `json:"certPath"`
|
|
KeyPath string `json:"keyPath"`
|
|
} `json:"server"`
|
|
CopilotConfig struct {
|
|
GithubApiUrl string `json:"github_api_url"`
|
|
Token []string `json:"token"`
|
|
} `json:"copilot_config"`
|
|
Verification string `json:"verification"`
|
|
}
|
|
|
|
// InfoItem 表示要显示的内容项
|
|
type InfoItem struct {
|
|
Title string
|
|
Value string
|
|
TitleColor termbox.Attribute // 标题颜色
|
|
ValueColor termbox.Attribute // 内容颜色
|
|
}
|
|
|
|
var (
|
|
//初始化需要返回给客户端的响应体
|
|
responseData map[string]interface{}
|
|
requestCountMutex sync.Mutex
|
|
githubApiCount = 0
|
|
requestCount = 0
|
|
successCount = 0
|
|
configFile Config
|
|
)
|