types.go 481 B

123456789101112131415161718192021222324252627282930313233
  1. package rest
  2. import "net/http"
  3. type (
  4. Middleware func(next http.HandlerFunc) http.HandlerFunc
  5. Route struct {
  6. Method string
  7. Path string
  8. Handler http.HandlerFunc
  9. }
  10. RouteOption func(r *featuredRoutes)
  11. jwtSetting struct {
  12. enabled bool
  13. secret string
  14. prevSecret string
  15. }
  16. signatureSetting struct {
  17. SignatureConf
  18. enabled bool
  19. }
  20. featuredRoutes struct {
  21. priority bool
  22. jwt jwtSetting
  23. signature signatureSetting
  24. routes []Route
  25. }
  26. )