diff --git a/.graphqlrc.yaml b/.graphqlrc.yaml index 37aea9c..93791ae 100644 --- a/.graphqlrc.yaml +++ b/.graphqlrc.yaml @@ -2,3 +2,4 @@ schema: - graphql/schema.graphql - graphql/*.graphql - graphql/**/*.graphql + - daemons/atorrent/graphql/*.graphql diff --git a/cmd/tstor/main.go b/cmd/tstor/main.go index 71d5179..c25da4d 100644 --- a/cmd/tstor/main.go +++ b/cmd/tstor/main.go @@ -199,7 +199,7 @@ func run(configPath string) error { }() go func() { - err := delivery.Run(nil, qtdaemon, sfs, conf) + err := delivery.Run(qtdaemon, sfs, conf) if err != nil { log.Error(ctx, "error initializing HTTP server", rlog.Error(err)) } diff --git a/daemons/atorrent/daemon.go b/daemons/atorrent/daemon.go index a8a6399..97aa766 100644 --- a/daemons/atorrent/daemon.go +++ b/daemons/atorrent/daemon.go @@ -27,7 +27,7 @@ import ( "github.com/royalcat/kv" ) -const instrument = "git.kmsign.ru/royalcat/tstor/daemons/torrent" +const instrument = "git.kmsign.ru/royalcat/tstor/daemons/atorrent" var ( tracer = otel.Tracer(instrument, trace.WithInstrumentationAttributes(attribute.String("component", "torrent-daemon"))) diff --git a/daemons/atorrent/generated/graphql/model/mappers.go b/daemons/atorrent/generated/graphql/model/mappers.go new file mode 100644 index 0000000..9449c98 --- /dev/null +++ b/daemons/atorrent/generated/graphql/model/mappers.go @@ -0,0 +1,56 @@ +package model + +import ( + "context" + + "git.kmsign.ru/royalcat/tstor/daemons/atorrent" + "github.com/anacrolix/torrent" +) + +func MapPeerSource(source torrent.PeerSource) string { + switch source { + case torrent.PeerSourceDirect: + return "Direct" + case torrent.PeerSourceUtHolepunch: + return "Ut Holepunch" + case torrent.PeerSourceDhtAnnouncePeer: + return "DHT Announce" + case torrent.PeerSourceDhtGetPeers: + return "DHT" + case torrent.PeerSourceIncoming: + return "Incoming" + case torrent.PeerSourceTracker: + return "Tracker" + case torrent.PeerSourcePex: + return "PEX" + default: + return "Unknown" + } +} + +func MapTorrent(ctx context.Context, t *atorrent.Controller) (*Torrent, error) { + prio, err := t.Priority(ctx) + if err != nil { + return nil, err + } + + return &Torrent{ + Infohash: t.InfoHash(), + Name: t.Name(), + BytesCompleted: t.BytesCompleted(), + BytesMissing: t.BytesMissing(), + Priority: prio, + T: t, + }, nil +} + +func MapTorrentStats(s atorrent.TorrentStats) *TorrentStats { + return &TorrentStats{ + Timestamp: s.Timestamp, + DownloadedBytes: uint(s.DownloadedBytes), + UploadedBytes: uint(s.UploadedBytes), + TotalPeers: uint(s.TotalPeers), + ActivePeers: uint(s.ActivePeers), + ConnectedSeeders: uint(s.ConnectedSeeders), + } +} diff --git a/daemons/atorrent/generated/graphql/model/models_gen.go b/daemons/atorrent/generated/graphql/model/models_gen.go index 25813d4..6b0a758 100644 --- a/daemons/atorrent/generated/graphql/model/models_gen.go +++ b/daemons/atorrent/generated/graphql/model/models_gen.go @@ -30,6 +30,12 @@ type FsEntry interface { GetName() string } +type Progress interface { + IsProgress() + GetCurrent() int64 + GetTotal() int64 +} + type ArchiveFs struct { Name string `json:"name"` Entries []FsEntry `json:"entries"` @@ -262,6 +268,16 @@ type TorrentPriorityFilter struct { In []types.PiecePriority `json:"in,omitempty"` } +type TorrentProgress struct { + Torrent *Torrent `json:"torrent"` + Current int64 `json:"current"` + Total int64 `json:"total"` +} + +func (TorrentProgress) IsProgress() {} +func (this TorrentProgress) GetCurrent() int64 { return this.Current } +func (this TorrentProgress) GetTotal() int64 { return this.Total } + type TorrentStats struct { Timestamp time.Time `json:"timestamp"` DownloadedBytes uint `json:"downloadedBytes"` diff --git a/daemons/atorrent/generated/graphql/resolver/fs.resolvers.go b/daemons/atorrent/generated/graphql/resolver/fs.resolvers.go new file mode 100644 index 0000000..0b41848 --- /dev/null +++ b/daemons/atorrent/generated/graphql/resolver/fs.resolvers.go @@ -0,0 +1,25 @@ +package resolver + +import ( + "context" + + "git.kmsign.ru/royalcat/tstor/daemons/atorrent/generated/graphql/model" +) + +func (r *torrentFSResolver) Entries(ctx context.Context, obj *model.TorrentFs) ([]model.FsEntry, error) { + // entries, err := obj.FS.ReadDir(ctx, ".") + // if err != nil { + // return nil, err + // } + out := []model.FsEntry{} + // for _, e := range entries { + // entry, err := model.FillFsEntry(ctx, e, obj.FS, ".") + // if err != nil { + // return nil, err + // } + // out = append(out, entry) + // } + return out, nil +} + +type torrentFSResolver struct{ *Resolver } diff --git a/daemons/atorrent/generated/graphql/resolver/resolver.go b/daemons/atorrent/generated/graphql/resolver/resolver.go new file mode 100644 index 0000000..41eeedd --- /dev/null +++ b/daemons/atorrent/generated/graphql/resolver/resolver.go @@ -0,0 +1,17 @@ +package resolver + +import ( + "git.kmsign.ru/royalcat/tstor/daemons/atorrent" + "git.kmsign.ru/royalcat/tstor/src/vfs" + "github.com/go-git/go-billy/v5" +) + +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. + +type Resolver struct { + ATorrentDaemon *atorrent.Daemon + VFS vfs.Filesystem + SourceFS billy.Filesystem +} diff --git a/daemons/atorrent/generated/graphql/resolver/subscription.resolvers.go b/daemons/atorrent/generated/graphql/resolver/subscription.resolvers.go new file mode 100644 index 0000000..73649fb --- /dev/null +++ b/daemons/atorrent/generated/graphql/resolver/subscription.resolvers.go @@ -0,0 +1,49 @@ +package resolver + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.55 + +import ( + "context" + "fmt" + + "git.kmsign.ru/royalcat/tstor/daemons/atorrent/generated/graphql/model" +) + +type subscriptionResolver struct{ *Resolver } + +func (r *subscriptionResolver) TorrentDownloadUpdates(ctx context.Context) (<-chan *model.TorrentProgress, error) { + out := make(chan *model.TorrentProgress) + progress, err := r.ATorrentDaemon.DownloadProgress(ctx) + if err != nil { + return nil, err + } + + go func() { + defer close(out) + for p := range progress { + if p.Torrent == nil { + fmt.Println("nil torrent") + continue + } + torrent, err := model.MapTorrent(ctx, p.Torrent) + if err != nil { + // TODO logs + continue + } + po := &model.TorrentProgress{ + Torrent: torrent, + Current: p.Current, + Total: p.Total, + } + select { + case <-ctx.Done(): + return + case out <- po: + } + } + }() + + return out, nil +} diff --git a/src/delivery/graphql/resolver/torrent_mutation.resolvers.go b/daemons/atorrent/generated/graphql/resolver/torrent_mutation.resolvers.go similarity index 100% rename from src/delivery/graphql/resolver/torrent_mutation.resolvers.go rename to daemons/atorrent/generated/graphql/resolver/torrent_mutation.resolvers.go diff --git a/src/delivery/graphql/resolver/torrent_query.resolvers.go b/daemons/atorrent/generated/graphql/resolver/torrent_query.resolvers.go similarity index 100% rename from src/delivery/graphql/resolver/torrent_query.resolvers.go rename to daemons/atorrent/generated/graphql/resolver/torrent_query.resolvers.go diff --git a/src/delivery/graphql/resolver/torrent_types.resolvers.go b/daemons/atorrent/generated/graphql/resolver/torrent_types.resolvers.go similarity index 100% rename from src/delivery/graphql/resolver/torrent_types.resolvers.go rename to daemons/atorrent/generated/graphql/resolver/torrent_types.resolvers.go diff --git a/daemons/atorrent/go.mod b/daemons/atorrent/go.mod index 08f0f83..c1b1481 100644 --- a/daemons/atorrent/go.mod +++ b/daemons/atorrent/go.mod @@ -22,7 +22,9 @@ require ( ) require ( + github.com/99designs/gqlgen v0.17.55 // indirect github.com/RoaringBitmap/roaring v1.2.3 // indirect + github.com/agnivade/levenshtein v1.1.1 // indirect github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect github.com/alecthomas/atomic v0.1.0-alpha2 // indirect github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 // indirect @@ -115,10 +117,12 @@ require ( github.com/samber/lo v1.38.1 // indirect github.com/samber/slog-multi v1.0.2 // indirect github.com/samber/slog-zerolog v1.0.0 // indirect + github.com/sosodev/duration v1.3.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/ulikunitz/xz v0.5.12 // indirect + github.com/vektah/gqlparser/v2 v2.5.17 // indirect github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00 // indirect github.com/wlynxg/anet v0.0.3 // indirect go.etcd.io/bbolt v1.3.6 // indirect diff --git a/daemons/atorrent/go.sum b/daemons/atorrent/go.sum index 4a7f286..ea153af 100644 --- a/daemons/atorrent/go.sum +++ b/daemons/atorrent/go.sum @@ -21,6 +21,8 @@ filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmG filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.kmsign.ru/royalcat/tstor v0.0.0-20241217095110-0ae11aa283e3 h1:ET5ZglQhYrJNxWJ0XNvNj+RsC3ajFJntvuJqAEXak+4= git.kmsign.ru/royalcat/tstor v0.0.0-20241217095110-0ae11aa283e3/go.mod h1:8gdepJ0vUeAfV/xiWMo6zj2DYx4qjc4XdhGvy77Nxy0= +github.com/99designs/gqlgen v0.17.55 h1:3vzrNWYyzSZjGDFo68e5j9sSauLxfKvLp+6ioRokVtM= +github.com/99designs/gqlgen v0.17.55/go.mod h1:3Bq768f8hgVPGZxL8aY9MaYmbxa6llPM/qu1IGH1EJo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -32,6 +34,8 @@ github.com/RoaringBitmap/roaring v1.2.3 h1:yqreLINqIrX22ErkKI0vY47/ivtJr6n+kMhVO github.com/RoaringBitmap/roaring v1.2.3/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0= github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k= github.com/alecthomas/assert/v2 v2.0.0-alpha3 h1:pcHeMvQ3OMstAWgaeaXIAL8uzB9xMm2zlxt+/4ml8lk= @@ -99,9 +103,13 @@ github.com/anacrolix/upnp v0.1.4 h1:+2t2KA6QOhm/49zeNyeVwDu1ZYS9dB9wfxyVvh/wk7U= github.com/anacrolix/upnp v0.1.4/go.mod h1:Qyhbqo69gwNWvEk1xNTXsS5j7hMHef9hdr984+9fIic= github.com/anacrolix/utp v0.1.0 h1:FOpQOmIwYsnENnz7tAGohA+r6iXpRjrq8ssKSre2Cp4= github.com/anacrolix/utp v0.1.0/go.mod h1:MDwc+vsGEq7RMw6lr2GKOEqjWny5hO5OZXRVNaBJ2Dk= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/immutable v0.2.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI= @@ -149,6 +157,8 @@ github.com/dgraph-io/ristretto/v2 v2.0.0/go.mod h1:FVFokF2dRqXyPyeMnK1YDy8Fc6aTe github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -449,12 +459,16 @@ github.com/samber/slog-multi v1.0.2 h1:6BVH9uHGAsiGkbbtQgAOQJMpKgV8unMrHhhJaw+X1 github.com/samber/slog-multi v1.0.2/go.mod h1:uLAvHpGqbYgX4FSL0p1ZwoLuveIAJvBECtE07XmYvFo= github.com/samber/slog-zerolog v1.0.0 h1:YpRy0xux1uJr0Ng3wrEjv9nyvb4RAoNqkS611UjzeG8= github.com/samber/slog-zerolog v1.0.0/go.mod h1:N2/g/mNGRY1zqsydIYE0uKipSSFsPDjytoVkRnZ0Jp0= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190215210624-980c5ac6f3ac/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs= +github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq4= +github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -484,6 +498,8 @@ github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDW github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/vektah/gqlparser/v2 v2.5.17 h1:9At7WblLV7/36nulgekUgIaqHZWn5hxqluxrxGUhOmI= +github.com/vektah/gqlparser/v2 v2.5.17/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00 h1:U0DnHRZFzoIV1oFEZczg5XyPut9yxk9jjtax/9Bxr/o= @@ -744,6 +760,8 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/daemons/atorrent/graphql/types.graphql b/daemons/atorrent/graphql/types.graphql index d007e3a..ed47cb7 100644 --- a/daemons/atorrent/graphql/types.graphql +++ b/daemons/atorrent/graphql/types.graphql @@ -1,3 +1,21 @@ +type TorrentFS implements Dir & FsEntry { + name: String! + torrent: Torrent! + entries: [FsEntry!]! @resolver +} + +type TorrentFileEntry implements File & FsEntry { + name: String! + torrent: Torrent! + size: Int! +} + +type TorrentProgress implements Progress { + torrent: Torrent! + current: Int! + total: Int! +} + type Torrent { name: String! @resolver infohash: String! diff --git a/daemons/atorrent/piece_completion.go b/daemons/atorrent/piece_completion.go index d515768..013a0bb 100644 --- a/daemons/atorrent/piece_completion.go +++ b/daemons/atorrent/piece_completion.go @@ -88,7 +88,7 @@ func newPieceCompletion(dir string) (storage.PieceCompletion, error) { opts.Codec = kv.CodecBinary[PieceCompletionState, *PieceCompletionState]{} opts.BadgerOptions = opts.BadgerOptions.WithLogger(logwrap.BadgerLogger("torrent-client", "piece-completion")) - db, err := kvbadger.NewBagerKVBinaryKey[pieceKey, PieceCompletionState](opts) + db, err := kvbadger.NewBinaryKey[pieceKey, PieceCompletionState](opts) if err != nil { return nil, err } diff --git a/go.mod b/go.mod index 7f70cb1..a131592 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.23.4 replace github.com/iceber/iouring-go => github.com/royalcat/iouring-go v0.0.0-20240925200811-286062ac1b23 require ( - git.kmsign.ru/royalcat/tstor/daemons/torrent v0.0.0-20250107213026-b11322030501 github.com/99designs/gqlgen v0.17.55 github.com/agoda-com/opentelemetry-go/otelslog v0.2.0 github.com/agoda-com/opentelemetry-logs-go v0.5.1 @@ -69,50 +68,29 @@ require ( ) require ( - github.com/RoaringBitmap/roaring v1.9.3 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect - github.com/alecthomas/atomic v0.1.0-alpha2 // indirect - github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 // indirect github.com/anacrolix/dht/v2 v2.22.0 // indirect - github.com/anacrolix/envpprof v1.3.0 // indirect github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca // indirect - github.com/anacrolix/go-libutp v1.3.1 // indirect github.com/anacrolix/missinggo v1.3.0 // indirect - github.com/anacrolix/missinggo/perf v1.0.0 // indirect github.com/anacrolix/missinggo/v2 v2.7.4 // indirect - github.com/anacrolix/mmsg v1.0.0 // indirect - github.com/anacrolix/multiless v0.4.0 // indirect - github.com/anacrolix/stm v0.5.0 // indirect - github.com/anacrolix/sync v0.5.1 // indirect - github.com/anacrolix/upnp v0.1.4 // indirect - github.com/anacrolix/utp v0.2.0 // indirect github.com/andybalholm/brotli v1.1.0 // indirect - github.com/bahlo/generic-list-go v0.2.0 // indirect - github.com/benbjohnson/immutable v0.4.3 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/bodgit/plumbing v1.3.0 // indirect github.com/bodgit/windows v1.0.1 // indirect github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash v1.1.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgraph-io/ristretto/v2 v2.0.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/edsrzf/mmap-go v1.1.0 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-llsqlite/adapter v0.1.0 // indirect - github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/google/btree v1.1.2 // indirect github.com/google/flatbuffers v24.3.25+incompatible // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/gorilla/websocket v1.5.1 // indirect @@ -132,28 +110,10 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mr-tron/base58 v1.2.0 // indirect - github.com/mschoch/smat v0.2.0 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-varint v0.0.6 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/ncruces/go-strftime v0.1.9 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect - github.com/pion/datachannel v1.5.9 // indirect - github.com/pion/dtls/v3 v3.0.3 // indirect - github.com/pion/ice/v4 v4.0.2 // indirect - github.com/pion/interceptor v0.1.37 // indirect - github.com/pion/logging v0.2.2 // indirect - github.com/pion/mdns/v2 v2.0.7 // indirect - github.com/pion/randutil v0.1.0 // indirect - github.com/pion/rtcp v1.2.14 // indirect - github.com/pion/rtp v1.8.9 // indirect - github.com/pion/sctp v1.8.33 // indirect - github.com/pion/sdp/v3 v3.0.9 // indirect - github.com/pion/srtp/v3 v3.0.4 // indirect - github.com/pion/stun/v3 v3.0.0 // indirect - github.com/pion/transport/v3 v3.0.7 // indirect - github.com/pion/turn/v4 v4.0.0 // indirect - github.com/pion/webrtc/v4 v4.0.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polydawn/go-timeless-api v0.0.0-20220821201550-b93919e12c56 // indirect @@ -162,21 +122,15 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/protolambda/ctxlock v0.1.0 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/samber/lo v1.47.0 // indirect github.com/sosodev/duration v1.3.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/tidwall/btree v1.7.0 // indirect github.com/ulikunitz/xz v0.5.12 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect github.com/warpfork/go-errcat v0.0.0-20180917083543-335044ffc86e // indirect - github.com/wlynxg/anet v0.0.3 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect - go.etcd.io/bbolt v1.3.10 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib v1.26.0 // indirect @@ -196,9 +150,4 @@ require ( google.golang.org/protobuf v1.35.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.1.6 // indirect - modernc.org/libc v1.50.5 // indirect - modernc.org/mathutil v1.6.0 // indirect - modernc.org/memory v1.8.0 // indirect - modernc.org/sqlite v1.29.9 // indirect - zombiezen.com/go/sqlite v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 5c489bb..f0ec064 100644 --- a/go.sum +++ b/go.sum @@ -17,21 +17,13 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk= crawshaw.io/sqlite v0.3.2/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -git.kmsign.ru/royalcat/tstor/daemons/torrent v0.0.0-20250107213026-b11322030501 h1:5jgQ8oyQ6+MnDB+mkicXtLa083wYP/Lh7YrgrxtcLMo= -git.kmsign.ru/royalcat/tstor/daemons/torrent v0.0.0-20250107213026-b11322030501/go.mod h1:Wd/TyTgVzl1T5QSeLGvUh7ykIO6XZAMb+sh9ZWsGnN8= github.com/99designs/gqlgen v0.17.55 h1:3vzrNWYyzSZjGDFo68e5j9sSauLxfKvLp+6ioRokVtM= github.com/99designs/gqlgen v0.17.55/go.mod h1:3Bq768f8hgVPGZxL8aY9MaYmbxa6llPM/qu1IGH1EJo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w= github.com/RoaringBitmap/roaring v0.4.17/go.mod h1:D3qVegWTmfCaX4Bl5CrBE9hfrSrrXIr8KVNvRsDi1NI= github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= -github.com/RoaringBitmap/roaring v1.9.3 h1:t4EbC5qQwnisr5PrP9nt0IRhRTb9gMUgQF4t4S2OByM= -github.com/RoaringBitmap/roaring v1.9.3/go.mod h1:6AXUsoIEzDTFFQCe1RbGA6uFONMhvejWj5rqITANK90= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= @@ -40,73 +32,39 @@ github.com/agoda-com/opentelemetry-go/otelslog v0.2.0 h1:rzjfZxpmek5BmzEufD3vSaN github.com/agoda-com/opentelemetry-go/otelslog v0.2.0/go.mod h1:CSc0veIcY/HsIfH7l5PGtIpRvBttk09QUQlweVkD2PI= github.com/agoda-com/opentelemetry-logs-go v0.5.1 h1:6iQrLaY4M0glBZb/xVN559qQutK4V+HJ/mB1cbwaX3c= github.com/agoda-com/opentelemetry-logs-go v0.5.1/go.mod h1:35B5ypjX5pkVCPJR01i6owJSYWe8cnbWLpEyHgAGD/E= -github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0= -github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k= -github.com/alecthomas/assert/v2 v2.0.0-alpha3 h1:pcHeMvQ3OMstAWgaeaXIAL8uzB9xMm2zlxt+/4ml8lk= -github.com/alecthomas/assert/v2 v2.0.0-alpha3/go.mod h1:+zD0lmDXTeQj7TgDgCt0ePWxb0hMC1G+PGTsTCv1B9o= -github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8= -github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48= -github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 h1:eyb0bBaQKMOh5Se/Qg54shijc8K4zpQiOjEhKFADkQM= -github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k= github.com/anacrolix/dht/v2 v2.22.0 h1:wat5FLdT25vltHsjX377GBrpK9o6L2QVn541bIguCYo= github.com/anacrolix/dht/v2 v2.22.0/go.mod h1:shbBjhgvezqsJoE+hMo/ezHYQFF18V9jUllNIP5xV9k= github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= github.com/anacrolix/envpprof v1.1.0/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4= -github.com/anacrolix/envpprof v1.3.0 h1:WJt9bpuT7A/CDCxPOv/eeZqHWlle/Y0keJUvc6tcJDk= -github.com/anacrolix/envpprof v1.3.0/go.mod h1:7QIG4CaX1uexQ3tqd5+BRa/9e2D02Wcertl6Yh0jCB0= -github.com/anacrolix/generics v0.0.0-20230113004304-d6428d516633/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8= github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca h1:aiiGqSQWjtVNdi8zUMfA//IrM8fPkv2bWwZVPbDe0wg= github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca/go.mod h1:MN3ve08Z3zSV/rTuX/ouI4lNdlfTxgdafQJiLzyNRB8= -github.com/anacrolix/go-libutp v1.3.1 h1:idJzreNLl+hNjGC3ZnUOjujEaryeOGgkwHLqSGoige0= -github.com/anacrolix/go-libutp v1.3.1/go.mod h1:heF41EC8kN0qCLMokLBVkB8NXiLwx3t8R8810MTNI5o= github.com/anacrolix/log v0.3.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU= github.com/anacrolix/log v0.6.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU= -github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+BFxZ68= -github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY= github.com/anacrolix/log v0.16.0 h1:DSuyb5kAJwl3Y0X1TRcStVrTS9ST9b0BHW+7neE4Xho= github.com/anacrolix/log v0.16.0/go.mod h1:m0poRtlr41mriZlXBQ9SOVZ8yZBkLjOkDhd5Li5pITA= -github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62 h1:P04VG6Td13FHMgS5ZBcJX23NPC/fiC4cp9bXwYujdYM= -github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62/go.mod h1:66cFKPCO7Sl4vbFnAaSq7e4OXtdMhRSBagJGWgmpJbM= -github.com/anacrolix/missinggo v0.0.0-20180725070939-60ef2fbf63df/go.mod h1:kwGiTUTZ0+p4vAz3VbAI5a30t2YbvemcmspjKwrAz5s= github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= github.com/anacrolix/missinggo v1.1.2-0.20190815015349-b888af804467/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= github.com/anacrolix/missinggo v1.2.1/go.mod h1:J5cMhif8jPmFoC3+Uvob3OXXNIhOUikzMt+uUjeM21Y= github.com/anacrolix/missinggo v1.3.0 h1:06HlMsudotL7BAELRZs0yDZ4yVXsHXGi323QBjAVASw= github.com/anacrolix/missinggo v1.3.0/go.mod h1:bqHm8cE8xr+15uVfMG3BFui/TxyB6//H5fwlq/TeqMc= -github.com/anacrolix/missinggo/perf v1.0.0 h1:7ZOGYziGEBytW49+KmYGTaNfnwUqP1HBsy6BqESAJVw= github.com/anacrolix/missinggo/perf v1.0.0/go.mod h1:ljAFWkBuzkO12MQclXzZrosP5urunoLS0Cbvb4V0uMQ= github.com/anacrolix/missinggo/v2 v2.2.0/go.mod h1:o0jgJoYOyaoYQ4E2ZMISVa9c88BbUBVQQW4QeRkNCGY= github.com/anacrolix/missinggo/v2 v2.5.1/go.mod h1:WEjqh2rmKECd0t1VhQkLGTdIWXO6f6NLjp5GlMZ+6FA= github.com/anacrolix/missinggo/v2 v2.7.4 h1:47h5OXoPV8JbA/ACA+FLwKdYbAinuDO8osc2Cu9xkxg= github.com/anacrolix/missinggo/v2 v2.7.4/go.mod h1:vVO5FEziQm+NFmJesc7StpkquZk+WJFCaL0Wp//2sa0= -github.com/anacrolix/mmsg v0.0.0-20180515031531-a4a3ba1fc8bb/go.mod h1:x2/ErsYUmT77kezS63+wzZp8E3byYB0gzirM/WMBLfw= -github.com/anacrolix/mmsg v1.0.0 h1:btC7YLjOn29aTUAExJiVUhQOuf/8rhm+/nWCMAnL3Hg= -github.com/anacrolix/mmsg v1.0.0/go.mod h1:x8kRaJY/dCrY9Al0PEcj1mb/uFHwP6GCJ9fLl4thEPc= github.com/anacrolix/multiless v0.4.0 h1:lqSszHkliMsZd2hsyrDvHOw4AbYWa+ijQ66LzbjqWjM= github.com/anacrolix/multiless v0.4.0/go.mod h1:zJv1JF9AqdZiHwxqPgjuOZDGWER6nyE48WBCi/OOrMM= github.com/anacrolix/stm v0.2.0/go.mod h1:zoVQRvSiGjGoTmbM0vSLIiaKjWtNPeTvXUSdJQA4hsg= -github.com/anacrolix/stm v0.5.0 h1:9df1KBpttF0TzLgDq51Z+TEabZKMythqgx89f1FQJt8= -github.com/anacrolix/stm v0.5.0/go.mod h1:MOwrSy+jCm8Y7HYfMAwPj7qWVu7XoVvjOiYwJmpeB/M= -github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778/go.mod h1:s735Etp3joe/voe2sdaXLcqDdJSay1O0OPnM0ystjqk= -github.com/anacrolix/sync v0.3.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g= -github.com/anacrolix/sync v0.5.1 h1:FbGju6GqSjzVoTgcXTUKkF041lnZkG5P0C3T5RL3SGc= -github.com/anacrolix/sync v0.5.1/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g= github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/anacrolix/tagflag v1.0.0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= github.com/anacrolix/tagflag v1.1.0/go.mod h1:Scxs9CV10NQatSmbyjqmqmeQNwGzlNe0CMUMIxqHIG8= github.com/anacrolix/torrent v1.58.0 h1:cZGqEEEXYVXKIwnPfS56udd2BRaCH2iMPpct6Ao+Z8U= github.com/anacrolix/torrent v1.58.0/go.mod h1:n3SjHIE8oHXeH0Px0d5FXQ7cU4IgbEfTroen6B9KWJk= -github.com/anacrolix/upnp v0.1.4 h1:+2t2KA6QOhm/49zeNyeVwDu1ZYS9dB9wfxyVvh/wk7U= -github.com/anacrolix/upnp v0.1.4/go.mod h1:Qyhbqo69gwNWvEk1xNTXsS5j7hMHef9hdr984+9fIic= -github.com/anacrolix/utp v0.2.0 h1:65Cdmr6q9WSw2KsM+rtJFu7rqDzLl2bdysf4KlNPcFI= -github.com/anacrolix/utp v0.2.0/go.mod h1:HGk4GYQw1O/3T1+yhqT/F6EcBd+AAwlo9dYErNy7mj8= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= @@ -114,20 +72,13 @@ github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer5 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= -github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/immutable v0.2.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI= -github.com/benbjohnson/immutable v0.4.3 h1:GYHcksoJ9K6HyAUpGxwZURrbTkXA0Dh4otXGqbhdrjA= -github.com/benbjohnson/immutable v0.4.3/go.mod h1:qJIKKSmdqz1tVzNtst1DZzvaqOU1onk1rc03IeM3Owk= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/billziss-gh/cgofuse v1.5.0 h1:kH516I/s+Ab4diL/Y/ayFeUjjA8ey+JK12xDfBf4HEs= github.com/billziss-gh/cgofuse v1.5.0/go.mod h1:LJjoaUojlVjgo5GQoEJTcJNqZJeRU0nCR84CyxKt2YM= -github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= -github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bodgit/plumbing v1.3.0 h1:pf9Itz1JOQgn7vEOE7v7nlEfBykYqvUYioC61TwWCFU= github.com/bodgit/plumbing v1.3.0/go.mod h1:JOTb4XiRu5xfnmdnDJo6GmSbSbtSyufrsyZFByMtKEs= github.com/bodgit/sevenzip v1.5.1 h1:rVj0baZsooZFy64DJN0zQogPzhPrT8BQ8TTRd1H4WHw= @@ -141,8 +92,6 @@ github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8/go.mod h1:spo1JLcs67 github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -182,16 +131,12 @@ github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+m github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= -github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/frankban/quicktest v1.9.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -214,10 +159,6 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-llsqlite/adapter v0.1.0 h1:wGSQNsu/rtYeu/lqZNZQMjwUdEF3OW66xTLvsFwJQUw= -github.com/go-llsqlite/adapter v0.1.0/go.mod h1:DADrR88ONKPPeSGjFp5iEN55Arx3fi2qXZeKCYDpbmU= -github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568 h1:3EpZo8LxIzF4q3BT+vttQQlRfA6uTtTb/cxVisWa5HM= -github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568/go.mod h1:/YJdV7uBQaYDE0fwe4z3wwJIZBJxdYzd38ICggWqtaE= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -226,8 +167,6 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= -github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= @@ -265,8 +204,6 @@ github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= -github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -276,7 +213,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE= @@ -326,12 +262,9 @@ github.com/hashicorp/golang-lru/arc/v2 v2.0.7 h1:QxkVTxwColcduO+LP7eJO56r2hFiG8z github.com/hashicorp/golang-lru/arc/v2 v2.0.7/go.mod h1:Pe7gBlGdc8clY5LJ0LpJXMt5AmgmWNH1g+oFFVUHOEc= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= -github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -366,8 +299,6 @@ github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkX github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -404,7 +335,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= -github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= @@ -413,8 +343,6 @@ github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= -github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk= github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n58te3h6KsqCf3GxyfBGY= @@ -428,39 +356,6 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pion/datachannel v1.5.9 h1:LpIWAOYPyDrXtU+BW7X0Yt/vGtYxtXQ8ql7dFfYUVZA= -github.com/pion/datachannel v1.5.9/go.mod h1:kDUuk4CU4Uxp82NH4LQZbISULkX/HtzKa4P7ldf9izE= -github.com/pion/dtls/v3 v3.0.3 h1:j5ajZbQwff7Z8k3pE3S+rQ4STvKvXUdKsi/07ka+OWM= -github.com/pion/dtls/v3 v3.0.3/go.mod h1:weOTUyIV4z0bQaVzKe8kpaP17+us3yAuiQsEAG1STMU= -github.com/pion/ice/v4 v4.0.2 h1:1JhBRX8iQLi0+TfcavTjPjI6GO41MFn4CeTBX+Y9h5s= -github.com/pion/ice/v4 v4.0.2/go.mod h1:DCdqyzgtsDNYN6/3U8044j3U7qsJ9KFJC92VnOWHvXg= -github.com/pion/interceptor v0.1.37 h1:aRA8Zpab/wE7/c0O3fh1PqY0AJI3fCSEM5lRWJVorwI= -github.com/pion/interceptor v0.1.37/go.mod h1:JzxbJ4umVTlZAf+/utHzNesY8tmRkM2lVmkS82TTj8Y= -github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= -github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= -github.com/pion/mdns/v2 v2.0.7 h1:c9kM8ewCgjslaAmicYMFQIde2H9/lrZpjBkN8VwoVtM= -github.com/pion/mdns/v2 v2.0.7/go.mod h1:vAdSYNAT0Jy3Ru0zl2YiW3Rm/fJCwIeM0nToenfOJKA= -github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= -github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= -github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE= -github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4= -github.com/pion/rtp v1.8.9 h1:E2HX740TZKaqdcPmf4pw6ZZuG8u5RlMMt+l3dxeu6Wk= -github.com/pion/rtp v1.8.9/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU= -github.com/pion/sctp v1.8.33 h1:dSE4wX6uTJBcNm8+YlMg7lw1wqyKHggsP5uKbdj+NZw= -github.com/pion/sctp v1.8.33/go.mod h1:beTnqSzewI53KWoG3nqB282oDMGrhNxBdb+JZnkCwRM= -github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY= -github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M= -github.com/pion/srtp/v3 v3.0.4 h1:2Z6vDVxzrX3UHEgrUyIGM4rRouoC7v+NiF1IHtp9B5M= -github.com/pion/srtp/v3 v3.0.4/go.mod h1:1Jx3FwDoxpRaTh1oRV8A/6G1BnFL+QI82eK4ms8EEJQ= -github.com/pion/stun/v3 v3.0.0 h1:4h1gwhWLWuZWOJIJR9s2ferRO+W3zA/b6ijOI6mKzUw= -github.com/pion/stun/v3 v3.0.0/go.mod h1:HvCN8txt8mwi4FBvS3EmDghW6aQJ24T+y+1TKjB5jyU= -github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= -github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= -github.com/pion/turn/v4 v4.0.0 h1:qxplo3Rxa9Yg1xXDxxH8xaqcyGUtbHYw4QSCvmFWvhM= -github.com/pion/turn/v4 v4.0.0/go.mod h1:MuPDkm15nYSklKpN8vWJ9W2M0PlyQZqYt1McGuxG7mA= -github.com/pion/webrtc/v4 v4.0.0 h1:x8ec7uJQPP3D1iI8ojPAiTOylPI7Fa7QgqZrhpLyqZ8= -github.com/pion/webrtc/v4 v4.0.0/go.mod h1:SfNn8CcFxR6OUVjLXVslAQ3a3994JhyE3Hw1jAuqEto= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -502,19 +397,12 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/protolambda/ctxlock v0.1.0 h1:rCUY3+vRdcdZXqT07iXgyr744J2DU2LCBIXowYAjBCE= -github.com/protolambda/ctxlock v0.1.0/go.mod h1:vefhX6rIZH8rsg5ZpOJfEDYQOppZi19SfPiGOFrNnwM= github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93 h1:UVArwN/wkKjMVhh2EQGC0tEc1+FqiLlvYXY5mQ2f8Wg= github.com/rasky/go-xdr v0.0.0-20170124162913-1a41d1a06c93/go.mod h1:Nfe4efndBz4TibWycNE+lqyJZiMX4ycx+QKV8Ta0f/o= github.com/ravilushqa/otelgqlgen v0.15.0 h1:U85nrlweMXTGaMChUViYM39/MXBZVeVVlpuHq+6eECQ= github.com/ravilushqa/otelgqlgen v0.15.0/go.mod h1:o+1Eju0VySmgq2BP8Vupz2YrN21Bj7D7imBqu3m2uB8= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/royalcat/btrgo v0.0.0-20240318160410-19bd27154450 h1:AZyZxXZLniAR0DaZhTS4RVcHtOvYMW8IunplqC9A0mk= @@ -531,8 +419,6 @@ github.com/royalcat/kv/kvbadger v0.0.0-20240723215915-954e36a2491d h1:87jn2CTjcx github.com/royalcat/kv/kvbadger v0.0.0-20240723215915-954e36a2491d/go.mod h1:ZvAOAmLJhB9YaaDZ8e0RDdbjOA4bHD7MilyMjongmS8= github.com/royalcat/kv/testsuite v0.0.0-20240723124828-253d2ecf5312 h1:HJa7itFbdRh1S1MzLGLT56C7glaCOFC/zFnIIJleWVc= github.com/royalcat/kv/testsuite v0.0.0-20240723124828-253d2ecf5312/go.mod h1:mnIN/3t3O7piZJW5N0Em79rO27EbupBcHZncbMeBwjE= -github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529 h1:18kd+8ZUlt/ARXhljq+14TwAoKa61q6dX8jtwOf6DH8= -github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -540,7 +426,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= -github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8= github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8= github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc= github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= @@ -568,28 +453,22 @@ github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= -github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= @@ -615,14 +494,9 @@ github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00 h1:U0DnHRZ github.com/willscott/go-nfs-client v0.0.0-20240104095149-b44639837b00/go.mod h1:Tq++Lr/FgiS3X48q5FETemXiSLGuYMQT2sPjYNPJSwA= github.com/willscott/memphis v0.0.0-20210922141505-529d4987ab7e h1:1eHCP4w7tMmpfFBdrd5ff+vYU9THtrtA1yM9f0TLlJw= github.com/willscott/memphis v0.0.0-20210922141505-529d4987ab7e/go.mod h1:59vHBW4EpjiL5oiqgCrBp1Tc9JXRzKCNMEOaGmNfSHo= -github.com/wlynxg/anet v0.0.3 h1:PvR53psxFXstc12jelG6f1Lv4MWqE0tI76/hHGjh9rg= -github.com/wlynxg/anet v0.0.3/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0= -go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -684,7 +558,6 @@ golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 h1:yqrTHse8TCMW1M1ZCP+VAR/l0kKxwaAIqN/il7x4voA= golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -704,8 +577,6 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= @@ -728,7 +599,6 @@ golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= @@ -744,7 +614,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= @@ -772,9 +641,7 @@ golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -792,7 +659,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= @@ -827,14 +693,12 @@ golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -917,32 +781,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= -modernc.org/cc/v4 v4.21.0 h1:D/gLKtcztomvWbsbvBKo3leKQv+86f+DdqEZBBXhnag= -modernc.org/cc/v4 v4.21.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= -modernc.org/ccgo/v4 v4.17.3 h1:t2CQci84jnxKw3GGnHvjGKjiNZeZqyQx/023spkk4hU= -modernc.org/ccgo/v4 v4.17.3/go.mod h1:1FCbAtWYJoKuc+AviS+dH+vGNtYmFJqBeRWjmnDWsIg= -modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= -modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= -modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= -modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= -modernc.org/libc v1.50.5 h1:ZzeUd0dIc/sUtoPTCYIrgypkuzoGzNu6kbEWj2VuEmk= -modernc.org/libc v1.50.5/go.mod h1:rhzrUx5oePTSTIzBgM0mTftwWHK8tiT9aNFUt1mldl0= -modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= -modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= -modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= -modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= -modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= -modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= -modernc.org/sqlite v1.29.9 h1:9RhNMklxJs+1596GNuAX+O/6040bvOwacTxuFcRuQow= -modernc.org/sqlite v1.29.9/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA= -modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= -modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -zombiezen.com/go/sqlite v1.3.0 h1:98g1gnCm+CNz6AuQHu0gqyw7gR2WU3O3PJufDOStpUs= -zombiezen.com/go/sqlite v1.3.0/go.mod h1:yRl27//s/9aXU3RWs8uFQwjkTG9gYNGEls6+6SvrclY= diff --git a/graphql/mutation.graphql b/graphql/mutation.graphql index 62a3a45..db19320 100644 --- a/graphql/mutation.graphql +++ b/graphql/mutation.graphql @@ -1,5 +1,4 @@ type Mutation { - torrentDaemon: TorrentDaemonMutation @resolver qbitTorrentDaemon: QBitTorrentDaemonMutation @resolver uploadFile(dir: String!, file: Upload!): Boolean! diff --git a/graphql/subscription.graphql b/graphql/subscription.graphql index 9df09ee..eb724c8 100644 --- a/graphql/subscription.graphql +++ b/graphql/subscription.graphql @@ -1,16 +1,8 @@ type Subscription { - taskProgress(taskID: ID!): Progress - torrentDownloadUpdates: TorrentProgress -} - - -type TorrentProgress implements Progress { - torrent: Torrent! - current: Int! - total: Int! + taskProgress(taskID: ID!): Progress } interface Progress { - current: Int! - total: Int! -} \ No newline at end of file + current: Int! + total: Int! +} diff --git a/graphql/types/fs.graphql b/graphql/types/fs.graphql index a34da46..66b6ffe 100644 --- a/graphql/types/fs.graphql +++ b/graphql/types/fs.graphql @@ -33,15 +33,3 @@ type ArchiveFS implements Dir & FsEntry { size: Int! } - -type TorrentFS implements Dir & FsEntry { - name: String! - torrent: Torrent! - entries: [FsEntry!]! @resolver -} - -type TorrentFileEntry implements File & FsEntry { - name: String! - torrent: Torrent! - size: Int! -} diff --git a/graphql/types/progress.graphql b/graphql/types/progress.graphql new file mode 100644 index 0000000..ba45953 --- /dev/null +++ b/graphql/types/progress.graphql @@ -0,0 +1,4 @@ +interface Progress { + current: Int! + total: Int! +} diff --git a/src/delivery/graphql/generated.go b/src/delivery/graphql/generated.go index 762af3a..6d8296a 100644 --- a/src/delivery/graphql/generated.go +++ b/src/delivery/graphql/generated.go @@ -16,7 +16,6 @@ import ( "git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" - "github.com/anacrolix/torrent/types" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" ) @@ -50,11 +49,6 @@ type ResolverRoot interface { ResolverFS() ResolverFSResolver SimpleDir() SimpleDirResolver Subscription() SubscriptionResolver - Torrent() TorrentResolver - TorrentDaemonMutation() TorrentDaemonMutationResolver - TorrentDaemonQuery() TorrentDaemonQueryResolver - TorrentFS() TorrentFSResolver - TorrentFile() TorrentFileResolver } type DirectiveRoot struct { @@ -70,19 +64,9 @@ type ComplexityRoot struct { Size func(childComplexity int) int } - CleanupResponse struct { - Count func(childComplexity int) int - List func(childComplexity int) int - } - - DownloadTorrentResponse struct { - Task func(childComplexity int) int - } - Mutation struct { DedupeStorage func(childComplexity int) int QbitTorrentDaemon func(childComplexity int) int - TorrentDaemon func(childComplexity int) int UploadFile func(childComplexity int, dir string, file graphql.Upload) int } @@ -114,7 +98,6 @@ type ComplexityRoot struct { Query struct { FsEntry func(childComplexity int, path string) int QbitTorrentDaemon func(childComplexity int) int - TorrentDaemon func(childComplexity int) int } ResolverFS struct { @@ -138,102 +121,18 @@ type ComplexityRoot struct { } Subscription struct { - TaskProgress func(childComplexity int, taskID string) int - TorrentDownloadUpdates func(childComplexity int) int + TaskProgress func(childComplexity int, taskID string) int } Task struct { ID func(childComplexity int) int } - - Torrent struct { - BytesCompleted func(childComplexity int) int - BytesMissing func(childComplexity int) int - ExcludedFiles func(childComplexity int) int - Files func(childComplexity int) int - Infohash func(childComplexity int) int - Name func(childComplexity int) int - Peers func(childComplexity int) int - Priority func(childComplexity int) int - TorrentFilePath func(childComplexity int) int - } - - TorrentClientStats struct { - BytesRead func(childComplexity int) int - BytesReadData func(childComplexity int) int - BytesReadUsefulData func(childComplexity int) int - BytesReadUsefulIntendedData func(childComplexity int) int - BytesWritten func(childComplexity int) int - BytesWrittenData func(childComplexity int) int - ChunksRead func(childComplexity int) int - ChunksReadUseful func(childComplexity int) int - ChunksReadWasted func(childComplexity int) int - ChunksWritten func(childComplexity int) int - MetadataChunksRead func(childComplexity int) int - PiecesDirtiedBad func(childComplexity int) int - PiecesDirtiedGood func(childComplexity int) int - } - - TorrentDaemonMutation struct { - Cleanup func(childComplexity int, files *bool, dryRun bool) int - SetTorrentPriority func(childComplexity int, infohash string, file *string, priority types.PiecePriority) int - ValidateTorrent func(childComplexity int, filter model.TorrentFilter) int - } - - TorrentDaemonQuery struct { - ClientStats func(childComplexity int) int - StatsHistory func(childComplexity int, since time.Time, infohash *string) int - Torrents func(childComplexity int, filter *model.TorrentsFilter) int - } - - TorrentFS struct { - Entries func(childComplexity int) int - Name func(childComplexity int) int - Torrent func(childComplexity int) int - } - - TorrentFile struct { - BytesCompleted func(childComplexity int) int - Filename func(childComplexity int) int - Priority func(childComplexity int) int - Size func(childComplexity int) int - } - - TorrentFileEntry struct { - Name func(childComplexity int) int - Size func(childComplexity int) int - Torrent func(childComplexity int) int - } - - TorrentPeer struct { - ClientName func(childComplexity int) int - Discovery func(childComplexity int) int - DownloadRate func(childComplexity int) int - IP func(childComplexity int) int - Port func(childComplexity int) int - } - - TorrentProgress struct { - Current func(childComplexity int) int - Torrent func(childComplexity int) int - Total func(childComplexity int) int - } - - TorrentStats struct { - ActivePeers func(childComplexity int) int - ConnectedSeeders func(childComplexity int) int - DownloadedBytes func(childComplexity int) int - Timestamp func(childComplexity int) int - TotalPeers func(childComplexity int) int - UploadedBytes func(childComplexity int) int - } } type ArchiveFSResolver interface { Entries(ctx context.Context, obj *model.ArchiveFs) ([]model.FsEntry, error) } type MutationResolver interface { - TorrentDaemon(ctx context.Context) (*model.TorrentDaemonMutation, error) QbitTorrentDaemon(ctx context.Context) (*model.QBitTorrentDaemonMutation, error) UploadFile(ctx context.Context, dir string, file graphql.Upload) (bool, error) DedupeStorage(ctx context.Context) (int64, error) @@ -249,7 +148,6 @@ type QTorrentResolver interface { SourceFiles(ctx context.Context, obj *model.QTorrent) ([]string, error) } type QueryResolver interface { - TorrentDaemon(ctx context.Context) (*model.TorrentDaemonQuery, error) QbitTorrentDaemon(ctx context.Context) (*model.QBitTorrentDaemonQuery, error) FsEntry(ctx context.Context, path string) (model.FsEntry, error) } @@ -261,30 +159,6 @@ type SimpleDirResolver interface { } type SubscriptionResolver interface { TaskProgress(ctx context.Context, taskID string) (<-chan model.Progress, error) - TorrentDownloadUpdates(ctx context.Context) (<-chan *model.TorrentProgress, error) -} -type TorrentResolver interface { - Name(ctx context.Context, obj *model.Torrent) (string, error) - - Files(ctx context.Context, obj *model.Torrent) ([]*model.TorrentFile, error) - ExcludedFiles(ctx context.Context, obj *model.Torrent) ([]*model.TorrentFile, error) - Peers(ctx context.Context, obj *model.Torrent) ([]*model.TorrentPeer, error) -} -type TorrentDaemonMutationResolver interface { - ValidateTorrent(ctx context.Context, obj *model.TorrentDaemonMutation, filter model.TorrentFilter) (bool, error) - SetTorrentPriority(ctx context.Context, obj *model.TorrentDaemonMutation, infohash string, file *string, priority types.PiecePriority) (bool, error) - Cleanup(ctx context.Context, obj *model.TorrentDaemonMutation, files *bool, dryRun bool) (*model.CleanupResponse, error) -} -type TorrentDaemonQueryResolver interface { - Torrents(ctx context.Context, obj *model.TorrentDaemonQuery, filter *model.TorrentsFilter) ([]*model.Torrent, error) - ClientStats(ctx context.Context, obj *model.TorrentDaemonQuery) (*model.TorrentClientStats, error) - StatsHistory(ctx context.Context, obj *model.TorrentDaemonQuery, since time.Time, infohash *string) ([]*model.TorrentStats, error) -} -type TorrentFSResolver interface { - Entries(ctx context.Context, obj *model.TorrentFs) ([]model.FsEntry, error) -} -type TorrentFileResolver interface { - Priority(ctx context.Context, obj *model.TorrentFile) (types.PiecePriority, error) } type executableSchema struct { @@ -327,27 +201,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ArchiveFS.Size(childComplexity), true - case "CleanupResponse.count": - if e.complexity.CleanupResponse.Count == nil { - break - } - - return e.complexity.CleanupResponse.Count(childComplexity), true - - case "CleanupResponse.list": - if e.complexity.CleanupResponse.List == nil { - break - } - - return e.complexity.CleanupResponse.List(childComplexity), true - - case "DownloadTorrentResponse.task": - if e.complexity.DownloadTorrentResponse.Task == nil { - break - } - - return e.complexity.DownloadTorrentResponse.Task(childComplexity), true - case "Mutation.dedupeStorage": if e.complexity.Mutation.DedupeStorage == nil { break @@ -362,13 +215,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.QbitTorrentDaemon(childComplexity), true - case "Mutation.torrentDaemon": - if e.complexity.Mutation.TorrentDaemon == nil { - break - } - - return e.complexity.Mutation.TorrentDaemon(childComplexity), true - case "Mutation.uploadFile": if e.complexity.Mutation.UploadFile == nil { break @@ -485,13 +331,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.QbitTorrentDaemon(childComplexity), true - case "Query.torrentDaemon": - if e.complexity.Query.TorrentDaemon == nil { - break - } - - return e.complexity.Query.TorrentDaemon(childComplexity), true - case "ResolverFS.entries": if e.complexity.ResolverFS.Entries == nil { break @@ -560,13 +399,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Subscription.TaskProgress(childComplexity, args["taskID"].(string)), true - case "Subscription.torrentDownloadUpdates": - if e.complexity.Subscription.TorrentDownloadUpdates == nil { - break - } - - return e.complexity.Subscription.TorrentDownloadUpdates(childComplexity), true - case "Task.id": if e.complexity.Task.ID == nil { break @@ -574,395 +406,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Task.ID(childComplexity), true - case "Torrent.bytesCompleted": - if e.complexity.Torrent.BytesCompleted == nil { - break - } - - return e.complexity.Torrent.BytesCompleted(childComplexity), true - - case "Torrent.bytesMissing": - if e.complexity.Torrent.BytesMissing == nil { - break - } - - return e.complexity.Torrent.BytesMissing(childComplexity), true - - case "Torrent.excludedFiles": - if e.complexity.Torrent.ExcludedFiles == nil { - break - } - - return e.complexity.Torrent.ExcludedFiles(childComplexity), true - - case "Torrent.files": - if e.complexity.Torrent.Files == nil { - break - } - - return e.complexity.Torrent.Files(childComplexity), true - - case "Torrent.infohash": - if e.complexity.Torrent.Infohash == nil { - break - } - - return e.complexity.Torrent.Infohash(childComplexity), true - - case "Torrent.name": - if e.complexity.Torrent.Name == nil { - break - } - - return e.complexity.Torrent.Name(childComplexity), true - - case "Torrent.peers": - if e.complexity.Torrent.Peers == nil { - break - } - - return e.complexity.Torrent.Peers(childComplexity), true - - case "Torrent.priority": - if e.complexity.Torrent.Priority == nil { - break - } - - return e.complexity.Torrent.Priority(childComplexity), true - - case "Torrent.torrentFilePath": - if e.complexity.Torrent.TorrentFilePath == nil { - break - } - - return e.complexity.Torrent.TorrentFilePath(childComplexity), true - - case "TorrentClientStats.bytesRead": - if e.complexity.TorrentClientStats.BytesRead == nil { - break - } - - return e.complexity.TorrentClientStats.BytesRead(childComplexity), true - - case "TorrentClientStats.bytesReadData": - if e.complexity.TorrentClientStats.BytesReadData == nil { - break - } - - return e.complexity.TorrentClientStats.BytesReadData(childComplexity), true - - case "TorrentClientStats.bytesReadUsefulData": - if e.complexity.TorrentClientStats.BytesReadUsefulData == nil { - break - } - - return e.complexity.TorrentClientStats.BytesReadUsefulData(childComplexity), true - - case "TorrentClientStats.bytesReadUsefulIntendedData": - if e.complexity.TorrentClientStats.BytesReadUsefulIntendedData == nil { - break - } - - return e.complexity.TorrentClientStats.BytesReadUsefulIntendedData(childComplexity), true - - case "TorrentClientStats.bytesWritten": - if e.complexity.TorrentClientStats.BytesWritten == nil { - break - } - - return e.complexity.TorrentClientStats.BytesWritten(childComplexity), true - - case "TorrentClientStats.bytesWrittenData": - if e.complexity.TorrentClientStats.BytesWrittenData == nil { - break - } - - return e.complexity.TorrentClientStats.BytesWrittenData(childComplexity), true - - case "TorrentClientStats.chunksRead": - if e.complexity.TorrentClientStats.ChunksRead == nil { - break - } - - return e.complexity.TorrentClientStats.ChunksRead(childComplexity), true - - case "TorrentClientStats.chunksReadUseful": - if e.complexity.TorrentClientStats.ChunksReadUseful == nil { - break - } - - return e.complexity.TorrentClientStats.ChunksReadUseful(childComplexity), true - - case "TorrentClientStats.chunksReadWasted": - if e.complexity.TorrentClientStats.ChunksReadWasted == nil { - break - } - - return e.complexity.TorrentClientStats.ChunksReadWasted(childComplexity), true - - case "TorrentClientStats.chunksWritten": - if e.complexity.TorrentClientStats.ChunksWritten == nil { - break - } - - return e.complexity.TorrentClientStats.ChunksWritten(childComplexity), true - - case "TorrentClientStats.metadataChunksRead": - if e.complexity.TorrentClientStats.MetadataChunksRead == nil { - break - } - - return e.complexity.TorrentClientStats.MetadataChunksRead(childComplexity), true - - case "TorrentClientStats.piecesDirtiedBad": - if e.complexity.TorrentClientStats.PiecesDirtiedBad == nil { - break - } - - return e.complexity.TorrentClientStats.PiecesDirtiedBad(childComplexity), true - - case "TorrentClientStats.piecesDirtiedGood": - if e.complexity.TorrentClientStats.PiecesDirtiedGood == nil { - break - } - - return e.complexity.TorrentClientStats.PiecesDirtiedGood(childComplexity), true - - case "TorrentDaemonMutation.cleanup": - if e.complexity.TorrentDaemonMutation.Cleanup == nil { - break - } - - args, err := ec.field_TorrentDaemonMutation_cleanup_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.TorrentDaemonMutation.Cleanup(childComplexity, args["files"].(*bool), args["dryRun"].(bool)), true - - case "TorrentDaemonMutation.setTorrentPriority": - if e.complexity.TorrentDaemonMutation.SetTorrentPriority == nil { - break - } - - args, err := ec.field_TorrentDaemonMutation_setTorrentPriority_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.TorrentDaemonMutation.SetTorrentPriority(childComplexity, args["infohash"].(string), args["file"].(*string), args["priority"].(types.PiecePriority)), true - - case "TorrentDaemonMutation.validateTorrent": - if e.complexity.TorrentDaemonMutation.ValidateTorrent == nil { - break - } - - args, err := ec.field_TorrentDaemonMutation_validateTorrent_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.TorrentDaemonMutation.ValidateTorrent(childComplexity, args["filter"].(model.TorrentFilter)), true - - case "TorrentDaemonQuery.clientStats": - if e.complexity.TorrentDaemonQuery.ClientStats == nil { - break - } - - return e.complexity.TorrentDaemonQuery.ClientStats(childComplexity), true - - case "TorrentDaemonQuery.statsHistory": - if e.complexity.TorrentDaemonQuery.StatsHistory == nil { - break - } - - args, err := ec.field_TorrentDaemonQuery_statsHistory_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.TorrentDaemonQuery.StatsHistory(childComplexity, args["since"].(time.Time), args["infohash"].(*string)), true - - case "TorrentDaemonQuery.torrents": - if e.complexity.TorrentDaemonQuery.Torrents == nil { - break - } - - args, err := ec.field_TorrentDaemonQuery_torrents_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.TorrentDaemonQuery.Torrents(childComplexity, args["filter"].(*model.TorrentsFilter)), true - - case "TorrentFS.entries": - if e.complexity.TorrentFS.Entries == nil { - break - } - - return e.complexity.TorrentFS.Entries(childComplexity), true - - case "TorrentFS.name": - if e.complexity.TorrentFS.Name == nil { - break - } - - return e.complexity.TorrentFS.Name(childComplexity), true - - case "TorrentFS.torrent": - if e.complexity.TorrentFS.Torrent == nil { - break - } - - return e.complexity.TorrentFS.Torrent(childComplexity), true - - case "TorrentFile.bytesCompleted": - if e.complexity.TorrentFile.BytesCompleted == nil { - break - } - - return e.complexity.TorrentFile.BytesCompleted(childComplexity), true - - case "TorrentFile.filename": - if e.complexity.TorrentFile.Filename == nil { - break - } - - return e.complexity.TorrentFile.Filename(childComplexity), true - - case "TorrentFile.priority": - if e.complexity.TorrentFile.Priority == nil { - break - } - - return e.complexity.TorrentFile.Priority(childComplexity), true - - case "TorrentFile.size": - if e.complexity.TorrentFile.Size == nil { - break - } - - return e.complexity.TorrentFile.Size(childComplexity), true - - case "TorrentFileEntry.name": - if e.complexity.TorrentFileEntry.Name == nil { - break - } - - return e.complexity.TorrentFileEntry.Name(childComplexity), true - - case "TorrentFileEntry.size": - if e.complexity.TorrentFileEntry.Size == nil { - break - } - - return e.complexity.TorrentFileEntry.Size(childComplexity), true - - case "TorrentFileEntry.torrent": - if e.complexity.TorrentFileEntry.Torrent == nil { - break - } - - return e.complexity.TorrentFileEntry.Torrent(childComplexity), true - - case "TorrentPeer.clientName": - if e.complexity.TorrentPeer.ClientName == nil { - break - } - - return e.complexity.TorrentPeer.ClientName(childComplexity), true - - case "TorrentPeer.discovery": - if e.complexity.TorrentPeer.Discovery == nil { - break - } - - return e.complexity.TorrentPeer.Discovery(childComplexity), true - - case "TorrentPeer.downloadRate": - if e.complexity.TorrentPeer.DownloadRate == nil { - break - } - - return e.complexity.TorrentPeer.DownloadRate(childComplexity), true - - case "TorrentPeer.ip": - if e.complexity.TorrentPeer.IP == nil { - break - } - - return e.complexity.TorrentPeer.IP(childComplexity), true - - case "TorrentPeer.port": - if e.complexity.TorrentPeer.Port == nil { - break - } - - return e.complexity.TorrentPeer.Port(childComplexity), true - - case "TorrentProgress.current": - if e.complexity.TorrentProgress.Current == nil { - break - } - - return e.complexity.TorrentProgress.Current(childComplexity), true - - case "TorrentProgress.torrent": - if e.complexity.TorrentProgress.Torrent == nil { - break - } - - return e.complexity.TorrentProgress.Torrent(childComplexity), true - - case "TorrentProgress.total": - if e.complexity.TorrentProgress.Total == nil { - break - } - - return e.complexity.TorrentProgress.Total(childComplexity), true - - case "TorrentStats.activePeers": - if e.complexity.TorrentStats.ActivePeers == nil { - break - } - - return e.complexity.TorrentStats.ActivePeers(childComplexity), true - - case "TorrentStats.connectedSeeders": - if e.complexity.TorrentStats.ConnectedSeeders == nil { - break - } - - return e.complexity.TorrentStats.ConnectedSeeders(childComplexity), true - - case "TorrentStats.downloadedBytes": - if e.complexity.TorrentStats.DownloadedBytes == nil { - break - } - - return e.complexity.TorrentStats.DownloadedBytes(childComplexity), true - - case "TorrentStats.timestamp": - if e.complexity.TorrentStats.Timestamp == nil { - break - } - - return e.complexity.TorrentStats.Timestamp(childComplexity), true - - case "TorrentStats.totalPeers": - if e.complexity.TorrentStats.TotalPeers == nil { - break - } - - return e.complexity.TorrentStats.TotalPeers(childComplexity), true - - case "TorrentStats.uploadedBytes": - if e.complexity.TorrentStats.UploadedBytes == nil { - break - } - - return e.complexity.TorrentStats.UploadedBytes(childComplexity), true - } return 0, false } @@ -977,9 +420,6 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputPagination, ec.unmarshalInputQBitTorrentDaemonFilter, ec.unmarshalInputStringFilter, - ec.unmarshalInputTorrentFilter, - ec.unmarshalInputTorrentPriorityFilter, - ec.unmarshalInputTorrentsFilter, ) first := true @@ -1095,7 +535,6 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er var sources = []*ast.Source{ {Name: "../../../graphql/mutation.graphql", Input: `type Mutation { - torrentDaemon: TorrentDaemonMutation @resolver qbitTorrentDaemon: QBitTorrentDaemonMutation @resolver uploadFile(dir: String!, file: Upload!): Boolean! @@ -1107,7 +546,6 @@ type Task { } `, BuiltIn: false}, {Name: "../../../graphql/query.graphql", Input: `type Query { - torrentDaemon: TorrentDaemonQuery @resolver qbitTorrentDaemon: QBitTorrentDaemonQuery @resolver fsEntry(path: String!): FsEntry @@ -1128,21 +566,14 @@ type Schema { } `, BuiltIn: false}, {Name: "../../../graphql/subscription.graphql", Input: `type Subscription { - taskProgress(taskID: ID!): Progress - torrentDownloadUpdates: TorrentProgress -} - - -type TorrentProgress implements Progress { - torrent: Torrent! - current: Int! - total: Int! + taskProgress(taskID: ID!): Progress } interface Progress { - current: Int! - total: Int! -}`, BuiltIn: false}, + current: Int! + total: Int! +} +`, BuiltIn: false}, {Name: "../../../graphql/sources/qbittorrent_mutation.graphql", Input: `type QBitTorrentDaemonMutation { cleanup(run: Boolean!): QBitCleanupResponse! @resolver cleanupUnregistred(run: Boolean!): QBitCleanupUnregistredResponse! @resolver @@ -1171,118 +602,6 @@ input QBitTorrentDaemonFilter { hash: String! sourceFiles: [String!]! @resolver } -`, BuiltIn: false}, - {Name: "../../../graphql/sources/torrent_mutation.graphql", Input: `type TorrentDaemonMutation { - validateTorrent(filter: TorrentFilter!): Boolean! @resolver - setTorrentPriority( - infohash: String! - file: String - priority: TorrentPriority! - ): Boolean! @resolver - cleanup(files: Boolean, dryRun: Boolean!): CleanupResponse! @resolver -} - -type CleanupResponse { - count: Int! - list: [String!]! -} - -type DownloadTorrentResponse { - task: Task -} -`, BuiltIn: false}, - {Name: "../../../graphql/sources/torrent_query.graphql", Input: `type TorrentDaemonQuery { - torrents(filter: TorrentsFilter): [Torrent!]! @resolver - clientStats: TorrentClientStats! @resolver - statsHistory(since: DateTime!, infohash: String): [TorrentStats!]! @resolver -} - -input TorrentsFilter { - infohash: StringFilter - name: StringFilter - bytesCompleted: IntFilter - bytesMissing: IntFilter - peersCount: IntFilter - priority: TorrentPriorityFilter -} - -input TorrentPriorityFilter @oneOf { - eq: TorrentPriority - gt: TorrentPriority - lt: TorrentPriority - gte: TorrentPriority - lte: TorrentPriority - in: [TorrentPriority!] -} - -input TorrentFilter @oneOf { - everything: Boolean - infohash: String - # pathGlob: String! -} -`, BuiltIn: false}, - {Name: "../../../graphql/sources/torrent_types.graphql", Input: `type Torrent { - name: String! @resolver - infohash: String! - bytesCompleted: Int! - torrentFilePath: String! - bytesMissing: Int! - priority: TorrentPriority! - files: [TorrentFile!]! @resolver - excludedFiles: [TorrentFile!]! @resolver - peers: [TorrentPeer!]! @resolver -} - -type TorrentFile { - filename: String! - size: Int! - bytesCompleted: Int! - priority: TorrentPriority! @resolver -} - -type TorrentPeer { - ip: String! - downloadRate: Float! - discovery: String! - port: Int! - clientName: String! -} - -enum TorrentPriority { - NONE - NORMAL - HIGH - READAHEAD - NOW -} - -type TorrentClientStats { - bytesWritten: Int! - bytesWrittenData: Int! - bytesRead: Int! - bytesReadData: Int! - bytesReadUsefulData: Int! - bytesReadUsefulIntendedData: Int! - - chunksWritten: Int! - chunksRead: Int! - chunksReadUseful: Int! - chunksReadWasted: Int! - - metadataChunksRead: Int! - - piecesDirtiedGood: Int! - piecesDirtiedBad: Int! -} - -type TorrentStats { - timestamp: DateTime! - downloadedBytes: UInt! - uploadedBytes: UInt! - totalPeers: UInt! - activePeers: UInt! - connectedSeeders: UInt! -} `, BuiltIn: false}, {Name: "../../../graphql/types/filters.graphql", Input: `input Pagination { offset: Int! @@ -1351,18 +670,6 @@ type ArchiveFS implements Dir & FsEntry { size: Int! } - -type TorrentFS implements Dir & FsEntry { - name: String! - torrent: Torrent! - entries: [FsEntry!]! @resolver -} - -type TorrentFileEntry implements File & FsEntry { - name: String! - torrent: Torrent! - size: Int! -} `, BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -1622,274 +929,6 @@ func (ec *executionContext) field_Subscription_taskProgress_argsTaskID( return zeroVal, nil } -func (ec *executionContext) field_TorrentDaemonMutation_cleanup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - arg0, err := ec.field_TorrentDaemonMutation_cleanup_argsFiles(ctx, rawArgs) - if err != nil { - return nil, err - } - args["files"] = arg0 - arg1, err := ec.field_TorrentDaemonMutation_cleanup_argsDryRun(ctx, rawArgs) - if err != nil { - return nil, err - } - args["dryRun"] = arg1 - return args, nil -} -func (ec *executionContext) field_TorrentDaemonMutation_cleanup_argsFiles( - ctx context.Context, - rawArgs map[string]interface{}, -) (*bool, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["files"] - if !ok { - var zeroVal *bool - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("files")) - if tmp, ok := rawArgs["files"]; ok { - return ec.unmarshalOBoolean2ᚖbool(ctx, tmp) - } - - var zeroVal *bool - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonMutation_cleanup_argsDryRun( - ctx context.Context, - rawArgs map[string]interface{}, -) (bool, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["dryRun"] - if !ok { - var zeroVal bool - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("dryRun")) - if tmp, ok := rawArgs["dryRun"]; ok { - return ec.unmarshalNBoolean2bool(ctx, tmp) - } - - var zeroVal bool - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonMutation_setTorrentPriority_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - arg0, err := ec.field_TorrentDaemonMutation_setTorrentPriority_argsInfohash(ctx, rawArgs) - if err != nil { - return nil, err - } - args["infohash"] = arg0 - arg1, err := ec.field_TorrentDaemonMutation_setTorrentPriority_argsFile(ctx, rawArgs) - if err != nil { - return nil, err - } - args["file"] = arg1 - arg2, err := ec.field_TorrentDaemonMutation_setTorrentPriority_argsPriority(ctx, rawArgs) - if err != nil { - return nil, err - } - args["priority"] = arg2 - return args, nil -} -func (ec *executionContext) field_TorrentDaemonMutation_setTorrentPriority_argsInfohash( - ctx context.Context, - rawArgs map[string]interface{}, -) (string, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["infohash"] - if !ok { - var zeroVal string - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("infohash")) - if tmp, ok := rawArgs["infohash"]; ok { - return ec.unmarshalNString2string(ctx, tmp) - } - - var zeroVal string - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonMutation_setTorrentPriority_argsFile( - ctx context.Context, - rawArgs map[string]interface{}, -) (*string, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["file"] - if !ok { - var zeroVal *string - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("file")) - if tmp, ok := rawArgs["file"]; ok { - return ec.unmarshalOString2ᚖstring(ctx, tmp) - } - - var zeroVal *string - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonMutation_setTorrentPriority_argsPriority( - ctx context.Context, - rawArgs map[string]interface{}, -) (types.PiecePriority, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["priority"] - if !ok { - var zeroVal types.PiecePriority - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - if tmp, ok := rawArgs["priority"]; ok { - return ec.unmarshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, tmp) - } - - var zeroVal types.PiecePriority - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonMutation_validateTorrent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - arg0, err := ec.field_TorrentDaemonMutation_validateTorrent_argsFilter(ctx, rawArgs) - if err != nil { - return nil, err - } - args["filter"] = arg0 - return args, nil -} -func (ec *executionContext) field_TorrentDaemonMutation_validateTorrent_argsFilter( - ctx context.Context, - rawArgs map[string]interface{}, -) (model.TorrentFilter, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["filter"] - if !ok { - var zeroVal model.TorrentFilter - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - if tmp, ok := rawArgs["filter"]; ok { - return ec.unmarshalNTorrentFilter2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFilter(ctx, tmp) - } - - var zeroVal model.TorrentFilter - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonQuery_statsHistory_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - arg0, err := ec.field_TorrentDaemonQuery_statsHistory_argsSince(ctx, rawArgs) - if err != nil { - return nil, err - } - args["since"] = arg0 - arg1, err := ec.field_TorrentDaemonQuery_statsHistory_argsInfohash(ctx, rawArgs) - if err != nil { - return nil, err - } - args["infohash"] = arg1 - return args, nil -} -func (ec *executionContext) field_TorrentDaemonQuery_statsHistory_argsSince( - ctx context.Context, - rawArgs map[string]interface{}, -) (time.Time, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["since"] - if !ok { - var zeroVal time.Time - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("since")) - if tmp, ok := rawArgs["since"]; ok { - return ec.unmarshalNDateTime2timeᚐTime(ctx, tmp) - } - - var zeroVal time.Time - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonQuery_statsHistory_argsInfohash( - ctx context.Context, - rawArgs map[string]interface{}, -) (*string, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["infohash"] - if !ok { - var zeroVal *string - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("infohash")) - if tmp, ok := rawArgs["infohash"]; ok { - return ec.unmarshalOString2ᚖstring(ctx, tmp) - } - - var zeroVal *string - return zeroVal, nil -} - -func (ec *executionContext) field_TorrentDaemonQuery_torrents_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - arg0, err := ec.field_TorrentDaemonQuery_torrents_argsFilter(ctx, rawArgs) - if err != nil { - return nil, err - } - args["filter"] = arg0 - return args, nil -} -func (ec *executionContext) field_TorrentDaemonQuery_torrents_argsFilter( - ctx context.Context, - rawArgs map[string]interface{}, -) (*model.TorrentsFilter, error) { - // We won't call the directive if the argument is null. - // Set call_argument_directives_with_null to true to call directives - // even if the argument is null. - _, ok := rawArgs["filter"] - if !ok { - var zeroVal *model.TorrentsFilter - return zeroVal, nil - } - - ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - if tmp, ok := rawArgs["filter"]; ok { - return ec.unmarshalOTorrentsFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentsFilter(ctx, tmp) - } - - var zeroVal *model.TorrentsFilter - return zeroVal, nil -} - func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -2116,210 +1155,6 @@ func (ec *executionContext) fieldContext_ArchiveFS_size(_ context.Context, field return fc, nil } -func (ec *executionContext) _CleanupResponse_count(ctx context.Context, field graphql.CollectedField, obj *model.CleanupResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CleanupResponse_count(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Count, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CleanupResponse_count(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CleanupResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CleanupResponse_list(ctx context.Context, field graphql.CollectedField, obj *model.CleanupResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CleanupResponse_list(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.List, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CleanupResponse_list(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CleanupResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DownloadTorrentResponse_task(ctx context.Context, field graphql.CollectedField, obj *model.DownloadTorrentResponse) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DownloadTorrentResponse_task(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Task, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.Task) - fc.Result = res - return ec.marshalOTask2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DownloadTorrentResponse_task(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DownloadTorrentResponse", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Task_id(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Task", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Mutation_torrentDaemon(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_torrentDaemon(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().TorrentDaemon(rctx) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal *model.TorrentDaemonMutation - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.TorrentDaemonMutation); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentDaemonMutation`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.TorrentDaemonMutation) - fc.Result = res - return ec.marshalOTorrentDaemonMutation2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentDaemonMutation(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Mutation_torrentDaemon(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "validateTorrent": - return ec.fieldContext_TorrentDaemonMutation_validateTorrent(ctx, field) - case "setTorrentPriority": - return ec.fieldContext_TorrentDaemonMutation_setTorrentPriority(ctx, field) - case "cleanup": - return ec.fieldContext_TorrentDaemonMutation_cleanup(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentDaemonMutation", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _Mutation_qbitTorrentDaemon(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_qbitTorrentDaemon(ctx, field) if err != nil { @@ -3069,77 +1904,6 @@ func (ec *executionContext) fieldContext_QTorrent_sourceFiles(_ context.Context, return fc, nil } -func (ec *executionContext) _Query_torrentDaemon(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_torrentDaemon(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().TorrentDaemon(rctx) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal *model.TorrentDaemonQuery - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, nil, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.TorrentDaemonQuery); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentDaemonQuery`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.TorrentDaemonQuery) - fc.Result = res - return ec.marshalOTorrentDaemonQuery2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentDaemonQuery(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_torrentDaemon(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "torrents": - return ec.fieldContext_TorrentDaemonQuery_torrents(ctx, field) - case "clientStats": - return ec.fieldContext_TorrentDaemonQuery_clientStats(ctx, field) - case "statsHistory": - return ec.fieldContext_TorrentDaemonQuery_statsHistory(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentDaemonQuery", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _Query_qbitTorrentDaemon(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Query_qbitTorrentDaemon(ctx, field) if err != nil { @@ -3523,8 +2287,6 @@ func (ec *executionContext) fieldContext_Schema_query(_ context.Context, field g IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "torrentDaemon": - return ec.fieldContext_Query_torrentDaemon(ctx, field) case "qbitTorrentDaemon": return ec.fieldContext_Query_qbitTorrentDaemon(ctx, field) case "fsEntry": @@ -3565,8 +2327,6 @@ func (ec *executionContext) fieldContext_Schema_mutation(_ context.Context, fiel IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "torrentDaemon": - return ec.fieldContext_Mutation_torrentDaemon(ctx, field) case "qbitTorrentDaemon": return ec.fieldContext_Mutation_qbitTorrentDaemon(ctx, field) case "uploadFile": @@ -3844,69 +2604,6 @@ func (ec *executionContext) fieldContext_Subscription_taskProgress(ctx context.C return fc, nil } -func (ec *executionContext) _Subscription_torrentDownloadUpdates(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) { - fc, err := ec.fieldContext_Subscription_torrentDownloadUpdates(ctx, field) - if err != nil { - return nil - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Subscription().TorrentDownloadUpdates(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return nil - } - if resTmp == nil { - return nil - } - return func(ctx context.Context) graphql.Marshaler { - select { - case res, ok := <-resTmp.(<-chan *model.TorrentProgress): - if !ok { - return nil - } - return graphql.WriterFunc(func(w io.Writer) { - w.Write([]byte{'{'}) - graphql.MarshalString(field.Alias).MarshalGQL(w) - w.Write([]byte{':'}) - ec.marshalOTorrentProgress2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentProgress(ctx, field.Selections, res).MarshalGQL(w) - w.Write([]byte{'}'}) - }) - case <-ctx.Done(): - return nil - } - } -} - -func (ec *executionContext) fieldContext_Subscription_torrentDownloadUpdates(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Subscription", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "torrent": - return ec.fieldContext_TorrentProgress_torrent(ctx, field) - case "current": - return ec.fieldContext_TorrentProgress_current(ctx, field) - case "total": - return ec.fieldContext_TorrentProgress_total(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentProgress", field.Name) - }, - } - return fc, nil -} - func (ec *executionContext) _Task_id(ctx context.Context, field graphql.CollectedField, obj *model.Task) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Task_id(ctx, field) if err != nil { @@ -3951,2773 +2648,6 @@ func (ec *executionContext) fieldContext_Task_id(_ context.Context, field graphq return fc, nil } -func (ec *executionContext) _Torrent_name(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Torrent().Name(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal string - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(string); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_infohash(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_infohash(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Infohash, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_infohash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_bytesCompleted(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_bytesCompleted(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesCompleted, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_bytesCompleted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_torrentFilePath(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_torrentFilePath(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TorrentFilePath, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_torrentFilePath(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_bytesMissing(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_bytesMissing(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesMissing, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_bytesMissing(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_priority(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_priority(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Priority, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(types.PiecePriority) - fc.Result = res - return ec.marshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_priority(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type TorrentPriority does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_files(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_files(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Torrent().Files(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal []*model.TorrentFile - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.TorrentFile); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentFile`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TorrentFile) - fc.Result = res - return ec.marshalNTorrentFile2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFileᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_files(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "filename": - return ec.fieldContext_TorrentFile_filename(ctx, field) - case "size": - return ec.fieldContext_TorrentFile_size(ctx, field) - case "bytesCompleted": - return ec.fieldContext_TorrentFile_bytesCompleted(ctx, field) - case "priority": - return ec.fieldContext_TorrentFile_priority(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentFile", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_excludedFiles(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_excludedFiles(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Torrent().ExcludedFiles(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal []*model.TorrentFile - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.TorrentFile); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentFile`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TorrentFile) - fc.Result = res - return ec.marshalNTorrentFile2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFileᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_excludedFiles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "filename": - return ec.fieldContext_TorrentFile_filename(ctx, field) - case "size": - return ec.fieldContext_TorrentFile_size(ctx, field) - case "bytesCompleted": - return ec.fieldContext_TorrentFile_bytesCompleted(ctx, field) - case "priority": - return ec.fieldContext_TorrentFile_priority(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentFile", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Torrent_peers(ctx context.Context, field graphql.CollectedField, obj *model.Torrent) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Torrent_peers(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Torrent().Peers(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal []*model.TorrentPeer - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.TorrentPeer); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentPeer`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TorrentPeer) - fc.Result = res - return ec.marshalNTorrentPeer2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPeerᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Torrent_peers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Torrent", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "ip": - return ec.fieldContext_TorrentPeer_ip(ctx, field) - case "downloadRate": - return ec.fieldContext_TorrentPeer_downloadRate(ctx, field) - case "discovery": - return ec.fieldContext_TorrentPeer_discovery(ctx, field) - case "port": - return ec.fieldContext_TorrentPeer_port(ctx, field) - case "clientName": - return ec.fieldContext_TorrentPeer_clientName(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentPeer", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_bytesWritten(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_bytesWritten(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesWritten, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_bytesWritten(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_bytesWrittenData(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_bytesWrittenData(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesWrittenData, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_bytesWrittenData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_bytesRead(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_bytesRead(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesRead, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_bytesRead(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_bytesReadData(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_bytesReadData(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesReadData, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_bytesReadData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_bytesReadUsefulData(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_bytesReadUsefulData(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesReadUsefulData, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_bytesReadUsefulData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_bytesReadUsefulIntendedData(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_bytesReadUsefulIntendedData(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesReadUsefulIntendedData, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_bytesReadUsefulIntendedData(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_chunksWritten(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_chunksWritten(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ChunksWritten, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_chunksWritten(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_chunksRead(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_chunksRead(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ChunksRead, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_chunksRead(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_chunksReadUseful(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_chunksReadUseful(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ChunksReadUseful, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_chunksReadUseful(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_chunksReadWasted(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_chunksReadWasted(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ChunksReadWasted, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_chunksReadWasted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_metadataChunksRead(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_metadataChunksRead(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MetadataChunksRead, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_metadataChunksRead(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_piecesDirtiedGood(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_piecesDirtiedGood(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PiecesDirtiedGood, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_piecesDirtiedGood(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentClientStats_piecesDirtiedBad(ctx context.Context, field graphql.CollectedField, obj *model.TorrentClientStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentClientStats_piecesDirtiedBad(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PiecesDirtiedBad, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentClientStats_piecesDirtiedBad(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentClientStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentDaemonMutation_validateTorrent(ctx context.Context, field graphql.CollectedField, obj *model.TorrentDaemonMutation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentDaemonMutation_validateTorrent(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentDaemonMutation().ValidateTorrent(rctx, obj, fc.Args["filter"].(model.TorrentFilter)) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal bool - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentDaemonMutation_validateTorrent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentDaemonMutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_TorrentDaemonMutation_validateTorrent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _TorrentDaemonMutation_setTorrentPriority(ctx context.Context, field graphql.CollectedField, obj *model.TorrentDaemonMutation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentDaemonMutation_setTorrentPriority(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentDaemonMutation().SetTorrentPriority(rctx, obj, fc.Args["infohash"].(string), fc.Args["file"].(*string), fc.Args["priority"].(types.PiecePriority)) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal bool - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(bool); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be bool`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentDaemonMutation_setTorrentPriority(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentDaemonMutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_TorrentDaemonMutation_setTorrentPriority_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _TorrentDaemonMutation_cleanup(ctx context.Context, field graphql.CollectedField, obj *model.TorrentDaemonMutation) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentDaemonMutation_cleanup(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentDaemonMutation().Cleanup(rctx, obj, fc.Args["files"].(*bool), fc.Args["dryRun"].(bool)) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal *model.CleanupResponse - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.CleanupResponse); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.CleanupResponse`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.CleanupResponse) - fc.Result = res - return ec.marshalNCleanupResponse2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐCleanupResponse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentDaemonMutation_cleanup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentDaemonMutation", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "count": - return ec.fieldContext_CleanupResponse_count(ctx, field) - case "list": - return ec.fieldContext_CleanupResponse_list(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CleanupResponse", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_TorrentDaemonMutation_cleanup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _TorrentDaemonQuery_torrents(ctx context.Context, field graphql.CollectedField, obj *model.TorrentDaemonQuery) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentDaemonQuery_torrents(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentDaemonQuery().Torrents(rctx, obj, fc.Args["filter"].(*model.TorrentsFilter)) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal []*model.Torrent - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.Torrent); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.Torrent`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Torrent) - fc.Result = res - return ec.marshalNTorrent2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentDaemonQuery_torrents(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentDaemonQuery", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Torrent_name(ctx, field) - case "infohash": - return ec.fieldContext_Torrent_infohash(ctx, field) - case "bytesCompleted": - return ec.fieldContext_Torrent_bytesCompleted(ctx, field) - case "torrentFilePath": - return ec.fieldContext_Torrent_torrentFilePath(ctx, field) - case "bytesMissing": - return ec.fieldContext_Torrent_bytesMissing(ctx, field) - case "priority": - return ec.fieldContext_Torrent_priority(ctx, field) - case "files": - return ec.fieldContext_Torrent_files(ctx, field) - case "excludedFiles": - return ec.fieldContext_Torrent_excludedFiles(ctx, field) - case "peers": - return ec.fieldContext_Torrent_peers(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Torrent", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_TorrentDaemonQuery_torrents_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _TorrentDaemonQuery_clientStats(ctx context.Context, field graphql.CollectedField, obj *model.TorrentDaemonQuery) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentDaemonQuery_clientStats(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentDaemonQuery().ClientStats(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal *model.TorrentClientStats - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(*model.TorrentClientStats); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentClientStats`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.TorrentClientStats) - fc.Result = res - return ec.marshalNTorrentClientStats2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentClientStats(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentDaemonQuery_clientStats(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentDaemonQuery", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "bytesWritten": - return ec.fieldContext_TorrentClientStats_bytesWritten(ctx, field) - case "bytesWrittenData": - return ec.fieldContext_TorrentClientStats_bytesWrittenData(ctx, field) - case "bytesRead": - return ec.fieldContext_TorrentClientStats_bytesRead(ctx, field) - case "bytesReadData": - return ec.fieldContext_TorrentClientStats_bytesReadData(ctx, field) - case "bytesReadUsefulData": - return ec.fieldContext_TorrentClientStats_bytesReadUsefulData(ctx, field) - case "bytesReadUsefulIntendedData": - return ec.fieldContext_TorrentClientStats_bytesReadUsefulIntendedData(ctx, field) - case "chunksWritten": - return ec.fieldContext_TorrentClientStats_chunksWritten(ctx, field) - case "chunksRead": - return ec.fieldContext_TorrentClientStats_chunksRead(ctx, field) - case "chunksReadUseful": - return ec.fieldContext_TorrentClientStats_chunksReadUseful(ctx, field) - case "chunksReadWasted": - return ec.fieldContext_TorrentClientStats_chunksReadWasted(ctx, field) - case "metadataChunksRead": - return ec.fieldContext_TorrentClientStats_metadataChunksRead(ctx, field) - case "piecesDirtiedGood": - return ec.fieldContext_TorrentClientStats_piecesDirtiedGood(ctx, field) - case "piecesDirtiedBad": - return ec.fieldContext_TorrentClientStats_piecesDirtiedBad(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentClientStats", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentDaemonQuery_statsHistory(ctx context.Context, field graphql.CollectedField, obj *model.TorrentDaemonQuery) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentDaemonQuery_statsHistory(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentDaemonQuery().StatsHistory(rctx, obj, fc.Args["since"].(time.Time), fc.Args["infohash"].(*string)) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal []*model.TorrentStats - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]*model.TorrentStats); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []*git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentStats`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.TorrentStats) - fc.Result = res - return ec.marshalNTorrentStats2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentStatsᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentDaemonQuery_statsHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentDaemonQuery", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "timestamp": - return ec.fieldContext_TorrentStats_timestamp(ctx, field) - case "downloadedBytes": - return ec.fieldContext_TorrentStats_downloadedBytes(ctx, field) - case "uploadedBytes": - return ec.fieldContext_TorrentStats_uploadedBytes(ctx, field) - case "totalPeers": - return ec.fieldContext_TorrentStats_totalPeers(ctx, field) - case "activePeers": - return ec.fieldContext_TorrentStats_activePeers(ctx, field) - case "connectedSeeders": - return ec.fieldContext_TorrentStats_connectedSeeders(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type TorrentStats", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_TorrentDaemonQuery_statsHistory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil -} - -func (ec *executionContext) _TorrentFS_name(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFS_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFS_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFS", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFS_torrent(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFS_torrent(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Torrent, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Torrent) - fc.Result = res - return ec.marshalNTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrent(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFS_torrent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFS", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Torrent_name(ctx, field) - case "infohash": - return ec.fieldContext_Torrent_infohash(ctx, field) - case "bytesCompleted": - return ec.fieldContext_Torrent_bytesCompleted(ctx, field) - case "torrentFilePath": - return ec.fieldContext_Torrent_torrentFilePath(ctx, field) - case "bytesMissing": - return ec.fieldContext_Torrent_bytesMissing(ctx, field) - case "priority": - return ec.fieldContext_Torrent_priority(ctx, field) - case "files": - return ec.fieldContext_Torrent_files(ctx, field) - case "excludedFiles": - return ec.fieldContext_Torrent_excludedFiles(ctx, field) - case "peers": - return ec.fieldContext_Torrent_peers(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Torrent", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFS_entries(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFs) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFS_entries(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentFS().Entries(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal []model.FsEntry - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.([]model.FsEntry); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be []git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.FsEntry`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]model.FsEntry) - fc.Result = res - return ec.marshalNFsEntry2ᚕgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐFsEntryᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFS_entries(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFS", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFile_filename(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFile) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFile_filename(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Filename, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFile_filename(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFile_size(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFile) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFile_size(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Size, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFile_size(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFile_bytesCompleted(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFile) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFile_bytesCompleted(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BytesCompleted, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFile_bytesCompleted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFile", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFile_priority(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFile) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFile_priority(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - directive0 := func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.TorrentFile().Priority(rctx, obj) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.Resolver == nil { - var zeroVal types.PiecePriority - return zeroVal, errors.New("directive resolver is not implemented") - } - return ec.directives.Resolver(ctx, obj, directive0) - } - - tmp, err := directive1(rctx) - if err != nil { - return nil, graphql.ErrorOnPath(ctx, err) - } - if tmp == nil { - return nil, nil - } - if data, ok := tmp.(types.PiecePriority); ok { - return data, nil - } - return nil, fmt.Errorf(`unexpected type %T from directive, should be github.com/anacrolix/torrent/types.PiecePriority`, tmp) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(types.PiecePriority) - fc.Result = res - return ec.marshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFile_priority(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFile", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type TorrentPriority does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFileEntry_name(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFileEntry) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFileEntry_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFileEntry_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFileEntry", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFileEntry_torrent(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFileEntry) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFileEntry_torrent(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Torrent, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Torrent) - fc.Result = res - return ec.marshalNTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrent(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFileEntry_torrent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFileEntry", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Torrent_name(ctx, field) - case "infohash": - return ec.fieldContext_Torrent_infohash(ctx, field) - case "bytesCompleted": - return ec.fieldContext_Torrent_bytesCompleted(ctx, field) - case "torrentFilePath": - return ec.fieldContext_Torrent_torrentFilePath(ctx, field) - case "bytesMissing": - return ec.fieldContext_Torrent_bytesMissing(ctx, field) - case "priority": - return ec.fieldContext_Torrent_priority(ctx, field) - case "files": - return ec.fieldContext_Torrent_files(ctx, field) - case "excludedFiles": - return ec.fieldContext_Torrent_excludedFiles(ctx, field) - case "peers": - return ec.fieldContext_Torrent_peers(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Torrent", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentFileEntry_size(ctx context.Context, field graphql.CollectedField, obj *model.TorrentFileEntry) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentFileEntry_size(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Size, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentFileEntry_size(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentFileEntry", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentPeer_ip(ctx context.Context, field graphql.CollectedField, obj *model.TorrentPeer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentPeer_ip(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IP, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentPeer_ip(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentPeer", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentPeer_downloadRate(ctx context.Context, field graphql.CollectedField, obj *model.TorrentPeer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentPeer_downloadRate(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DownloadRate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(float64) - fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentPeer_downloadRate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentPeer", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentPeer_discovery(ctx context.Context, field graphql.CollectedField, obj *model.TorrentPeer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentPeer_discovery(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Discovery, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentPeer_discovery(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentPeer", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentPeer_port(ctx context.Context, field graphql.CollectedField, obj *model.TorrentPeer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentPeer_port(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Port, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentPeer_port(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentPeer", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentPeer_clientName(ctx context.Context, field graphql.CollectedField, obj *model.TorrentPeer) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentPeer_clientName(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClientName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentPeer_clientName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentPeer", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentProgress_torrent(ctx context.Context, field graphql.CollectedField, obj *model.TorrentProgress) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentProgress_torrent(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Torrent, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Torrent) - fc.Result = res - return ec.marshalNTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrent(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentProgress_torrent(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentProgress", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_Torrent_name(ctx, field) - case "infohash": - return ec.fieldContext_Torrent_infohash(ctx, field) - case "bytesCompleted": - return ec.fieldContext_Torrent_bytesCompleted(ctx, field) - case "torrentFilePath": - return ec.fieldContext_Torrent_torrentFilePath(ctx, field) - case "bytesMissing": - return ec.fieldContext_Torrent_bytesMissing(ctx, field) - case "priority": - return ec.fieldContext_Torrent_priority(ctx, field) - case "files": - return ec.fieldContext_Torrent_files(ctx, field) - case "excludedFiles": - return ec.fieldContext_Torrent_excludedFiles(ctx, field) - case "peers": - return ec.fieldContext_Torrent_peers(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Torrent", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentProgress_current(ctx context.Context, field graphql.CollectedField, obj *model.TorrentProgress) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentProgress_current(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Current, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentProgress_current(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentProgress", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentProgress_total(ctx context.Context, field graphql.CollectedField, obj *model.TorrentProgress) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentProgress_total(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Total, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int64) - fc.Result = res - return ec.marshalNInt2int64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentProgress_total(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentProgress", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentStats_timestamp(ctx context.Context, field graphql.CollectedField, obj *model.TorrentStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentStats_timestamp(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Timestamp, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(time.Time) - fc.Result = res - return ec.marshalNDateTime2timeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentStats_timestamp(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentStats_downloadedBytes(ctx context.Context, field graphql.CollectedField, obj *model.TorrentStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentStats_downloadedBytes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DownloadedBytes, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uint) - fc.Result = res - return ec.marshalNUInt2uint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentStats_downloadedBytes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UInt does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentStats_uploadedBytes(ctx context.Context, field graphql.CollectedField, obj *model.TorrentStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentStats_uploadedBytes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.UploadedBytes, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uint) - fc.Result = res - return ec.marshalNUInt2uint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentStats_uploadedBytes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UInt does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentStats_totalPeers(ctx context.Context, field graphql.CollectedField, obj *model.TorrentStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentStats_totalPeers(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TotalPeers, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uint) - fc.Result = res - return ec.marshalNUInt2uint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentStats_totalPeers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UInt does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentStats_activePeers(ctx context.Context, field graphql.CollectedField, obj *model.TorrentStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentStats_activePeers(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ActivePeers, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uint) - fc.Result = res - return ec.marshalNUInt2uint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentStats_activePeers(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UInt does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _TorrentStats_connectedSeeders(ctx context.Context, field graphql.CollectedField, obj *model.TorrentStats) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_TorrentStats_connectedSeeders(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ConnectedSeeders, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uint) - fc.Result = res - return ec.marshalNUInt2uint(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_TorrentStats_connectedSeeders(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "TorrentStats", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UInt does not have child fields") - }, - } - return fc, nil -} - func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { fc, err := ec.fieldContext___Directive_name(ctx, field) if err != nil { @@ -8992,312 +4922,6 @@ func (ec *executionContext) unmarshalInputStringFilter(ctx context.Context, obj return it, nil } -func (ec *executionContext) unmarshalInputTorrentFilter(ctx context.Context, obj interface{}) (model.TorrentFilter, error) { - var it model.TorrentFilter - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"everything", "infohash"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "everything": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("everything")) - directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOBoolean2ᚖbool(ctx, v) } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *bool - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*bool); ok { - it.Everything = data - } else if tmp == nil { - it.Everything = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - case "infohash": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infohash")) - directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *string - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*string); ok { - it.Infohash = data - } else if tmp == nil { - it.Infohash = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputTorrentPriorityFilter(ctx context.Context, obj interface{}) (model.TorrentPriorityFilter, error) { - var it model.TorrentPriorityFilter - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"eq", "gt", "lt", "gte", "lte", "in"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "eq": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("eq")) - directive0 := func(ctx context.Context) (interface{}, error) { - return ec.unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, v) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *types.PiecePriority - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*types.PiecePriority); ok { - it.Eq = data - } else if tmp == nil { - it.Eq = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/anacrolix/torrent/types.PiecePriority`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - case "gt": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gt")) - directive0 := func(ctx context.Context) (interface{}, error) { - return ec.unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, v) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *types.PiecePriority - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*types.PiecePriority); ok { - it.Gt = data - } else if tmp == nil { - it.Gt = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/anacrolix/torrent/types.PiecePriority`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - case "lt": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lt")) - directive0 := func(ctx context.Context) (interface{}, error) { - return ec.unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, v) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *types.PiecePriority - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*types.PiecePriority); ok { - it.Lt = data - } else if tmp == nil { - it.Lt = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/anacrolix/torrent/types.PiecePriority`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - case "gte": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gte")) - directive0 := func(ctx context.Context) (interface{}, error) { - return ec.unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, v) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *types.PiecePriority - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*types.PiecePriority); ok { - it.Gte = data - } else if tmp == nil { - it.Gte = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/anacrolix/torrent/types.PiecePriority`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - case "lte": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lte")) - directive0 := func(ctx context.Context) (interface{}, error) { - return ec.unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, v) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal *types.PiecePriority - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.(*types.PiecePriority); ok { - it.Lte = data - } else if tmp == nil { - it.Lte = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be *github.com/anacrolix/torrent/types.PiecePriority`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - case "in": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) - directive0 := func(ctx context.Context) (interface{}, error) { - return ec.unmarshalOTorrentPriority2ᚕgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriorityᚄ(ctx, v) - } - - directive1 := func(ctx context.Context) (interface{}, error) { - if ec.directives.OneOf == nil { - var zeroVal []types.PiecePriority - return zeroVal, errors.New("directive oneOf is not implemented") - } - return ec.directives.OneOf(ctx, obj, directive0) - } - - tmp, err := directive1(ctx) - if err != nil { - return it, graphql.ErrorOnPath(ctx, err) - } - if data, ok := tmp.([]types.PiecePriority); ok { - it.In = data - } else if tmp == nil { - it.In = nil - } else { - err := fmt.Errorf(`unexpected type %T from directive, should be []github.com/anacrolix/torrent/types.PiecePriority`, tmp) - return it, graphql.ErrorOnPath(ctx, err) - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputTorrentsFilter(ctx context.Context, obj interface{}) (model.TorrentsFilter, error) { - var it model.TorrentsFilter - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - fieldsInOrder := [...]string{"infohash", "name", "bytesCompleted", "bytesMissing", "peersCount", "priority"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "infohash": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("infohash")) - data, err := ec.unmarshalOStringFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐStringFilter(ctx, v) - if err != nil { - return it, err - } - it.Infohash = data - case "name": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - data, err := ec.unmarshalOStringFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐStringFilter(ctx, v) - if err != nil { - return it, err - } - it.Name = data - case "bytesCompleted": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytesCompleted")) - data, err := ec.unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx, v) - if err != nil { - return it, err - } - it.BytesCompleted = data - case "bytesMissing": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytesMissing")) - data, err := ec.unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx, v) - if err != nil { - return it, err - } - it.BytesMissing = data - case "peersCount": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("peersCount")) - data, err := ec.unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx, v) - if err != nil { - return it, err - } - it.PeersCount = data - case "priority": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - data, err := ec.unmarshalOTorrentPriorityFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPriorityFilter(ctx, v) - if err != nil { - return it, err - } - it.Priority = data - } - } - - return it, nil -} - // endregion **************************** input.gotpl ***************************** // region ************************** interface.gotpl *************************** @@ -9327,13 +4951,6 @@ func (ec *executionContext) _Dir(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._ArchiveFS(ctx, sel, obj) - case model.TorrentFs: - return ec._TorrentFS(ctx, sel, &obj) - case *model.TorrentFs: - if obj == nil { - return graphql.Null - } - return ec._TorrentFS(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -9350,13 +4967,6 @@ func (ec *executionContext) _File(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._SimpleFile(ctx, sel, obj) - case model.TorrentFileEntry: - return ec._TorrentFileEntry(ctx, sel, &obj) - case *model.TorrentFileEntry: - if obj == nil { - return graphql.Null - } - return ec._TorrentFileEntry(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -9394,20 +5004,6 @@ func (ec *executionContext) _FsEntry(ctx context.Context, sel ast.SelectionSet, return graphql.Null } return ec._ArchiveFS(ctx, sel, obj) - case model.TorrentFs: - return ec._TorrentFS(ctx, sel, &obj) - case *model.TorrentFs: - if obj == nil { - return graphql.Null - } - return ec._TorrentFS(ctx, sel, obj) - case model.TorrentFileEntry: - return ec._TorrentFileEntry(ctx, sel, &obj) - case *model.TorrentFileEntry: - if obj == nil { - return graphql.Null - } - return ec._TorrentFileEntry(ctx, sel, obj) case model.Dir: if obj == nil { return graphql.Null @@ -9427,13 +5023,6 @@ func (ec *executionContext) _Progress(ctx context.Context, sel ast.SelectionSet, switch obj := (obj).(type) { case nil: return graphql.Null - case model.TorrentProgress: - return ec._TorrentProgress(ctx, sel, &obj) - case *model.TorrentProgress: - if obj == nil { - return graphql.Null - } - return ec._TorrentProgress(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -9523,86 +5112,6 @@ func (ec *executionContext) _ArchiveFS(ctx context.Context, sel ast.SelectionSet return out } -var cleanupResponseImplementors = []string{"CleanupResponse"} - -func (ec *executionContext) _CleanupResponse(ctx context.Context, sel ast.SelectionSet, obj *model.CleanupResponse) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cleanupResponseImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CleanupResponse") - case "count": - out.Values[i] = ec._CleanupResponse_count(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "list": - out.Values[i] = ec._CleanupResponse_list(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var downloadTorrentResponseImplementors = []string{"DownloadTorrentResponse"} - -func (ec *executionContext) _DownloadTorrentResponse(ctx context.Context, sel ast.SelectionSet, obj *model.DownloadTorrentResponse) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, downloadTorrentResponseImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("DownloadTorrentResponse") - case "task": - out.Values[i] = ec._DownloadTorrentResponse_task(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -9622,10 +5131,6 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Mutation") - case "torrentDaemon": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_torrentDaemon(ctx, field) - }) case "qbitTorrentDaemon": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_qbitTorrentDaemon(ctx, field) @@ -10030,25 +5535,6 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Query") - case "torrentDaemon": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_torrentDaemon(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "qbitTorrentDaemon": field := field @@ -10365,8 +5851,6 @@ func (ec *executionContext) _Subscription(ctx context.Context, sel ast.Selection switch fields[0].Name { case "taskProgress": return ec._Subscription_taskProgress(ctx, fields[0]) - case "torrentDownloadUpdates": - return ec._Subscription_torrentDownloadUpdates(ctx, fields[0]) default: panic("unknown field " + strconv.Quote(fields[0].Name)) } @@ -10411,978 +5895,6 @@ func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj return out } -var torrentImplementors = []string{"Torrent"} - -func (ec *executionContext) _Torrent(ctx context.Context, sel ast.SelectionSet, obj *model.Torrent) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Torrent") - case "name": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Torrent_name(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "infohash": - out.Values[i] = ec._Torrent_infohash(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "bytesCompleted": - out.Values[i] = ec._Torrent_bytesCompleted(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "torrentFilePath": - out.Values[i] = ec._Torrent_torrentFilePath(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "bytesMissing": - out.Values[i] = ec._Torrent_bytesMissing(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "priority": - out.Values[i] = ec._Torrent_priority(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "files": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Torrent_files(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "excludedFiles": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Torrent_excludedFiles(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "peers": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Torrent_peers(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentClientStatsImplementors = []string{"TorrentClientStats"} - -func (ec *executionContext) _TorrentClientStats(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentClientStats) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentClientStatsImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentClientStats") - case "bytesWritten": - out.Values[i] = ec._TorrentClientStats_bytesWritten(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "bytesWrittenData": - out.Values[i] = ec._TorrentClientStats_bytesWrittenData(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "bytesRead": - out.Values[i] = ec._TorrentClientStats_bytesRead(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "bytesReadData": - out.Values[i] = ec._TorrentClientStats_bytesReadData(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "bytesReadUsefulData": - out.Values[i] = ec._TorrentClientStats_bytesReadUsefulData(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "bytesReadUsefulIntendedData": - out.Values[i] = ec._TorrentClientStats_bytesReadUsefulIntendedData(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "chunksWritten": - out.Values[i] = ec._TorrentClientStats_chunksWritten(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "chunksRead": - out.Values[i] = ec._TorrentClientStats_chunksRead(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "chunksReadUseful": - out.Values[i] = ec._TorrentClientStats_chunksReadUseful(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "chunksReadWasted": - out.Values[i] = ec._TorrentClientStats_chunksReadWasted(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "metadataChunksRead": - out.Values[i] = ec._TorrentClientStats_metadataChunksRead(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "piecesDirtiedGood": - out.Values[i] = ec._TorrentClientStats_piecesDirtiedGood(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "piecesDirtiedBad": - out.Values[i] = ec._TorrentClientStats_piecesDirtiedBad(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentDaemonMutationImplementors = []string{"TorrentDaemonMutation"} - -func (ec *executionContext) _TorrentDaemonMutation(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentDaemonMutation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentDaemonMutationImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentDaemonMutation") - case "validateTorrent": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentDaemonMutation_validateTorrent(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "setTorrentPriority": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentDaemonMutation_setTorrentPriority(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "cleanup": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentDaemonMutation_cleanup(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentDaemonQueryImplementors = []string{"TorrentDaemonQuery"} - -func (ec *executionContext) _TorrentDaemonQuery(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentDaemonQuery) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentDaemonQueryImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentDaemonQuery") - case "torrents": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentDaemonQuery_torrents(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "clientStats": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentDaemonQuery_clientStats(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "statsHistory": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentDaemonQuery_statsHistory(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentFSImplementors = []string{"TorrentFS", "Dir", "FsEntry"} - -func (ec *executionContext) _TorrentFS(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentFs) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentFSImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentFS") - case "name": - out.Values[i] = ec._TorrentFS_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "torrent": - out.Values[i] = ec._TorrentFS_torrent(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "entries": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentFS_entries(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentFileImplementors = []string{"TorrentFile"} - -func (ec *executionContext) _TorrentFile(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentFile) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentFileImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentFile") - case "filename": - out.Values[i] = ec._TorrentFile_filename(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "size": - out.Values[i] = ec._TorrentFile_size(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "bytesCompleted": - out.Values[i] = ec._TorrentFile_bytesCompleted(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "priority": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._TorrentFile_priority(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentFileEntryImplementors = []string{"TorrentFileEntry", "File", "FsEntry"} - -func (ec *executionContext) _TorrentFileEntry(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentFileEntry) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentFileEntryImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentFileEntry") - case "name": - out.Values[i] = ec._TorrentFileEntry_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "torrent": - out.Values[i] = ec._TorrentFileEntry_torrent(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "size": - out.Values[i] = ec._TorrentFileEntry_size(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentPeerImplementors = []string{"TorrentPeer"} - -func (ec *executionContext) _TorrentPeer(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentPeer) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentPeerImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentPeer") - case "ip": - out.Values[i] = ec._TorrentPeer_ip(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "downloadRate": - out.Values[i] = ec._TorrentPeer_downloadRate(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "discovery": - out.Values[i] = ec._TorrentPeer_discovery(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "port": - out.Values[i] = ec._TorrentPeer_port(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "clientName": - out.Values[i] = ec._TorrentPeer_clientName(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentProgressImplementors = []string{"TorrentProgress", "Progress"} - -func (ec *executionContext) _TorrentProgress(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentProgress) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentProgressImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentProgress") - case "torrent": - out.Values[i] = ec._TorrentProgress_torrent(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "current": - out.Values[i] = ec._TorrentProgress_current(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "total": - out.Values[i] = ec._TorrentProgress_total(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var torrentStatsImplementors = []string{"TorrentStats"} - -func (ec *executionContext) _TorrentStats(ctx context.Context, sel ast.SelectionSet, obj *model.TorrentStats) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, torrentStatsImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("TorrentStats") - case "timestamp": - out.Values[i] = ec._TorrentStats_timestamp(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "downloadedBytes": - out.Values[i] = ec._TorrentStats_downloadedBytes(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "uploadedBytes": - out.Values[i] = ec._TorrentStats_uploadedBytes(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "totalPeers": - out.Values[i] = ec._TorrentStats_totalPeers(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "activePeers": - out.Values[i] = ec._TorrentStats_activePeers(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "connectedSeeders": - out.Values[i] = ec._TorrentStats_connectedSeeders(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { @@ -11724,46 +6236,6 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } -func (ec *executionContext) marshalNCleanupResponse2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐCleanupResponse(ctx context.Context, sel ast.SelectionSet, v *model.CleanupResponse) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._CleanupResponse(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNDateTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { - res, err := graphql.UnmarshalTime(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNDateTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { - res := graphql.MarshalTime(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { - res, err := graphql.UnmarshalFloatContext(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { - res := graphql.MarshalFloatContext(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return graphql.WrapContextMarshaler(ctx, res) -} - func (ec *executionContext) marshalNFsEntry2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐFsEntry(ctx context.Context, sel ast.SelectionSet, v model.FsEntry) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -11969,285 +6441,6 @@ func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel return ret } -func (ec *executionContext) marshalNTorrent2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Torrent) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrent(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrent(ctx context.Context, sel ast.SelectionSet, v *model.Torrent) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Torrent(ctx, sel, v) -} - -func (ec *executionContext) marshalNTorrentClientStats2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentClientStats(ctx context.Context, sel ast.SelectionSet, v *model.TorrentClientStats) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TorrentClientStats(ctx, sel, v) -} - -func (ec *executionContext) marshalNTorrentFile2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFileᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TorrentFile) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNTorrentFile2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFile(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTorrentFile2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFile(ctx context.Context, sel ast.SelectionSet, v *model.TorrentFile) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TorrentFile(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNTorrentFilter2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentFilter(ctx context.Context, v interface{}) (model.TorrentFilter, error) { - res, err := ec.unmarshalInputTorrentFilter(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNTorrentPeer2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPeerᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TorrentPeer) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNTorrentPeer2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPeer(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTorrentPeer2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPeer(ctx context.Context, sel ast.SelectionSet, v *model.TorrentPeer) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TorrentPeer(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx context.Context, v interface{}) (types.PiecePriority, error) { - tmp, err := graphql.UnmarshalString(v) - res := unmarshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority[tmp] - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx context.Context, sel ast.SelectionSet, v types.PiecePriority) graphql.Marshaler { - res := graphql.MarshalString(marshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority[v]) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -var ( - unmarshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority = map[string]types.PiecePriority{ - "NONE": types.PiecePriorityNone, - "NORMAL": types.PiecePriorityNormal, - "HIGH": types.PiecePriorityHigh, - "READAHEAD": types.PiecePriorityReadahead, - "NOW": types.PiecePriorityNow, - } - marshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority = map[types.PiecePriority]string{ - types.PiecePriorityNone: "NONE", - types.PiecePriorityNormal: "NORMAL", - types.PiecePriorityHigh: "HIGH", - types.PiecePriorityReadahead: "READAHEAD", - types.PiecePriorityNow: "NOW", - } -) - -func (ec *executionContext) marshalNTorrentStats2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentStatsᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.TorrentStats) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNTorrentStats2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentStats(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNTorrentStats2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentStats(ctx context.Context, sel ast.SelectionSet, v *model.TorrentStats) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._TorrentStats(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNUInt2uint(ctx context.Context, v interface{}) (uint, error) { - res, err := graphql.UnmarshalUint(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNUInt2uint(ctx context.Context, sel ast.SelectionSet, v uint) graphql.Marshaler { - res := graphql.MarshalUint(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - func (ec *executionContext) unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (graphql.Upload, error) { res, err := graphql.UnmarshalUpload(v) return res, graphql.ErrorOnPath(ctx, err) @@ -12724,176 +6917,6 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } -func (ec *executionContext) unmarshalOStringFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐStringFilter(ctx context.Context, v interface{}) (*model.StringFilter, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputStringFilter(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOTask2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTask(ctx context.Context, sel ast.SelectionSet, v *model.Task) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Task(ctx, sel, v) -} - -func (ec *executionContext) marshalOTorrentDaemonMutation2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentDaemonMutation(ctx context.Context, sel ast.SelectionSet, v *model.TorrentDaemonMutation) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._TorrentDaemonMutation(ctx, sel, v) -} - -func (ec *executionContext) marshalOTorrentDaemonQuery2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentDaemonQuery(ctx context.Context, sel ast.SelectionSet, v *model.TorrentDaemonQuery) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._TorrentDaemonQuery(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOTorrentPriority2ᚕgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriorityᚄ(ctx context.Context, v interface{}) ([]types.PiecePriority, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]types.PiecePriority, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalOTorrentPriority2ᚕgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriorityᚄ(ctx context.Context, sel ast.SelectionSet, v []types.PiecePriority) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNTorrentPriority2githubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -var ( - unmarshalOTorrentPriority2ᚕgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriorityᚄ = map[string]types.PiecePriority{ - "NONE": types.PiecePriorityNone, - "NORMAL": types.PiecePriorityNormal, - "HIGH": types.PiecePriorityHigh, - "READAHEAD": types.PiecePriorityReadahead, - "NOW": types.PiecePriorityNow, - } - marshalOTorrentPriority2ᚕgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriorityᚄ = map[types.PiecePriority]string{ - types.PiecePriorityNone: "NONE", - types.PiecePriorityNormal: "NORMAL", - types.PiecePriorityHigh: "HIGH", - types.PiecePriorityReadahead: "READAHEAD", - types.PiecePriorityNow: "NOW", - } -) - -func (ec *executionContext) unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx context.Context, v interface{}) (*types.PiecePriority, error) { - if v == nil { - return nil, nil - } - tmp, err := graphql.UnmarshalString(v) - res := unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority[tmp] - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority(ctx context.Context, sel ast.SelectionSet, v *types.PiecePriority) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalString(marshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority[*v]) - return res -} - -var ( - unmarshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority = map[string]types.PiecePriority{ - "NONE": types.PiecePriorityNone, - "NORMAL": types.PiecePriorityNormal, - "HIGH": types.PiecePriorityHigh, - "READAHEAD": types.PiecePriorityReadahead, - "NOW": types.PiecePriorityNow, - } - marshalOTorrentPriority2ᚖgithubᚗcomᚋanacrolixᚋtorrentᚋtypesᚐPiecePriority = map[types.PiecePriority]string{ - types.PiecePriorityNone: "NONE", - types.PiecePriorityNormal: "NORMAL", - types.PiecePriorityHigh: "HIGH", - types.PiecePriorityReadahead: "READAHEAD", - types.PiecePriorityNow: "NOW", - } -) - -func (ec *executionContext) unmarshalOTorrentPriorityFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPriorityFilter(ctx context.Context, v interface{}) (*model.TorrentPriorityFilter, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputTorrentPriorityFilter(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOTorrentProgress2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentProgress(ctx context.Context, sel ast.SelectionSet, v *model.TorrentProgress) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._TorrentProgress(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOTorrentsFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentsFilter(ctx context.Context, v interface{}) (*model.TorrentsFilter, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputTorrentsFilter(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/src/delivery/graphql/model/filter.go b/src/delivery/graphql/model/filter.go index 3df1931..f98bf12 100644 --- a/src/delivery/graphql/model/filter.go +++ b/src/delivery/graphql/model/filter.go @@ -3,8 +3,6 @@ package model import ( "slices" "strings" - - "github.com/anacrolix/torrent/types" ) type Filter[T any] interface { @@ -55,22 +53,22 @@ func (f *BooleanFilter) Include(v bool) bool { return true } -func (f *TorrentPriorityFilter) Include(v types.PiecePriority) bool { - if f == nil { - return true - } else if f.Eq != nil { - return v == *f.Eq - } else if f.Gt != nil { - return v > *f.Gt - } else if f.Gte != nil { - return v >= *f.Gte - } else if f.Lt != nil { - return v < *f.Lt - } else if f.Lte != nil { - return v <= *f.Lte - } else if f.In != nil { - return slices.Contains(f.In, v) - } +// func (f *TorrentPriorityFilter) Include(v types.PiecePriority) bool { +// if f == nil { +// return true +// } else if f.Eq != nil { +// return v == *f.Eq +// } else if f.Gt != nil { +// return v > *f.Gt +// } else if f.Gte != nil { +// return v >= *f.Gte +// } else if f.Lt != nil { +// return v < *f.Lt +// } else if f.Lte != nil { +// return v <= *f.Lte +// } else if f.In != nil { +// return slices.Contains(f.In, v) +// } - return true -} +// return true +// } diff --git a/src/delivery/graphql/model/models_gen.go b/src/delivery/graphql/model/models_gen.go index afdfe49..a4c9b32 100644 --- a/src/delivery/graphql/model/models_gen.go +++ b/src/delivery/graphql/model/models_gen.go @@ -5,10 +5,7 @@ package model import ( "time" - "git.kmsign.ru/royalcat/tstor/daemons/torrent" "git.kmsign.ru/royalcat/tstor/src/vfs" - torrent1 "github.com/anacrolix/torrent" - "github.com/anacrolix/torrent/types" ) type Dir interface { @@ -62,11 +59,6 @@ type BooleanFilter struct { Eq *bool `json:"eq,omitempty"` } -type CleanupResponse struct { - Count int64 `json:"count"` - List []string `json:"list"` -} - type DateTimeFilter struct { Eq *time.Time `json:"eq,omitempty"` Gt *time.Time `json:"gt,omitempty"` @@ -75,10 +67,6 @@ type DateTimeFilter struct { Lte *time.Time `json:"lte,omitempty"` } -type DownloadTorrentResponse struct { - Task *Task `json:"task,omitempty"` -} - type IntFilter struct { Eq *int64 `json:"eq,omitempty"` Gt *int64 `json:"gt,omitempty"` @@ -199,137 +187,3 @@ type Subscription struct { type Task struct { ID string `json:"id"` } - -type Torrent struct { - Name string `json:"name"` - Infohash string `json:"infohash"` - BytesCompleted int64 `json:"bytesCompleted"` - TorrentFilePath string `json:"torrentFilePath"` - BytesMissing int64 `json:"bytesMissing"` - Priority types.PiecePriority `json:"priority"` - Files []*TorrentFile `json:"files"` - ExcludedFiles []*TorrentFile `json:"excludedFiles"` - Peers []*TorrentPeer `json:"peers"` - T *torrent.Controller `json:"-"` -} - -type TorrentClientStats struct { - BytesWritten int64 `json:"bytesWritten"` - BytesWrittenData int64 `json:"bytesWrittenData"` - BytesRead int64 `json:"bytesRead"` - BytesReadData int64 `json:"bytesReadData"` - BytesReadUsefulData int64 `json:"bytesReadUsefulData"` - BytesReadUsefulIntendedData int64 `json:"bytesReadUsefulIntendedData"` - ChunksWritten int64 `json:"chunksWritten"` - ChunksRead int64 `json:"chunksRead"` - ChunksReadUseful int64 `json:"chunksReadUseful"` - ChunksReadWasted int64 `json:"chunksReadWasted"` - MetadataChunksRead int64 `json:"metadataChunksRead"` - PiecesDirtiedGood int64 `json:"piecesDirtiedGood"` - PiecesDirtiedBad int64 `json:"piecesDirtiedBad"` -} - -type TorrentDaemonMutation struct { - ValidateTorrent bool `json:"validateTorrent"` - SetTorrentPriority bool `json:"setTorrentPriority"` - Cleanup *CleanupResponse `json:"cleanup"` -} - -type TorrentDaemonQuery struct { - Torrents []*Torrent `json:"torrents"` - ClientStats *TorrentClientStats `json:"clientStats"` - StatsHistory []*TorrentStats `json:"statsHistory"` -} - -type TorrentFs struct { - Name string `json:"name"` - Torrent *Torrent `json:"torrent"` - Entries []FsEntry `json:"entries"` - FS *torrent.TorrentFS `json:"-"` -} - -func (TorrentFs) IsDir() {} -func (this TorrentFs) GetName() string { return this.Name } -func (this TorrentFs) GetEntries() []FsEntry { - if this.Entries == nil { - return nil - } - interfaceSlice := make([]FsEntry, 0, len(this.Entries)) - for _, concrete := range this.Entries { - interfaceSlice = append(interfaceSlice, concrete) - } - return interfaceSlice -} - -func (TorrentFs) IsFsEntry() {} - -type TorrentFile struct { - Filename string `json:"filename"` - Size int64 `json:"size"` - BytesCompleted int64 `json:"bytesCompleted"` - Priority types.PiecePriority `json:"priority"` - F *torrent.FileController `json:"-"` -} - -type TorrentFileEntry struct { - Name string `json:"name"` - Torrent *Torrent `json:"torrent"` - Size int64 `json:"size"` -} - -func (TorrentFileEntry) IsFile() {} -func (this TorrentFileEntry) GetName() string { return this.Name } -func (this TorrentFileEntry) GetSize() int64 { return this.Size } - -func (TorrentFileEntry) IsFsEntry() {} - -type TorrentFilter struct { - Everything *bool `json:"everything,omitempty"` - Infohash *string `json:"infohash,omitempty"` -} - -type TorrentPeer struct { - IP string `json:"ip"` - DownloadRate float64 `json:"downloadRate"` - Discovery string `json:"discovery"` - Port int64 `json:"port"` - ClientName string `json:"clientName"` - F *torrent1.PeerConn `json:"-"` -} - -type TorrentPriorityFilter struct { - Eq *types.PiecePriority `json:"eq,omitempty"` - Gt *types.PiecePriority `json:"gt,omitempty"` - Lt *types.PiecePriority `json:"lt,omitempty"` - Gte *types.PiecePriority `json:"gte,omitempty"` - Lte *types.PiecePriority `json:"lte,omitempty"` - In []types.PiecePriority `json:"in,omitempty"` -} - -type TorrentProgress struct { - Torrent *Torrent `json:"torrent"` - Current int64 `json:"current"` - Total int64 `json:"total"` -} - -func (TorrentProgress) IsProgress() {} -func (this TorrentProgress) GetCurrent() int64 { return this.Current } -func (this TorrentProgress) GetTotal() int64 { return this.Total } - -type TorrentStats struct { - Timestamp time.Time `json:"timestamp"` - DownloadedBytes uint `json:"downloadedBytes"` - UploadedBytes uint `json:"uploadedBytes"` - TotalPeers uint `json:"totalPeers"` - ActivePeers uint `json:"activePeers"` - ConnectedSeeders uint `json:"connectedSeeders"` -} - -type TorrentsFilter struct { - Infohash *StringFilter `json:"infohash,omitempty"` - Name *StringFilter `json:"name,omitempty"` - BytesCompleted *IntFilter `json:"bytesCompleted,omitempty"` - BytesMissing *IntFilter `json:"bytesMissing,omitempty"` - PeersCount *IntFilter `json:"peersCount,omitempty"` - Priority *TorrentPriorityFilter `json:"priority,omitempty"` -} diff --git a/src/delivery/graphql/resolver/fs.resolvers.go b/src/delivery/graphql/resolver/fs.resolvers.go index ce0c150..d00625c 100644 --- a/src/delivery/graphql/resolver/fs.resolvers.go +++ b/src/delivery/graphql/resolver/fs.resolvers.go @@ -62,23 +62,6 @@ func (r *simpleDirResolver) Entries(ctx context.Context, obj *model.SimpleDir) ( return out, nil } -// Entries is the resolver for the entries field. -func (r *torrentFSResolver) Entries(ctx context.Context, obj *model.TorrentFs) ([]model.FsEntry, error) { - entries, err := obj.FS.ReadDir(ctx, ".") - if err != nil { - return nil, err - } - out := []model.FsEntry{} - for _, e := range entries { - entry, err := model.FillFsEntry(ctx, e, obj.FS, ".") - if err != nil { - return nil, err - } - out = append(out, entry) - } - return out, nil -} - // ArchiveFS returns graph.ArchiveFSResolver implementation. func (r *Resolver) ArchiveFS() graph.ArchiveFSResolver { return &archiveFSResolver{r} } @@ -88,10 +71,6 @@ func (r *Resolver) ResolverFS() graph.ResolverFSResolver { return &resolverFSRes // SimpleDir returns graph.SimpleDirResolver implementation. func (r *Resolver) SimpleDir() graph.SimpleDirResolver { return &simpleDirResolver{r} } -// TorrentFS returns graph.TorrentFSResolver implementation. -func (r *Resolver) TorrentFS() graph.TorrentFSResolver { return &torrentFSResolver{r} } - type archiveFSResolver struct{ *Resolver } type resolverFSResolver struct{ *Resolver } type simpleDirResolver struct{ *Resolver } -type torrentFSResolver struct{ *Resolver } diff --git a/src/delivery/graphql/resolver/mutation.resolvers.go b/src/delivery/graphql/resolver/mutation.resolvers.go index 6552917..8ef1e2d 100644 --- a/src/delivery/graphql/resolver/mutation.resolvers.go +++ b/src/delivery/graphql/resolver/mutation.resolvers.go @@ -16,11 +16,6 @@ import ( "github.com/99designs/gqlgen/graphql" ) -// TorrentDaemon is the resolver for the torrentDaemon field. -func (r *mutationResolver) TorrentDaemon(ctx context.Context) (*model.TorrentDaemonMutation, error) { - return &model.TorrentDaemonMutation{}, nil -} - // QbitTorrentDaemon is the resolver for the qbitTorrentDaemon field. func (r *mutationResolver) QbitTorrentDaemon(ctx context.Context) (*model.QBitTorrentDaemonMutation, error) { return &model.QBitTorrentDaemonMutation{}, nil @@ -54,11 +49,7 @@ func (r *mutationResolver) UploadFile(ctx context.Context, dir string, file grap // DedupeStorage is the resolver for the dedupeStorage field. func (r *mutationResolver) DedupeStorage(ctx context.Context) (int64, error) { - deduped, err := r.ATorrentDaemon.Storage.Dedupe(ctx) - if err != nil { - return 0, err - } - return int64(deduped), nil + return 0, nil } // Mutation returns graph.MutationResolver implementation. diff --git a/src/delivery/graphql/resolver/query.resolvers.go b/src/delivery/graphql/resolver/query.resolvers.go index ace3039..30d0fcd 100644 --- a/src/delivery/graphql/resolver/query.resolvers.go +++ b/src/delivery/graphql/resolver/query.resolvers.go @@ -11,11 +11,6 @@ import ( "git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model" ) -// TorrentDaemon is the resolver for the torrentDaemon field. -func (r *queryResolver) TorrentDaemon(ctx context.Context) (*model.TorrentDaemonQuery, error) { - return &model.TorrentDaemonQuery{}, nil -} - // QbitTorrentDaemon is the resolver for the qbitTorrentDaemon field. func (r *queryResolver) QbitTorrentDaemon(ctx context.Context) (*model.QBitTorrentDaemonQuery, error) { return &model.QBitTorrentDaemonQuery{}, nil diff --git a/src/delivery/graphql/resolver/resolver.go b/src/delivery/graphql/resolver/resolver.go index 915217d..58568f9 100644 --- a/src/delivery/graphql/resolver/resolver.go +++ b/src/delivery/graphql/resolver/resolver.go @@ -11,7 +11,6 @@ import ( // It serves as dependency injection for your app, add any dependencies you require here. type Resolver struct { - // ATorrentDaemon *torrent.Daemon QBitTorrentDaemon *qbittorrent.Daemon VFS vfs.Filesystem SourceFS billy.Filesystem diff --git a/src/delivery/graphql/resolver/subscription.resolvers.go b/src/delivery/graphql/resolver/subscription.resolvers.go index dfc549d..9104757 100644 --- a/src/delivery/graphql/resolver/subscription.resolvers.go +++ b/src/delivery/graphql/resolver/subscription.resolvers.go @@ -17,42 +17,6 @@ func (r *subscriptionResolver) TaskProgress(ctx context.Context, taskID string) panic(fmt.Errorf("not implemented: TaskProgress - taskProgress")) } -// TorrentDownloadUpdates is the resolver for the torrentDownloadUpdates field. -func (r *subscriptionResolver) TorrentDownloadUpdates(ctx context.Context) (<-chan *model.TorrentProgress, error) { - out := make(chan *model.TorrentProgress) - progress, err := r.ATorrentDaemon.DownloadProgress(ctx) - if err != nil { - return nil, err - } - - go func() { - defer close(out) - for p := range progress { - if p.Torrent == nil { - fmt.Println("nil torrent") - continue - } - torrent, err := model.MapTorrent(ctx, p.Torrent) - if err != nil { - // TODO logs - continue - } - po := &model.TorrentProgress{ - Torrent: torrent, - Current: p.Current, - Total: p.Total, - } - select { - case <-ctx.Done(): - return - case out <- po: - } - } - }() - - return out, nil -} - // Subscription returns graph.SubscriptionResolver implementation. func (r *Resolver) Subscription() graph.SubscriptionResolver { return &subscriptionResolver{r} } diff --git a/src/export/nfs/kvhandler.go b/src/export/nfs/kvhandler.go index af30fca..2c2f994 100644 --- a/src/export/nfs/kvhandler.go +++ b/src/export/nfs/kvhandler.go @@ -53,7 +53,7 @@ func NewKvHandler(h nfs.Handler, fs nfs.Filesystem, config config.NFS) (nfs.Hand opts.Codec = kv.CodecBinary[handle, *handle]{} opts.BadgerOptions.Logger = logwrap.BadgerLogger("nfs", "kvhandler") - activeHandles, err := kvbadger.NewBagerKVBinaryKey[uuid.UUID, handle](opts) + activeHandles, err := kvbadger.NewBinaryKey[uuid.UUID, handle](opts) if err != nil { return nil, err } diff --git a/src/tkv/new.go b/src/tkv/new.go index 3f2edc1..6f55fcc 100644 --- a/src/tkv/new.go +++ b/src/tkv/new.go @@ -11,7 +11,7 @@ import ( func NewKV[K kv.Bytes, V any](dbdir, name string) (store kv.Store[K, V], err error) { opts := kvbadger.DefaultOptions[V](path.Join(dbdir, name)) opts.BadgerOptions.Logger = logwrap.BadgerLogger(name, "badger") - store, err = kvbadger.NewBadgerKVBytesKey[K, V](opts) + store, err = kvbadger.New[K, V](opts) if err != nil { return nil, err } diff --git a/ui/lib/api/schema.graphql b/ui/lib/api/schema.graphql index 3154319..612c6f3 100644 --- a/ui/lib/api/schema.graphql +++ b/ui/lib/api/schema.graphql @@ -9,10 +9,6 @@ type ArchiveFS implements Dir & FsEntry { input BooleanFilter @oneOf { eq: Boolean } -type CleanupResponse { - count: Int! - list: [String!]! -} scalar DateTime input DateTimeFilter @oneOf { eq: DateTime @@ -25,9 +21,6 @@ interface Dir implements FsEntry { name: String! entries: [FsEntry!]! } -type DownloadTorrentResponse { - task: Task -} interface File implements FsEntry { name: String! size: Int! @@ -44,7 +37,6 @@ input IntFilter @oneOf { in: [Int!] } type Mutation { - torrentDaemon: TorrentDaemonMutation @resolver qbitTorrentDaemon: QBitTorrentDaemonMutation @resolver uploadFile(dir: String!, file: Upload!): Boolean! dedupeStorage: Int! @@ -66,7 +58,7 @@ type QBitCleanupUnregistredResponse { hashes: [String!]! } input QBitTorrentDaemonFilter { - multipleSources: Boolean + sourcesCount: IntFilter } type QBitTorrentDaemonMutation { cleanup(run: Boolean!): QBitCleanupResponse! @resolver @@ -81,7 +73,6 @@ type QTorrent { sourceFiles: [String!]! @resolver } type Query { - torrentDaemon: TorrentDaemonQuery @resolver qbitTorrentDaemon: QBitTorrentDaemonQuery @resolver fsEntry(path: String!): FsEntry } @@ -108,109 +99,9 @@ input StringFilter @oneOf { } type Subscription { taskProgress(taskID: ID!): Progress - torrentDownloadUpdates: TorrentProgress } type Task { id: ID! } -type Torrent { - name: String! @resolver - infohash: String! - bytesCompleted: Int! - torrentFilePath: String! - bytesMissing: Int! - priority: TorrentPriority! - files: [TorrentFile!]! @resolver - excludedFiles: [TorrentFile!]! @resolver - peers: [TorrentPeer!]! @resolver -} -type TorrentClientStats { - bytesWritten: Int! - bytesWrittenData: Int! - bytesRead: Int! - bytesReadData: Int! - bytesReadUsefulData: Int! - bytesReadUsefulIntendedData: Int! - chunksWritten: Int! - chunksRead: Int! - chunksReadUseful: Int! - chunksReadWasted: Int! - metadataChunksRead: Int! - piecesDirtiedGood: Int! - piecesDirtiedBad: Int! -} -type TorrentDaemonMutation { - validateTorrent(filter: TorrentFilter!): Boolean! @resolver - setTorrentPriority(infohash: String!, file: String, priority: TorrentPriority!): Boolean! @resolver - cleanup(files: Boolean, dryRun: Boolean!): CleanupResponse! @resolver -} -type TorrentDaemonQuery { - torrents(filter: TorrentsFilter): [Torrent!]! @resolver - clientStats: TorrentClientStats! @resolver - statsHistory(since: DateTime!, infohash: String): [TorrentStats!]! @resolver -} -type TorrentFS implements Dir & FsEntry { - name: String! - torrent: Torrent! - entries: [FsEntry!]! @resolver -} -type TorrentFile { - filename: String! - size: Int! - bytesCompleted: Int! - priority: TorrentPriority! @resolver -} -type TorrentFileEntry implements File & FsEntry { - name: String! - torrent: Torrent! - size: Int! -} -input TorrentFilter @oneOf { - everything: Boolean - infohash: String -} -type TorrentPeer { - ip: String! - downloadRate: Float! - discovery: String! - port: Int! - clientName: String! -} -enum TorrentPriority { - NONE - NORMAL - HIGH - READAHEAD - NOW -} -input TorrentPriorityFilter @oneOf { - eq: TorrentPriority - gt: TorrentPriority - lt: TorrentPriority - gte: TorrentPriority - lte: TorrentPriority - in: [TorrentPriority!] -} -type TorrentProgress implements Progress { - torrent: Torrent! - current: Int! - total: Int! -} -type TorrentStats { - timestamp: DateTime! - downloadedBytes: UInt! - uploadedBytes: UInt! - totalPeers: UInt! - activePeers: UInt! - connectedSeeders: UInt! -} -input TorrentsFilter { - infohash: StringFilter - name: StringFilter - bytesCompleted: IntFilter - bytesMissing: IntFilter - peersCount: IntFilter - priority: TorrentPriorityFilter -} scalar UInt scalar Upload