server.go
func NewServer(opts *ServerOptions) *Server {
	server := &Server{
		signer:          opts.Signer,
		verifier:        opts.Verifier,
		isProcessor:     hasProcessor(opts),
		isController:    hasController(opts),
		headers:         http.Header{},
		processorDomain: opts.ProcessorDomain,
	}
	server.headers.Set("Accept", "application/json")
	server.headers.Set("Content-Type", "application/json")
	if hasProcessor(opts) {
		server.headers.Set("X-OpenGDPR-ProcessorDomain", opts.ProcessorDomain)
	}
	router := httprouter.New()
	hm := buildHandlerMap(opts)
	for path, methods := range hm {
		for method, builder := range methods {
			router.Handle(method, path, server.handle(builder(opts)))
		}
	}
	server.handlerFn = router.ServeHTTP
	return server
}
func NewServer(opts *ServerOptions) *Server {
	server := &Server{
		signer:          opts.Signer,
		verifier:        opts.Verifier,
		isProcessor:     hasProcessor(opts),
		isController:    hasController(opts),
		headers:         http.Header{},
		processorDomain: opts.ProcessorDomain,
	}
	server.headers.Set("Accept", "application/json")
	server.headers.Set("Content-Type", "application/json")
	if hasProcessor(opts) {
		server.headers.Set("X-OpenGDPR-ProcessorDomain", opts.ProcessorDomain)
	}
	router := httprouter.New()
	hm := buildHandlerMap(opts)
	for path, methods := range hm {
		for method, builder := range methods {
			router.Handle(method, path, server.handle(builder(opts)))
		}
	}
	server.handlerFn = router.ServeHTTP
	return server
}
func NewServer ( opts * ServerOptions ) * Server { server := & Server { signer : opts . Signer , verifier : opts . Verifier , isProcessor : hasProcessor ( opts ) , isController : hasController ( opts ) , headers : http . Header { } , processorDomain : opts . ProcessorDomain , } server . headers . Set ( " " , " " ) server . headers . Set ( " " , " " ) if hasProcessor ( opts ) { server . headers . Set ( " " , opts . ProcessorDomain ) } router := httprouter . New ( ) hm := buildHandlerMap ( opts ) for path , methods := range hm { for method , builder := range methods { router . Handle ( method , path , server . handle ( builder ( opts ) ) ) } } server . handlerFn = router . ServeHTTP return server }
// NewServer returns a server type that statisfies the
// http.Handler interface.
NewServer returns a server type that statisfies the http . Handler interface .