rename 'internal/apirequest' to 'internal/request' but use import alias 'apirequest' in dependencies
This commit is contained in:
parent
9fa18b8736
commit
f5800900b0
|
@ -64,7 +64,7 @@ func (d *Generic) Load(_path []string, _method string) (func(response.Arguments)
|
|||
if outErr, ok := output["error"]; ok {
|
||||
errCode, ok := outErr.(float64)
|
||||
if ok {
|
||||
res.Err = e.Error{int(errCode), "unknown reason", nil}
|
||||
res.Err = e.Error{Code: int(errCode), Reason: "unknown reason", Arguments: nil}
|
||||
}
|
||||
|
||||
delete(output, "error")
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"git.xdrm.io/go/aicra/response"
|
||||
)
|
||||
|
||||
// Driver defines the driver interface to load controller/middleware implementation or executables
|
||||
type Driver interface {
|
||||
Load(_path []string, _method string) (func(response.Arguments) response.Response, err.Error)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package apirequest
|
||||
package request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
|
@ -1,4 +1,4 @@
|
|||
package apirequest
|
||||
package request
|
||||
|
||||
// Parse parameter (json-like) if not already done
|
||||
func (i *Parameter) Parse() {
|
|
@ -1,4 +1,4 @@
|
|||
package apirequest
|
||||
package request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
|
@ -1,4 +1,4 @@
|
|||
package apirequest
|
||||
package request
|
||||
|
||||
// Request represents a request by its URI, controller path and data (uri, get, post)
|
||||
type Request struct {
|
|
@ -1,4 +1,4 @@
|
|||
package apirequest
|
||||
package request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
|
@ -4,9 +4,9 @@ import (
|
|||
"errors"
|
||||
"git.xdrm.io/go/aicra/driver"
|
||||
e "git.xdrm.io/go/aicra/err"
|
||||
"git.xdrm.io/go/aicra/internal/apirequest"
|
||||
"git.xdrm.io/go/aicra/internal/checker"
|
||||
"git.xdrm.io/go/aicra/internal/config"
|
||||
apirequest "git.xdrm.io/go/aicra/internal/request"
|
||||
"git.xdrm.io/go/aicra/middleware"
|
||||
"log"
|
||||
"net/http"
|
||||
|
@ -23,6 +23,7 @@ type Server struct {
|
|||
driver driver.Driver
|
||||
}
|
||||
|
||||
// ErrNilDriver is raised when a NULL driver is given to the constructor
|
||||
var ErrNilDriver = errors.New("the driver is <nil>")
|
||||
|
||||
// New creates a framework instance from a configuration file
|
||||
|
|
Loading…
Reference in New Issue