license.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package conf
  2. import xtime "go-common/library/time"
  3. // Sync struct defines the parameters for the data sync to license owner
  4. type Sync struct {
  5. HTTPTimeout xtime.Duration
  6. DialTimeout xtime.Duration
  7. LogSize int
  8. LConf LicenseConf // conf for the sync with License Owner
  9. PlayURL PlayURL // playurl config
  10. API LicenseURL // license owner url
  11. Frequency Duration
  12. AuditPrefix string // the prefix for audit pgc data
  13. UGCPrefix string // the prefix for audit ugc data
  14. Sign string
  15. }
  16. // LicenseConf defubes the configuration about the comm with the license owner
  17. type LicenseConf struct {
  18. // how many programs can be contained in one message
  19. SizeMsg int
  20. // cpcode recognized by License owner
  21. CPCode string
  22. // number of modified season to sync in one time
  23. NbSeason int
  24. }
  25. // PlayURL defines the conf to have the temp play URL
  26. type PlayURL struct {
  27. Upsigsecret string // key of playurl
  28. Deadline string // deadline of playurl
  29. PlayPath string // path of playurl
  30. API string // the api to get the playurl with CID
  31. Qn string // quality of the video
  32. Deadcodes []int // playurl response codes, for them we think the video is dead and delete it
  33. }
  34. // Duration defines the frequencies of the data sync/wait
  35. type Duration struct {
  36. // Modified Season sync frequency
  37. FreModSeason xtime.Duration
  38. // how much time wait if error
  39. ErrorWait xtime.Duration
  40. // unit: seconds. if it's 3600, that means when we found season is delayed ( not in DB yet ), we postpone all its eps auditing one hour
  41. AuditDelay int64
  42. // unit: seconds. used for rejected season case, we re-audit its content in one day
  43. RejectWait int
  44. // one minute for the data to sync ( avoid selecting the same data )
  45. WaitCall int
  46. }
  47. // LicenseURL defines the API address of the license owner
  48. type LicenseURL struct {
  49. AddURL string
  50. DelSeasonURL string
  51. DelEPURL string
  52. UpdateURL string
  53. }