ratio_sync.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package dto
  2. type UpstreamDTO struct {
  3. ID int `json:"id,omitempty"`
  4. Name string `json:"name" binding:"required"`
  5. BaseURL string `json:"base_url" binding:"required"`
  6. Endpoint string `json:"endpoint"`
  7. }
  8. type UpstreamRequest struct {
  9. ChannelIDs []int64 `json:"channel_ids"`
  10. Upstreams []UpstreamDTO `json:"upstreams"`
  11. Timeout int `json:"timeout"`
  12. }
  13. // TestResult 上游测试连通性结果
  14. type TestResult struct {
  15. Name string `json:"name"`
  16. Status string `json:"status"`
  17. Error string `json:"error,omitempty"`
  18. }
  19. // DifferenceItem 差异项
  20. // Current 为本地值,可能为 nil
  21. // Upstreams 为各渠道的上游值,具体数值 / "same" / nil
  22. type DifferenceItem struct {
  23. Current interface{} `json:"current"`
  24. Upstreams map[string]interface{} `json:"upstreams"`
  25. Confidence map[string]bool `json:"confidence"`
  26. }
  27. type SyncableChannel struct {
  28. ID int `json:"id"`
  29. Name string `json:"name"`
  30. BaseURL string `json:"base_url"`
  31. Status int `json:"status"`
  32. }