Documentation
¶
Overview ¶
Package testserver starts a real motte server in the process of a caller's test.
Index ¶
- Constants
- type Server
- func (s *Server) Client(token string, opts ...client.Option) *client.Client
- func (s *Server) ImportGrant(t testing.TB, repo string) string
- func (s *Server) Mint(t testing.TB, signer grant.Signer, c grant.Claims) string
- func (s *Server) NodeGrant(t testing.TB, workspace string, epoch uint64, repo string) string
- func (s *Server) OperatorGrant(t testing.TB) string
- func (s *Server) ReadGrant(t testing.TB, repo string) string
Constants ¶
const DSNEnv = pgtest.DSNEnv
DSNEnv is the environment variable that Start reads when it gets no DSN.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
URL string
// Operator is the control-plane signer.
Operator grant.Signer
// Node is the node signer.
Node grant.Signer
// Expire is the expiry of the grants that the helpers mint.
Expire time.Time
}
Server is a running store. Its control-plane key signs every scope. Its node key signs only node grants.
func Start ¶
Start runs a server on a fresh schema of the database at dsn and a temporary filesystem bucket. An empty dsn is read from DSNEnv. When that is empty too, Start skips the test. Cleanup drops the schema.
func (*Server) ImportGrant ¶
ImportGrant mints an import grant.
func (*Server) OperatorGrant ¶
OperatorGrant mints an operator grant.