12181 lines
364 KiB
Go
12181 lines
364 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package graph
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
"sync"
|
|
"sync/atomic"
|
|
"time"
|
|
|
|
"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"
|
|
)
|
|
|
|
// region ************************** generated!.gotpl **************************
|
|
|
|
// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
|
|
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
|
|
return &executableSchema{
|
|
schema: cfg.Schema,
|
|
resolvers: cfg.Resolvers,
|
|
directives: cfg.Directives,
|
|
complexity: cfg.Complexity,
|
|
}
|
|
}
|
|
|
|
type Config struct {
|
|
Schema *ast.Schema
|
|
Resolvers ResolverRoot
|
|
Directives DirectiveRoot
|
|
Complexity ComplexityRoot
|
|
}
|
|
|
|
type ResolverRoot interface {
|
|
Mutation() MutationResolver
|
|
Query() QueryResolver
|
|
Subscription() SubscriptionResolver
|
|
}
|
|
|
|
type DirectiveRoot struct {
|
|
OneOf func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
|
|
Resolver func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
|
|
Stream func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
|
|
}
|
|
|
|
type ComplexityRoot struct {
|
|
ArchiveFS struct {
|
|
Entries func(childComplexity int) int
|
|
Name func(childComplexity int) int
|
|
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
|
|
}
|
|
|
|
QBitCleanupResponse struct {
|
|
Count func(childComplexity int) int
|
|
Hashes func(childComplexity int) int
|
|
}
|
|
|
|
QBitTorrentDaemonMutation struct {
|
|
Cleanup func(childComplexity int, run bool) int
|
|
}
|
|
|
|
QBitTorrentDaemonQuery struct {
|
|
Torrents func(childComplexity int) int
|
|
}
|
|
|
|
QTorrent struct {
|
|
Hash func(childComplexity int) int
|
|
Name func(childComplexity int) int
|
|
SourceFiles func(childComplexity int) int
|
|
}
|
|
|
|
Query struct {
|
|
FsEntry func(childComplexity int, path string) int
|
|
QbitTorrentDaemon func(childComplexity int) int
|
|
TorrentDaemon func(childComplexity int) int
|
|
}
|
|
|
|
ResolverFS struct {
|
|
Entries func(childComplexity int) int
|
|
Name func(childComplexity int) int
|
|
}
|
|
|
|
Schema struct {
|
|
Mutation func(childComplexity int) int
|
|
Query func(childComplexity int) int
|
|
}
|
|
|
|
SimpleDir struct {
|
|
Entries func(childComplexity int) int
|
|
Name func(childComplexity int) int
|
|
}
|
|
|
|
SimpleFile struct {
|
|
Name func(childComplexity int) int
|
|
Size func(childComplexity int) int
|
|
}
|
|
|
|
Subscription struct {
|
|
TaskProgress func(childComplexity int, taskID string) int
|
|
TorrentDownloadUpdates func(childComplexity int) 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 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)
|
|
}
|
|
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)
|
|
}
|
|
type SubscriptionResolver interface {
|
|
TaskProgress(ctx context.Context, taskID string) (<-chan model.Progress, error)
|
|
TorrentDownloadUpdates(ctx context.Context) (<-chan *model.TorrentProgress, error)
|
|
}
|
|
|
|
type executableSchema struct {
|
|
schema *ast.Schema
|
|
resolvers ResolverRoot
|
|
directives DirectiveRoot
|
|
complexity ComplexityRoot
|
|
}
|
|
|
|
func (e *executableSchema) Schema() *ast.Schema {
|
|
if e.schema != nil {
|
|
return e.schema
|
|
}
|
|
return parsedSchema
|
|
}
|
|
|
|
func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
|
|
ec := executionContext{nil, e, 0, 0, nil}
|
|
_ = ec
|
|
switch typeName + "." + field {
|
|
|
|
case "ArchiveFS.entries":
|
|
if e.complexity.ArchiveFS.Entries == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ArchiveFS.Entries(childComplexity), true
|
|
|
|
case "ArchiveFS.name":
|
|
if e.complexity.ArchiveFS.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ArchiveFS.Name(childComplexity), true
|
|
|
|
case "ArchiveFS.size":
|
|
if e.complexity.ArchiveFS.Size == nil {
|
|
break
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
return e.complexity.Mutation.DedupeStorage(childComplexity), true
|
|
|
|
case "Mutation.qbitTorrentDaemon":
|
|
if e.complexity.Mutation.QbitTorrentDaemon == nil {
|
|
break
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
args, err := ec.field_Mutation_uploadFile_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Mutation.UploadFile(childComplexity, args["dir"].(string), args["file"].(graphql.Upload)), true
|
|
|
|
case "QBitCleanupResponse.count":
|
|
if e.complexity.QBitCleanupResponse.Count == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QBitCleanupResponse.Count(childComplexity), true
|
|
|
|
case "QBitCleanupResponse.hashes":
|
|
if e.complexity.QBitCleanupResponse.Hashes == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QBitCleanupResponse.Hashes(childComplexity), true
|
|
|
|
case "QBitTorrentDaemonMutation.cleanup":
|
|
if e.complexity.QBitTorrentDaemonMutation.Cleanup == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_QBitTorrentDaemonMutation_cleanup_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.QBitTorrentDaemonMutation.Cleanup(childComplexity, args["run"].(bool)), true
|
|
|
|
case "QBitTorrentDaemonQuery.torrents":
|
|
if e.complexity.QBitTorrentDaemonQuery.Torrents == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QBitTorrentDaemonQuery.Torrents(childComplexity), true
|
|
|
|
case "QTorrent.hash":
|
|
if e.complexity.QTorrent.Hash == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QTorrent.Hash(childComplexity), true
|
|
|
|
case "QTorrent.name":
|
|
if e.complexity.QTorrent.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QTorrent.Name(childComplexity), true
|
|
|
|
case "QTorrent.sourceFiles":
|
|
if e.complexity.QTorrent.SourceFiles == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.QTorrent.SourceFiles(childComplexity), true
|
|
|
|
case "Query.fsEntry":
|
|
if e.complexity.Query.FsEntry == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Query_fsEntry_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
return e.complexity.Query.FsEntry(childComplexity, args["path"].(string)), true
|
|
|
|
case "Query.qbitTorrentDaemon":
|
|
if e.complexity.Query.QbitTorrentDaemon == nil {
|
|
break
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
return e.complexity.ResolverFS.Entries(childComplexity), true
|
|
|
|
case "ResolverFS.name":
|
|
if e.complexity.ResolverFS.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.ResolverFS.Name(childComplexity), true
|
|
|
|
case "Schema.mutation":
|
|
if e.complexity.Schema.Mutation == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Schema.Mutation(childComplexity), true
|
|
|
|
case "Schema.query":
|
|
if e.complexity.Schema.Query == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.Schema.Query(childComplexity), true
|
|
|
|
case "SimpleDir.entries":
|
|
if e.complexity.SimpleDir.Entries == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.SimpleDir.Entries(childComplexity), true
|
|
|
|
case "SimpleDir.name":
|
|
if e.complexity.SimpleDir.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.SimpleDir.Name(childComplexity), true
|
|
|
|
case "SimpleFile.name":
|
|
if e.complexity.SimpleFile.Name == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.SimpleFile.Name(childComplexity), true
|
|
|
|
case "SimpleFile.size":
|
|
if e.complexity.SimpleFile.Size == nil {
|
|
break
|
|
}
|
|
|
|
return e.complexity.SimpleFile.Size(childComplexity), true
|
|
|
|
case "Subscription.taskProgress":
|
|
if e.complexity.Subscription.TaskProgress == nil {
|
|
break
|
|
}
|
|
|
|
args, err := ec.field_Subscription_taskProgress_args(context.TODO(), rawArgs)
|
|
if err != nil {
|
|
return 0, false
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
|
|
rc := graphql.GetOperationContext(ctx)
|
|
ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)}
|
|
inputUnmarshalMap := graphql.BuildUnmarshalerMap(
|
|
ec.unmarshalInputBooleanFilter,
|
|
ec.unmarshalInputDateTimeFilter,
|
|
ec.unmarshalInputIntFilter,
|
|
ec.unmarshalInputPagination,
|
|
ec.unmarshalInputStringFilter,
|
|
ec.unmarshalInputTorrentFilter,
|
|
ec.unmarshalInputTorrentPriorityFilter,
|
|
ec.unmarshalInputTorrentsFilter,
|
|
)
|
|
first := true
|
|
|
|
switch rc.Operation.Operation {
|
|
case ast.Query:
|
|
return func(ctx context.Context) *graphql.Response {
|
|
var response graphql.Response
|
|
var data graphql.Marshaler
|
|
if first {
|
|
first = false
|
|
ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
|
|
data = ec._Query(ctx, rc.Operation.SelectionSet)
|
|
} else {
|
|
if atomic.LoadInt32(&ec.pendingDeferred) > 0 {
|
|
result := <-ec.deferredResults
|
|
atomic.AddInt32(&ec.pendingDeferred, -1)
|
|
data = result.Result
|
|
response.Path = result.Path
|
|
response.Label = result.Label
|
|
response.Errors = result.Errors
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|
|
var buf bytes.Buffer
|
|
data.MarshalGQL(&buf)
|
|
response.Data = buf.Bytes()
|
|
if atomic.LoadInt32(&ec.deferred) > 0 {
|
|
hasNext := atomic.LoadInt32(&ec.pendingDeferred) > 0
|
|
response.HasNext = &hasNext
|
|
}
|
|
|
|
return &response
|
|
}
|
|
case ast.Mutation:
|
|
return func(ctx context.Context) *graphql.Response {
|
|
if !first {
|
|
return nil
|
|
}
|
|
first = false
|
|
ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap)
|
|
data := ec._Mutation(ctx, rc.Operation.SelectionSet)
|
|
var buf bytes.Buffer
|
|
data.MarshalGQL(&buf)
|
|
|
|
return &graphql.Response{
|
|
Data: buf.Bytes(),
|
|
}
|
|
}
|
|
case ast.Subscription:
|
|
next := ec._Subscription(ctx, rc.Operation.SelectionSet)
|
|
|
|
var buf bytes.Buffer
|
|
return func(ctx context.Context) *graphql.Response {
|
|
buf.Reset()
|
|
data := next(ctx)
|
|
|
|
if data == nil {
|
|
return nil
|
|
}
|
|
data.MarshalGQL(&buf)
|
|
|
|
return &graphql.Response{
|
|
Data: buf.Bytes(),
|
|
}
|
|
}
|
|
|
|
default:
|
|
return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
|
|
}
|
|
}
|
|
|
|
type executionContext struct {
|
|
*graphql.OperationContext
|
|
*executableSchema
|
|
deferred int32
|
|
pendingDeferred int32
|
|
deferredResults chan graphql.DeferredResult
|
|
}
|
|
|
|
func (ec *executionContext) processDeferredGroup(dg graphql.DeferredGroup) {
|
|
atomic.AddInt32(&ec.pendingDeferred, 1)
|
|
go func() {
|
|
ctx := graphql.WithFreshResponseContext(dg.Context)
|
|
dg.FieldSet.Dispatch(ctx)
|
|
ds := graphql.DeferredResult{
|
|
Path: dg.Path,
|
|
Label: dg.Label,
|
|
Result: dg.FieldSet,
|
|
Errors: graphql.GetErrors(ctx),
|
|
}
|
|
// null fields should bubble up
|
|
if dg.FieldSet.Invalids > 0 {
|
|
ds.Result = graphql.Null
|
|
}
|
|
ec.deferredResults <- ds
|
|
}()
|
|
}
|
|
|
|
func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
|
|
if ec.DisableIntrospection {
|
|
return nil, errors.New("introspection disabled")
|
|
}
|
|
return introspection.WrapSchema(ec.Schema()), nil
|
|
}
|
|
|
|
func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
|
|
if ec.DisableIntrospection {
|
|
return nil, errors.New("introspection disabled")
|
|
}
|
|
return introspection.WrapTypeFromDef(ec.Schema(), ec.Schema().Types[name]), nil
|
|
}
|
|
|
|
var sources = []*ast.Source{
|
|
{Name: "../../../graphql/mutation.graphql", Input: `type Mutation {
|
|
torrentDaemon: TorrentDaemonMutation @resolver
|
|
qbitTorrentDaemon: QBitTorrentDaemonMutation @resolver
|
|
|
|
uploadFile(dir: String!, file: Upload!): Boolean!
|
|
dedupeStorage: Int!
|
|
}
|
|
|
|
type Task {
|
|
id: ID!
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "../../../graphql/query.graphql", Input: `type Query {
|
|
torrentDaemon: TorrentDaemonQuery @resolver
|
|
qbitTorrentDaemon: QBitTorrentDaemonQuery @resolver
|
|
|
|
fsEntry(path: String!): FsEntry
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "../../../graphql/schema.graphql", Input: `directive @oneOf on INPUT_OBJECT | FIELD_DEFINITION
|
|
directive @resolver on INPUT_FIELD_DEFINITION | FIELD_DEFINITION
|
|
|
|
directive @stream on FIELD_DEFINITION
|
|
|
|
scalar DateTime
|
|
scalar Upload
|
|
scalar UInt
|
|
|
|
type Schema {
|
|
query: Query
|
|
mutation: Mutation
|
|
}
|
|
`, 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!
|
|
}
|
|
|
|
interface Progress {
|
|
current: Int!
|
|
total: Int!
|
|
}`, BuiltIn: false},
|
|
{Name: "../../../graphql/sources/qbittorrent_mutation.graphql", Input: `type QBitTorrentDaemonMutation {
|
|
cleanup(run: Boolean!): QBitCleanupResponse! @resolver
|
|
}
|
|
|
|
type QBitCleanupResponse {
|
|
count: Int!
|
|
hashes: [String!]!
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "../../../graphql/sources/qbittorrent_query.graphql", Input: `type QBitTorrentDaemonQuery {
|
|
torrents: [QTorrent!]! @resolver
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "../../../graphql/sources/qbittorrent_types.graphql", Input: `type QTorrent {
|
|
name: String!
|
|
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!
|
|
limit: Int!
|
|
}
|
|
|
|
input StringFilter @oneOf {
|
|
eq: String
|
|
substr: String
|
|
in: [String!]
|
|
}
|
|
|
|
input IntFilter @oneOf {
|
|
eq: Int
|
|
gt: Int
|
|
lt: Int
|
|
gte: Int
|
|
lte: Int
|
|
in: [Int!]
|
|
}
|
|
|
|
input DateTimeFilter @oneOf {
|
|
eq: DateTime
|
|
gt: DateTime
|
|
lt: DateTime
|
|
gte: DateTime
|
|
lte: DateTime
|
|
}
|
|
|
|
input BooleanFilter @oneOf {
|
|
eq: Boolean
|
|
}
|
|
`, BuiltIn: false},
|
|
{Name: "../../../graphql/types/fs.graphql", Input: `interface FsEntry {
|
|
name: String!
|
|
}
|
|
|
|
interface Dir implements FsEntry {
|
|
name: String!
|
|
entries: [FsEntry!]!
|
|
}
|
|
|
|
interface File implements FsEntry {
|
|
name: String!
|
|
size: Int!
|
|
}
|
|
|
|
type SimpleDir implements Dir & FsEntry {
|
|
name: String!
|
|
entries: [FsEntry!]! @resolver
|
|
}
|
|
|
|
type SimpleFile implements File & FsEntry {
|
|
name: String!
|
|
size: Int!
|
|
}
|
|
|
|
type ResolverFS implements Dir & FsEntry {
|
|
name: String!
|
|
entries: [FsEntry!]! @resolver
|
|
}
|
|
|
|
type ArchiveFS implements Dir & FsEntry {
|
|
name: String!
|
|
entries: [FsEntry!]! @resolver
|
|
|
|
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...)
|
|
|
|
// endregion ************************** generated!.gotpl **************************
|
|
|
|
// region ***************************** args.gotpl *****************************
|
|
|
|
func (ec *executionContext) field_Mutation_uploadFile_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Mutation_uploadFile_argsDir(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["dir"] = arg0
|
|
arg1, err := ec.field_Mutation_uploadFile_argsFile(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["file"] = arg1
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Mutation_uploadFile_argsDir(
|
|
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["dir"]
|
|
if !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("dir"))
|
|
if tmp, ok := rawArgs["dir"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Mutation_uploadFile_argsFile(
|
|
ctx context.Context,
|
|
rawArgs map[string]interface{},
|
|
) (graphql.Upload, 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 graphql.Upload
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("file"))
|
|
if tmp, ok := rawArgs["file"]; ok {
|
|
return ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal graphql.Upload
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_QBitTorrentDaemonMutation_cleanup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_QBitTorrentDaemonMutation_cleanup_argsRun(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["run"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_QBitTorrentDaemonMutation_cleanup_argsRun(
|
|
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["run"]
|
|
if !ok {
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("run"))
|
|
if tmp, ok := rawArgs["run"]; ok {
|
|
return ec.unmarshalNBoolean2bool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query___type_argsName(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["name"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query___type_argsName(
|
|
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["name"]
|
|
if !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
if tmp, ok := rawArgs["name"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Query_fsEntry_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Query_fsEntry_argsPath(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["path"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Query_fsEntry_argsPath(
|
|
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["path"]
|
|
if !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("path"))
|
|
if tmp, ok := rawArgs["path"]; ok {
|
|
return ec.unmarshalNString2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field_Subscription_taskProgress_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field_Subscription_taskProgress_argsTaskID(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["taskID"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field_Subscription_taskProgress_argsTaskID(
|
|
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["taskID"]
|
|
if !ok {
|
|
var zeroVal string
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("taskID"))
|
|
if tmp, ok := rawArgs["taskID"]; ok {
|
|
return ec.unmarshalNID2string(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal string
|
|
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{}{}
|
|
arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated(
|
|
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["includeDeprecated"]
|
|
if !ok {
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
return ec.unmarshalOBoolean2bool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
|
|
var err error
|
|
args := map[string]interface{}{}
|
|
arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
args["includeDeprecated"] = arg0
|
|
return args, nil
|
|
}
|
|
func (ec *executionContext) field___Type_fields_argsIncludeDeprecated(
|
|
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["includeDeprecated"]
|
|
if !ok {
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated"))
|
|
if tmp, ok := rawArgs["includeDeprecated"]; ok {
|
|
return ec.unmarshalOBoolean2bool(ctx, tmp)
|
|
}
|
|
|
|
var zeroVal bool
|
|
return zeroVal, nil
|
|
}
|
|
|
|
// endregion ***************************** args.gotpl *****************************
|
|
|
|
// region ************************** directives.gotpl **************************
|
|
|
|
// endregion ************************** directives.gotpl **************************
|
|
|
|
// region **************************** field.gotpl *****************************
|
|
|
|
func (ec *executionContext) _ArchiveFS_name(ctx context.Context, field graphql.CollectedField, obj *model.ArchiveFs) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ArchiveFS_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_ArchiveFS_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ArchiveFS",
|
|
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) _ArchiveFS_entries(ctx context.Context, field graphql.CollectedField, obj *model.ArchiveFs) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ArchiveFS_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 obj.Entries, nil
|
|
}
|
|
|
|
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_ArchiveFS_entries(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ArchiveFS",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
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) _ArchiveFS_size(ctx context.Context, field graphql.CollectedField, obj *model.ArchiveFs) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ArchiveFS_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_ArchiveFS_size(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ArchiveFS",
|
|
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_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 {
|
|
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().QbitTorrentDaemon(rctx)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.Resolver == nil {
|
|
var zeroVal *model.QBitTorrentDaemonMutation
|
|
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.QBitTorrentDaemonMutation); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.QBitTorrentDaemonMutation`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.QBitTorrentDaemonMutation)
|
|
fc.Result = res
|
|
return ec.marshalOQBitTorrentDaemonMutation2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQBitTorrentDaemonMutation(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Mutation_qbitTorrentDaemon(_ 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 "cleanup":
|
|
return ec.fieldContext_QBitTorrentDaemonMutation_cleanup(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type QBitTorrentDaemonMutation", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_uploadFile(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_uploadFile(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 ec.resolvers.Mutation().UploadFile(rctx, fc.Args["dir"].(string), fc.Args["file"].(graphql.Upload))
|
|
})
|
|
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_Mutation_uploadFile(ctx 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) {
|
|
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_Mutation_uploadFile_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Mutation_dedupeStorage(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Mutation_dedupeStorage(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 ec.resolvers.Mutation().DedupeStorage(rctx)
|
|
})
|
|
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_Mutation_dedupeStorage(_ 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) {
|
|
return nil, errors.New("field of type Int does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _QBitCleanupResponse_count(ctx context.Context, field graphql.CollectedField, obj *model.QBitCleanupResponse) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QBitCleanupResponse_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_QBitCleanupResponse_count(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QBitCleanupResponse",
|
|
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) _QBitCleanupResponse_hashes(ctx context.Context, field graphql.CollectedField, obj *model.QBitCleanupResponse) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QBitCleanupResponse_hashes(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.Hashes, 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_QBitCleanupResponse_hashes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QBitCleanupResponse",
|
|
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) _QBitTorrentDaemonMutation_cleanup(ctx context.Context, field graphql.CollectedField, obj *model.QBitTorrentDaemonMutation) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QBitTorrentDaemonMutation_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 obj.Cleanup, nil
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.Resolver == nil {
|
|
var zeroVal *model.QBitCleanupResponse
|
|
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.QBitCleanupResponse); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.QBitCleanupResponse`, 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.QBitCleanupResponse)
|
|
fc.Result = res
|
|
return ec.marshalNQBitCleanupResponse2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQBitCleanupResponse(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_QBitTorrentDaemonMutation_cleanup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QBitTorrentDaemonMutation",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "count":
|
|
return ec.fieldContext_QBitCleanupResponse_count(ctx, field)
|
|
case "hashes":
|
|
return ec.fieldContext_QBitCleanupResponse_hashes(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type QBitCleanupResponse", 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_QBitTorrentDaemonMutation_cleanup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _QBitTorrentDaemonQuery_torrents(ctx context.Context, field graphql.CollectedField, obj *model.QBitTorrentDaemonQuery) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QBitTorrentDaemonQuery_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 obj.Torrents, nil
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.Resolver == nil {
|
|
var zeroVal []*model.QTorrent
|
|
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.QTorrent); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be []*git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.QTorrent`, 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.QTorrent)
|
|
fc.Result = res
|
|
return ec.marshalNQTorrent2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQTorrentᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_QBitTorrentDaemonQuery_torrents(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QBitTorrentDaemonQuery",
|
|
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_QTorrent_name(ctx, field)
|
|
case "hash":
|
|
return ec.fieldContext_QTorrent_hash(ctx, field)
|
|
case "sourceFiles":
|
|
return ec.fieldContext_QTorrent_sourceFiles(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type QTorrent", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _QTorrent_name(ctx context.Context, field graphql.CollectedField, obj *model.QTorrent) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QTorrent_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_QTorrent_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QTorrent",
|
|
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) _QTorrent_hash(ctx context.Context, field graphql.CollectedField, obj *model.QTorrent) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QTorrent_hash(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.Hash, 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_QTorrent_hash(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QTorrent",
|
|
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) _QTorrent_sourceFiles(ctx context.Context, field graphql.CollectedField, obj *model.QTorrent) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_QTorrent_sourceFiles(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 obj.SourceFiles, nil
|
|
}
|
|
|
|
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.marshalNString2ᚕstringᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_QTorrent_sourceFiles(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "QTorrent",
|
|
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) _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 {
|
|
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().QbitTorrentDaemon(rctx)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.Resolver == nil {
|
|
var zeroVal *model.QBitTorrentDaemonQuery
|
|
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.QBitTorrentDaemonQuery); ok {
|
|
return data, nil
|
|
}
|
|
return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.QBitTorrentDaemonQuery`, tmp)
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*model.QBitTorrentDaemonQuery)
|
|
fc.Result = res
|
|
return ec.marshalOQBitTorrentDaemonQuery2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQBitTorrentDaemonQuery(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_qbitTorrentDaemon(_ 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_QBitTorrentDaemonQuery_torrents(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type QBitTorrentDaemonQuery", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query_fsEntry(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query_fsEntry(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 ec.resolvers.Query().FsEntry(rctx, fc.Args["path"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(model.FsEntry)
|
|
fc.Result = res
|
|
return ec.marshalOFsEntry2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐFsEntry(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query_fsEntry(ctx 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) {
|
|
return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE")
|
|
},
|
|
}
|
|
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_Query_fsEntry_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query___type(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 ec.introspectType(fc.Args["name"].(string))
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", 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_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Query___schema(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 ec.introspectSchema()
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Schema)
|
|
fc.Result = res
|
|
return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Query",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "description":
|
|
return ec.fieldContext___Schema_description(ctx, field)
|
|
case "types":
|
|
return ec.fieldContext___Schema_types(ctx, field)
|
|
case "queryType":
|
|
return ec.fieldContext___Schema_queryType(ctx, field)
|
|
case "mutationType":
|
|
return ec.fieldContext___Schema_mutationType(ctx, field)
|
|
case "subscriptionType":
|
|
return ec.fieldContext___Schema_subscriptionType(ctx, field)
|
|
case "directives":
|
|
return ec.fieldContext___Schema_directives(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _ResolverFS_name(ctx context.Context, field graphql.CollectedField, obj *model.ResolverFs) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ResolverFS_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_ResolverFS_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ResolverFS",
|
|
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) _ResolverFS_entries(ctx context.Context, field graphql.CollectedField, obj *model.ResolverFs) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_ResolverFS_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 obj.Entries, nil
|
|
}
|
|
|
|
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_ResolverFS_entries(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "ResolverFS",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
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) _Schema_query(ctx context.Context, field graphql.CollectedField, obj *model.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Schema_query(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
|
|
}
|
|
}()
|
|
res := &model.Query{}
|
|
fc.Result = res
|
|
return ec.marshalOQuery2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQuery(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Schema_query(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Schema",
|
|
Field: field,
|
|
IsMethod: false,
|
|
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":
|
|
return ec.fieldContext_Query_fsEntry(ctx, field)
|
|
case "__schema":
|
|
return ec.fieldContext_Query___schema(ctx, field)
|
|
case "__type":
|
|
return ec.fieldContext_Query___type(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Query", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _Schema_mutation(ctx context.Context, field graphql.CollectedField, obj *model.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Schema_mutation(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
|
|
}
|
|
}()
|
|
res := &model.Mutation{}
|
|
fc.Result = res
|
|
return ec.marshalOMutation2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐMutation(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Schema_mutation(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Schema",
|
|
Field: field,
|
|
IsMethod: false,
|
|
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":
|
|
return ec.fieldContext_Mutation_uploadFile(ctx, field)
|
|
case "dedupeStorage":
|
|
return ec.fieldContext_Mutation_dedupeStorage(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type Mutation", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) _SimpleDir_name(ctx context.Context, field graphql.CollectedField, obj *model.SimpleDir) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_SimpleDir_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_SimpleDir_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "SimpleDir",
|
|
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) _SimpleDir_entries(ctx context.Context, field graphql.CollectedField, obj *model.SimpleDir) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_SimpleDir_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 obj.Entries, nil
|
|
}
|
|
|
|
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_SimpleDir_entries(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "SimpleDir",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
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) _SimpleFile_name(ctx context.Context, field graphql.CollectedField, obj *model.SimpleFile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_SimpleFile_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_SimpleFile_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "SimpleFile",
|
|
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) _SimpleFile_size(ctx context.Context, field graphql.CollectedField, obj *model.SimpleFile) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_SimpleFile_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_SimpleFile_size(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "SimpleFile",
|
|
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) _Subscription_taskProgress(ctx context.Context, field graphql.CollectedField) (ret func(ctx context.Context) graphql.Marshaler) {
|
|
fc, err := ec.fieldContext_Subscription_taskProgress(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().TaskProgress(rctx, fc.Args["taskID"].(string))
|
|
})
|
|
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.Progress):
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return graphql.WriterFunc(func(w io.Writer) {
|
|
w.Write([]byte{'{'})
|
|
graphql.MarshalString(field.Alias).MarshalGQL(w)
|
|
w.Write([]byte{':'})
|
|
ec.marshalOProgress2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐProgress(ctx, field.Selections, res).MarshalGQL(w)
|
|
w.Write([]byte{'}'})
|
|
})
|
|
case <-ctx.Done():
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Subscription_taskProgress(ctx 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) {
|
|
return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE")
|
|
},
|
|
}
|
|
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_Subscription_taskProgress_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
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 {
|
|
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.ID, 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.marshalNID2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext_Task_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "Task",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type ID does not have child fields")
|
|
},
|
|
}
|
|
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 obj.Name, nil
|
|
}
|
|
|
|
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: 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_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 obj.Files, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.ExcludedFiles, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.Peers, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.ValidateTorrent, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.SetTorrentPriority, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.Cleanup, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.Torrents, nil
|
|
}
|
|
|
|
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: 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)
|
|
},
|
|
}
|
|
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 obj.ClientStats, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.StatsHistory, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.Entries, nil
|
|
}
|
|
|
|
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: false,
|
|
IsResolver: false,
|
|
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 obj.Priority, nil
|
|
}
|
|
|
|
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: 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) _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 {
|
|
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___Directive_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
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) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_description(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.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_locations(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.Locations, 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.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_locations(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type __DirectiveLocation does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_args(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.Args, 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.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
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___InputValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___InputValue_description(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___InputValue_type(ctx, field)
|
|
case "defaultValue":
|
|
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Directive_isRepeatable(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.IsRepeatable, 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.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Directive_isRepeatable(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Directive",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_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___EnumValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
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) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_description(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.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_isDeprecated(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.IsDeprecated(), 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.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___EnumValue_deprecationReason(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.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___EnumValue_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__EnumValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_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___Field_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
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) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_description(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.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_args(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.Args, 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.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_args(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
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___InputValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___InputValue_description(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___InputValue_type(ctx, field)
|
|
case "defaultValue":
|
|
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_type(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.Type, 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.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_isDeprecated(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.IsDeprecated(), 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.(bool)
|
|
fc.Result = res
|
|
return ec.marshalNBoolean2bool(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_isDeprecated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type Boolean does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Field_deprecationReason(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.DeprecationReason(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Field_deprecationReason(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Field",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_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___InputValue_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
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) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_description(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.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_type(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.Type, 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.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_type(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
Field: field,
|
|
IsMethod: false,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___InputValue_defaultValue(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.DefaultValue, nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___InputValue_defaultValue(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__InputValue",
|
|
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) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_description(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.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_types(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.Types(), 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.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_types(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_queryType(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.QueryType(), 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.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_queryType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_mutationType(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.MutationType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_mutationType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_subscriptionType(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.SubscriptionType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_subscriptionType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Schema_directives(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.Directives(), 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.([]introspection.Directive)
|
|
fc.Result = res
|
|
return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Schema_directives(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Schema",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___Directive_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Directive_description(ctx, field)
|
|
case "locations":
|
|
return ec.fieldContext___Directive_locations(ctx, field)
|
|
case "args":
|
|
return ec.fieldContext___Directive_args(ctx, field)
|
|
case "isRepeatable":
|
|
return ec.fieldContext___Directive_isRepeatable(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_kind(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.Kind(), 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.marshalN__TypeKind2string(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_kind(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
return nil, errors.New("field of type __TypeKind does not have child fields")
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_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 {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_description(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.Description(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_fields(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.Fields(fc.Args["includeDeprecated"].(bool)), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Field)
|
|
fc.Result = res
|
|
return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___Field_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Field_description(ctx, field)
|
|
case "args":
|
|
return ec.fieldContext___Field_args(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___Field_type(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___Field_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___Field_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Field", 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___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_interfaces(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.Interfaces(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_interfaces(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_possibleTypes(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.PossibleTypes(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_possibleTypes(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_enumValues(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.EnumValues(fc.Args["includeDeprecated"].(bool)), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.EnumValue)
|
|
fc.Result = res
|
|
return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___EnumValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___EnumValue_description(ctx, field)
|
|
case "isDeprecated":
|
|
return ec.fieldContext___EnumValue_isDeprecated(ctx, field)
|
|
case "deprecationReason":
|
|
return ec.fieldContext___EnumValue_deprecationReason(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __EnumValue", 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___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil {
|
|
ec.Error(ctx, err)
|
|
return fc, err
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_inputFields(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.InputFields(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.([]introspection.InputValue)
|
|
fc.Result = res
|
|
return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_inputFields(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "name":
|
|
return ec.fieldContext___InputValue_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___InputValue_description(ctx, field)
|
|
case "type":
|
|
return ec.fieldContext___InputValue_type(ctx, field)
|
|
case "defaultValue":
|
|
return ec.fieldContext___InputValue_defaultValue(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_ofType(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.OfType(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*introspection.Type)
|
|
fc.Result = res
|
|
return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_ofType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
IsResolver: false,
|
|
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
switch field.Name {
|
|
case "kind":
|
|
return ec.fieldContext___Type_kind(ctx, field)
|
|
case "name":
|
|
return ec.fieldContext___Type_name(ctx, field)
|
|
case "description":
|
|
return ec.fieldContext___Type_description(ctx, field)
|
|
case "fields":
|
|
return ec.fieldContext___Type_fields(ctx, field)
|
|
case "interfaces":
|
|
return ec.fieldContext___Type_interfaces(ctx, field)
|
|
case "possibleTypes":
|
|
return ec.fieldContext___Type_possibleTypes(ctx, field)
|
|
case "enumValues":
|
|
return ec.fieldContext___Type_enumValues(ctx, field)
|
|
case "inputFields":
|
|
return ec.fieldContext___Type_inputFields(ctx, field)
|
|
case "ofType":
|
|
return ec.fieldContext___Type_ofType(ctx, field)
|
|
case "specifiedByURL":
|
|
return ec.fieldContext___Type_specifiedByURL(ctx, field)
|
|
}
|
|
return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name)
|
|
},
|
|
}
|
|
return fc, nil
|
|
}
|
|
|
|
func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {
|
|
fc, err := ec.fieldContext___Type_specifiedByURL(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.SpecifiedByURL(), nil
|
|
})
|
|
if err != nil {
|
|
ec.Error(ctx, err)
|
|
return graphql.Null
|
|
}
|
|
if resTmp == nil {
|
|
return graphql.Null
|
|
}
|
|
res := resTmp.(*string)
|
|
fc.Result = res
|
|
return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
|
|
}
|
|
|
|
func (ec *executionContext) fieldContext___Type_specifiedByURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
fc = &graphql.FieldContext{
|
|
Object: "__Type",
|
|
Field: field,
|
|
IsMethod: true,
|
|
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
|
|
}
|
|
|
|
// endregion **************************** field.gotpl *****************************
|
|
|
|
// region **************************** input.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalInputBooleanFilter(ctx context.Context, obj interface{}) (model.BooleanFilter, error) {
|
|
var it model.BooleanFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"eq"}
|
|
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.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.Eq = data
|
|
} else if tmp == nil {
|
|
it.Eq = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputDateTimeFilter(ctx context.Context, obj interface{}) (model.DateTimeFilter, error) {
|
|
var it model.DateTimeFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"eq", "gt", "lt", "gte", "lte"}
|
|
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.unmarshalODateTime2ᚖtimeᚐTime(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *time.Time
|
|
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.(*time.Time); ok {
|
|
it.Eq = data
|
|
} else if tmp == nil {
|
|
it.Eq = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *time.Time`, 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.unmarshalODateTime2ᚖtimeᚐTime(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *time.Time
|
|
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.(*time.Time); ok {
|
|
it.Gt = data
|
|
} else if tmp == nil {
|
|
it.Gt = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *time.Time`, 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.unmarshalODateTime2ᚖtimeᚐTime(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *time.Time
|
|
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.(*time.Time); ok {
|
|
it.Lt = data
|
|
} else if tmp == nil {
|
|
it.Lt = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *time.Time`, 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.unmarshalODateTime2ᚖtimeᚐTime(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *time.Time
|
|
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.(*time.Time); ok {
|
|
it.Gte = data
|
|
} else if tmp == nil {
|
|
it.Gte = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *time.Time`, 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.unmarshalODateTime2ᚖtimeᚐTime(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *time.Time
|
|
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.(*time.Time); ok {
|
|
it.Lte = data
|
|
} else if tmp == nil {
|
|
it.Lte = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *time.Time`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputIntFilter(ctx context.Context, obj interface{}) (model.IntFilter, error) {
|
|
var it model.IntFilter
|
|
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.unmarshalOInt2ᚖint64(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *int64
|
|
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.(*int64); ok {
|
|
it.Eq = data
|
|
} else if tmp == nil {
|
|
it.Eq = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *int64`, 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.unmarshalOInt2ᚖint64(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *int64
|
|
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.(*int64); ok {
|
|
it.Gt = data
|
|
} else if tmp == nil {
|
|
it.Gt = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *int64`, 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.unmarshalOInt2ᚖint64(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *int64
|
|
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.(*int64); ok {
|
|
it.Lt = data
|
|
} else if tmp == nil {
|
|
it.Lt = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *int64`, 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.unmarshalOInt2ᚖint64(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *int64
|
|
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.(*int64); ok {
|
|
it.Gte = data
|
|
} else if tmp == nil {
|
|
it.Gte = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *int64`, 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.unmarshalOInt2ᚖint64(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *int64
|
|
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.(*int64); ok {
|
|
it.Lte = data
|
|
} else if tmp == nil {
|
|
it.Lte = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *int64`, 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.unmarshalOInt2ᚕint64ᚄ(ctx, v) }
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal []int64
|
|
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.([]int64); ok {
|
|
it.In = data
|
|
} else if tmp == nil {
|
|
it.In = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be []int64`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputPagination(ctx context.Context, obj interface{}) (model.Pagination, error) {
|
|
var it model.Pagination
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"offset", "limit"}
|
|
for _, k := range fieldsInOrder {
|
|
v, ok := asMap[k]
|
|
if !ok {
|
|
continue
|
|
}
|
|
switch k {
|
|
case "offset":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offset"))
|
|
data, err := ec.unmarshalNInt2int64(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Offset = data
|
|
case "limit":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit"))
|
|
data, err := ec.unmarshalNInt2int64(ctx, v)
|
|
if err != nil {
|
|
return it, err
|
|
}
|
|
it.Limit = data
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalInputStringFilter(ctx context.Context, obj interface{}) (model.StringFilter, error) {
|
|
var it model.StringFilter
|
|
asMap := map[string]interface{}{}
|
|
for k, v := range obj.(map[string]interface{}) {
|
|
asMap[k] = v
|
|
}
|
|
|
|
fieldsInOrder := [...]string{"eq", "substr", "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.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.Eq = data
|
|
} else if tmp == nil {
|
|
it.Eq = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
case "substr":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("substr"))
|
|
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.Substr = data
|
|
} else if tmp == nil {
|
|
it.Substr = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *string`, 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.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.In = data
|
|
} else if tmp == nil {
|
|
it.In = 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) 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"))
|
|
directive0 := func(ctx context.Context) (interface{}, error) {
|
|
return ec.unmarshalOStringFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐStringFilter(ctx, v)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *model.StringFilter
|
|
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.(*model.StringFilter); ok {
|
|
it.Infohash = data
|
|
} else if tmp == nil {
|
|
it.Infohash = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.StringFilter`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
case "name":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name"))
|
|
directive0 := func(ctx context.Context) (interface{}, error) {
|
|
return ec.unmarshalOStringFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐStringFilter(ctx, v)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *model.StringFilter
|
|
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.(*model.StringFilter); ok {
|
|
it.Name = data
|
|
} else if tmp == nil {
|
|
it.Name = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.StringFilter`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
case "bytesCompleted":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytesCompleted"))
|
|
directive0 := func(ctx context.Context) (interface{}, error) {
|
|
return ec.unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx, v)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *model.IntFilter
|
|
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.(*model.IntFilter); ok {
|
|
it.BytesCompleted = data
|
|
} else if tmp == nil {
|
|
it.BytesCompleted = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.IntFilter`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
case "bytesMissing":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytesMissing"))
|
|
directive0 := func(ctx context.Context) (interface{}, error) {
|
|
return ec.unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx, v)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *model.IntFilter
|
|
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.(*model.IntFilter); ok {
|
|
it.BytesMissing = data
|
|
} else if tmp == nil {
|
|
it.BytesMissing = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.IntFilter`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
case "peersCount":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("peersCount"))
|
|
directive0 := func(ctx context.Context) (interface{}, error) {
|
|
return ec.unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx, v)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *model.IntFilter
|
|
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.(*model.IntFilter); ok {
|
|
it.PeersCount = data
|
|
} else if tmp == nil {
|
|
it.PeersCount = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.IntFilter`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
case "priority":
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority"))
|
|
directive0 := func(ctx context.Context) (interface{}, error) {
|
|
return ec.unmarshalOTorrentPriorityFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐTorrentPriorityFilter(ctx, v)
|
|
}
|
|
|
|
directive1 := func(ctx context.Context) (interface{}, error) {
|
|
if ec.directives.OneOf == nil {
|
|
var zeroVal *model.TorrentPriorityFilter
|
|
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.(*model.TorrentPriorityFilter); ok {
|
|
it.Priority = data
|
|
} else if tmp == nil {
|
|
it.Priority = nil
|
|
} else {
|
|
err := fmt.Errorf(`unexpected type %T from directive, should be *git.kmsign.ru/royalcat/tstor/src/delivery/graphql/model.TorrentPriorityFilter`, tmp)
|
|
return it, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
}
|
|
}
|
|
|
|
return it, nil
|
|
}
|
|
|
|
// endregion **************************** input.gotpl *****************************
|
|
|
|
// region ************************** interface.gotpl ***************************
|
|
|
|
func (ec *executionContext) _Dir(ctx context.Context, sel ast.SelectionSet, obj model.Dir) graphql.Marshaler {
|
|
switch obj := (obj).(type) {
|
|
case nil:
|
|
return graphql.Null
|
|
case model.SimpleDir:
|
|
return ec._SimpleDir(ctx, sel, &obj)
|
|
case *model.SimpleDir:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._SimpleDir(ctx, sel, obj)
|
|
case model.ResolverFs:
|
|
return ec._ResolverFS(ctx, sel, &obj)
|
|
case *model.ResolverFs:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._ResolverFS(ctx, sel, obj)
|
|
case model.ArchiveFs:
|
|
return ec._ArchiveFS(ctx, sel, &obj)
|
|
case *model.ArchiveFs:
|
|
if obj == nil {
|
|
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))
|
|
}
|
|
}
|
|
|
|
func (ec *executionContext) _File(ctx context.Context, sel ast.SelectionSet, obj model.File) graphql.Marshaler {
|
|
switch obj := (obj).(type) {
|
|
case nil:
|
|
return graphql.Null
|
|
case model.SimpleFile:
|
|
return ec._SimpleFile(ctx, sel, &obj)
|
|
case *model.SimpleFile:
|
|
if obj == nil {
|
|
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))
|
|
}
|
|
}
|
|
|
|
func (ec *executionContext) _FsEntry(ctx context.Context, sel ast.SelectionSet, obj model.FsEntry) graphql.Marshaler {
|
|
switch obj := (obj).(type) {
|
|
case nil:
|
|
return graphql.Null
|
|
case model.SimpleDir:
|
|
return ec._SimpleDir(ctx, sel, &obj)
|
|
case *model.SimpleDir:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._SimpleDir(ctx, sel, obj)
|
|
case model.SimpleFile:
|
|
return ec._SimpleFile(ctx, sel, &obj)
|
|
case *model.SimpleFile:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._SimpleFile(ctx, sel, obj)
|
|
case model.ResolverFs:
|
|
return ec._ResolverFS(ctx, sel, &obj)
|
|
case *model.ResolverFs:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._ResolverFS(ctx, sel, obj)
|
|
case model.ArchiveFs:
|
|
return ec._ArchiveFS(ctx, sel, &obj)
|
|
case *model.ArchiveFs:
|
|
if obj == nil {
|
|
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
|
|
}
|
|
return ec._Dir(ctx, sel, obj)
|
|
case model.File:
|
|
if obj == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._File(ctx, sel, obj)
|
|
default:
|
|
panic(fmt.Errorf("unexpected type %T", obj))
|
|
}
|
|
}
|
|
|
|
func (ec *executionContext) _Progress(ctx context.Context, sel ast.SelectionSet, obj model.Progress) graphql.Marshaler {
|
|
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))
|
|
}
|
|
}
|
|
|
|
// endregion ************************** interface.gotpl ***************************
|
|
|
|
// region **************************** object.gotpl ****************************
|
|
|
|
var archiveFSImplementors = []string{"ArchiveFS", "Dir", "FsEntry"}
|
|
|
|
func (ec *executionContext) _ArchiveFS(ctx context.Context, sel ast.SelectionSet, obj *model.ArchiveFs) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, archiveFSImplementors)
|
|
|
|
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("ArchiveFS")
|
|
case "name":
|
|
out.Values[i] = ec._ArchiveFS_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "entries":
|
|
out.Values[i] = ec._ArchiveFS_entries(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "size":
|
|
out.Values[i] = ec._ArchiveFS_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 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 {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Mutation",
|
|
})
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
|
|
Object: field.Name,
|
|
Field: field,
|
|
})
|
|
|
|
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)
|
|
})
|
|
case "uploadFile":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_uploadFile(ctx, field)
|
|
})
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "dedupeStorage":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Mutation_dedupeStorage(ctx, field)
|
|
})
|
|
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 qBitCleanupResponseImplementors = []string{"QBitCleanupResponse"}
|
|
|
|
func (ec *executionContext) _QBitCleanupResponse(ctx context.Context, sel ast.SelectionSet, obj *model.QBitCleanupResponse) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, qBitCleanupResponseImplementors)
|
|
|
|
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("QBitCleanupResponse")
|
|
case "count":
|
|
out.Values[i] = ec._QBitCleanupResponse_count(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "hashes":
|
|
out.Values[i] = ec._QBitCleanupResponse_hashes(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 qBitTorrentDaemonMutationImplementors = []string{"QBitTorrentDaemonMutation"}
|
|
|
|
func (ec *executionContext) _QBitTorrentDaemonMutation(ctx context.Context, sel ast.SelectionSet, obj *model.QBitTorrentDaemonMutation) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, qBitTorrentDaemonMutationImplementors)
|
|
|
|
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("QBitTorrentDaemonMutation")
|
|
case "cleanup":
|
|
out.Values[i] = ec._QBitTorrentDaemonMutation_cleanup(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 qBitTorrentDaemonQueryImplementors = []string{"QBitTorrentDaemonQuery"}
|
|
|
|
func (ec *executionContext) _QBitTorrentDaemonQuery(ctx context.Context, sel ast.SelectionSet, obj *model.QBitTorrentDaemonQuery) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, qBitTorrentDaemonQueryImplementors)
|
|
|
|
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("QBitTorrentDaemonQuery")
|
|
case "torrents":
|
|
out.Values[i] = ec._QBitTorrentDaemonQuery_torrents(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 qTorrentImplementors = []string{"QTorrent"}
|
|
|
|
func (ec *executionContext) _QTorrent(ctx context.Context, sel ast.SelectionSet, obj *model.QTorrent) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, qTorrentImplementors)
|
|
|
|
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("QTorrent")
|
|
case "name":
|
|
out.Values[i] = ec._QTorrent_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "hash":
|
|
out.Values[i] = ec._QTorrent_hash(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "sourceFiles":
|
|
out.Values[i] = ec._QTorrent_sourceFiles(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 queryImplementors = []string{"Query"}
|
|
|
|
func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Query",
|
|
})
|
|
|
|
out := graphql.NewFieldSet(fields)
|
|
deferred := make(map[string]*graphql.FieldSet)
|
|
for i, field := range fields {
|
|
innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{
|
|
Object: field.Name,
|
|
Field: field,
|
|
})
|
|
|
|
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
|
|
|
|
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_qbitTorrentDaemon(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 "fsEntry":
|
|
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_fsEntry(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 "__type":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Query___type(ctx, field)
|
|
})
|
|
case "__schema":
|
|
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
|
|
return ec._Query___schema(ctx, field)
|
|
})
|
|
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 resolverFSImplementors = []string{"ResolverFS", "Dir", "FsEntry"}
|
|
|
|
func (ec *executionContext) _ResolverFS(ctx context.Context, sel ast.SelectionSet, obj *model.ResolverFs) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, resolverFSImplementors)
|
|
|
|
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("ResolverFS")
|
|
case "name":
|
|
out.Values[i] = ec._ResolverFS_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "entries":
|
|
out.Values[i] = ec._ResolverFS_entries(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 schemaImplementors = []string{"Schema"}
|
|
|
|
func (ec *executionContext) _Schema(ctx context.Context, sel ast.SelectionSet, obj *model.Schema) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, schemaImplementors)
|
|
|
|
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("Schema")
|
|
case "query":
|
|
out.Values[i] = ec._Schema_query(ctx, field, obj)
|
|
case "mutation":
|
|
out.Values[i] = ec._Schema_mutation(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 simpleDirImplementors = []string{"SimpleDir", "Dir", "FsEntry"}
|
|
|
|
func (ec *executionContext) _SimpleDir(ctx context.Context, sel ast.SelectionSet, obj *model.SimpleDir) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, simpleDirImplementors)
|
|
|
|
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("SimpleDir")
|
|
case "name":
|
|
out.Values[i] = ec._SimpleDir_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "entries":
|
|
out.Values[i] = ec._SimpleDir_entries(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 simpleFileImplementors = []string{"SimpleFile", "File", "FsEntry"}
|
|
|
|
func (ec *executionContext) _SimpleFile(ctx context.Context, sel ast.SelectionSet, obj *model.SimpleFile) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, simpleFileImplementors)
|
|
|
|
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("SimpleFile")
|
|
case "name":
|
|
out.Values[i] = ec._SimpleFile_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "size":
|
|
out.Values[i] = ec._SimpleFile_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 subscriptionImplementors = []string{"Subscription"}
|
|
|
|
func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func(ctx context.Context) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)
|
|
ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{
|
|
Object: "Subscription",
|
|
})
|
|
if len(fields) != 1 {
|
|
ec.Errorf(ctx, "must subscribe to exactly one stream")
|
|
return nil
|
|
}
|
|
|
|
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))
|
|
}
|
|
}
|
|
|
|
var taskImplementors = []string{"Task"}
|
|
|
|
func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj *model.Task) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, taskImplementors)
|
|
|
|
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("Task")
|
|
case "id":
|
|
out.Values[i] = ec._Task_id(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 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":
|
|
out.Values[i] = ec._Torrent_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "infohash":
|
|
out.Values[i] = ec._Torrent_infohash(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "bytesCompleted":
|
|
out.Values[i] = ec._Torrent_bytesCompleted(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "torrentFilePath":
|
|
out.Values[i] = ec._Torrent_torrentFilePath(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "bytesMissing":
|
|
out.Values[i] = ec._Torrent_bytesMissing(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "priority":
|
|
out.Values[i] = ec._Torrent_priority(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "files":
|
|
out.Values[i] = ec._Torrent_files(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "excludedFiles":
|
|
out.Values[i] = ec._Torrent_excludedFiles(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "peers":
|
|
out.Values[i] = ec._Torrent_peers(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 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":
|
|
out.Values[i] = ec._TorrentDaemonMutation_validateTorrent(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "setTorrentPriority":
|
|
out.Values[i] = ec._TorrentDaemonMutation_setTorrentPriority(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "cleanup":
|
|
out.Values[i] = ec._TorrentDaemonMutation_cleanup(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 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":
|
|
out.Values[i] = ec._TorrentDaemonQuery_torrents(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "clientStats":
|
|
out.Values[i] = ec._TorrentDaemonQuery_clientStats(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "statsHistory":
|
|
out.Values[i] = ec._TorrentDaemonQuery_statsHistory(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 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 {
|
|
out.Invalids++
|
|
}
|
|
case "torrent":
|
|
out.Values[i] = ec._TorrentFS_torrent(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "entries":
|
|
out.Values[i] = ec._TorrentFS_entries(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 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 {
|
|
out.Invalids++
|
|
}
|
|
case "size":
|
|
out.Values[i] = ec._TorrentFile_size(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "bytesCompleted":
|
|
out.Values[i] = ec._TorrentFile_bytesCompleted(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "priority":
|
|
out.Values[i] = ec._TorrentFile_priority(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 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 {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)
|
|
|
|
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("__Directive")
|
|
case "name":
|
|
out.Values[i] = ec.___Directive_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___Directive_description(ctx, field, obj)
|
|
case "locations":
|
|
out.Values[i] = ec.___Directive_locations(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "args":
|
|
out.Values[i] = ec.___Directive_args(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "isRepeatable":
|
|
out.Values[i] = ec.___Directive_isRepeatable(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 __EnumValueImplementors = []string{"__EnumValue"}
|
|
|
|
func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)
|
|
|
|
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("__EnumValue")
|
|
case "name":
|
|
out.Values[i] = ec.___EnumValue_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___EnumValue_description(ctx, field, obj)
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___EnumValue_deprecationReason(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 __FieldImplementors = []string{"__Field"}
|
|
|
|
func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)
|
|
|
|
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("__Field")
|
|
case "name":
|
|
out.Values[i] = ec.___Field_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___Field_description(ctx, field, obj)
|
|
case "args":
|
|
out.Values[i] = ec.___Field_args(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "type":
|
|
out.Values[i] = ec.___Field_type(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "isDeprecated":
|
|
out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "deprecationReason":
|
|
out.Values[i] = ec.___Field_deprecationReason(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 __InputValueImplementors = []string{"__InputValue"}
|
|
|
|
func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)
|
|
|
|
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("__InputValue")
|
|
case "name":
|
|
out.Values[i] = ec.___InputValue_name(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "description":
|
|
out.Values[i] = ec.___InputValue_description(ctx, field, obj)
|
|
case "type":
|
|
out.Values[i] = ec.___InputValue_type(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "defaultValue":
|
|
out.Values[i] = ec.___InputValue_defaultValue(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 __SchemaImplementors = []string{"__Schema"}
|
|
|
|
func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)
|
|
|
|
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("__Schema")
|
|
case "description":
|
|
out.Values[i] = ec.___Schema_description(ctx, field, obj)
|
|
case "types":
|
|
out.Values[i] = ec.___Schema_types(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "queryType":
|
|
out.Values[i] = ec.___Schema_queryType(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "mutationType":
|
|
out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)
|
|
case "subscriptionType":
|
|
out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)
|
|
case "directives":
|
|
out.Values[i] = ec.___Schema_directives(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 __TypeImplementors = []string{"__Type"}
|
|
|
|
func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {
|
|
fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)
|
|
|
|
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("__Type")
|
|
case "kind":
|
|
out.Values[i] = ec.___Type_kind(ctx, field, obj)
|
|
if out.Values[i] == graphql.Null {
|
|
out.Invalids++
|
|
}
|
|
case "name":
|
|
out.Values[i] = ec.___Type_name(ctx, field, obj)
|
|
case "description":
|
|
out.Values[i] = ec.___Type_description(ctx, field, obj)
|
|
case "fields":
|
|
out.Values[i] = ec.___Type_fields(ctx, field, obj)
|
|
case "interfaces":
|
|
out.Values[i] = ec.___Type_interfaces(ctx, field, obj)
|
|
case "possibleTypes":
|
|
out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)
|
|
case "enumValues":
|
|
out.Values[i] = ec.___Type_enumValues(ctx, field, obj)
|
|
case "inputFields":
|
|
out.Values[i] = ec.___Type_inputFields(ctx, field, obj)
|
|
case "ofType":
|
|
out.Values[i] = ec.___Type_ofType(ctx, field, obj)
|
|
case "specifiedByURL":
|
|
out.Values[i] = ec.___Type_specifiedByURL(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
|
|
}
|
|
|
|
// endregion **************************** object.gotpl ****************************
|
|
|
|
// region ***************************** type.gotpl *****************************
|
|
|
|
func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
|
|
res := graphql.MarshalBoolean(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) 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)) {
|
|
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
|
|
}
|
|
return graphql.Null
|
|
}
|
|
return ec._FsEntry(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNFsEntry2ᚕgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐFsEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []model.FsEntry) 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.marshalNFsEntry2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐFsEntry(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) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalID(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalID(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) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) {
|
|
res, err := graphql.UnmarshalInt64(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler {
|
|
res := graphql.MarshalInt64(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) marshalNQBitCleanupResponse2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQBitCleanupResponse(ctx context.Context, sel ast.SelectionSet, v *model.QBitCleanupResponse) 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._QBitCleanupResponse(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNQTorrent2ᚕᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQTorrentᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.QTorrent) 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.marshalNQTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQTorrent(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) marshalNQTorrent2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQTorrent(ctx context.Context, sel ast.SelectionSet, v *model.QTorrent) 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._QTorrent(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(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) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]string, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNString2string(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNString2string(ctx, sel, v[i])
|
|
}
|
|
|
|
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 {
|
|
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)
|
|
}
|
|
|
|
func (ec *executionContext) marshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v graphql.Upload) graphql.Marshaler {
|
|
res := graphql.MarshalUpload(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) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
|
|
return ec.___Directive(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) 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.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(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) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(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) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]string, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) 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.marshalN__DirectiveLocation2string(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) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {
|
|
return ec.___EnumValue(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {
|
|
return ec.___Field(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {
|
|
return ec.___InputValue(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) 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.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(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) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {
|
|
return ec.___Type(ctx, sel, &v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) 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.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(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) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) 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.___Type(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) {
|
|
res, err := graphql.UnmarshalString(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {
|
|
res := graphql.MarshalString(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) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) {
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {
|
|
res := graphql.MarshalBoolean(v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalBoolean(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalBoolean(*v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalODateTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalTime(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalODateTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalTime(*v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) marshalOFsEntry2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐFsEntry(ctx context.Context, sel ast.SelectionSet, v model.FsEntry) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._FsEntry(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOInt2ᚕint64ᚄ(ctx context.Context, v interface{}) ([]int64, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]int64, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNInt2int64(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalOInt2ᚕint64ᚄ(ctx context.Context, sel ast.SelectionSet, v []int64) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNInt2int64(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOInt2ᚖint64(ctx context.Context, v interface{}) (*int64, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalInt64(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOInt2ᚖint64(ctx context.Context, sel ast.SelectionSet, v *int64) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalInt64(*v)
|
|
return res
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOIntFilter2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐIntFilter(ctx context.Context, v interface{}) (*model.IntFilter, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := ec.unmarshalInputIntFilter(ctx, v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOMutation2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐMutation(ctx context.Context, sel ast.SelectionSet, v *model.Mutation) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Mutation(ctx, sel)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOProgress2gitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐProgress(ctx context.Context, sel ast.SelectionSet, v model.Progress) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Progress(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQBitTorrentDaemonMutation2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQBitTorrentDaemonMutation(ctx context.Context, sel ast.SelectionSet, v *model.QBitTorrentDaemonMutation) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._QBitTorrentDaemonMutation(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQBitTorrentDaemonQuery2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQBitTorrentDaemonQuery(ctx context.Context, sel ast.SelectionSet, v *model.QBitTorrentDaemonQuery) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._QBitTorrentDaemonQuery(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOQuery2ᚖgitᚗkmsignᚗruᚋroyalcatᚋtstorᚋsrcᚋdeliveryᚋgraphqlᚋmodelᚐQuery(ctx context.Context, sel ast.SelectionSet, v *model.Query) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec._Query(ctx, sel)
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
var vSlice []interface{}
|
|
if v != nil {
|
|
vSlice = graphql.CoerceList(v)
|
|
}
|
|
var err error
|
|
res := make([]string, len(vSlice))
|
|
for i := range vSlice {
|
|
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))
|
|
res[i], err = ec.unmarshalNString2string(ctx, vSlice[i])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
return res, nil
|
|
}
|
|
|
|
func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
ret := make(graphql.Array, len(v))
|
|
for i := range v {
|
|
ret[i] = ec.marshalNString2string(ctx, sel, v[i])
|
|
}
|
|
|
|
for _, e := range ret {
|
|
if e == graphql.Null {
|
|
return graphql.Null
|
|
}
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|
|
func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) {
|
|
if v == nil {
|
|
return nil, nil
|
|
}
|
|
res, err := graphql.UnmarshalString(v)
|
|
return &res, graphql.ErrorOnPath(ctx, err)
|
|
}
|
|
|
|
func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
res := graphql.MarshalString(*v)
|
|
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
|
|
}
|
|
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.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(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) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) 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.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(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) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) 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.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(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) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec.___Schema(ctx, sel, v)
|
|
}
|
|
|
|
func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) 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.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(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) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {
|
|
if v == nil {
|
|
return graphql.Null
|
|
}
|
|
return ec.___Type(ctx, sel, v)
|
|
}
|
|
|
|
// endregion ***************************** type.gotpl *****************************
|