homebox/backend/pkgs/server/result.go
Hayden 6529549289
refactor: http interfaces (#114)
* implement custom http handler interface

* implement trace_id

* normalize http method spacing for consistent logs

* fix failing test

* fix linter errors

* cleanup old dead code

* more route cleanup

* cleanup some inconsistent errors

* update and generate code

* make taskfile more consistent

* update task calls

* run tidy

* drop `@` tag for version

* use relative paths

* tidy

* fix auto-setting variables

* update build paths

* add contributing guide

* tidy
2022-10-29 18:15:35 -08:00

19 lines
441 B
Go

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"`
}
type Results struct {
Items any `json:"items"`
}
// Wrap creates a Wrapper instance and adds the initial namespace and data to be returned.
func Wrap(data interface{}) Result {
return Result{
Item: data,
}
}