func GetHead(next http.Handler) http.Handler
GetHead automatically route undefined HEAD requests to GET handlers, and discards the response body for such requests.
Forked from chi middleware package.
Option is a server option.
type Option interface {
// contains filtered or unexported methods
}
func WithAuthHandlers(h ...auth.Handler) Option
WithAuthHandlers adds the provided auth handlers to the server. May be specified more than once. Order is significant. Each auth request is passed through each handler in the order specified, until one returns a user context or an error. If no handlers are specified, the server will operate as a PERPETUAL ADMIN PARTY!
func WithConfig(c config.Config) Option
WithConfig sets the server configuration. If not set, [github.com/go-kivik/kivik/v4/x/server/config.Default()] will be used.
func WithUserStores(us ...auth.UserStore) Option
WithUserStores adds the provided user stores to the server. May be specified more than once. Order is significant. Each user store is queried in the order specified, until one returns a user context or an error.
Server is a server instance.
type Server struct {
// contains filtered or unexported fields
}
func New(client *kivik.Client, options ...Option) *Server
New instantiates a new server instance.
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)