basic find download ability

This commit is contained in:
Simon Ding
2024-07-01 11:35:28 +08:00
parent 3b7a444164
commit 6b7b24f912
32 changed files with 1785 additions and 118 deletions

View File

@@ -32,6 +32,18 @@ func (f EpidodesFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, er
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.EpidodesMutation", m)
}
// The HistoryFunc type is an adapter to allow the use of ordinary
// function as History mutator.
type HistoryFunc func(context.Context, *ent.HistoryMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f HistoryFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.HistoryMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.HistoryMutation", m)
}
// The IndexersFunc type is an adapter to allow the use of ordinary
// function as Indexers mutator.
type IndexersFunc func(context.Context, *ent.IndexersMutation) (ent.Value, error)