types.go 847 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package cli
  2. import "time"
  3. type Param struct {
  4. Key string
  5. Value string
  6. }
  7. type Params []Param
  8. type HandleFunc func(ctx *Context) (err error)
  9. type Middleware func(next HandleFunc) HandleFunc
  10. type responsePayload struct {
  11. Type uint8 `json:"-"`
  12. Code int `json:"code"`
  13. Reason string `json:"reason,omitempty"`
  14. Data any `json:"data,omitempty"`
  15. }
  16. type Info struct {
  17. ID int64 `json:"id"`
  18. OS string `json:"os"`
  19. Name string `json:"name"`
  20. Version string `json:"version"`
  21. ServerTime time.Time `json:"server_time"`
  22. RemoteAddr string `json:"remote_addr"`
  23. }
  24. type Command struct {
  25. Path string
  26. Handle HandleFunc
  27. Description string
  28. }
  29. type commander struct {
  30. Name string
  31. Path string
  32. Description string
  33. }
  34. type encoder interface {
  35. Marshal() ([]byte, error)
  36. }