tests

package
v0.0.0-...-e8e34a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tests implements a test suite for the Conduit server API.

To use this package, your server must provide a NewServer function which returns a struct that satisfies the Server interface.

You must also arrange for your server's test file to call the suite functions directly. Those are the functions that have the NewServer as a parameter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authentication

func Authentication(newServer TestServer, t *testing.T)

func Profile

func Profile(newServer TestServer, t *testing.T)

func Registration

func Registration(newServer TestServer, t *testing.T)

func Suite

func Suite(newServer TestServer, t *testing.T)

func User

func User(newServer TestServer, t *testing.T)

Specification: User API

Types

type Server

type Server interface {
	NewJWT(ttl time.Duration, id int, username, email string, roles ...string) string
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

type TestServer

type TestServer func(secret string) Server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL