William Petit f9a6a3ab2a
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
feat: initial commit
2023-05-16 14:03:15 +02:00

33 lines
517 B
Go

package queue
import (
"net/http"
"forge.cadoles.com/Cadoles/go-proxy"
)
type Queue struct {
repository Repository
}
func (q *Queue) Middleware() proxy.Middleware {
return func(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
}
return http.HandlerFunc(fn)
}
}
func New(repository Repository, funcs ...OptionFunc) *Queue {
opts := defaultOptions()
for _, fn := range funcs {
fn(opts)
}
return &Queue{
repository: repository,
}
}