Documentation ¶
Index ¶
- Variables
- func NewNoopTask() worker.Task
- type OAuthService
- type Server
- func (s *Server) AddCookie(name string, value string) *Server
- func (s *Server) AddHeader(name string, value string) *Server
- func (s *Server) AddParam(name string, value interface{}) *Server
- func (s *Server) AsUser(user *models.User) *Server
- func (s *Server) Engine() *web.Engine
- func (s *Server) Execute(handler web.HandlerFunc) (int, *httptest.ResponseRecorder)
- func (s *Server) ExecuteAsJSON(handler web.HandlerFunc) (int, *jsonq.Query)
- func (s *Server) ExecutePost(handler web.HandlerFunc, body string) (int, *httptest.ResponseRecorder)
- func (s *Server) ExecutePostAsJSON(handler web.HandlerFunc, body string) (int, *jsonq.Query)
- func (s *Server) OnTenant(tenant *models.Tenant) *Server
- func (s *Server) Use(middleware web.MiddlewareFunc)
- func (s *Server) WithURL(fullURL string) *Server
- type Worker
Constants ¶
This section is empty.
Variables ¶
var AryaStark *models.User
AryaStark is a mocked user
var AvengersTenant *models.Tenant
AvengersTenant is a mocked tenant
var DemoTenant *models.Tenant
DemoTenant is a mocked tenant
var JonSnow *models.User
JonSnow is a mocked user
Functions ¶
func NewNoopTask ¶ added in v0.11.0
NewNoopTask returns a worker task that does nothing
Types ¶
type OAuthService ¶ added in v0.5.0
type OAuthService struct{}
OAuthService implements a mocked OAuthService
func (*OAuthService) GetAuthURL ¶ added in v0.5.0
func (p *OAuthService) GetAuthURL(authEndpoint string, provider string, redirect string) string
GetAuthURL returns authentication url for given provider
func (*OAuthService) GetProfile ¶ added in v0.5.0
func (p *OAuthService) GetProfile(authEndpoint string, provider string, code string) (*oauth.UserProfile, error)
GetProfile returns user profile based on provider and code
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a HTTP server wrapper for testing purpose
func NewSingleTenantServer ¶
NewSingleTenantServer creates a new multitenant test server
func (*Server) Execute ¶
func (s *Server) Execute(handler web.HandlerFunc) (int, *httptest.ResponseRecorder)
Execute given handler and return response
func (*Server) ExecuteAsJSON ¶
ExecuteAsJSON given handler and return json response
func (*Server) ExecutePost ¶
func (s *Server) ExecutePost(handler web.HandlerFunc, body string) (int, *httptest.ResponseRecorder)
ExecutePost executes given handler as POST and return response
func (*Server) ExecutePostAsJSON ¶ added in v0.6.0
ExecutePostAsJSON executes given handler as POST and return json response
func (*Server) Use ¶
func (s *Server) Use(middleware web.MiddlewareFunc)
Use adds a new middleware to pipeline
type Worker ¶ added in v0.10.0
type Worker struct {
// contains filtered or unexported fields
}
Worker is fake wrapper for background worker