Documentation
¶
Index ¶
- type HookBinder
- type Option
- type Server
- func (s *Server) ClientForRecord(t testing.TB, collection, email string) pbclient.AuthenticatedClient
- func (s *Server) ClientWithToken(token string) pbclient.AuthenticatedClient
- func (s *Server) Close()
- func (s *Server) SuperuserClient(t testing.TB, email string) pbclient.AuthenticatedClient
- func (s *Server) Token(t testing.TB, collection, email string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HookBinder ¶
HookBinder allows callers to register app hooks before serving routes.
type Option ¶
type Option func(*startOptions)
Option configures Start.
func WithDataDir ¶
WithDataDir overrides the PocketBase test data directory.
func WithHookBinder ¶
func WithHookBinder(binder HookBinder) Option
WithHookBinder registers a callback invoked after app initialization and before serving.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps an embedded PocketBase test app and HTTP server.
func (*Server) ClientForRecord ¶
func (s *Server) ClientForRecord(t testing.TB, collection, email string) pbclient.AuthenticatedClient
ClientForRecord builds a token client for a collection record.
func (*Server) ClientWithToken ¶
func (s *Server) ClientWithToken(token string) pbclient.AuthenticatedClient
ClientWithToken returns a pbclient.AuthenticatedClient backed by the embedded server.
func (*Server) Close ¶
func (s *Server) Close()
Close shuts down the test server and cleans app state.
func (*Server) SuperuserClient ¶
SuperuserClient builds a token client for a superuser email.
Click to show internal directories.
Click to hide internal directories.