From ee19846ddcbc4c36a7d9b9840f2aa66fd554c897 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 1 Oct 2018 21:16:59 +0200 Subject: [PATCH] unexport driver.generic mockups --- driver/generic.go | 6 +++--- driver/generic.mockup.go | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/driver/generic.go b/driver/generic.go index 8c60687..c44fcae 100644 --- a/driver/generic.go +++ b/driver/generic.go @@ -35,17 +35,17 @@ func (d Generic) Compiled() bool { return false } // LoadController implements the Driver interface func (d *Generic) LoadController(_path string) (Controller, error) { - return GenericController(_path), nil + return genericController(_path), nil } // LoadMiddleware returns a new middleware; it must be a // valid and existing folder/filename file func (d *Generic) LoadMiddleware(_path string) (Middleware, error) { - return GenericMiddleware(_path), nil + return genericMiddleware(_path), nil } // LoadChecker returns a new middleware; it must be a // valid and existing folder/filename file func (d *Generic) LoadChecker(_path string) (Checker, error) { - return GenericChecker(_path), nil + return genericChecker(_path), nil } diff --git a/driver/generic.mockup.go b/driver/generic.mockup.go index 7f86aa4..cf31280 100644 --- a/driver/generic.mockup.go +++ b/driver/generic.mockup.go @@ -9,10 +9,10 @@ import ( "strings" ) -// GenericController is the mockup for returning a controller with as a string the path -type GenericController string +// 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 response.Arguments) response.Response { res := response.New() @@ -67,20 +67,20 @@ func (path GenericController) Get(d response.Arguments) response.Response { } -func (path GenericController) Post(d response.Arguments) response.Response { +func (path genericController) Post(d response.Arguments) response.Response { return path.Get(d) } -func (path GenericController) Put(d response.Arguments) response.Response { +func (path genericController) Put(d response.Arguments) response.Response { return path.Get(d) } -func (path GenericController) Delete(d response.Arguments) response.Response { +func (path genericController) Delete(d response.Arguments) response.Response { return path.Get(d) } -// GenericMiddleware is the mockup for returning a middleware as a string (its path) -type GenericMiddleware string +// genericMiddleware is the mockup for returning a middleware as a string (its path) +type genericMiddleware string -func (path GenericMiddleware) Inspect(_req http.Request, _scope *[]string) { +func (path genericMiddleware) Inspect(_req http.Request, _scope *[]string) { /* (1) Prepare stdin data */ stdin, err := json.Marshal(_scope) @@ -120,10 +120,10 @@ func (path GenericMiddleware) Inspect(_req http.Request, _scope *[]string) { } -// GenericChecker is the mockup for returning a checker as a string (its path) -type GenericChecker string +// genericChecker is the mockup for returning a checker as a string (its path) +type genericChecker string -func (path GenericChecker) Match(_type string) bool { +func (path genericChecker) Match(_type string) bool { /* (1) Try to load command with -> stdout */ cmd := exec.Command(string(path), _type) @@ -139,7 +139,7 @@ func (path GenericChecker) Match(_type string) bool { return output == "true" || output == "1" } -func (path GenericChecker) Check(_value interface{}) bool { +func (path genericChecker) Check(_value interface{}) bool { /* (1) Prepare stdin data */ indata := make(map[string]interface{})