mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
basic find download ability
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user