This commit is contained in:
parent
3e948f55a2
commit
ff38d10fbf
43 changed files with 27 additions and 27 deletions
|
@ -27,11 +27,11 @@ models:
|
|||
Torrent:
|
||||
extraFields:
|
||||
T:
|
||||
type: "*git.kmsign.ru/royalcat/tstor/src/sources/torrent.Controller"
|
||||
type: "*git.kmsign.ru/royalcat/tstor/src/daemons/torrent.Controller"
|
||||
TorrentFile:
|
||||
extraFields:
|
||||
F:
|
||||
type: "*git.kmsign.ru/royalcat/tstor/src/sources/torrent.FileController"
|
||||
type: "*git.kmsign.ru/royalcat/tstor/src/daemons/torrent.FileController"
|
||||
TorrentPeer:
|
||||
extraFields:
|
||||
F:
|
||||
|
@ -45,7 +45,7 @@ models:
|
|||
TorrentFS:
|
||||
extraFields:
|
||||
FS:
|
||||
type: "*git.kmsign.ru/royalcat/tstor/src/sources/torrent.TorrentFS"
|
||||
type: "*git.kmsign.ru/royalcat/tstor/src/daemons/torrent.TorrentFS"
|
||||
ResolverFS:
|
||||
extraFields:
|
||||
FS:
|
||||
|
|
|
@ -17,10 +17,10 @@ import (
|
|||
wnfs "git.kmsign.ru/royalcat/tstor/pkg/go-nfs"
|
||||
"git.kmsign.ru/royalcat/tstor/pkg/rlog"
|
||||
"git.kmsign.ru/royalcat/tstor/src/config"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/ytdlp"
|
||||
"git.kmsign.ru/royalcat/tstor/src/delivery"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/ytdlp"
|
||||
"git.kmsign.ru/royalcat/tstor/src/telemetry"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
"github.com/go-git/go-billy/v5/osfs"
|
||||
|
@ -109,7 +109,7 @@ func run(configPath string) error {
|
|||
return fmt.Errorf("error creating qbittorrent daemon: %w", err)
|
||||
}
|
||||
|
||||
sfs := sources.NewHostedFS(
|
||||
sfs := daemons.NewHostedFS(
|
||||
vfs.NewCtxBillyFs("/", ctxbilly.WrapFileSystem(sourceFs)),
|
||||
qtdaemon, ytdlpsrv,
|
||||
)
|
||||
|
|
|
@ -25,7 +25,7 @@ import (
|
|||
"go.opentelemetry.io/otel"
|
||||
)
|
||||
|
||||
var trace = otel.Tracer("git.kmsign.ru/royalcat/tstor/src/sources/qbittorrent")
|
||||
var trace = otel.Tracer("git.kmsign.ru/royalcat/tstor/src/daemons/qbittorrent")
|
||||
|
||||
type Daemon struct {
|
||||
proc *os.Process
|
|
@ -1,10 +1,10 @@
|
|||
package sources
|
||||
package daemons
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/ytdlp"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/ytdlp"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
)
|
||||
|
|
@ -27,7 +27,7 @@ import (
|
|||
"github.com/royalcat/kv"
|
||||
)
|
||||
|
||||
const instrument = "git.kmsign.ru/royalcat/tstor/sources/torrent"
|
||||
const instrument = "git.kmsign.ru/royalcat/tstor/daemons/torrent"
|
||||
|
||||
var (
|
||||
tracer = otel.Tracer(instrument, trace.WithInstrumentationAttributes(attribute.String("component", "torrent-daemon")))
|
|
@ -1055,17 +1055,17 @@ interface Progress {
|
|||
current: Int!
|
||||
total: Int!
|
||||
}`, BuiltIn: false},
|
||||
{Name: "../../../graphql/sources/qbittorrent_query.graphql", Input: `type QBitTorrentDaemonQuery {
|
||||
{Name: "../../../graphql/daemons/qbittorrent_query.graphql", Input: `type QBitTorrentDaemonQuery {
|
||||
torrents: [QTorrent!]! @resolver
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "../../../graphql/sources/qbittorrent_types.graphql", Input: `type QTorrent {
|
||||
{Name: "../../../graphql/daemons/qbittorrent_types.graphql", Input: `type QTorrent {
|
||||
name: String!
|
||||
hash: String!
|
||||
sourceFiles: [String!]! @resolver
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "../../../graphql/sources/torrent_mutation.graphql", Input: `type TorrentDaemonMutation {
|
||||
{Name: "../../../graphql/daemons/torrent_mutation.graphql", Input: `type TorrentDaemonMutation {
|
||||
validateTorrent(filter: TorrentFilter!): Boolean! @resolver
|
||||
setTorrentPriority(
|
||||
infohash: String!
|
||||
|
@ -1084,7 +1084,7 @@ type DownloadTorrentResponse {
|
|||
task: Task
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "../../../graphql/sources/torrent_query.graphql", Input: `type TorrentDaemonQuery {
|
||||
{Name: "../../../graphql/daemons/torrent_query.graphql", Input: `type TorrentDaemonQuery {
|
||||
torrents(filter: TorrentsFilter): [Torrent!]! @resolver
|
||||
clientStats: TorrentClientStats! @resolver
|
||||
statsHistory(since: DateTime!, infohash: String): [TorrentStats!]! @resolver
|
||||
|
@ -1114,7 +1114,7 @@ input TorrentFilter @oneOf {
|
|||
# pathGlob: String!
|
||||
}
|
||||
`, BuiltIn: false},
|
||||
{Name: "../../../graphql/sources/torrent_types.graphql", Input: `type Torrent {
|
||||
{Name: "../../../graphql/daemons/torrent_types.graphql", Input: `type Torrent {
|
||||
name: String! @resolver
|
||||
infohash: String!
|
||||
bytesCompleted: Int!
|
||||
|
|
|
@ -3,7 +3,7 @@ package model
|
|||
import (
|
||||
"context"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package model
|
|||
import (
|
||||
"context"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
atorrent "github.com/anacrolix/torrent"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ package model
|
|||
import (
|
||||
"time"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
torrent1 "github.com/anacrolix/torrent"
|
||||
"github.com/anacrolix/torrent/types"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package resolver
|
||||
|
||||
import (
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
"github.com/go-git/go-billy/v5"
|
||||
)
|
||||
|
|
|
@ -10,9 +10,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
graph "git.kmsign.ru/royalcat/tstor/src/delivery/graphql"
|
||||
"git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
tinfohash "github.com/anacrolix/torrent/types/infohash"
|
||||
)
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import (
|
|||
|
||||
"git.kmsign.ru/royalcat/tstor/pkg/rlog"
|
||||
"git.kmsign.ru/royalcat/tstor/src/config"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
echopprof "github.com/labstack/echo-contrib/pprof"
|
||||
"github.com/labstack/echo/v4"
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"context"
|
||||
"net/http"
|
||||
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/daemons/torrent"
|
||||
graph "git.kmsign.ru/royalcat/tstor/src/delivery/graphql"
|
||||
"git.kmsign.ru/royalcat/tstor/src/delivery/graphql/resolver"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/qbittorrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/sources/torrent"
|
||||
"git.kmsign.ru/royalcat/tstor/src/vfs"
|
||||
"github.com/99designs/gqlgen/graphql"
|
||||
"github.com/99designs/gqlgen/graphql/handler"
|
||||
|
|
Loading…
Reference in a new issue