rename 'internal/apirequest' to 'internal/request' but use import alias 'apirequest' in dependencies

This commit is contained in:
Adrien Marquès 2018-09-28 08:10:41 +02:00
parent 9fa18b8736
commit f5800900b0
9 changed files with 10 additions and 8 deletions

View File

@ -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")

View File

@ -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)
}

View File

@ -1,4 +1,4 @@
package apirequest
package request
import (
"encoding/json"

View File

@ -1,4 +1,4 @@
package apirequest
package request
// Parse parameter (json-like) if not already done
func (i *Parameter) Parse() {

View File

@ -1,4 +1,4 @@
package apirequest
package request
import (
"encoding/json"

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package apirequest
package request
import (
"encoding/json"

View File

@ -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

View File

@ -3,8 +3,8 @@ package aicra
import (
"encoding/json"
"git.xdrm.io/go/aicra/err"
"git.xdrm.io/go/aicra/internal/apirequest"
"git.xdrm.io/go/aicra/internal/config"
apirequest "git.xdrm.io/go/aicra/internal/request"
"git.xdrm.io/go/aicra/response"
"log"
"net/http"