config.go 719 B

123456789101112131415161718192021222324252627282930313233
  1. package ngin
  2. import (
  3. "time"
  4. "zero/core/service"
  5. )
  6. type (
  7. PrivateKeyConf struct {
  8. Fingerprint string
  9. KeyFile string
  10. }
  11. SignatureConf struct {
  12. Strict bool `json:",default=false"`
  13. Expiry time.Duration `json:",default=1h"`
  14. PrivateKeys []PrivateKeyConf
  15. }
  16. NgConf struct {
  17. service.ServiceConf
  18. Host string `json:",default=0.0.0.0"`
  19. Port int
  20. Verbose bool `json:",optional"`
  21. MaxConns int `json:",default=10000"`
  22. MaxBytes int64 `json:",default=1048576,range=[0:8388608]"`
  23. // milliseconds
  24. Timeout int64 `json:",default=3000"`
  25. CpuThreshold int64 `json:",default=900,range=[0:1000]"`
  26. Signature SignatureConf `json:",optional"`
  27. }
  28. )