-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
391 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package goplugin | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/TykTechnologies/tyk/user" | ||
) | ||
|
||
// Logger provides interface to output to Tyk's logging system with log levels INFO, DEBUG, WARN and ERROR | ||
type Logger interface { | ||
Info(args ...interface{}) | ||
Infof(format string, args ...interface{}) | ||
Infoln(args ...interface{}) | ||
|
||
Debug(args ...interface{}) | ||
Debugf(format string, args ...interface{}) | ||
Debugln(args ...interface{}) | ||
|
||
Warning(args ...interface{}) | ||
Warningf(format string, args ...interface{}) | ||
Warningln(args ...interface{}) | ||
|
||
Error(args ...interface{}) | ||
Errorf(format string, args ...interface{}) | ||
Errorln(args ...interface{}) | ||
} | ||
|
||
type APISpec struct { | ||
OrgID string | ||
APIID string | ||
ConfigData map[string]interface{} | ||
} | ||
|
||
// ProcessFunc type functions are called for "pre", "post", "post_key_auth" custom middleware methods | ||
type ProcessFunc func( | ||
http.ResponseWriter, | ||
*http.Request, | ||
*user.SessionState, | ||
APISpec, | ||
Logger, | ||
) error | ||
|
||
// AuthFunc type function is called for "auth_check" custom middleware method | ||
type AuthFunc func( | ||
http.ResponseWriter, | ||
*http.Request, | ||
APISpec, | ||
Logger, | ||
) (session *user.SessionState, token string, err error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.