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