added chat messages

This commit is contained in:
2022-01-29 19:32:13 +01:00
parent 2e6c94de81
commit b036275665
48 changed files with 4167 additions and 353 deletions

View File

@@ -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)