Run formatter
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
7a65835816
commit
e8cb614b2e
|
@ -25,12 +25,12 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/twitchtv/twirp"
|
"github.com/twitchtv/twirp"
|
||||||
"go.elara.ws/logger"
|
"go.elara.ws/logger"
|
||||||
"go.elara.ws/logger/log"
|
"go.elara.ws/logger/log"
|
||||||
"go.elara.ws/lure/internal/api"
|
"go.elara.ws/lure/internal/api"
|
||||||
"go.elara.ws/lure/internal/repos"
|
"go.elara.ws/lure/internal/repos"
|
||||||
"github.com/go-chi/chi/v5"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -61,12 +61,12 @@ func main() {
|
||||||
|
|
||||||
sigCh := make(chan struct{}, 200)
|
sigCh := make(chan struct{}, 200)
|
||||||
go repoPullWorker(ctx, sigCh)
|
go repoPullWorker(ctx, sigCh)
|
||||||
|
|
||||||
apiServer := api.NewAPIServer(
|
apiServer := api.NewAPIServer(
|
||||||
lureWebAPI{db: gdb},
|
lureWebAPI{db: gdb},
|
||||||
twirp.WithServerPathPrefix(""),
|
twirp.WithServerPathPrefix(""),
|
||||||
)
|
)
|
||||||
|
|
||||||
r := chi.NewRouter()
|
r := chi.NewRouter()
|
||||||
r.With(allowAllCORSHandler, withAcceptLanguage).Handle("/*", apiServer)
|
r.With(allowAllCORSHandler, withAcceptLanguage).Handle("/*", apiServer)
|
||||||
r.Post("/webhook", handleWebhook(sigCh))
|
r.Post("/webhook", handleWebhook(sigCh))
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
package dl
|
package dl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var urlMatchRegex = regexp.MustCompile(`(magnet|torrent\+https?):.*`)
|
var (
|
||||||
var ErrAria2NotFound = errors.New("aria2 must be installed for torrent functionality")
|
urlMatchRegex = regexp.MustCompile(`(magnet|torrent\+https?):.*`)
|
||||||
var ErrDestinationEmpty = errors.New("the destination directory is empty")
|
ErrAria2NotFound = errors.New("aria2 must be installed for torrent functionality")
|
||||||
|
ErrDestinationEmpty = errors.New("the destination directory is empty")
|
||||||
|
)
|
||||||
|
|
||||||
type TorrentDownloader struct{}
|
type TorrentDownloader struct{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue