func (c *FakeConnector) Stop() error {
	if c.Server == nil {
		return errors.New("Cannot not stop a server that has not started")
	}
	close(c.OnCallback)
	return c.Server.Close()
}
Stop the server or return an error if it couldn't be stopped
package connector
import (
	"crypto/rand"
	"errors"
	"fmt"
	"net/http"
	"sync"
	"time"
	"github.com/go-zoo/bone"
	"github.com/manifoldco/go-base32"
	"github.com/manifoldco/go-connector"
	cerrors "github.com/manifoldco/go-connector/errors"
	"github.com/manifoldco/go-manifold"
	"github.com/manifoldco/go-manifold/idtype"
	"github.com/manifoldco/grafton/db"
)
var ErrCallbackNotFound = errors.New("Callback Not Found")
var ErrCallbackAlreadyResolved = errors.New("Callback Already Resolved")
var ErrResourceNotFound = errors.New("Resource Not Found")
type RequestCapturer struct {
	Route    string
	requests []interface{}
}
func (r *RequestCapturer) capture(v interface{}) {
	r.requests = append(r.requests, v)
}
func (r *RequestCapturer) Get() []interface{} {
	return r.requests
}
type FakeConnectorConfig struct {
	Product      string
	Port         uint
	ClientID     string
	ClientSecret string
	SigningKey   string
}
type FakeConnector struct {
	Config     *FakeConnectorConfig
	DB         *db.DB
	OnCallback chan *Callback
	capturers  map[string]*RequestCapturer
	codes      []*AuthorizationCode
	tokens     []*AccessToken
	callbacks  []*Callback
	Server     *http.Server
}
func (c *FakeConnector) StartSync() error {
	h := ValidHandler(c)
	c.Server = &http.Server{
		Addr:    fmt.Sprintf("localhost:%d", c.Config.Port),
		Handler: h,
	}
	return c.Server.ListenAndServe()
}
func (c *FakeConnector) Start() {
	h := ValidHandler(c)
	c.Server = &http.Server{
		Addr:    fmt.Sprintf("localhost:%d", c.Config.Port),
		Handler: h,
	}
	go c.Server.ListenAndServe()
}