types.go 728 B

123456789101112131415161718192021
  1. package nginx_log
  2. import "github.com/0xJacky/Nginx-UI/internal/translation"
  3. const (
  4. // PageSize defines the size of log chunks returned by the API
  5. PageSize = 128 * 1024
  6. )
  7. // controlStruct represents the request parameters for getting log content
  8. type controlStruct struct {
  9. Type string `json:"type"` // Type of log: "access" or "error"
  10. Path string `json:"path"` // Path to the log file
  11. }
  12. // nginxLogPageResp represents the response format for log content
  13. type nginxLogPageResp struct {
  14. Content string `json:"content"` // Log content
  15. Page int64 `json:"page"` // Current page number
  16. Error *translation.Container `json:"error,omitempty"` // Error message if any
  17. }