added chat messages
This commit is contained in:
@@ -34,6 +34,19 @@ func (f MatchPlayerFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value,
|
||||
return f(ctx, mv)
|
||||
}
|
||||
|
||||
// The MessagesFunc type is an adapter to allow the use of ordinary
|
||||
// function as Messages mutator.
|
||||
type MessagesFunc func(context.Context, *ent.MessagesMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f MessagesFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
mv, ok := m.(*ent.MessagesMutation)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.MessagesMutation", m)
|
||||
}
|
||||
return f(ctx, mv)
|
||||
}
|
||||
|
||||
// The PlayerFunc type is an adapter to allow the use of ordinary
|
||||
// function as Player mutator.
|
||||
type PlayerFunc func(context.Context, *ent.PlayerMutation) (ent.Value, error)
|
||||
|
Reference in New Issue
Block a user