rename 'response' to 'api'
This commit is contained in:
parent
5e7ece3f30
commit
049400e2be
|
@ -1,4 +1,4 @@
|
|||
package response
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
|
@ -1,11 +1,11 @@
|
|||
package response
|
||||
package api
|
||||
|
||||
import (
|
||||
"git.xdrm.io/go/aicra/err"
|
||||
)
|
||||
|
||||
// New creates an empty response
|
||||
func New() *Response {
|
||||
func NewResponse() *Response {
|
||||
return &Response{
|
||||
data: make(map[string]interface{}),
|
||||
Err: err.Success,
|
|
@ -1,4 +1,4 @@
|
|||
package response
|
||||
package api
|
||||
|
||||
import (
|
||||
"git.xdrm.io/go/aicra/err"
|
|
@ -2,8 +2,8 @@ package driver
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
e "git.xdrm.io/go/aicra/err"
|
||||
"git.xdrm.io/go/aicra/response"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
@ -12,9 +12,9 @@ import (
|
|||
// genericController is the mockup for returning a controller with as a string the path
|
||||
type genericController string
|
||||
|
||||
func (path genericController) Get(d response.Arguments) response.Response {
|
||||
func (path genericController) Get(d api.Arguments) api.Response {
|
||||
|
||||
res := response.New()
|
||||
res := api.NewResponse()
|
||||
|
||||
/* (1) Prepare stdin data */
|
||||
stdin, err := json.Marshal(d)
|
||||
|
@ -79,13 +79,13 @@ func (path genericController) Get(d response.Arguments) response.Response {
|
|||
|
||||
}
|
||||
|
||||
func (path genericController) Post(d response.Arguments) response.Response {
|
||||
func (path genericController) Post(d api.Arguments) api.Response {
|
||||
return path.Get(d)
|
||||
}
|
||||
func (path genericController) Put(d response.Arguments) response.Response {
|
||||
func (path genericController) Put(d api.Arguments) api.Response {
|
||||
return path.Get(d)
|
||||
}
|
||||
func (path genericController) Delete(d response.Arguments) response.Response {
|
||||
func (path genericController) Delete(d api.Arguments) api.Response {
|
||||
return path.Get(d)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package driver
|
||||
|
||||
import (
|
||||
"git.xdrm.io/go/aicra/response"
|
||||
"git.xdrm.io/go/aicra/api"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
@ -27,10 +27,10 @@ type Checker interface {
|
|||
// Controller is the interface that controller implementation must follow
|
||||
// it is used by the 'Import' driver
|
||||
type Controller interface {
|
||||
Get(d response.Arguments) response.Response
|
||||
Post(d response.Arguments) response.Response
|
||||
Put(d response.Arguments) response.Response
|
||||
Delete(d response.Arguments) response.Response
|
||||
Get(d api.Arguments) api.Response
|
||||
Post(d api.Arguments) api.Response
|
||||
Put(d api.Arguments) api.Response
|
||||
Delete(d api.Arguments) api.Response
|
||||
}
|
||||
|
||||
// Middleware is the interface that middleware implementation must follow
|
||||
|
|
Loading…
Reference in New Issue