homebox/backend/pkgs/server/result.go

20 lines
441 B
Go
Raw Normal View History

2022-08-30 02:30:36 +00:00
package server
type Result struct {
Error bool `json:"error,omitempty"`
Details interface{} `json:"details,omitempty"`
Message string `json:"message,omitempty"`
Item interface{} `json:"item,omitempty"`
}
2022-08-31 05:22:01 +00:00
type Results struct {
Items any `json:"items"`
}
2022-08-30 02:30:36 +00:00
// Wrap creates a Wrapper instance and adds the initial namespace and data to be returned.
func Wrap(data interface{}) Result {
return Result{
Item: data,
}
}