refactor-test #15

Merged
xdrm-brackets merged 12 commits from refactor-test into 0.3.0 2020-04-04 15:33:44 +00:00
3 changed files with 11 additions and 14 deletions
Showing only changes of commit df56496a16 - Show all commits

View File

@ -8,6 +8,12 @@ import (
"git.xdrm.io/go/aicra/internal/config" "git.xdrm.io/go/aicra/internal/config"
) )
// Handler represents a dynamic api handler
type Handler struct {
spec spec
fn interface{}
}
// Build a handler from a service configuration and a dynamic function // Build a handler from a service configuration and a dynamic function
// //
// @fn must have as a signature : `func(inputStruct) (*outputStruct, api.Error)` // @fn must have as a signature : `func(inputStruct) (*outputStruct, api.Error)`

View File

@ -9,6 +9,11 @@ import (
"git.xdrm.io/go/aicra/internal/config" "git.xdrm.io/go/aicra/internal/config"
) )
type spec struct {
Input map[string]reflect.Type
Output map[string]reflect.Type
}
// builds a spec from the configuration service // builds a spec from the configuration service
func makeSpec(service config.Service) spec { func makeSpec(service config.Service) spec {
spec := spec{ spec := spec{

View File

@ -1,14 +0,0 @@
package dynfunc
import "reflect"
// Handler represents a dynamic api handler
type Handler struct {
spec spec
fn interface{}
}
type spec struct {
Input map[string]reflect.Type
Output map[string]reflect.Type
}