feat: add goreleaser

This commit is contained in:
Simon Ding
2024-09-29 14:27:01 +08:00
parent ce25c090f5
commit 5d726dbcf1
25 changed files with 2192 additions and 48 deletions

View File

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