mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-06 10:07:45 +08:00
feat: add goreleaser
This commit is contained in:
@@ -8,6 +8,18 @@ import (
|
||||
"polaris/ent"
|
||||
)
|
||||
|
||||
// The BlocklistFunc type is an adapter to allow the use of ordinary
|
||||
// function as Blocklist mutator.
|
||||
type BlocklistFunc func(context.Context, *ent.BlocklistMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f BlocklistFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.BlocklistMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.BlocklistMutation", m)
|
||||
}
|
||||
|
||||
// The DownloadClientsFunc type is an adapter to allow the use of ordinary
|
||||
// function as DownloadClients mutator.
|
||||
type DownloadClientsFunc func(context.Context, *ent.DownloadClientsMutation) (ent.Value, error)
|
||||
|
||||
Reference in New Issue
Block a user