mirror of
https://github.com/simon-ding/polaris.git
synced 2026-02-06 23:21:00 +08:00
feat: api to add torrent hash to blacklist
This commit is contained in:
9
db/db.go
9
db/db.go
@@ -69,9 +69,9 @@ func (c *Client) init() {
|
||||
if tr := c.GetAllDonloadClients(); len(tr) == 0 {
|
||||
log.Warnf("no download client, set default download client")
|
||||
c.SaveDownloader(&ent.DownloadClients{
|
||||
Name: "transmission",
|
||||
Name: "transmission",
|
||||
Implementation: downloadclients.ImplementationTransmission,
|
||||
URL: "http://transmission:9091",
|
||||
URL: "http://transmission:9091",
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -339,7 +339,6 @@ func (c *Client) SaveDownloader(downloader *ent.DownloadClients) error {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
func (c *Client) GetAllDonloadClients() []*ent.DownloadClients {
|
||||
cc, err := c.ent.DownloadClients.Query().Order(ent.Asc(downloadclients.FieldPriority1)).All(context.TODO())
|
||||
if err != nil {
|
||||
@@ -657,3 +656,7 @@ func (c *Client) CleanAllDanglingEpisodes() error {
|
||||
_, err := c.ent.Episode.Delete().Where(episode.Not(episode.HasMedia())).Exec(context.Background())
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Client) AddBlacklistItem(item *ent.Blacklist) error {
|
||||
return c.ent.Blacklist.Create().SetType(item.Type).SetValue(item.Value).SetNotes(item.Notes).Exec(context.Background())
|
||||
}
|
||||
|
||||
@@ -3,34 +3,40 @@
|
||||
package ent
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/schema"
|
||||
"strings"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// Blocklist is the model entity for the Blocklist schema.
|
||||
type Blocklist struct {
|
||||
// Blacklist is the model entity for the Blacklist schema.
|
||||
type Blacklist struct {
|
||||
config `json:"-"`
|
||||
// ID of the ent.
|
||||
ID int `json:"id,omitempty"`
|
||||
// Type holds the value of the "type" field.
|
||||
Type blocklist.Type `json:"type,omitempty"`
|
||||
Type blacklist.Type `json:"type,omitempty"`
|
||||
// Value holds the value of the "value" field.
|
||||
Value string `json:"value,omitempty"`
|
||||
Value schema.BlacklistValue `json:"value,omitempty"`
|
||||
// Notes holds the value of the "notes" field.
|
||||
Notes string `json:"notes,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Blocklist) scanValues(columns []string) ([]any, error) {
|
||||
func (*Blacklist) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case blocklist.FieldID:
|
||||
case blacklist.FieldValue:
|
||||
values[i] = new([]byte)
|
||||
case blacklist.FieldID:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case blocklist.FieldType, blocklist.FieldValue:
|
||||
case blacklist.FieldType, blacklist.FieldNotes:
|
||||
values[i] = new(sql.NullString)
|
||||
default:
|
||||
values[i] = new(sql.UnknownType)
|
||||
@@ -40,30 +46,38 @@ func (*Blocklist) scanValues(columns []string) ([]any, error) {
|
||||
}
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Blocklist fields.
|
||||
func (b *Blocklist) assignValues(columns []string, values []any) error {
|
||||
// to the Blacklist fields.
|
||||
func (b *Blacklist) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case blocklist.FieldID:
|
||||
case blacklist.FieldID:
|
||||
value, ok := values[i].(*sql.NullInt64)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field id", value)
|
||||
}
|
||||
b.ID = int(value.Int64)
|
||||
case blocklist.FieldType:
|
||||
case blacklist.FieldType:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field type", values[i])
|
||||
} else if value.Valid {
|
||||
b.Type = blocklist.Type(value.String)
|
||||
b.Type = blacklist.Type(value.String)
|
||||
}
|
||||
case blocklist.FieldValue:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
case blacklist.FieldValue:
|
||||
if value, ok := values[i].(*[]byte); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field value", values[i])
|
||||
} else if value != nil && len(*value) > 0 {
|
||||
if err := json.Unmarshal(*value, &b.Value); err != nil {
|
||||
return fmt.Errorf("unmarshal field value: %w", err)
|
||||
}
|
||||
}
|
||||
case blacklist.FieldNotes:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field notes", values[i])
|
||||
} else if value.Valid {
|
||||
b.Value = value.String
|
||||
b.Notes = value.String
|
||||
}
|
||||
default:
|
||||
b.selectValues.Set(columns[i], values[i])
|
||||
@@ -72,43 +86,46 @@ func (b *Blocklist) assignValues(columns []string, values []any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetValue returns the ent.Value that was dynamically selected and assigned to the Blocklist.
|
||||
// GetValue returns the ent.Value that was dynamically selected and assigned to the Blacklist.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (b *Blocklist) GetValue(name string) (ent.Value, error) {
|
||||
func (b *Blacklist) GetValue(name string) (ent.Value, error) {
|
||||
return b.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this Blocklist.
|
||||
// Note that you need to call Blocklist.Unwrap() before calling this method if this Blocklist
|
||||
// Update returns a builder for updating this Blacklist.
|
||||
// Note that you need to call Blacklist.Unwrap() before calling this method if this Blacklist
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
func (b *Blocklist) Update() *BlocklistUpdateOne {
|
||||
return NewBlocklistClient(b.config).UpdateOne(b)
|
||||
func (b *Blacklist) Update() *BlacklistUpdateOne {
|
||||
return NewBlacklistClient(b.config).UpdateOne(b)
|
||||
}
|
||||
|
||||
// Unwrap unwraps the Blocklist entity that was returned from a transaction after it was closed,
|
||||
// Unwrap unwraps the Blacklist entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (b *Blocklist) Unwrap() *Blocklist {
|
||||
func (b *Blacklist) Unwrap() *Blacklist {
|
||||
_tx, ok := b.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Blocklist is not a transactional entity")
|
||||
panic("ent: Blacklist is not a transactional entity")
|
||||
}
|
||||
b.config.driver = _tx.drv
|
||||
return b
|
||||
}
|
||||
|
||||
// String implements the fmt.Stringer.
|
||||
func (b *Blocklist) String() string {
|
||||
func (b *Blacklist) String() string {
|
||||
var builder strings.Builder
|
||||
builder.WriteString("Blocklist(")
|
||||
builder.WriteString("Blacklist(")
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", b.ID))
|
||||
builder.WriteString("type=")
|
||||
builder.WriteString(fmt.Sprintf("%v", b.Type))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("value=")
|
||||
builder.WriteString(b.Value)
|
||||
builder.WriteString(fmt.Sprintf("%v", b.Value))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("notes=")
|
||||
builder.WriteString(b.Notes)
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
// Blocklists is a parsable slice of Blocklist.
|
||||
type Blocklists []*Blocklist
|
||||
// Blacklists is a parsable slice of Blacklist.
|
||||
type Blacklists []*Blacklist
|
||||
@@ -1,31 +1,35 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package blocklist
|
||||
package blacklist
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"polaris/ent/schema"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the blocklist type in the database.
|
||||
Label = "blocklist"
|
||||
// Label holds the string label denoting the blacklist type in the database.
|
||||
Label = "blacklist"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldType holds the string denoting the type field in the database.
|
||||
FieldType = "type"
|
||||
// FieldValue holds the string denoting the value field in the database.
|
||||
FieldValue = "value"
|
||||
// Table holds the table name of the blocklist in the database.
|
||||
Table = "blocklists"
|
||||
// FieldNotes holds the string denoting the notes field in the database.
|
||||
FieldNotes = "notes"
|
||||
// Table holds the table name of the blacklist in the database.
|
||||
Table = "blacklists"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for blocklist fields.
|
||||
// Columns holds all SQL columns for blacklist fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldType,
|
||||
FieldValue,
|
||||
FieldNotes,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
@@ -38,6 +42,11 @@ func ValidColumn(column string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// DefaultValue holds the default value on creation for the "value" field.
|
||||
DefaultValue schema.BlacklistValue
|
||||
)
|
||||
|
||||
// Type defines the type for the "type" enum field.
|
||||
type Type string
|
||||
|
||||
@@ -57,11 +66,11 @@ func TypeValidator(_type Type) error {
|
||||
case TypeMedia, TypeTorrent:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("blocklist: invalid enum value for type field: %q", _type)
|
||||
return fmt.Errorf("blacklist: invalid enum value for type field: %q", _type)
|
||||
}
|
||||
}
|
||||
|
||||
// OrderOption defines the ordering options for the Blocklist queries.
|
||||
// OrderOption defines the ordering options for the Blacklist queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
// ByID orders the results by the id field.
|
||||
@@ -74,7 +83,7 @@ func ByType(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldType, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByValue orders the results by the value field.
|
||||
func ByValue(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldValue, opts...).ToFunc()
|
||||
// ByNotes orders the results by the notes field.
|
||||
func ByNotes(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNotes, opts...).ToFunc()
|
||||
}
|
||||
169
ent/blacklist/where.go
Normal file
169
ent/blacklist/where.go
Normal file
@@ -0,0 +1,169 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package blacklist
|
||||
|
||||
import (
|
||||
"polaris/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Notes applies equality check predicate on the "notes" field. It's identical to NotesEQ.
|
||||
func Notes(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldEQ(FieldNotes, v))
|
||||
}
|
||||
|
||||
// TypeEQ applies the EQ predicate on the "type" field.
|
||||
func TypeEQ(v Type) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldEQ(FieldType, v))
|
||||
}
|
||||
|
||||
// TypeNEQ applies the NEQ predicate on the "type" field.
|
||||
func TypeNEQ(v Type) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNEQ(FieldType, v))
|
||||
}
|
||||
|
||||
// TypeIn applies the In predicate on the "type" field.
|
||||
func TypeIn(vs ...Type) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldIn(FieldType, vs...))
|
||||
}
|
||||
|
||||
// TypeNotIn applies the NotIn predicate on the "type" field.
|
||||
func TypeNotIn(vs ...Type) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNotIn(FieldType, vs...))
|
||||
}
|
||||
|
||||
// NotesEQ applies the EQ predicate on the "notes" field.
|
||||
func NotesEQ(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldEQ(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesNEQ applies the NEQ predicate on the "notes" field.
|
||||
func NotesNEQ(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNEQ(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesIn applies the In predicate on the "notes" field.
|
||||
func NotesIn(vs ...string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldIn(FieldNotes, vs...))
|
||||
}
|
||||
|
||||
// NotesNotIn applies the NotIn predicate on the "notes" field.
|
||||
func NotesNotIn(vs ...string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNotIn(FieldNotes, vs...))
|
||||
}
|
||||
|
||||
// NotesGT applies the GT predicate on the "notes" field.
|
||||
func NotesGT(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldGT(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesGTE applies the GTE predicate on the "notes" field.
|
||||
func NotesGTE(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldGTE(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesLT applies the LT predicate on the "notes" field.
|
||||
func NotesLT(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldLT(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesLTE applies the LTE predicate on the "notes" field.
|
||||
func NotesLTE(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldLTE(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesContains applies the Contains predicate on the "notes" field.
|
||||
func NotesContains(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldContains(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesHasPrefix applies the HasPrefix predicate on the "notes" field.
|
||||
func NotesHasPrefix(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldHasPrefix(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesHasSuffix applies the HasSuffix predicate on the "notes" field.
|
||||
func NotesHasSuffix(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldHasSuffix(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesIsNil applies the IsNil predicate on the "notes" field.
|
||||
func NotesIsNil() predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldIsNull(FieldNotes))
|
||||
}
|
||||
|
||||
// NotesNotNil applies the NotNil predicate on the "notes" field.
|
||||
func NotesNotNil() predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldNotNull(FieldNotes))
|
||||
}
|
||||
|
||||
// NotesEqualFold applies the EqualFold predicate on the "notes" field.
|
||||
func NotesEqualFold(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldEqualFold(FieldNotes, v))
|
||||
}
|
||||
|
||||
// NotesContainsFold applies the ContainsFold predicate on the "notes" field.
|
||||
func NotesContainsFold(v string) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.FieldContainsFold(FieldNotes, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Blacklist) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Blacklist) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Blacklist) predicate.Blacklist {
|
||||
return predicate.Blacklist(sql.NotPredicates(p))
|
||||
}
|
||||
@@ -6,43 +6,67 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/schema"
|
||||
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// BlocklistCreate is the builder for creating a Blocklist entity.
|
||||
type BlocklistCreate struct {
|
||||
// BlacklistCreate is the builder for creating a Blacklist entity.
|
||||
type BlacklistCreate struct {
|
||||
config
|
||||
mutation *BlocklistMutation
|
||||
mutation *BlacklistMutation
|
||||
hooks []Hook
|
||||
}
|
||||
|
||||
// SetType sets the "type" field.
|
||||
func (bc *BlocklistCreate) SetType(b blocklist.Type) *BlocklistCreate {
|
||||
func (bc *BlacklistCreate) SetType(b blacklist.Type) *BlacklistCreate {
|
||||
bc.mutation.SetType(b)
|
||||
return bc
|
||||
}
|
||||
|
||||
// SetValue sets the "value" field.
|
||||
func (bc *BlocklistCreate) SetValue(s string) *BlocklistCreate {
|
||||
bc.mutation.SetValue(s)
|
||||
func (bc *BlacklistCreate) SetValue(sv schema.BlacklistValue) *BlacklistCreate {
|
||||
bc.mutation.SetValue(sv)
|
||||
return bc
|
||||
}
|
||||
|
||||
// Mutation returns the BlocklistMutation object of the builder.
|
||||
func (bc *BlocklistCreate) Mutation() *BlocklistMutation {
|
||||
// SetNillableValue sets the "value" field if the given value is not nil.
|
||||
func (bc *BlacklistCreate) SetNillableValue(sv *schema.BlacklistValue) *BlacklistCreate {
|
||||
if sv != nil {
|
||||
bc.SetValue(*sv)
|
||||
}
|
||||
return bc
|
||||
}
|
||||
|
||||
// SetNotes sets the "notes" field.
|
||||
func (bc *BlacklistCreate) SetNotes(s string) *BlacklistCreate {
|
||||
bc.mutation.SetNotes(s)
|
||||
return bc
|
||||
}
|
||||
|
||||
// SetNillableNotes sets the "notes" field if the given value is not nil.
|
||||
func (bc *BlacklistCreate) SetNillableNotes(s *string) *BlacklistCreate {
|
||||
if s != nil {
|
||||
bc.SetNotes(*s)
|
||||
}
|
||||
return bc
|
||||
}
|
||||
|
||||
// Mutation returns the BlacklistMutation object of the builder.
|
||||
func (bc *BlacklistCreate) Mutation() *BlacklistMutation {
|
||||
return bc.mutation
|
||||
}
|
||||
|
||||
// Save creates the Blocklist in the database.
|
||||
func (bc *BlocklistCreate) Save(ctx context.Context) (*Blocklist, error) {
|
||||
// Save creates the Blacklist in the database.
|
||||
func (bc *BlacklistCreate) Save(ctx context.Context) (*Blacklist, error) {
|
||||
bc.defaults()
|
||||
return withHooks(ctx, bc.sqlSave, bc.mutation, bc.hooks)
|
||||
}
|
||||
|
||||
// SaveX calls Save and panics if Save returns an error.
|
||||
func (bc *BlocklistCreate) SaveX(ctx context.Context) *Blocklist {
|
||||
func (bc *BlacklistCreate) SaveX(ctx context.Context) *Blacklist {
|
||||
v, err := bc.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -51,35 +75,43 @@ func (bc *BlocklistCreate) SaveX(ctx context.Context) *Blocklist {
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (bc *BlocklistCreate) Exec(ctx context.Context) error {
|
||||
func (bc *BlacklistCreate) Exec(ctx context.Context) error {
|
||||
_, err := bc.Save(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (bc *BlocklistCreate) ExecX(ctx context.Context) {
|
||||
func (bc *BlacklistCreate) ExecX(ctx context.Context) {
|
||||
if err := bc.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// defaults sets the default values of the builder before save.
|
||||
func (bc *BlacklistCreate) defaults() {
|
||||
if _, ok := bc.mutation.Value(); !ok {
|
||||
v := blacklist.DefaultValue
|
||||
bc.mutation.SetValue(v)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (bc *BlocklistCreate) check() error {
|
||||
func (bc *BlacklistCreate) check() error {
|
||||
if _, ok := bc.mutation.GetType(); !ok {
|
||||
return &ValidationError{Name: "type", err: errors.New(`ent: missing required field "Blocklist.type"`)}
|
||||
return &ValidationError{Name: "type", err: errors.New(`ent: missing required field "Blacklist.type"`)}
|
||||
}
|
||||
if v, ok := bc.mutation.GetType(); ok {
|
||||
if err := blocklist.TypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blocklist.type": %w`, err)}
|
||||
if err := blacklist.TypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blacklist.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := bc.mutation.Value(); !ok {
|
||||
return &ValidationError{Name: "value", err: errors.New(`ent: missing required field "Blocklist.value"`)}
|
||||
return &ValidationError{Name: "value", err: errors.New(`ent: missing required field "Blacklist.value"`)}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (bc *BlocklistCreate) sqlSave(ctx context.Context) (*Blocklist, error) {
|
||||
func (bc *BlacklistCreate) sqlSave(ctx context.Context) (*Blacklist, error) {
|
||||
if err := bc.check(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -97,42 +129,47 @@ func (bc *BlocklistCreate) sqlSave(ctx context.Context) (*Blocklist, error) {
|
||||
return _node, nil
|
||||
}
|
||||
|
||||
func (bc *BlocklistCreate) createSpec() (*Blocklist, *sqlgraph.CreateSpec) {
|
||||
func (bc *BlacklistCreate) createSpec() (*Blacklist, *sqlgraph.CreateSpec) {
|
||||
var (
|
||||
_node = &Blocklist{config: bc.config}
|
||||
_spec = sqlgraph.NewCreateSpec(blocklist.Table, sqlgraph.NewFieldSpec(blocklist.FieldID, field.TypeInt))
|
||||
_node = &Blacklist{config: bc.config}
|
||||
_spec = sqlgraph.NewCreateSpec(blacklist.Table, sqlgraph.NewFieldSpec(blacklist.FieldID, field.TypeInt))
|
||||
)
|
||||
if value, ok := bc.mutation.GetType(); ok {
|
||||
_spec.SetField(blocklist.FieldType, field.TypeEnum, value)
|
||||
_spec.SetField(blacklist.FieldType, field.TypeEnum, value)
|
||||
_node.Type = value
|
||||
}
|
||||
if value, ok := bc.mutation.Value(); ok {
|
||||
_spec.SetField(blocklist.FieldValue, field.TypeString, value)
|
||||
_spec.SetField(blacklist.FieldValue, field.TypeJSON, value)
|
||||
_node.Value = value
|
||||
}
|
||||
if value, ok := bc.mutation.Notes(); ok {
|
||||
_spec.SetField(blacklist.FieldNotes, field.TypeString, value)
|
||||
_node.Notes = value
|
||||
}
|
||||
return _node, _spec
|
||||
}
|
||||
|
||||
// BlocklistCreateBulk is the builder for creating many Blocklist entities in bulk.
|
||||
type BlocklistCreateBulk struct {
|
||||
// BlacklistCreateBulk is the builder for creating many Blacklist entities in bulk.
|
||||
type BlacklistCreateBulk struct {
|
||||
config
|
||||
err error
|
||||
builders []*BlocklistCreate
|
||||
builders []*BlacklistCreate
|
||||
}
|
||||
|
||||
// Save creates the Blocklist entities in the database.
|
||||
func (bcb *BlocklistCreateBulk) Save(ctx context.Context) ([]*Blocklist, error) {
|
||||
// Save creates the Blacklist entities in the database.
|
||||
func (bcb *BlacklistCreateBulk) Save(ctx context.Context) ([]*Blacklist, error) {
|
||||
if bcb.err != nil {
|
||||
return nil, bcb.err
|
||||
}
|
||||
specs := make([]*sqlgraph.CreateSpec, len(bcb.builders))
|
||||
nodes := make([]*Blocklist, len(bcb.builders))
|
||||
nodes := make([]*Blacklist, len(bcb.builders))
|
||||
mutators := make([]Mutator, len(bcb.builders))
|
||||
for i := range bcb.builders {
|
||||
func(i int, root context.Context) {
|
||||
builder := bcb.builders[i]
|
||||
builder.defaults()
|
||||
var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
|
||||
mutation, ok := m.(*BlocklistMutation)
|
||||
mutation, ok := m.(*BlacklistMutation)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected mutation type %T", m)
|
||||
}
|
||||
@@ -179,7 +216,7 @@ func (bcb *BlocklistCreateBulk) Save(ctx context.Context) ([]*Blocklist, error)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func (bcb *BlocklistCreateBulk) SaveX(ctx context.Context) []*Blocklist {
|
||||
func (bcb *BlacklistCreateBulk) SaveX(ctx context.Context) []*Blacklist {
|
||||
v, err := bcb.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -188,13 +225,13 @@ func (bcb *BlocklistCreateBulk) SaveX(ctx context.Context) []*Blocklist {
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (bcb *BlocklistCreateBulk) Exec(ctx context.Context) error {
|
||||
func (bcb *BlacklistCreateBulk) Exec(ctx context.Context) error {
|
||||
_, err := bcb.Save(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (bcb *BlocklistCreateBulk) ExecX(ctx context.Context) {
|
||||
func (bcb *BlacklistCreateBulk) ExecX(ctx context.Context) {
|
||||
if err := bcb.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -4,7 +4,7 @@ package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
@@ -12,26 +12,26 @@ import (
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// BlocklistDelete is the builder for deleting a Blocklist entity.
|
||||
type BlocklistDelete struct {
|
||||
// BlacklistDelete is the builder for deleting a Blacklist entity.
|
||||
type BlacklistDelete struct {
|
||||
config
|
||||
hooks []Hook
|
||||
mutation *BlocklistMutation
|
||||
mutation *BlacklistMutation
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlocklistDelete builder.
|
||||
func (bd *BlocklistDelete) Where(ps ...predicate.Blocklist) *BlocklistDelete {
|
||||
// Where appends a list predicates to the BlacklistDelete builder.
|
||||
func (bd *BlacklistDelete) Where(ps ...predicate.Blacklist) *BlacklistDelete {
|
||||
bd.mutation.Where(ps...)
|
||||
return bd
|
||||
}
|
||||
|
||||
// Exec executes the deletion query and returns how many vertices were deleted.
|
||||
func (bd *BlocklistDelete) Exec(ctx context.Context) (int, error) {
|
||||
func (bd *BlacklistDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks(ctx, bd.sqlExec, bd.mutation, bd.hooks)
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (bd *BlocklistDelete) ExecX(ctx context.Context) int {
|
||||
func (bd *BlacklistDelete) ExecX(ctx context.Context) int {
|
||||
n, err := bd.Exec(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -39,8 +39,8 @@ func (bd *BlocklistDelete) ExecX(ctx context.Context) int {
|
||||
return n
|
||||
}
|
||||
|
||||
func (bd *BlocklistDelete) sqlExec(ctx context.Context) (int, error) {
|
||||
_spec := sqlgraph.NewDeleteSpec(blocklist.Table, sqlgraph.NewFieldSpec(blocklist.FieldID, field.TypeInt))
|
||||
func (bd *BlacklistDelete) sqlExec(ctx context.Context) (int, error) {
|
||||
_spec := sqlgraph.NewDeleteSpec(blacklist.Table, sqlgraph.NewFieldSpec(blacklist.FieldID, field.TypeInt))
|
||||
if ps := bd.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
@@ -56,32 +56,32 @@ func (bd *BlocklistDelete) sqlExec(ctx context.Context) (int, error) {
|
||||
return affected, err
|
||||
}
|
||||
|
||||
// BlocklistDeleteOne is the builder for deleting a single Blocklist entity.
|
||||
type BlocklistDeleteOne struct {
|
||||
bd *BlocklistDelete
|
||||
// BlacklistDeleteOne is the builder for deleting a single Blacklist entity.
|
||||
type BlacklistDeleteOne struct {
|
||||
bd *BlacklistDelete
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlocklistDelete builder.
|
||||
func (bdo *BlocklistDeleteOne) Where(ps ...predicate.Blocklist) *BlocklistDeleteOne {
|
||||
// Where appends a list predicates to the BlacklistDelete builder.
|
||||
func (bdo *BlacklistDeleteOne) Where(ps ...predicate.Blacklist) *BlacklistDeleteOne {
|
||||
bdo.bd.mutation.Where(ps...)
|
||||
return bdo
|
||||
}
|
||||
|
||||
// Exec executes the deletion query.
|
||||
func (bdo *BlocklistDeleteOne) Exec(ctx context.Context) error {
|
||||
func (bdo *BlacklistDeleteOne) Exec(ctx context.Context) error {
|
||||
n, err := bdo.bd.Exec(ctx)
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case n == 0:
|
||||
return &NotFoundError{blocklist.Label}
|
||||
return &NotFoundError{blacklist.Label}
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (bdo *BlocklistDeleteOne) ExecX(ctx context.Context) {
|
||||
func (bdo *BlacklistDeleteOne) ExecX(ctx context.Context) {
|
||||
if err := bdo.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
@@ -14,64 +14,64 @@ import (
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// BlocklistQuery is the builder for querying Blocklist entities.
|
||||
type BlocklistQuery struct {
|
||||
// BlacklistQuery is the builder for querying Blacklist entities.
|
||||
type BlacklistQuery struct {
|
||||
config
|
||||
ctx *QueryContext
|
||||
order []blocklist.OrderOption
|
||||
order []blacklist.OrderOption
|
||||
inters []Interceptor
|
||||
predicates []predicate.Blocklist
|
||||
predicates []predicate.Blacklist
|
||||
// intermediate query (i.e. traversal path).
|
||||
sql *sql.Selector
|
||||
path func(context.Context) (*sql.Selector, error)
|
||||
}
|
||||
|
||||
// Where adds a new predicate for the BlocklistQuery builder.
|
||||
func (bq *BlocklistQuery) Where(ps ...predicate.Blocklist) *BlocklistQuery {
|
||||
// Where adds a new predicate for the BlacklistQuery builder.
|
||||
func (bq *BlacklistQuery) Where(ps ...predicate.Blacklist) *BlacklistQuery {
|
||||
bq.predicates = append(bq.predicates, ps...)
|
||||
return bq
|
||||
}
|
||||
|
||||
// Limit the number of records to be returned by this query.
|
||||
func (bq *BlocklistQuery) Limit(limit int) *BlocklistQuery {
|
||||
func (bq *BlacklistQuery) Limit(limit int) *BlacklistQuery {
|
||||
bq.ctx.Limit = &limit
|
||||
return bq
|
||||
}
|
||||
|
||||
// Offset to start from.
|
||||
func (bq *BlocklistQuery) Offset(offset int) *BlocklistQuery {
|
||||
func (bq *BlacklistQuery) Offset(offset int) *BlacklistQuery {
|
||||
bq.ctx.Offset = &offset
|
||||
return bq
|
||||
}
|
||||
|
||||
// Unique configures the query builder to filter duplicate records on query.
|
||||
// By default, unique is set to true, and can be disabled using this method.
|
||||
func (bq *BlocklistQuery) Unique(unique bool) *BlocklistQuery {
|
||||
func (bq *BlacklistQuery) Unique(unique bool) *BlacklistQuery {
|
||||
bq.ctx.Unique = &unique
|
||||
return bq
|
||||
}
|
||||
|
||||
// Order specifies how the records should be ordered.
|
||||
func (bq *BlocklistQuery) Order(o ...blocklist.OrderOption) *BlocklistQuery {
|
||||
func (bq *BlacklistQuery) Order(o ...blacklist.OrderOption) *BlacklistQuery {
|
||||
bq.order = append(bq.order, o...)
|
||||
return bq
|
||||
}
|
||||
|
||||
// First returns the first Blocklist entity from the query.
|
||||
// Returns a *NotFoundError when no Blocklist was found.
|
||||
func (bq *BlocklistQuery) First(ctx context.Context) (*Blocklist, error) {
|
||||
// First returns the first Blacklist entity from the query.
|
||||
// Returns a *NotFoundError when no Blacklist was found.
|
||||
func (bq *BlacklistQuery) First(ctx context.Context) (*Blacklist, error) {
|
||||
nodes, err := bq.Limit(1).All(setContextOp(ctx, bq.ctx, "First"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(nodes) == 0 {
|
||||
return nil, &NotFoundError{blocklist.Label}
|
||||
return nil, &NotFoundError{blacklist.Label}
|
||||
}
|
||||
return nodes[0], nil
|
||||
}
|
||||
|
||||
// FirstX is like First, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) FirstX(ctx context.Context) *Blocklist {
|
||||
func (bq *BlacklistQuery) FirstX(ctx context.Context) *Blacklist {
|
||||
node, err := bq.First(ctx)
|
||||
if err != nil && !IsNotFound(err) {
|
||||
panic(err)
|
||||
@@ -79,22 +79,22 @@ func (bq *BlocklistQuery) FirstX(ctx context.Context) *Blocklist {
|
||||
return node
|
||||
}
|
||||
|
||||
// FirstID returns the first Blocklist ID from the query.
|
||||
// Returns a *NotFoundError when no Blocklist ID was found.
|
||||
func (bq *BlocklistQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
// FirstID returns the first Blacklist ID from the query.
|
||||
// Returns a *NotFoundError when no Blacklist ID was found.
|
||||
func (bq *BlacklistQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = bq.Limit(1).IDs(setContextOp(ctx, bq.ctx, "FirstID")); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
err = &NotFoundError{blocklist.Label}
|
||||
err = &NotFoundError{blacklist.Label}
|
||||
return
|
||||
}
|
||||
return ids[0], nil
|
||||
}
|
||||
|
||||
// FirstIDX is like FirstID, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) FirstIDX(ctx context.Context) int {
|
||||
func (bq *BlacklistQuery) FirstIDX(ctx context.Context) int {
|
||||
id, err := bq.FirstID(ctx)
|
||||
if err != nil && !IsNotFound(err) {
|
||||
panic(err)
|
||||
@@ -102,10 +102,10 @@ func (bq *BlocklistQuery) FirstIDX(ctx context.Context) int {
|
||||
return id
|
||||
}
|
||||
|
||||
// Only returns a single Blocklist entity found by the query, ensuring it only returns one.
|
||||
// Returns a *NotSingularError when more than one Blocklist entity is found.
|
||||
// Returns a *NotFoundError when no Blocklist entities are found.
|
||||
func (bq *BlocklistQuery) Only(ctx context.Context) (*Blocklist, error) {
|
||||
// Only returns a single Blacklist entity found by the query, ensuring it only returns one.
|
||||
// Returns a *NotSingularError when more than one Blacklist entity is found.
|
||||
// Returns a *NotFoundError when no Blacklist entities are found.
|
||||
func (bq *BlacklistQuery) Only(ctx context.Context) (*Blacklist, error) {
|
||||
nodes, err := bq.Limit(2).All(setContextOp(ctx, bq.ctx, "Only"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -114,14 +114,14 @@ func (bq *BlocklistQuery) Only(ctx context.Context) (*Blocklist, error) {
|
||||
case 1:
|
||||
return nodes[0], nil
|
||||
case 0:
|
||||
return nil, &NotFoundError{blocklist.Label}
|
||||
return nil, &NotFoundError{blacklist.Label}
|
||||
default:
|
||||
return nil, &NotSingularError{blocklist.Label}
|
||||
return nil, &NotSingularError{blacklist.Label}
|
||||
}
|
||||
}
|
||||
|
||||
// OnlyX is like Only, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) OnlyX(ctx context.Context) *Blocklist {
|
||||
func (bq *BlacklistQuery) OnlyX(ctx context.Context) *Blacklist {
|
||||
node, err := bq.Only(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -129,10 +129,10 @@ func (bq *BlocklistQuery) OnlyX(ctx context.Context) *Blocklist {
|
||||
return node
|
||||
}
|
||||
|
||||
// OnlyID is like Only, but returns the only Blocklist ID in the query.
|
||||
// Returns a *NotSingularError when more than one Blocklist ID is found.
|
||||
// OnlyID is like Only, but returns the only Blacklist ID in the query.
|
||||
// Returns a *NotSingularError when more than one Blacklist ID is found.
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (bq *BlocklistQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
func (bq *BlacklistQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = bq.Limit(2).IDs(setContextOp(ctx, bq.ctx, "OnlyID")); err != nil {
|
||||
return
|
||||
@@ -141,15 +141,15 @@ func (bq *BlocklistQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
case 1:
|
||||
id = ids[0]
|
||||
case 0:
|
||||
err = &NotFoundError{blocklist.Label}
|
||||
err = &NotFoundError{blacklist.Label}
|
||||
default:
|
||||
err = &NotSingularError{blocklist.Label}
|
||||
err = &NotSingularError{blacklist.Label}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// OnlyIDX is like OnlyID, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) OnlyIDX(ctx context.Context) int {
|
||||
func (bq *BlacklistQuery) OnlyIDX(ctx context.Context) int {
|
||||
id, err := bq.OnlyID(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -157,18 +157,18 @@ func (bq *BlocklistQuery) OnlyIDX(ctx context.Context) int {
|
||||
return id
|
||||
}
|
||||
|
||||
// All executes the query and returns a list of Blocklists.
|
||||
func (bq *BlocklistQuery) All(ctx context.Context) ([]*Blocklist, error) {
|
||||
// All executes the query and returns a list of Blacklists.
|
||||
func (bq *BlacklistQuery) All(ctx context.Context) ([]*Blacklist, error) {
|
||||
ctx = setContextOp(ctx, bq.ctx, "All")
|
||||
if err := bq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
qr := querierAll[[]*Blocklist, *BlocklistQuery]()
|
||||
return withInterceptors[[]*Blocklist](ctx, bq, qr, bq.inters)
|
||||
qr := querierAll[[]*Blacklist, *BlacklistQuery]()
|
||||
return withInterceptors[[]*Blacklist](ctx, bq, qr, bq.inters)
|
||||
}
|
||||
|
||||
// AllX is like All, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) AllX(ctx context.Context) []*Blocklist {
|
||||
func (bq *BlacklistQuery) AllX(ctx context.Context) []*Blacklist {
|
||||
nodes, err := bq.All(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -176,20 +176,20 @@ func (bq *BlocklistQuery) AllX(ctx context.Context) []*Blocklist {
|
||||
return nodes
|
||||
}
|
||||
|
||||
// IDs executes the query and returns a list of Blocklist IDs.
|
||||
func (bq *BlocklistQuery) IDs(ctx context.Context) (ids []int, err error) {
|
||||
// IDs executes the query and returns a list of Blacklist IDs.
|
||||
func (bq *BlacklistQuery) IDs(ctx context.Context) (ids []int, err error) {
|
||||
if bq.ctx.Unique == nil && bq.path != nil {
|
||||
bq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, bq.ctx, "IDs")
|
||||
if err = bq.Select(blocklist.FieldID).Scan(ctx, &ids); err != nil {
|
||||
if err = bq.Select(blacklist.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ids, nil
|
||||
}
|
||||
|
||||
// IDsX is like IDs, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) IDsX(ctx context.Context) []int {
|
||||
func (bq *BlacklistQuery) IDsX(ctx context.Context) []int {
|
||||
ids, err := bq.IDs(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -198,16 +198,16 @@ func (bq *BlocklistQuery) IDsX(ctx context.Context) []int {
|
||||
}
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (bq *BlocklistQuery) Count(ctx context.Context) (int, error) {
|
||||
func (bq *BlacklistQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, bq.ctx, "Count")
|
||||
if err := bq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return withInterceptors[int](ctx, bq, querierCount[*BlocklistQuery](), bq.inters)
|
||||
return withInterceptors[int](ctx, bq, querierCount[*BlacklistQuery](), bq.inters)
|
||||
}
|
||||
|
||||
// CountX is like Count, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) CountX(ctx context.Context) int {
|
||||
func (bq *BlacklistQuery) CountX(ctx context.Context) int {
|
||||
count, err := bq.Count(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -216,7 +216,7 @@ func (bq *BlocklistQuery) CountX(ctx context.Context) int {
|
||||
}
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (bq *BlocklistQuery) Exist(ctx context.Context) (bool, error) {
|
||||
func (bq *BlacklistQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, bq.ctx, "Exist")
|
||||
switch _, err := bq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
@@ -229,7 +229,7 @@ func (bq *BlocklistQuery) Exist(ctx context.Context) (bool, error) {
|
||||
}
|
||||
|
||||
// ExistX is like Exist, but panics if an error occurs.
|
||||
func (bq *BlocklistQuery) ExistX(ctx context.Context) bool {
|
||||
func (bq *BlacklistQuery) ExistX(ctx context.Context) bool {
|
||||
exist, err := bq.Exist(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -237,18 +237,18 @@ func (bq *BlocklistQuery) ExistX(ctx context.Context) bool {
|
||||
return exist
|
||||
}
|
||||
|
||||
// Clone returns a duplicate of the BlocklistQuery builder, including all associated steps. It can be
|
||||
// Clone returns a duplicate of the BlacklistQuery builder, including all associated steps. It can be
|
||||
// used to prepare common query builders and use them differently after the clone is made.
|
||||
func (bq *BlocklistQuery) Clone() *BlocklistQuery {
|
||||
func (bq *BlacklistQuery) Clone() *BlacklistQuery {
|
||||
if bq == nil {
|
||||
return nil
|
||||
}
|
||||
return &BlocklistQuery{
|
||||
return &BlacklistQuery{
|
||||
config: bq.config,
|
||||
ctx: bq.ctx.Clone(),
|
||||
order: append([]blocklist.OrderOption{}, bq.order...),
|
||||
order: append([]blacklist.OrderOption{}, bq.order...),
|
||||
inters: append([]Interceptor{}, bq.inters...),
|
||||
predicates: append([]predicate.Blocklist{}, bq.predicates...),
|
||||
predicates: append([]predicate.Blacklist{}, bq.predicates...),
|
||||
// clone intermediate query.
|
||||
sql: bq.sql.Clone(),
|
||||
path: bq.path,
|
||||
@@ -261,19 +261,19 @@ func (bq *BlocklistQuery) Clone() *BlocklistQuery {
|
||||
// Example:
|
||||
//
|
||||
// var v []struct {
|
||||
// Type blocklist.Type `json:"type,omitempty"`
|
||||
// Type blacklist.Type `json:"type,omitempty"`
|
||||
// Count int `json:"count,omitempty"`
|
||||
// }
|
||||
//
|
||||
// client.Blocklist.Query().
|
||||
// GroupBy(blocklist.FieldType).
|
||||
// client.Blacklist.Query().
|
||||
// GroupBy(blacklist.FieldType).
|
||||
// Aggregate(ent.Count()).
|
||||
// Scan(ctx, &v)
|
||||
func (bq *BlocklistQuery) GroupBy(field string, fields ...string) *BlocklistGroupBy {
|
||||
func (bq *BlacklistQuery) GroupBy(field string, fields ...string) *BlacklistGroupBy {
|
||||
bq.ctx.Fields = append([]string{field}, fields...)
|
||||
grbuild := &BlocklistGroupBy{build: bq}
|
||||
grbuild := &BlacklistGroupBy{build: bq}
|
||||
grbuild.flds = &bq.ctx.Fields
|
||||
grbuild.label = blocklist.Label
|
||||
grbuild.label = blacklist.Label
|
||||
grbuild.scan = grbuild.Scan
|
||||
return grbuild
|
||||
}
|
||||
@@ -284,26 +284,26 @@ func (bq *BlocklistQuery) GroupBy(field string, fields ...string) *BlocklistGrou
|
||||
// Example:
|
||||
//
|
||||
// var v []struct {
|
||||
// Type blocklist.Type `json:"type,omitempty"`
|
||||
// Type blacklist.Type `json:"type,omitempty"`
|
||||
// }
|
||||
//
|
||||
// client.Blocklist.Query().
|
||||
// Select(blocklist.FieldType).
|
||||
// client.Blacklist.Query().
|
||||
// Select(blacklist.FieldType).
|
||||
// Scan(ctx, &v)
|
||||
func (bq *BlocklistQuery) Select(fields ...string) *BlocklistSelect {
|
||||
func (bq *BlacklistQuery) Select(fields ...string) *BlacklistSelect {
|
||||
bq.ctx.Fields = append(bq.ctx.Fields, fields...)
|
||||
sbuild := &BlocklistSelect{BlocklistQuery: bq}
|
||||
sbuild.label = blocklist.Label
|
||||
sbuild := &BlacklistSelect{BlacklistQuery: bq}
|
||||
sbuild.label = blacklist.Label
|
||||
sbuild.flds, sbuild.scan = &bq.ctx.Fields, sbuild.Scan
|
||||
return sbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a BlocklistSelect configured with the given aggregations.
|
||||
func (bq *BlocklistQuery) Aggregate(fns ...AggregateFunc) *BlocklistSelect {
|
||||
// Aggregate returns a BlacklistSelect configured with the given aggregations.
|
||||
func (bq *BlacklistQuery) Aggregate(fns ...AggregateFunc) *BlacklistSelect {
|
||||
return bq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (bq *BlocklistQuery) prepareQuery(ctx context.Context) error {
|
||||
func (bq *BlacklistQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, inter := range bq.inters {
|
||||
if inter == nil {
|
||||
return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
|
||||
@@ -315,7 +315,7 @@ func (bq *BlocklistQuery) prepareQuery(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
for _, f := range bq.ctx.Fields {
|
||||
if !blocklist.ValidColumn(f) {
|
||||
if !blacklist.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
|
||||
}
|
||||
}
|
||||
@@ -329,16 +329,16 @@ func (bq *BlocklistQuery) prepareQuery(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (bq *BlocklistQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Blocklist, error) {
|
||||
func (bq *BlacklistQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Blacklist, error) {
|
||||
var (
|
||||
nodes = []*Blocklist{}
|
||||
nodes = []*Blacklist{}
|
||||
_spec = bq.querySpec()
|
||||
)
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*Blocklist).scanValues(nil, columns)
|
||||
return (*Blacklist).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &Blocklist{config: bq.config}
|
||||
node := &Blacklist{config: bq.config}
|
||||
nodes = append(nodes, node)
|
||||
return node.assignValues(columns, values)
|
||||
}
|
||||
@@ -354,7 +354,7 @@ func (bq *BlocklistQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Bl
|
||||
return nodes, nil
|
||||
}
|
||||
|
||||
func (bq *BlocklistQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
func (bq *BlacklistQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
_spec := bq.querySpec()
|
||||
_spec.Node.Columns = bq.ctx.Fields
|
||||
if len(bq.ctx.Fields) > 0 {
|
||||
@@ -363,8 +363,8 @@ func (bq *BlocklistQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
return sqlgraph.CountNodes(ctx, bq.driver, _spec)
|
||||
}
|
||||
|
||||
func (bq *BlocklistQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
_spec := sqlgraph.NewQuerySpec(blocklist.Table, blocklist.Columns, sqlgraph.NewFieldSpec(blocklist.FieldID, field.TypeInt))
|
||||
func (bq *BlacklistQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
_spec := sqlgraph.NewQuerySpec(blacklist.Table, blacklist.Columns, sqlgraph.NewFieldSpec(blacklist.FieldID, field.TypeInt))
|
||||
_spec.From = bq.sql
|
||||
if unique := bq.ctx.Unique; unique != nil {
|
||||
_spec.Unique = *unique
|
||||
@@ -373,9 +373,9 @@ func (bq *BlocklistQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
}
|
||||
if fields := bq.ctx.Fields; len(fields) > 0 {
|
||||
_spec.Node.Columns = make([]string, 0, len(fields))
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, blocklist.FieldID)
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, blacklist.FieldID)
|
||||
for i := range fields {
|
||||
if fields[i] != blocklist.FieldID {
|
||||
if fields[i] != blacklist.FieldID {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
|
||||
}
|
||||
}
|
||||
@@ -403,12 +403,12 @@ func (bq *BlocklistQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
return _spec
|
||||
}
|
||||
|
||||
func (bq *BlocklistQuery) sqlQuery(ctx context.Context) *sql.Selector {
|
||||
func (bq *BlacklistQuery) sqlQuery(ctx context.Context) *sql.Selector {
|
||||
builder := sql.Dialect(bq.driver.Dialect())
|
||||
t1 := builder.Table(blocklist.Table)
|
||||
t1 := builder.Table(blacklist.Table)
|
||||
columns := bq.ctx.Fields
|
||||
if len(columns) == 0 {
|
||||
columns = blocklist.Columns
|
||||
columns = blacklist.Columns
|
||||
}
|
||||
selector := builder.Select(t1.Columns(columns...)...).From(t1)
|
||||
if bq.sql != nil {
|
||||
@@ -435,28 +435,28 @@ func (bq *BlocklistQuery) sqlQuery(ctx context.Context) *sql.Selector {
|
||||
return selector
|
||||
}
|
||||
|
||||
// BlocklistGroupBy is the group-by builder for Blocklist entities.
|
||||
type BlocklistGroupBy struct {
|
||||
// BlacklistGroupBy is the group-by builder for Blacklist entities.
|
||||
type BlacklistGroupBy struct {
|
||||
selector
|
||||
build *BlocklistQuery
|
||||
build *BlacklistQuery
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the group-by query.
|
||||
func (bgb *BlocklistGroupBy) Aggregate(fns ...AggregateFunc) *BlocklistGroupBy {
|
||||
func (bgb *BlacklistGroupBy) Aggregate(fns ...AggregateFunc) *BlacklistGroupBy {
|
||||
bgb.fns = append(bgb.fns, fns...)
|
||||
return bgb
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (bgb *BlocklistGroupBy) Scan(ctx context.Context, v any) error {
|
||||
func (bgb *BlacklistGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, bgb.build.ctx, "GroupBy")
|
||||
if err := bgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
return scanWithInterceptors[*BlocklistQuery, *BlocklistGroupBy](ctx, bgb.build, bgb, bgb.build.inters, v)
|
||||
return scanWithInterceptors[*BlacklistQuery, *BlacklistGroupBy](ctx, bgb.build, bgb, bgb.build.inters, v)
|
||||
}
|
||||
|
||||
func (bgb *BlocklistGroupBy) sqlScan(ctx context.Context, root *BlocklistQuery, v any) error {
|
||||
func (bgb *BlacklistGroupBy) sqlScan(ctx context.Context, root *BlacklistQuery, v any) error {
|
||||
selector := root.sqlQuery(ctx).Select()
|
||||
aggregation := make([]string, 0, len(bgb.fns))
|
||||
for _, fn := range bgb.fns {
|
||||
@@ -483,28 +483,28 @@ func (bgb *BlocklistGroupBy) sqlScan(ctx context.Context, root *BlocklistQuery,
|
||||
return sql.ScanSlice(rows, v)
|
||||
}
|
||||
|
||||
// BlocklistSelect is the builder for selecting fields of Blocklist entities.
|
||||
type BlocklistSelect struct {
|
||||
*BlocklistQuery
|
||||
// BlacklistSelect is the builder for selecting fields of Blacklist entities.
|
||||
type BlacklistSelect struct {
|
||||
*BlacklistQuery
|
||||
selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (bs *BlocklistSelect) Aggregate(fns ...AggregateFunc) *BlocklistSelect {
|
||||
func (bs *BlacklistSelect) Aggregate(fns ...AggregateFunc) *BlacklistSelect {
|
||||
bs.fns = append(bs.fns, fns...)
|
||||
return bs
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (bs *BlocklistSelect) Scan(ctx context.Context, v any) error {
|
||||
func (bs *BlacklistSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, bs.ctx, "Select")
|
||||
if err := bs.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
return scanWithInterceptors[*BlocklistQuery, *BlocklistSelect](ctx, bs.BlocklistQuery, bs, bs.inters, v)
|
||||
return scanWithInterceptors[*BlacklistQuery, *BlacklistSelect](ctx, bs.BlacklistQuery, bs, bs.inters, v)
|
||||
}
|
||||
|
||||
func (bs *BlocklistSelect) sqlScan(ctx context.Context, root *BlocklistQuery, v any) error {
|
||||
func (bs *BlacklistSelect) sqlScan(ctx context.Context, root *BlacklistQuery, v any) error {
|
||||
selector := root.sqlQuery(ctx)
|
||||
aggregation := make([]string, 0, len(bs.fns))
|
||||
for _, fn := range bs.fns {
|
||||
322
ent/blacklist_update.go
Normal file
322
ent/blacklist_update.go
Normal file
@@ -0,0 +1,322 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/predicate"
|
||||
"polaris/ent/schema"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// BlacklistUpdate is the builder for updating Blacklist entities.
|
||||
type BlacklistUpdate struct {
|
||||
config
|
||||
hooks []Hook
|
||||
mutation *BlacklistMutation
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlacklistUpdate builder.
|
||||
func (bu *BlacklistUpdate) Where(ps ...predicate.Blacklist) *BlacklistUpdate {
|
||||
bu.mutation.Where(ps...)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetType sets the "type" field.
|
||||
func (bu *BlacklistUpdate) SetType(b blacklist.Type) *BlacklistUpdate {
|
||||
bu.mutation.SetType(b)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetNillableType sets the "type" field if the given value is not nil.
|
||||
func (bu *BlacklistUpdate) SetNillableType(b *blacklist.Type) *BlacklistUpdate {
|
||||
if b != nil {
|
||||
bu.SetType(*b)
|
||||
}
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetValue sets the "value" field.
|
||||
func (bu *BlacklistUpdate) SetValue(sv schema.BlacklistValue) *BlacklistUpdate {
|
||||
bu.mutation.SetValue(sv)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetNillableValue sets the "value" field if the given value is not nil.
|
||||
func (bu *BlacklistUpdate) SetNillableValue(sv *schema.BlacklistValue) *BlacklistUpdate {
|
||||
if sv != nil {
|
||||
bu.SetValue(*sv)
|
||||
}
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetNotes sets the "notes" field.
|
||||
func (bu *BlacklistUpdate) SetNotes(s string) *BlacklistUpdate {
|
||||
bu.mutation.SetNotes(s)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetNillableNotes sets the "notes" field if the given value is not nil.
|
||||
func (bu *BlacklistUpdate) SetNillableNotes(s *string) *BlacklistUpdate {
|
||||
if s != nil {
|
||||
bu.SetNotes(*s)
|
||||
}
|
||||
return bu
|
||||
}
|
||||
|
||||
// ClearNotes clears the value of the "notes" field.
|
||||
func (bu *BlacklistUpdate) ClearNotes() *BlacklistUpdate {
|
||||
bu.mutation.ClearNotes()
|
||||
return bu
|
||||
}
|
||||
|
||||
// Mutation returns the BlacklistMutation object of the builder.
|
||||
func (bu *BlacklistUpdate) Mutation() *BlacklistMutation {
|
||||
return bu.mutation
|
||||
}
|
||||
|
||||
// Save executes the query and returns the number of nodes affected by the update operation.
|
||||
func (bu *BlacklistUpdate) Save(ctx context.Context) (int, error) {
|
||||
return withHooks(ctx, bu.sqlSave, bu.mutation, bu.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func (bu *BlacklistUpdate) SaveX(ctx context.Context) int {
|
||||
affected, err := bu.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return affected
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (bu *BlacklistUpdate) Exec(ctx context.Context) error {
|
||||
_, err := bu.Save(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (bu *BlacklistUpdate) ExecX(ctx context.Context) {
|
||||
if err := bu.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (bu *BlacklistUpdate) check() error {
|
||||
if v, ok := bu.mutation.GetType(); ok {
|
||||
if err := blacklist.TypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blacklist.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (bu *BlacklistUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if err := bu.check(); err != nil {
|
||||
return n, err
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(blacklist.Table, blacklist.Columns, sqlgraph.NewFieldSpec(blacklist.FieldID, field.TypeInt))
|
||||
if ps := bu.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
ps[i](selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
if value, ok := bu.mutation.GetType(); ok {
|
||||
_spec.SetField(blacklist.FieldType, field.TypeEnum, value)
|
||||
}
|
||||
if value, ok := bu.mutation.Value(); ok {
|
||||
_spec.SetField(blacklist.FieldValue, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := bu.mutation.Notes(); ok {
|
||||
_spec.SetField(blacklist.FieldNotes, field.TypeString, value)
|
||||
}
|
||||
if bu.mutation.NotesCleared() {
|
||||
_spec.ClearField(blacklist.FieldNotes, field.TypeString)
|
||||
}
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, bu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{blacklist.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
bu.mutation.done = true
|
||||
return n, nil
|
||||
}
|
||||
|
||||
// BlacklistUpdateOne is the builder for updating a single Blacklist entity.
|
||||
type BlacklistUpdateOne struct {
|
||||
config
|
||||
fields []string
|
||||
hooks []Hook
|
||||
mutation *BlacklistMutation
|
||||
}
|
||||
|
||||
// SetType sets the "type" field.
|
||||
func (buo *BlacklistUpdateOne) SetType(b blacklist.Type) *BlacklistUpdateOne {
|
||||
buo.mutation.SetType(b)
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetNillableType sets the "type" field if the given value is not nil.
|
||||
func (buo *BlacklistUpdateOne) SetNillableType(b *blacklist.Type) *BlacklistUpdateOne {
|
||||
if b != nil {
|
||||
buo.SetType(*b)
|
||||
}
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetValue sets the "value" field.
|
||||
func (buo *BlacklistUpdateOne) SetValue(sv schema.BlacklistValue) *BlacklistUpdateOne {
|
||||
buo.mutation.SetValue(sv)
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetNillableValue sets the "value" field if the given value is not nil.
|
||||
func (buo *BlacklistUpdateOne) SetNillableValue(sv *schema.BlacklistValue) *BlacklistUpdateOne {
|
||||
if sv != nil {
|
||||
buo.SetValue(*sv)
|
||||
}
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetNotes sets the "notes" field.
|
||||
func (buo *BlacklistUpdateOne) SetNotes(s string) *BlacklistUpdateOne {
|
||||
buo.mutation.SetNotes(s)
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetNillableNotes sets the "notes" field if the given value is not nil.
|
||||
func (buo *BlacklistUpdateOne) SetNillableNotes(s *string) *BlacklistUpdateOne {
|
||||
if s != nil {
|
||||
buo.SetNotes(*s)
|
||||
}
|
||||
return buo
|
||||
}
|
||||
|
||||
// ClearNotes clears the value of the "notes" field.
|
||||
func (buo *BlacklistUpdateOne) ClearNotes() *BlacklistUpdateOne {
|
||||
buo.mutation.ClearNotes()
|
||||
return buo
|
||||
}
|
||||
|
||||
// Mutation returns the BlacklistMutation object of the builder.
|
||||
func (buo *BlacklistUpdateOne) Mutation() *BlacklistMutation {
|
||||
return buo.mutation
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlacklistUpdate builder.
|
||||
func (buo *BlacklistUpdateOne) Where(ps ...predicate.Blacklist) *BlacklistUpdateOne {
|
||||
buo.mutation.Where(ps...)
|
||||
return buo
|
||||
}
|
||||
|
||||
// Select allows selecting one or more fields (columns) of the returned entity.
|
||||
// The default is selecting all fields defined in the entity schema.
|
||||
func (buo *BlacklistUpdateOne) Select(field string, fields ...string) *BlacklistUpdateOne {
|
||||
buo.fields = append([]string{field}, fields...)
|
||||
return buo
|
||||
}
|
||||
|
||||
// Save executes the query and returns the updated Blacklist entity.
|
||||
func (buo *BlacklistUpdateOne) Save(ctx context.Context) (*Blacklist, error) {
|
||||
return withHooks(ctx, buo.sqlSave, buo.mutation, buo.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func (buo *BlacklistUpdateOne) SaveX(ctx context.Context) *Blacklist {
|
||||
node, err := buo.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return node
|
||||
}
|
||||
|
||||
// Exec executes the query on the entity.
|
||||
func (buo *BlacklistUpdateOne) Exec(ctx context.Context) error {
|
||||
_, err := buo.Save(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (buo *BlacklistUpdateOne) ExecX(ctx context.Context) {
|
||||
if err := buo.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (buo *BlacklistUpdateOne) check() error {
|
||||
if v, ok := buo.mutation.GetType(); ok {
|
||||
if err := blacklist.TypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blacklist.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (buo *BlacklistUpdateOne) sqlSave(ctx context.Context) (_node *Blacklist, err error) {
|
||||
if err := buo.check(); err != nil {
|
||||
return _node, err
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(blacklist.Table, blacklist.Columns, sqlgraph.NewFieldSpec(blacklist.FieldID, field.TypeInt))
|
||||
id, ok := buo.mutation.ID()
|
||||
if !ok {
|
||||
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Blacklist.id" for update`)}
|
||||
}
|
||||
_spec.Node.ID.Value = id
|
||||
if fields := buo.fields; len(fields) > 0 {
|
||||
_spec.Node.Columns = make([]string, 0, len(fields))
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, blacklist.FieldID)
|
||||
for _, f := range fields {
|
||||
if !blacklist.ValidColumn(f) {
|
||||
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
|
||||
}
|
||||
if f != blacklist.FieldID {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ps := buo.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
ps[i](selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
if value, ok := buo.mutation.GetType(); ok {
|
||||
_spec.SetField(blacklist.FieldType, field.TypeEnum, value)
|
||||
}
|
||||
if value, ok := buo.mutation.Value(); ok {
|
||||
_spec.SetField(blacklist.FieldValue, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := buo.mutation.Notes(); ok {
|
||||
_spec.SetField(blacklist.FieldNotes, field.TypeString, value)
|
||||
}
|
||||
if buo.mutation.NotesCleared() {
|
||||
_spec.ClearField(blacklist.FieldNotes, field.TypeString)
|
||||
}
|
||||
_node = &Blacklist{config: buo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
if err = sqlgraph.UpdateNode(ctx, buo.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{blacklist.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
buo.mutation.done = true
|
||||
return _node, nil
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package blocklist
|
||||
|
||||
import (
|
||||
"polaris/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldNEQ(FieldID, id))
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldNotIn(FieldID, ids...))
|
||||
}
|
||||
|
||||
// IDGT applies the GT predicate on the ID field.
|
||||
func IDGT(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldGT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldGTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldLT(FieldID, id))
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id int) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// Value applies equality check predicate on the "value" field. It's identical to ValueEQ.
|
||||
func Value(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldEQ(FieldValue, v))
|
||||
}
|
||||
|
||||
// TypeEQ applies the EQ predicate on the "type" field.
|
||||
func TypeEQ(v Type) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldEQ(FieldType, v))
|
||||
}
|
||||
|
||||
// TypeNEQ applies the NEQ predicate on the "type" field.
|
||||
func TypeNEQ(v Type) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldNEQ(FieldType, v))
|
||||
}
|
||||
|
||||
// TypeIn applies the In predicate on the "type" field.
|
||||
func TypeIn(vs ...Type) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldIn(FieldType, vs...))
|
||||
}
|
||||
|
||||
// TypeNotIn applies the NotIn predicate on the "type" field.
|
||||
func TypeNotIn(vs ...Type) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldNotIn(FieldType, vs...))
|
||||
}
|
||||
|
||||
// ValueEQ applies the EQ predicate on the "value" field.
|
||||
func ValueEQ(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldEQ(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueNEQ applies the NEQ predicate on the "value" field.
|
||||
func ValueNEQ(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldNEQ(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueIn applies the In predicate on the "value" field.
|
||||
func ValueIn(vs ...string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldIn(FieldValue, vs...))
|
||||
}
|
||||
|
||||
// ValueNotIn applies the NotIn predicate on the "value" field.
|
||||
func ValueNotIn(vs ...string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldNotIn(FieldValue, vs...))
|
||||
}
|
||||
|
||||
// ValueGT applies the GT predicate on the "value" field.
|
||||
func ValueGT(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldGT(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueGTE applies the GTE predicate on the "value" field.
|
||||
func ValueGTE(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldGTE(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueLT applies the LT predicate on the "value" field.
|
||||
func ValueLT(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldLT(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueLTE applies the LTE predicate on the "value" field.
|
||||
func ValueLTE(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldLTE(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueContains applies the Contains predicate on the "value" field.
|
||||
func ValueContains(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldContains(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueHasPrefix applies the HasPrefix predicate on the "value" field.
|
||||
func ValueHasPrefix(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldHasPrefix(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueHasSuffix applies the HasSuffix predicate on the "value" field.
|
||||
func ValueHasSuffix(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldHasSuffix(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueEqualFold applies the EqualFold predicate on the "value" field.
|
||||
func ValueEqualFold(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldEqualFold(FieldValue, v))
|
||||
}
|
||||
|
||||
// ValueContainsFold applies the ContainsFold predicate on the "value" field.
|
||||
func ValueContainsFold(v string) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.FieldContainsFold(FieldValue, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Blocklist) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.AndPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Or groups predicates with the OR operator between them.
|
||||
func Or(predicates ...predicate.Blocklist) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.OrPredicates(predicates...))
|
||||
}
|
||||
|
||||
// Not applies the not operator on the given predicate.
|
||||
func Not(p predicate.Blocklist) predicate.Blocklist {
|
||||
return predicate.Blocklist(sql.NotPredicates(p))
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// BlocklistUpdate is the builder for updating Blocklist entities.
|
||||
type BlocklistUpdate struct {
|
||||
config
|
||||
hooks []Hook
|
||||
mutation *BlocklistMutation
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlocklistUpdate builder.
|
||||
func (bu *BlocklistUpdate) Where(ps ...predicate.Blocklist) *BlocklistUpdate {
|
||||
bu.mutation.Where(ps...)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetType sets the "type" field.
|
||||
func (bu *BlocklistUpdate) SetType(b blocklist.Type) *BlocklistUpdate {
|
||||
bu.mutation.SetType(b)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetNillableType sets the "type" field if the given value is not nil.
|
||||
func (bu *BlocklistUpdate) SetNillableType(b *blocklist.Type) *BlocklistUpdate {
|
||||
if b != nil {
|
||||
bu.SetType(*b)
|
||||
}
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetValue sets the "value" field.
|
||||
func (bu *BlocklistUpdate) SetValue(s string) *BlocklistUpdate {
|
||||
bu.mutation.SetValue(s)
|
||||
return bu
|
||||
}
|
||||
|
||||
// SetNillableValue sets the "value" field if the given value is not nil.
|
||||
func (bu *BlocklistUpdate) SetNillableValue(s *string) *BlocklistUpdate {
|
||||
if s != nil {
|
||||
bu.SetValue(*s)
|
||||
}
|
||||
return bu
|
||||
}
|
||||
|
||||
// Mutation returns the BlocklistMutation object of the builder.
|
||||
func (bu *BlocklistUpdate) Mutation() *BlocklistMutation {
|
||||
return bu.mutation
|
||||
}
|
||||
|
||||
// Save executes the query and returns the number of nodes affected by the update operation.
|
||||
func (bu *BlocklistUpdate) Save(ctx context.Context) (int, error) {
|
||||
return withHooks(ctx, bu.sqlSave, bu.mutation, bu.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func (bu *BlocklistUpdate) SaveX(ctx context.Context) int {
|
||||
affected, err := bu.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return affected
|
||||
}
|
||||
|
||||
// Exec executes the query.
|
||||
func (bu *BlocklistUpdate) Exec(ctx context.Context) error {
|
||||
_, err := bu.Save(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (bu *BlocklistUpdate) ExecX(ctx context.Context) {
|
||||
if err := bu.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (bu *BlocklistUpdate) check() error {
|
||||
if v, ok := bu.mutation.GetType(); ok {
|
||||
if err := blocklist.TypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blocklist.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (bu *BlocklistUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
if err := bu.check(); err != nil {
|
||||
return n, err
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(blocklist.Table, blocklist.Columns, sqlgraph.NewFieldSpec(blocklist.FieldID, field.TypeInt))
|
||||
if ps := bu.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
ps[i](selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
if value, ok := bu.mutation.GetType(); ok {
|
||||
_spec.SetField(blocklist.FieldType, field.TypeEnum, value)
|
||||
}
|
||||
if value, ok := bu.mutation.Value(); ok {
|
||||
_spec.SetField(blocklist.FieldValue, field.TypeString, value)
|
||||
}
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, bu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{blocklist.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
bu.mutation.done = true
|
||||
return n, nil
|
||||
}
|
||||
|
||||
// BlocklistUpdateOne is the builder for updating a single Blocklist entity.
|
||||
type BlocklistUpdateOne struct {
|
||||
config
|
||||
fields []string
|
||||
hooks []Hook
|
||||
mutation *BlocklistMutation
|
||||
}
|
||||
|
||||
// SetType sets the "type" field.
|
||||
func (buo *BlocklistUpdateOne) SetType(b blocklist.Type) *BlocklistUpdateOne {
|
||||
buo.mutation.SetType(b)
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetNillableType sets the "type" field if the given value is not nil.
|
||||
func (buo *BlocklistUpdateOne) SetNillableType(b *blocklist.Type) *BlocklistUpdateOne {
|
||||
if b != nil {
|
||||
buo.SetType(*b)
|
||||
}
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetValue sets the "value" field.
|
||||
func (buo *BlocklistUpdateOne) SetValue(s string) *BlocklistUpdateOne {
|
||||
buo.mutation.SetValue(s)
|
||||
return buo
|
||||
}
|
||||
|
||||
// SetNillableValue sets the "value" field if the given value is not nil.
|
||||
func (buo *BlocklistUpdateOne) SetNillableValue(s *string) *BlocklistUpdateOne {
|
||||
if s != nil {
|
||||
buo.SetValue(*s)
|
||||
}
|
||||
return buo
|
||||
}
|
||||
|
||||
// Mutation returns the BlocklistMutation object of the builder.
|
||||
func (buo *BlocklistUpdateOne) Mutation() *BlocklistMutation {
|
||||
return buo.mutation
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlocklistUpdate builder.
|
||||
func (buo *BlocklistUpdateOne) Where(ps ...predicate.Blocklist) *BlocklistUpdateOne {
|
||||
buo.mutation.Where(ps...)
|
||||
return buo
|
||||
}
|
||||
|
||||
// Select allows selecting one or more fields (columns) of the returned entity.
|
||||
// The default is selecting all fields defined in the entity schema.
|
||||
func (buo *BlocklistUpdateOne) Select(field string, fields ...string) *BlocklistUpdateOne {
|
||||
buo.fields = append([]string{field}, fields...)
|
||||
return buo
|
||||
}
|
||||
|
||||
// Save executes the query and returns the updated Blocklist entity.
|
||||
func (buo *BlocklistUpdateOne) Save(ctx context.Context) (*Blocklist, error) {
|
||||
return withHooks(ctx, buo.sqlSave, buo.mutation, buo.hooks)
|
||||
}
|
||||
|
||||
// SaveX is like Save, but panics if an error occurs.
|
||||
func (buo *BlocklistUpdateOne) SaveX(ctx context.Context) *Blocklist {
|
||||
node, err := buo.Save(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return node
|
||||
}
|
||||
|
||||
// Exec executes the query on the entity.
|
||||
func (buo *BlocklistUpdateOne) Exec(ctx context.Context) error {
|
||||
_, err := buo.Save(ctx)
|
||||
return err
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (buo *BlocklistUpdateOne) ExecX(ctx context.Context) {
|
||||
if err := buo.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
func (buo *BlocklistUpdateOne) check() error {
|
||||
if v, ok := buo.mutation.GetType(); ok {
|
||||
if err := blocklist.TypeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blocklist.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (buo *BlocklistUpdateOne) sqlSave(ctx context.Context) (_node *Blocklist, err error) {
|
||||
if err := buo.check(); err != nil {
|
||||
return _node, err
|
||||
}
|
||||
_spec := sqlgraph.NewUpdateSpec(blocklist.Table, blocklist.Columns, sqlgraph.NewFieldSpec(blocklist.FieldID, field.TypeInt))
|
||||
id, ok := buo.mutation.ID()
|
||||
if !ok {
|
||||
return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Blocklist.id" for update`)}
|
||||
}
|
||||
_spec.Node.ID.Value = id
|
||||
if fields := buo.fields; len(fields) > 0 {
|
||||
_spec.Node.Columns = make([]string, 0, len(fields))
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, blocklist.FieldID)
|
||||
for _, f := range fields {
|
||||
if !blocklist.ValidColumn(f) {
|
||||
return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
|
||||
}
|
||||
if f != blocklist.FieldID {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ps := buo.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
ps[i](selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
if value, ok := buo.mutation.GetType(); ok {
|
||||
_spec.SetField(blocklist.FieldType, field.TypeEnum, value)
|
||||
}
|
||||
if value, ok := buo.mutation.Value(); ok {
|
||||
_spec.SetField(blocklist.FieldValue, field.TypeString, value)
|
||||
}
|
||||
_node = &Blocklist{config: buo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
if err = sqlgraph.UpdateNode(ctx, buo.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{blocklist.Label}
|
||||
} else if sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
buo.mutation.done = true
|
||||
return _node, nil
|
||||
}
|
||||
142
ent/client.go
142
ent/client.go
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"polaris/ent/migrate"
|
||||
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/downloadclients"
|
||||
"polaris/ent/episode"
|
||||
"polaris/ent/history"
|
||||
@@ -33,8 +33,8 @@ type Client struct {
|
||||
config
|
||||
// Schema is the client for creating, migrating and dropping schema.
|
||||
Schema *migrate.Schema
|
||||
// Blocklist is the client for interacting with the Blocklist builders.
|
||||
Blocklist *BlocklistClient
|
||||
// Blacklist is the client for interacting with the Blacklist builders.
|
||||
Blacklist *BlacklistClient
|
||||
// DownloadClients is the client for interacting with the DownloadClients builders.
|
||||
DownloadClients *DownloadClientsClient
|
||||
// Episode is the client for interacting with the Episode builders.
|
||||
@@ -64,7 +64,7 @@ func NewClient(opts ...Option) *Client {
|
||||
|
||||
func (c *Client) init() {
|
||||
c.Schema = migrate.NewSchema(c.driver)
|
||||
c.Blocklist = NewBlocklistClient(c.config)
|
||||
c.Blacklist = NewBlacklistClient(c.config)
|
||||
c.DownloadClients = NewDownloadClientsClient(c.config)
|
||||
c.Episode = NewEpisodeClient(c.config)
|
||||
c.History = NewHistoryClient(c.config)
|
||||
@@ -166,7 +166,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
|
||||
return &Tx{
|
||||
ctx: ctx,
|
||||
config: cfg,
|
||||
Blocklist: NewBlocklistClient(cfg),
|
||||
Blacklist: NewBlacklistClient(cfg),
|
||||
DownloadClients: NewDownloadClientsClient(cfg),
|
||||
Episode: NewEpisodeClient(cfg),
|
||||
History: NewHistoryClient(cfg),
|
||||
@@ -195,7 +195,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
|
||||
return &Tx{
|
||||
ctx: ctx,
|
||||
config: cfg,
|
||||
Blocklist: NewBlocklistClient(cfg),
|
||||
Blacklist: NewBlacklistClient(cfg),
|
||||
DownloadClients: NewDownloadClientsClient(cfg),
|
||||
Episode: NewEpisodeClient(cfg),
|
||||
History: NewHistoryClient(cfg),
|
||||
@@ -211,7 +211,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
|
||||
// Debug returns a new debug-client. It's used to get verbose logging on specific operations.
|
||||
//
|
||||
// client.Debug().
|
||||
// Blocklist.
|
||||
// Blacklist.
|
||||
// Query().
|
||||
// Count(ctx)
|
||||
func (c *Client) Debug() *Client {
|
||||
@@ -234,7 +234,7 @@ func (c *Client) Close() error {
|
||||
// In order to add hooks to a specific client, call: `client.Node.Use(...)`.
|
||||
func (c *Client) Use(hooks ...Hook) {
|
||||
for _, n := range []interface{ Use(...Hook) }{
|
||||
c.Blocklist, c.DownloadClients, c.Episode, c.History, c.ImportList, c.Indexers,
|
||||
c.Blacklist, c.DownloadClients, c.Episode, c.History, c.ImportList, c.Indexers,
|
||||
c.Media, c.NotificationClient, c.Settings, c.Storage,
|
||||
} {
|
||||
n.Use(hooks...)
|
||||
@@ -245,7 +245,7 @@ func (c *Client) Use(hooks ...Hook) {
|
||||
// In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
|
||||
func (c *Client) Intercept(interceptors ...Interceptor) {
|
||||
for _, n := range []interface{ Intercept(...Interceptor) }{
|
||||
c.Blocklist, c.DownloadClients, c.Episode, c.History, c.ImportList, c.Indexers,
|
||||
c.Blacklist, c.DownloadClients, c.Episode, c.History, c.ImportList, c.Indexers,
|
||||
c.Media, c.NotificationClient, c.Settings, c.Storage,
|
||||
} {
|
||||
n.Intercept(interceptors...)
|
||||
@@ -255,8 +255,8 @@ func (c *Client) Intercept(interceptors ...Interceptor) {
|
||||
// Mutate implements the ent.Mutator interface.
|
||||
func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
|
||||
switch m := m.(type) {
|
||||
case *BlocklistMutation:
|
||||
return c.Blocklist.mutate(ctx, m)
|
||||
case *BlacklistMutation:
|
||||
return c.Blacklist.mutate(ctx, m)
|
||||
case *DownloadClientsMutation:
|
||||
return c.DownloadClients.mutate(ctx, m)
|
||||
case *EpisodeMutation:
|
||||
@@ -280,107 +280,107 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// BlocklistClient is a client for the Blocklist schema.
|
||||
type BlocklistClient struct {
|
||||
// BlacklistClient is a client for the Blacklist schema.
|
||||
type BlacklistClient struct {
|
||||
config
|
||||
}
|
||||
|
||||
// NewBlocklistClient returns a client for the Blocklist from the given config.
|
||||
func NewBlocklistClient(c config) *BlocklistClient {
|
||||
return &BlocklistClient{config: c}
|
||||
// NewBlacklistClient returns a client for the Blacklist from the given config.
|
||||
func NewBlacklistClient(c config) *BlacklistClient {
|
||||
return &BlacklistClient{config: c}
|
||||
}
|
||||
|
||||
// Use adds a list of mutation hooks to the hooks stack.
|
||||
// A call to `Use(f, g, h)` equals to `blocklist.Hooks(f(g(h())))`.
|
||||
func (c *BlocklistClient) Use(hooks ...Hook) {
|
||||
c.hooks.Blocklist = append(c.hooks.Blocklist, hooks...)
|
||||
// A call to `Use(f, g, h)` equals to `blacklist.Hooks(f(g(h())))`.
|
||||
func (c *BlacklistClient) Use(hooks ...Hook) {
|
||||
c.hooks.Blacklist = append(c.hooks.Blacklist, hooks...)
|
||||
}
|
||||
|
||||
// Intercept adds a list of query interceptors to the interceptors stack.
|
||||
// A call to `Intercept(f, g, h)` equals to `blocklist.Intercept(f(g(h())))`.
|
||||
func (c *BlocklistClient) Intercept(interceptors ...Interceptor) {
|
||||
c.inters.Blocklist = append(c.inters.Blocklist, interceptors...)
|
||||
// A call to `Intercept(f, g, h)` equals to `blacklist.Intercept(f(g(h())))`.
|
||||
func (c *BlacklistClient) Intercept(interceptors ...Interceptor) {
|
||||
c.inters.Blacklist = append(c.inters.Blacklist, interceptors...)
|
||||
}
|
||||
|
||||
// Create returns a builder for creating a Blocklist entity.
|
||||
func (c *BlocklistClient) Create() *BlocklistCreate {
|
||||
mutation := newBlocklistMutation(c.config, OpCreate)
|
||||
return &BlocklistCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
// Create returns a builder for creating a Blacklist entity.
|
||||
func (c *BlacklistClient) Create() *BlacklistCreate {
|
||||
mutation := newBlacklistMutation(c.config, OpCreate)
|
||||
return &BlacklistCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
}
|
||||
|
||||
// CreateBulk returns a builder for creating a bulk of Blocklist entities.
|
||||
func (c *BlocklistClient) CreateBulk(builders ...*BlocklistCreate) *BlocklistCreateBulk {
|
||||
return &BlocklistCreateBulk{config: c.config, builders: builders}
|
||||
// CreateBulk returns a builder for creating a bulk of Blacklist entities.
|
||||
func (c *BlacklistClient) CreateBulk(builders ...*BlacklistCreate) *BlacklistCreateBulk {
|
||||
return &BlacklistCreateBulk{config: c.config, builders: builders}
|
||||
}
|
||||
|
||||
// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
|
||||
// a builder and applies setFunc on it.
|
||||
func (c *BlocklistClient) MapCreateBulk(slice any, setFunc func(*BlocklistCreate, int)) *BlocklistCreateBulk {
|
||||
func (c *BlacklistClient) MapCreateBulk(slice any, setFunc func(*BlacklistCreate, int)) *BlacklistCreateBulk {
|
||||
rv := reflect.ValueOf(slice)
|
||||
if rv.Kind() != reflect.Slice {
|
||||
return &BlocklistCreateBulk{err: fmt.Errorf("calling to BlocklistClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||
return &BlacklistCreateBulk{err: fmt.Errorf("calling to BlacklistClient.MapCreateBulk with wrong type %T, need slice", slice)}
|
||||
}
|
||||
builders := make([]*BlocklistCreate, rv.Len())
|
||||
builders := make([]*BlacklistCreate, rv.Len())
|
||||
for i := 0; i < rv.Len(); i++ {
|
||||
builders[i] = c.Create()
|
||||
setFunc(builders[i], i)
|
||||
}
|
||||
return &BlocklistCreateBulk{config: c.config, builders: builders}
|
||||
return &BlacklistCreateBulk{config: c.config, builders: builders}
|
||||
}
|
||||
|
||||
// Update returns an update builder for Blocklist.
|
||||
func (c *BlocklistClient) Update() *BlocklistUpdate {
|
||||
mutation := newBlocklistMutation(c.config, OpUpdate)
|
||||
return &BlocklistUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
// Update returns an update builder for Blacklist.
|
||||
func (c *BlacklistClient) Update() *BlacklistUpdate {
|
||||
mutation := newBlacklistMutation(c.config, OpUpdate)
|
||||
return &BlacklistUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
}
|
||||
|
||||
// UpdateOne returns an update builder for the given entity.
|
||||
func (c *BlocklistClient) UpdateOne(b *Blocklist) *BlocklistUpdateOne {
|
||||
mutation := newBlocklistMutation(c.config, OpUpdateOne, withBlocklist(b))
|
||||
return &BlocklistUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
func (c *BlacklistClient) UpdateOne(b *Blacklist) *BlacklistUpdateOne {
|
||||
mutation := newBlacklistMutation(c.config, OpUpdateOne, withBlacklist(b))
|
||||
return &BlacklistUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
}
|
||||
|
||||
// UpdateOneID returns an update builder for the given id.
|
||||
func (c *BlocklistClient) UpdateOneID(id int) *BlocklistUpdateOne {
|
||||
mutation := newBlocklistMutation(c.config, OpUpdateOne, withBlocklistID(id))
|
||||
return &BlocklistUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
func (c *BlacklistClient) UpdateOneID(id int) *BlacklistUpdateOne {
|
||||
mutation := newBlacklistMutation(c.config, OpUpdateOne, withBlacklistID(id))
|
||||
return &BlacklistUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
}
|
||||
|
||||
// Delete returns a delete builder for Blocklist.
|
||||
func (c *BlocklistClient) Delete() *BlocklistDelete {
|
||||
mutation := newBlocklistMutation(c.config, OpDelete)
|
||||
return &BlocklistDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
// Delete returns a delete builder for Blacklist.
|
||||
func (c *BlacklistClient) Delete() *BlacklistDelete {
|
||||
mutation := newBlacklistMutation(c.config, OpDelete)
|
||||
return &BlacklistDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity.
|
||||
func (c *BlocklistClient) DeleteOne(b *Blocklist) *BlocklistDeleteOne {
|
||||
func (c *BlacklistClient) DeleteOne(b *Blacklist) *BlacklistDeleteOne {
|
||||
return c.DeleteOneID(b.ID)
|
||||
}
|
||||
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *BlocklistClient) DeleteOneID(id int) *BlocklistDeleteOne {
|
||||
builder := c.Delete().Where(blocklist.ID(id))
|
||||
func (c *BlacklistClient) DeleteOneID(id int) *BlacklistDeleteOne {
|
||||
builder := c.Delete().Where(blacklist.ID(id))
|
||||
builder.mutation.id = &id
|
||||
builder.mutation.op = OpDeleteOne
|
||||
return &BlocklistDeleteOne{builder}
|
||||
return &BlacklistDeleteOne{builder}
|
||||
}
|
||||
|
||||
// Query returns a query builder for Blocklist.
|
||||
func (c *BlocklistClient) Query() *BlocklistQuery {
|
||||
return &BlocklistQuery{
|
||||
// Query returns a query builder for Blacklist.
|
||||
func (c *BlacklistClient) Query() *BlacklistQuery {
|
||||
return &BlacklistQuery{
|
||||
config: c.config,
|
||||
ctx: &QueryContext{Type: TypeBlocklist},
|
||||
ctx: &QueryContext{Type: TypeBlacklist},
|
||||
inters: c.Interceptors(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get returns a Blocklist entity by its id.
|
||||
func (c *BlocklistClient) Get(ctx context.Context, id int) (*Blocklist, error) {
|
||||
return c.Query().Where(blocklist.ID(id)).Only(ctx)
|
||||
// Get returns a Blacklist entity by its id.
|
||||
func (c *BlacklistClient) Get(ctx context.Context, id int) (*Blacklist, error) {
|
||||
return c.Query().Where(blacklist.ID(id)).Only(ctx)
|
||||
}
|
||||
|
||||
// GetX is like Get, but panics if an error occurs.
|
||||
func (c *BlocklistClient) GetX(ctx context.Context, id int) *Blocklist {
|
||||
func (c *BlacklistClient) GetX(ctx context.Context, id int) *Blacklist {
|
||||
obj, err := c.Get(ctx, id)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -389,27 +389,27 @@ func (c *BlocklistClient) GetX(ctx context.Context, id int) *Blocklist {
|
||||
}
|
||||
|
||||
// Hooks returns the client hooks.
|
||||
func (c *BlocklistClient) Hooks() []Hook {
|
||||
return c.hooks.Blocklist
|
||||
func (c *BlacklistClient) Hooks() []Hook {
|
||||
return c.hooks.Blacklist
|
||||
}
|
||||
|
||||
// Interceptors returns the client interceptors.
|
||||
func (c *BlocklistClient) Interceptors() []Interceptor {
|
||||
return c.inters.Blocklist
|
||||
func (c *BlacklistClient) Interceptors() []Interceptor {
|
||||
return c.inters.Blacklist
|
||||
}
|
||||
|
||||
func (c *BlocklistClient) mutate(ctx context.Context, m *BlocklistMutation) (Value, error) {
|
||||
func (c *BlacklistClient) mutate(ctx context.Context, m *BlacklistMutation) (Value, error) {
|
||||
switch m.Op() {
|
||||
case OpCreate:
|
||||
return (&BlocklistCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
return (&BlacklistCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdate:
|
||||
return (&BlocklistUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
return (&BlacklistUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpUpdateOne:
|
||||
return (&BlocklistUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
return (&BlacklistUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
|
||||
case OpDelete, OpDeleteOne:
|
||||
return (&BlocklistDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
return (&BlacklistDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("ent: unknown Blocklist mutation op: %q", m.Op())
|
||||
return nil, fmt.Errorf("ent: unknown Blacklist mutation op: %q", m.Op())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1645,11 +1645,11 @@ func (c *StorageClient) mutate(ctx context.Context, m *StorageMutation) (Value,
|
||||
// hooks and interceptors per client, for fast access.
|
||||
type (
|
||||
hooks struct {
|
||||
Blocklist, DownloadClients, Episode, History, ImportList, Indexers, Media,
|
||||
Blacklist, DownloadClients, Episode, History, ImportList, Indexers, Media,
|
||||
NotificationClient, Settings, Storage []ent.Hook
|
||||
}
|
||||
inters struct {
|
||||
Blocklist, DownloadClients, Episode, History, ImportList, Indexers, Media,
|
||||
Blacklist, DownloadClients, Episode, History, ImportList, Indexers, Media,
|
||||
NotificationClient, Settings, Storage []ent.Interceptor
|
||||
}
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/downloadclients"
|
||||
"polaris/ent/episode"
|
||||
"polaris/ent/history"
|
||||
@@ -82,7 +82,7 @@ var (
|
||||
func checkColumn(table, column string) error {
|
||||
initCheck.Do(func() {
|
||||
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
|
||||
blocklist.Table: blocklist.ValidColumn,
|
||||
blacklist.Table: blacklist.ValidColumn,
|
||||
downloadclients.Table: downloadclients.ValidColumn,
|
||||
episode.Table: episode.ValidColumn,
|
||||
history.Table: history.ValidColumn,
|
||||
|
||||
@@ -8,16 +8,16 @@ 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)
|
||||
// The BlacklistFunc type is an adapter to allow the use of ordinary
|
||||
// function as Blacklist mutator.
|
||||
type BlacklistFunc func(context.Context, *ent.BlacklistMutation) (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 {
|
||||
func (f BlacklistFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.BlacklistMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.BlocklistMutation", m)
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.BlacklistMutation", m)
|
||||
}
|
||||
|
||||
// The DownloadClientsFunc type is an adapter to allow the use of ordinary
|
||||
|
||||
@@ -8,17 +8,18 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// BlocklistsColumns holds the columns for the "blocklists" table.
|
||||
BlocklistsColumns = []*schema.Column{
|
||||
// BlacklistsColumns holds the columns for the "blacklists" table.
|
||||
BlacklistsColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
{Name: "type", Type: field.TypeEnum, Enums: []string{"media", "torrent"}},
|
||||
{Name: "value", Type: field.TypeString},
|
||||
{Name: "value", Type: field.TypeJSON},
|
||||
{Name: "notes", Type: field.TypeString, Nullable: true},
|
||||
}
|
||||
// BlocklistsTable holds the schema information for the "blocklists" table.
|
||||
BlocklistsTable = &schema.Table{
|
||||
Name: "blocklists",
|
||||
Columns: BlocklistsColumns,
|
||||
PrimaryKey: []*schema.Column{BlocklistsColumns[0]},
|
||||
// BlacklistsTable holds the schema information for the "blacklists" table.
|
||||
BlacklistsTable = &schema.Table{
|
||||
Name: "blacklists",
|
||||
Columns: BlacklistsColumns,
|
||||
PrimaryKey: []*schema.Column{BlacklistsColumns[0]},
|
||||
}
|
||||
// DownloadClientsColumns holds the columns for the "download_clients" table.
|
||||
DownloadClientsColumns = []*schema.Column{
|
||||
@@ -192,7 +193,7 @@ var (
|
||||
}
|
||||
// Tables holds all the tables in the schema.
|
||||
Tables = []*schema.Table{
|
||||
BlocklistsTable,
|
||||
BlacklistsTable,
|
||||
DownloadClientsTable,
|
||||
EpisodesTable,
|
||||
HistoriesTable,
|
||||
|
||||
260
ent/mutation.go
260
ent/mutation.go
@@ -6,7 +6,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"polaris/ent/blocklist"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/downloadclients"
|
||||
"polaris/ent/episode"
|
||||
"polaris/ent/history"
|
||||
@@ -34,7 +34,7 @@ const (
|
||||
OpUpdateOne = ent.OpUpdateOne
|
||||
|
||||
// Node types.
|
||||
TypeBlocklist = "Blocklist"
|
||||
TypeBlacklist = "Blacklist"
|
||||
TypeDownloadClients = "DownloadClients"
|
||||
TypeEpisode = "Episode"
|
||||
TypeHistory = "History"
|
||||
@@ -46,31 +46,32 @@ const (
|
||||
TypeStorage = "Storage"
|
||||
)
|
||||
|
||||
// BlocklistMutation represents an operation that mutates the Blocklist nodes in the graph.
|
||||
type BlocklistMutation struct {
|
||||
// BlacklistMutation represents an operation that mutates the Blacklist nodes in the graph.
|
||||
type BlacklistMutation struct {
|
||||
config
|
||||
op Op
|
||||
typ string
|
||||
id *int
|
||||
_type *blocklist.Type
|
||||
value *string
|
||||
_type *blacklist.Type
|
||||
value *schema.BlacklistValue
|
||||
notes *string
|
||||
clearedFields map[string]struct{}
|
||||
done bool
|
||||
oldValue func(context.Context) (*Blocklist, error)
|
||||
predicates []predicate.Blocklist
|
||||
oldValue func(context.Context) (*Blacklist, error)
|
||||
predicates []predicate.Blacklist
|
||||
}
|
||||
|
||||
var _ ent.Mutation = (*BlocklistMutation)(nil)
|
||||
var _ ent.Mutation = (*BlacklistMutation)(nil)
|
||||
|
||||
// blocklistOption allows management of the mutation configuration using functional options.
|
||||
type blocklistOption func(*BlocklistMutation)
|
||||
// blacklistOption allows management of the mutation configuration using functional options.
|
||||
type blacklistOption func(*BlacklistMutation)
|
||||
|
||||
// newBlocklistMutation creates new mutation for the Blocklist entity.
|
||||
func newBlocklistMutation(c config, op Op, opts ...blocklistOption) *BlocklistMutation {
|
||||
m := &BlocklistMutation{
|
||||
// newBlacklistMutation creates new mutation for the Blacklist entity.
|
||||
func newBlacklistMutation(c config, op Op, opts ...blacklistOption) *BlacklistMutation {
|
||||
m := &BlacklistMutation{
|
||||
config: c,
|
||||
op: op,
|
||||
typ: TypeBlocklist,
|
||||
typ: TypeBlacklist,
|
||||
clearedFields: make(map[string]struct{}),
|
||||
}
|
||||
for _, opt := range opts {
|
||||
@@ -79,20 +80,20 @@ func newBlocklistMutation(c config, op Op, opts ...blocklistOption) *BlocklistMu
|
||||
return m
|
||||
}
|
||||
|
||||
// withBlocklistID sets the ID field of the mutation.
|
||||
func withBlocklistID(id int) blocklistOption {
|
||||
return func(m *BlocklistMutation) {
|
||||
// withBlacklistID sets the ID field of the mutation.
|
||||
func withBlacklistID(id int) blacklistOption {
|
||||
return func(m *BlacklistMutation) {
|
||||
var (
|
||||
err error
|
||||
once sync.Once
|
||||
value *Blocklist
|
||||
value *Blacklist
|
||||
)
|
||||
m.oldValue = func(ctx context.Context) (*Blocklist, error) {
|
||||
m.oldValue = func(ctx context.Context) (*Blacklist, error) {
|
||||
once.Do(func() {
|
||||
if m.done {
|
||||
err = errors.New("querying old values post mutation is not allowed")
|
||||
} else {
|
||||
value, err = m.Client().Blocklist.Get(ctx, id)
|
||||
value, err = m.Client().Blacklist.Get(ctx, id)
|
||||
}
|
||||
})
|
||||
return value, err
|
||||
@@ -101,10 +102,10 @@ func withBlocklistID(id int) blocklistOption {
|
||||
}
|
||||
}
|
||||
|
||||
// withBlocklist sets the old Blocklist of the mutation.
|
||||
func withBlocklist(node *Blocklist) blocklistOption {
|
||||
return func(m *BlocklistMutation) {
|
||||
m.oldValue = func(context.Context) (*Blocklist, error) {
|
||||
// withBlacklist sets the old Blacklist of the mutation.
|
||||
func withBlacklist(node *Blacklist) blacklistOption {
|
||||
return func(m *BlacklistMutation) {
|
||||
m.oldValue = func(context.Context) (*Blacklist, error) {
|
||||
return node, nil
|
||||
}
|
||||
m.id = &node.ID
|
||||
@@ -113,7 +114,7 @@ func withBlocklist(node *Blocklist) blocklistOption {
|
||||
|
||||
// Client returns a new `ent.Client` from the mutation. If the mutation was
|
||||
// executed in a transaction (ent.Tx), a transactional client is returned.
|
||||
func (m BlocklistMutation) Client() *Client {
|
||||
func (m BlacklistMutation) Client() *Client {
|
||||
client := &Client{config: m.config}
|
||||
client.init()
|
||||
return client
|
||||
@@ -121,7 +122,7 @@ func (m BlocklistMutation) Client() *Client {
|
||||
|
||||
// Tx returns an `ent.Tx` for mutations that were executed in transactions;
|
||||
// it returns an error otherwise.
|
||||
func (m BlocklistMutation) Tx() (*Tx, error) {
|
||||
func (m BlacklistMutation) Tx() (*Tx, error) {
|
||||
if _, ok := m.driver.(*txDriver); !ok {
|
||||
return nil, errors.New("ent: mutation is not running in a transaction")
|
||||
}
|
||||
@@ -132,7 +133,7 @@ func (m BlocklistMutation) Tx() (*Tx, error) {
|
||||
|
||||
// ID returns the ID value in the mutation. Note that the ID is only available
|
||||
// if it was provided to the builder or after it was returned from the database.
|
||||
func (m *BlocklistMutation) ID() (id int, exists bool) {
|
||||
func (m *BlacklistMutation) ID() (id int, exists bool) {
|
||||
if m.id == nil {
|
||||
return
|
||||
}
|
||||
@@ -143,7 +144,7 @@ func (m *BlocklistMutation) ID() (id int, exists bool) {
|
||||
// That means, if the mutation is applied within a transaction with an isolation level such
|
||||
// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
|
||||
// or updated by the mutation.
|
||||
func (m *BlocklistMutation) IDs(ctx context.Context) ([]int, error) {
|
||||
func (m *BlacklistMutation) IDs(ctx context.Context) ([]int, error) {
|
||||
switch {
|
||||
case m.op.Is(OpUpdateOne | OpDeleteOne):
|
||||
id, exists := m.ID()
|
||||
@@ -152,19 +153,19 @@ func (m *BlocklistMutation) IDs(ctx context.Context) ([]int, error) {
|
||||
}
|
||||
fallthrough
|
||||
case m.op.Is(OpUpdate | OpDelete):
|
||||
return m.Client().Blocklist.Query().Where(m.predicates...).IDs(ctx)
|
||||
return m.Client().Blacklist.Query().Where(m.predicates...).IDs(ctx)
|
||||
default:
|
||||
return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
|
||||
}
|
||||
}
|
||||
|
||||
// SetType sets the "type" field.
|
||||
func (m *BlocklistMutation) SetType(b blocklist.Type) {
|
||||
func (m *BlacklistMutation) SetType(b blacklist.Type) {
|
||||
m._type = &b
|
||||
}
|
||||
|
||||
// GetType returns the value of the "type" field in the mutation.
|
||||
func (m *BlocklistMutation) GetType() (r blocklist.Type, exists bool) {
|
||||
func (m *BlacklistMutation) GetType() (r blacklist.Type, exists bool) {
|
||||
v := m._type
|
||||
if v == nil {
|
||||
return
|
||||
@@ -172,10 +173,10 @@ func (m *BlocklistMutation) GetType() (r blocklist.Type, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldType returns the old "type" field's value of the Blocklist entity.
|
||||
// If the Blocklist object wasn't provided to the builder, the object is fetched from the database.
|
||||
// OldType returns the old "type" field's value of the Blacklist entity.
|
||||
// If the Blacklist object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *BlocklistMutation) OldType(ctx context.Context) (v blocklist.Type, err error) {
|
||||
func (m *BlacklistMutation) OldType(ctx context.Context) (v blacklist.Type, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldType is only allowed on UpdateOne operations")
|
||||
}
|
||||
@@ -190,17 +191,17 @@ func (m *BlocklistMutation) OldType(ctx context.Context) (v blocklist.Type, err
|
||||
}
|
||||
|
||||
// ResetType resets all changes to the "type" field.
|
||||
func (m *BlocklistMutation) ResetType() {
|
||||
func (m *BlacklistMutation) ResetType() {
|
||||
m._type = nil
|
||||
}
|
||||
|
||||
// SetValue sets the "value" field.
|
||||
func (m *BlocklistMutation) SetValue(s string) {
|
||||
m.value = &s
|
||||
func (m *BlacklistMutation) SetValue(sv schema.BlacklistValue) {
|
||||
m.value = &sv
|
||||
}
|
||||
|
||||
// Value returns the value of the "value" field in the mutation.
|
||||
func (m *BlocklistMutation) Value() (r string, exists bool) {
|
||||
func (m *BlacklistMutation) Value() (r schema.BlacklistValue, exists bool) {
|
||||
v := m.value
|
||||
if v == nil {
|
||||
return
|
||||
@@ -208,10 +209,10 @@ func (m *BlocklistMutation) Value() (r string, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldValue returns the old "value" field's value of the Blocklist entity.
|
||||
// If the Blocklist object wasn't provided to the builder, the object is fetched from the database.
|
||||
// OldValue returns the old "value" field's value of the Blacklist entity.
|
||||
// If the Blacklist object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *BlocklistMutation) OldValue(ctx context.Context) (v string, err error) {
|
||||
func (m *BlacklistMutation) OldValue(ctx context.Context) (v schema.BlacklistValue, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldValue is only allowed on UpdateOne operations")
|
||||
}
|
||||
@@ -226,19 +227,68 @@ func (m *BlocklistMutation) OldValue(ctx context.Context) (v string, err error)
|
||||
}
|
||||
|
||||
// ResetValue resets all changes to the "value" field.
|
||||
func (m *BlocklistMutation) ResetValue() {
|
||||
func (m *BlacklistMutation) ResetValue() {
|
||||
m.value = nil
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlocklistMutation builder.
|
||||
func (m *BlocklistMutation) Where(ps ...predicate.Blocklist) {
|
||||
// SetNotes sets the "notes" field.
|
||||
func (m *BlacklistMutation) SetNotes(s string) {
|
||||
m.notes = &s
|
||||
}
|
||||
|
||||
// Notes returns the value of the "notes" field in the mutation.
|
||||
func (m *BlacklistMutation) Notes() (r string, exists bool) {
|
||||
v := m.notes
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldNotes returns the old "notes" field's value of the Blacklist entity.
|
||||
// If the Blacklist object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *BlacklistMutation) OldNotes(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldNotes is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldNotes requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldNotes: %w", err)
|
||||
}
|
||||
return oldValue.Notes, nil
|
||||
}
|
||||
|
||||
// ClearNotes clears the value of the "notes" field.
|
||||
func (m *BlacklistMutation) ClearNotes() {
|
||||
m.notes = nil
|
||||
m.clearedFields[blacklist.FieldNotes] = struct{}{}
|
||||
}
|
||||
|
||||
// NotesCleared returns if the "notes" field was cleared in this mutation.
|
||||
func (m *BlacklistMutation) NotesCleared() bool {
|
||||
_, ok := m.clearedFields[blacklist.FieldNotes]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetNotes resets all changes to the "notes" field.
|
||||
func (m *BlacklistMutation) ResetNotes() {
|
||||
m.notes = nil
|
||||
delete(m.clearedFields, blacklist.FieldNotes)
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the BlacklistMutation builder.
|
||||
func (m *BlacklistMutation) Where(ps ...predicate.Blacklist) {
|
||||
m.predicates = append(m.predicates, ps...)
|
||||
}
|
||||
|
||||
// WhereP appends storage-level predicates to the BlocklistMutation builder. Using this method,
|
||||
// WhereP appends storage-level predicates to the BlacklistMutation builder. Using this method,
|
||||
// users can use type-assertion to append predicates that do not depend on any generated package.
|
||||
func (m *BlocklistMutation) WhereP(ps ...func(*sql.Selector)) {
|
||||
p := make([]predicate.Blocklist, len(ps))
|
||||
func (m *BlacklistMutation) WhereP(ps ...func(*sql.Selector)) {
|
||||
p := make([]predicate.Blacklist, len(ps))
|
||||
for i := range ps {
|
||||
p[i] = ps[i]
|
||||
}
|
||||
@@ -246,30 +296,33 @@ func (m *BlocklistMutation) WhereP(ps ...func(*sql.Selector)) {
|
||||
}
|
||||
|
||||
// Op returns the operation name.
|
||||
func (m *BlocklistMutation) Op() Op {
|
||||
func (m *BlacklistMutation) Op() Op {
|
||||
return m.op
|
||||
}
|
||||
|
||||
// SetOp allows setting the mutation operation.
|
||||
func (m *BlocklistMutation) SetOp(op Op) {
|
||||
func (m *BlacklistMutation) SetOp(op Op) {
|
||||
m.op = op
|
||||
}
|
||||
|
||||
// Type returns the node type of this mutation (Blocklist).
|
||||
func (m *BlocklistMutation) Type() string {
|
||||
// Type returns the node type of this mutation (Blacklist).
|
||||
func (m *BlacklistMutation) Type() string {
|
||||
return m.typ
|
||||
}
|
||||
|
||||
// Fields returns all fields that were changed during this mutation. Note that in
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *BlocklistMutation) Fields() []string {
|
||||
fields := make([]string, 0, 2)
|
||||
func (m *BlacklistMutation) Fields() []string {
|
||||
fields := make([]string, 0, 3)
|
||||
if m._type != nil {
|
||||
fields = append(fields, blocklist.FieldType)
|
||||
fields = append(fields, blacklist.FieldType)
|
||||
}
|
||||
if m.value != nil {
|
||||
fields = append(fields, blocklist.FieldValue)
|
||||
fields = append(fields, blacklist.FieldValue)
|
||||
}
|
||||
if m.notes != nil {
|
||||
fields = append(fields, blacklist.FieldNotes)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
@@ -277,12 +330,14 @@ func (m *BlocklistMutation) Fields() []string {
|
||||
// Field returns the value of a field with the given name. The second boolean
|
||||
// return value indicates that this field was not set, or was not defined in the
|
||||
// schema.
|
||||
func (m *BlocklistMutation) Field(name string) (ent.Value, bool) {
|
||||
func (m *BlacklistMutation) Field(name string) (ent.Value, bool) {
|
||||
switch name {
|
||||
case blocklist.FieldType:
|
||||
case blacklist.FieldType:
|
||||
return m.GetType()
|
||||
case blocklist.FieldValue:
|
||||
case blacklist.FieldValue:
|
||||
return m.Value()
|
||||
case blacklist.FieldNotes:
|
||||
return m.Notes()
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
@@ -290,140 +345,161 @@ func (m *BlocklistMutation) Field(name string) (ent.Value, bool) {
|
||||
// OldField returns the old value of the field from the database. An error is
|
||||
// returned if the mutation operation is not UpdateOne, or the query to the
|
||||
// database failed.
|
||||
func (m *BlocklistMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
|
||||
func (m *BlacklistMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
|
||||
switch name {
|
||||
case blocklist.FieldType:
|
||||
case blacklist.FieldType:
|
||||
return m.OldType(ctx)
|
||||
case blocklist.FieldValue:
|
||||
case blacklist.FieldValue:
|
||||
return m.OldValue(ctx)
|
||||
case blacklist.FieldNotes:
|
||||
return m.OldNotes(ctx)
|
||||
}
|
||||
return nil, fmt.Errorf("unknown Blocklist field %s", name)
|
||||
return nil, fmt.Errorf("unknown Blacklist field %s", name)
|
||||
}
|
||||
|
||||
// SetField sets the value of a field with the given name. It returns an error if
|
||||
// the field is not defined in the schema, or if the type mismatched the field
|
||||
// type.
|
||||
func (m *BlocklistMutation) SetField(name string, value ent.Value) error {
|
||||
func (m *BlacklistMutation) SetField(name string, value ent.Value) error {
|
||||
switch name {
|
||||
case blocklist.FieldType:
|
||||
v, ok := value.(blocklist.Type)
|
||||
case blacklist.FieldType:
|
||||
v, ok := value.(blacklist.Type)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetType(v)
|
||||
return nil
|
||||
case blocklist.FieldValue:
|
||||
v, ok := value.(string)
|
||||
case blacklist.FieldValue:
|
||||
v, ok := value.(schema.BlacklistValue)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetValue(v)
|
||||
return nil
|
||||
case blacklist.FieldNotes:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetNotes(v)
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Blocklist field %s", name)
|
||||
return fmt.Errorf("unknown Blacklist field %s", name)
|
||||
}
|
||||
|
||||
// AddedFields returns all numeric fields that were incremented/decremented during
|
||||
// this mutation.
|
||||
func (m *BlocklistMutation) AddedFields() []string {
|
||||
func (m *BlacklistMutation) AddedFields() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddedField returns the numeric value that was incremented/decremented on a field
|
||||
// with the given name. The second boolean return value indicates that this field
|
||||
// was not set, or was not defined in the schema.
|
||||
func (m *BlocklistMutation) AddedField(name string) (ent.Value, bool) {
|
||||
func (m *BlacklistMutation) AddedField(name string) (ent.Value, bool) {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// AddField adds the value to the field with the given name. It returns an error if
|
||||
// the field is not defined in the schema, or if the type mismatched the field
|
||||
// type.
|
||||
func (m *BlocklistMutation) AddField(name string, value ent.Value) error {
|
||||
func (m *BlacklistMutation) AddField(name string, value ent.Value) error {
|
||||
switch name {
|
||||
}
|
||||
return fmt.Errorf("unknown Blocklist numeric field %s", name)
|
||||
return fmt.Errorf("unknown Blacklist numeric field %s", name)
|
||||
}
|
||||
|
||||
// ClearedFields returns all nullable fields that were cleared during this
|
||||
// mutation.
|
||||
func (m *BlocklistMutation) ClearedFields() []string {
|
||||
return nil
|
||||
func (m *BlacklistMutation) ClearedFields() []string {
|
||||
var fields []string
|
||||
if m.FieldCleared(blacklist.FieldNotes) {
|
||||
fields = append(fields, blacklist.FieldNotes)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
// FieldCleared returns a boolean indicating if a field with the given name was
|
||||
// cleared in this mutation.
|
||||
func (m *BlocklistMutation) FieldCleared(name string) bool {
|
||||
func (m *BlacklistMutation) FieldCleared(name string) bool {
|
||||
_, ok := m.clearedFields[name]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ClearField clears the value of the field with the given name. It returns an
|
||||
// error if the field is not defined in the schema.
|
||||
func (m *BlocklistMutation) ClearField(name string) error {
|
||||
return fmt.Errorf("unknown Blocklist nullable field %s", name)
|
||||
func (m *BlacklistMutation) ClearField(name string) error {
|
||||
switch name {
|
||||
case blacklist.FieldNotes:
|
||||
m.ClearNotes()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Blacklist nullable field %s", name)
|
||||
}
|
||||
|
||||
// ResetField resets all changes in the mutation for the field with the given name.
|
||||
// It returns an error if the field is not defined in the schema.
|
||||
func (m *BlocklistMutation) ResetField(name string) error {
|
||||
func (m *BlacklistMutation) ResetField(name string) error {
|
||||
switch name {
|
||||
case blocklist.FieldType:
|
||||
case blacklist.FieldType:
|
||||
m.ResetType()
|
||||
return nil
|
||||
case blocklist.FieldValue:
|
||||
case blacklist.FieldValue:
|
||||
m.ResetValue()
|
||||
return nil
|
||||
case blacklist.FieldNotes:
|
||||
m.ResetNotes()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown Blocklist field %s", name)
|
||||
return fmt.Errorf("unknown Blacklist field %s", name)
|
||||
}
|
||||
|
||||
// AddedEdges returns all edge names that were set/added in this mutation.
|
||||
func (m *BlocklistMutation) AddedEdges() []string {
|
||||
func (m *BlacklistMutation) AddedEdges() []string {
|
||||
edges := make([]string, 0, 0)
|
||||
return edges
|
||||
}
|
||||
|
||||
// AddedIDs returns all IDs (to other nodes) that were added for the given edge
|
||||
// name in this mutation.
|
||||
func (m *BlocklistMutation) AddedIDs(name string) []ent.Value {
|
||||
func (m *BlacklistMutation) AddedIDs(name string) []ent.Value {
|
||||
return nil
|
||||
}
|
||||
|
||||
// RemovedEdges returns all edge names that were removed in this mutation.
|
||||
func (m *BlocklistMutation) RemovedEdges() []string {
|
||||
func (m *BlacklistMutation) RemovedEdges() []string {
|
||||
edges := make([]string, 0, 0)
|
||||
return edges
|
||||
}
|
||||
|
||||
// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
||||
// the given name in this mutation.
|
||||
func (m *BlocklistMutation) RemovedIDs(name string) []ent.Value {
|
||||
func (m *BlacklistMutation) RemovedIDs(name string) []ent.Value {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ClearedEdges returns all edge names that were cleared in this mutation.
|
||||
func (m *BlocklistMutation) ClearedEdges() []string {
|
||||
func (m *BlacklistMutation) ClearedEdges() []string {
|
||||
edges := make([]string, 0, 0)
|
||||
return edges
|
||||
}
|
||||
|
||||
// EdgeCleared returns a boolean which indicates if the edge with the given name
|
||||
// was cleared in this mutation.
|
||||
func (m *BlocklistMutation) EdgeCleared(name string) bool {
|
||||
func (m *BlacklistMutation) EdgeCleared(name string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ClearEdge clears the value of the edge with the given name. It returns an error
|
||||
// if that edge is not defined in the schema.
|
||||
func (m *BlocklistMutation) ClearEdge(name string) error {
|
||||
return fmt.Errorf("unknown Blocklist unique edge %s", name)
|
||||
func (m *BlacklistMutation) ClearEdge(name string) error {
|
||||
return fmt.Errorf("unknown Blacklist unique edge %s", name)
|
||||
}
|
||||
|
||||
// ResetEdge resets all changes to the edge with the given name in this mutation.
|
||||
// It returns an error if the edge is not defined in the schema.
|
||||
func (m *BlocklistMutation) ResetEdge(name string) error {
|
||||
return fmt.Errorf("unknown Blocklist edge %s", name)
|
||||
func (m *BlacklistMutation) ResetEdge(name string) error {
|
||||
return fmt.Errorf("unknown Blacklist edge %s", name)
|
||||
}
|
||||
|
||||
// DownloadClientsMutation represents an operation that mutates the DownloadClients nodes in the graph.
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// Blocklist is the predicate function for blocklist builders.
|
||||
type Blocklist func(*sql.Selector)
|
||||
// Blacklist is the predicate function for blacklist builders.
|
||||
type Blacklist func(*sql.Selector)
|
||||
|
||||
// DownloadClients is the predicate function for downloadclients builders.
|
||||
type DownloadClients func(*sql.Selector)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package ent
|
||||
|
||||
import (
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/downloadclients"
|
||||
"polaris/ent/episode"
|
||||
"polaris/ent/history"
|
||||
@@ -18,6 +19,12 @@ import (
|
||||
// (default values, validators, hooks and policies) and stitches it
|
||||
// to their package variables.
|
||||
func init() {
|
||||
blacklistFields := schema.Blacklist{}.Fields()
|
||||
_ = blacklistFields
|
||||
// blacklistDescValue is the schema descriptor for value field.
|
||||
blacklistDescValue := blacklistFields[1].Descriptor()
|
||||
// blacklist.DefaultValue holds the default value on creation for the value field.
|
||||
blacklist.DefaultValue = blacklistDescValue.Default.(schema.BlacklistValue)
|
||||
downloadclientsFields := schema.DownloadClients{}.Fields()
|
||||
_ = downloadclientsFields
|
||||
// downloadclientsDescUser is the schema descriptor for user field.
|
||||
|
||||
30
ent/schema/blacklist.go
Normal file
30
ent/schema/blacklist.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// Blacklist holds the schema definition for the Blacklist entity.
|
||||
type Blacklist struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
// Fields of the Blacklist.
|
||||
func (Blacklist) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Enum("type").Values("media", "torrent"),
|
||||
field.JSON("value", BlacklistValue{}).Default(BlacklistValue{}),
|
||||
field.String("notes").Optional(),
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the Blacklist.
|
||||
func (Blacklist) Edges() []ent.Edge {
|
||||
return nil
|
||||
}
|
||||
|
||||
type BlacklistValue struct {
|
||||
TmdbID int `json:"tmdb_id"`
|
||||
TorrentHash string `json:"torrent_hash"`
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// Blocklist holds the schema definition for the Blocklist entity.
|
||||
type Blocklist struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
// Fields of the Blocklist.
|
||||
func (Blocklist) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Enum("type").Values("media", "torrent"),
|
||||
field.String("value"),
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the Blocklist.
|
||||
func (Blocklist) Edges() []ent.Edge {
|
||||
return nil
|
||||
}
|
||||
@@ -21,7 +21,7 @@ func (History) Fields() []ent.Field {
|
||||
field.Int("size").Default(0),
|
||||
field.Int("download_client_id").Optional(),
|
||||
field.Int("indexer_id").Optional(),
|
||||
field.String("link").Optional(),
|
||||
field.String("link").Optional(), //should be magnet link
|
||||
field.Enum("status").Values("running", "success", "fail", "uploading", "seeding"),
|
||||
field.String("saved").Optional(),
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ import (
|
||||
// Tx is a transactional client that is created by calling Client.Tx().
|
||||
type Tx struct {
|
||||
config
|
||||
// Blocklist is the client for interacting with the Blocklist builders.
|
||||
Blocklist *BlocklistClient
|
||||
// Blacklist is the client for interacting with the Blacklist builders.
|
||||
Blacklist *BlacklistClient
|
||||
// DownloadClients is the client for interacting with the DownloadClients builders.
|
||||
DownloadClients *DownloadClientsClient
|
||||
// Episode is the client for interacting with the Episode builders.
|
||||
@@ -163,7 +163,7 @@ func (tx *Tx) Client() *Client {
|
||||
}
|
||||
|
||||
func (tx *Tx) init() {
|
||||
tx.Blocklist = NewBlocklistClient(tx.config)
|
||||
tx.Blacklist = NewBlacklistClient(tx.config)
|
||||
tx.DownloadClients = NewDownloadClientsClient(tx.config)
|
||||
tx.Episode = NewEpisodeClient(tx.config)
|
||||
tx.History = NewHistoryClient(tx.config)
|
||||
@@ -182,7 +182,7 @@ func (tx *Tx) init() {
|
||||
// of them in order to commit or rollback the transaction.
|
||||
//
|
||||
// If a closed transaction is embedded in one of the generated entities, and the entity
|
||||
// applies a query, for example: Blocklist.QueryXXX(), the query will be executed
|
||||
// applies a query, for example: Blacklist.QueryXXX(), the query will be executed
|
||||
// through the driver which created this transaction.
|
||||
//
|
||||
// Note that txDriver is not goroutine safe.
|
||||
|
||||
62
go.mod
62
go.mod
@@ -15,6 +15,7 @@ require (
|
||||
|
||||
require (
|
||||
github.com/PuerkitoBio/goquery v1.9.2
|
||||
github.com/anacrolix/torrent v1.57.1
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
|
||||
github.com/gin-contrib/zap v1.1.3
|
||||
github.com/ncruces/go-sqlite3 v0.18.4
|
||||
@@ -25,91 +26,30 @@ require (
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
|
||||
github.com/RoaringBitmap/roaring v1.2.3 // indirect
|
||||
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect
|
||||
github.com/alecthomas/atomic v0.1.0-alpha2 // indirect
|
||||
github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 // indirect
|
||||
github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444 // indirect
|
||||
github.com/anacrolix/envpprof v1.3.0 // indirect
|
||||
github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca // indirect
|
||||
github.com/anacrolix/go-libutp v1.3.1 // indirect
|
||||
github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 // indirect
|
||||
github.com/anacrolix/missinggo v1.3.0 // indirect
|
||||
github.com/anacrolix/missinggo/perf v1.0.0 // indirect
|
||||
github.com/anacrolix/missinggo/v2 v2.7.4 // indirect
|
||||
github.com/anacrolix/mmsg v1.0.0 // indirect
|
||||
github.com/anacrolix/multiless v0.3.0 // indirect
|
||||
github.com/anacrolix/stm v0.4.0 // indirect
|
||||
github.com/anacrolix/sync v0.5.1 // indirect
|
||||
github.com/anacrolix/torrent v1.57.1 // indirect
|
||||
github.com/anacrolix/upnp v0.1.4 // indirect
|
||||
github.com/anacrolix/utp v0.1.0 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||
github.com/bahlo/generic-list-go v0.2.0 // indirect
|
||||
github.com/benbjohnson/immutable v0.3.0 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.2.2 // indirect
|
||||
github.com/blinkbean/dingtalk v1.1.3 // indirect
|
||||
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
|
||||
github.com/cespare/xxhash v1.1.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/edsrzf/mmap-go v1.1.0 // indirect
|
||||
github.com/go-llsqlite/adapter v0.0.0-20230927005056-7f5ce7f0c916 // indirect
|
||||
github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect
|
||||
github.com/go-test/deep v1.0.4 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/gregdel/pushover v1.3.1 // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
github.com/minio/sha256-simd v1.0.0 // indirect
|
||||
github.com/mr-tron/base58 v1.2.0 // indirect
|
||||
github.com/mschoch/smat v0.2.0 // indirect
|
||||
github.com/multiformats/go-multihash v0.2.3 // indirect
|
||||
github.com/multiformats/go-varint v0.0.6 // indirect
|
||||
github.com/ncruces/julianday v1.0.0 // indirect
|
||||
github.com/pion/datachannel v1.5.2 // indirect
|
||||
github.com/pion/dtls/v2 v2.2.4 // indirect
|
||||
github.com/pion/ice/v2 v2.2.6 // indirect
|
||||
github.com/pion/interceptor v0.1.11 // indirect
|
||||
github.com/pion/logging v0.2.2 // indirect
|
||||
github.com/pion/mdns v0.0.5 // indirect
|
||||
github.com/pion/randutil v0.1.0 // indirect
|
||||
github.com/pion/rtcp v1.2.9 // indirect
|
||||
github.com/pion/rtp v1.7.13 // indirect
|
||||
github.com/pion/sctp v1.8.2 // indirect
|
||||
github.com/pion/sdp/v3 v3.0.5 // indirect
|
||||
github.com/pion/srtp/v2 v2.0.9 // indirect
|
||||
github.com/pion/stun v0.3.5 // indirect
|
||||
github.com/pion/transport v0.13.1 // indirect
|
||||
github.com/pion/transport/v2 v2.0.0 // indirect
|
||||
github.com/pion/turn/v2 v2.0.8 // indirect
|
||||
github.com/pion/udp v0.1.4 // indirect
|
||||
github.com/pion/webrtc/v3 v3.1.42 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/protolambda/ctxlock v0.1.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/stretchr/objx v0.5.2 // indirect
|
||||
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
|
||||
github.com/tetratelabs/wazero v1.8.0 // indirect
|
||||
github.com/tidwall/btree v1.6.0 // indirect
|
||||
go.etcd.io/bbolt v1.3.6 // indirect
|
||||
go.opentelemetry.io/otel v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.28.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.28.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
lukechampine.com/blake3 v1.1.6 // indirect
|
||||
modernc.org/libc v1.22.3 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.5.0 // indirect
|
||||
modernc.org/sqlite v1.21.1 // indirect
|
||||
zombiezen.com/go/sqlite v0.13.1 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
|
||||
228
go.sum
228
go.sum
@@ -11,96 +11,53 @@ github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0
|
||||
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE=
|
||||
github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
|
||||
github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
|
||||
github.com/RoaringBitmap/roaring v0.4.17/go.mod h1:D3qVegWTmfCaX4Bl5CrBE9hfrSrrXIr8KVNvRsDi1NI=
|
||||
github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo=
|
||||
github.com/RoaringBitmap/roaring v1.2.3 h1:yqreLINqIrX22ErkKI0vY47/ivtJr6n+kMhVOVmhWBY=
|
||||
github.com/RoaringBitmap/roaring v1.2.3/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE=
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
|
||||
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
|
||||
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0=
|
||||
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k=
|
||||
github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8=
|
||||
github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 h1:eyb0bBaQKMOh5Se/Qg54shijc8K4zpQiOjEhKFADkQM=
|
||||
github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k=
|
||||
github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444 h1:8V0K09lrGoeT2KRJNOtspA7q+OMxGwQqK/Ug0IiaaRE=
|
||||
github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444/go.mod h1:MctKM1HS5YYDb3F30NGJxLE+QPuqWoT5ReW/4jt8xew=
|
||||
github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
|
||||
github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
|
||||
github.com/anacrolix/envpprof v1.1.0/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4=
|
||||
github.com/anacrolix/envpprof v1.3.0 h1:WJt9bpuT7A/CDCxPOv/eeZqHWlle/Y0keJUvc6tcJDk=
|
||||
github.com/anacrolix/envpprof v1.3.0/go.mod h1:7QIG4CaX1uexQ3tqd5+BRa/9e2D02Wcertl6Yh0jCB0=
|
||||
github.com/anacrolix/generics v0.0.0-20230113004304-d6428d516633/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
|
||||
github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca h1:aiiGqSQWjtVNdi8zUMfA//IrM8fPkv2bWwZVPbDe0wg=
|
||||
github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca/go.mod h1:MN3ve08Z3zSV/rTuX/ouI4lNdlfTxgdafQJiLzyNRB8=
|
||||
github.com/anacrolix/go-libutp v1.3.1 h1:idJzreNLl+hNjGC3ZnUOjujEaryeOGgkwHLqSGoige0=
|
||||
github.com/anacrolix/go-libutp v1.3.1/go.mod h1:heF41EC8kN0qCLMokLBVkB8NXiLwx3t8R8810MTNI5o=
|
||||
github.com/anacrolix/log v0.3.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU=
|
||||
github.com/anacrolix/log v0.6.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU=
|
||||
github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+BFxZ68=
|
||||
github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY=
|
||||
github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 h1:9o/yVzzLzYaBDFx8B27yhkvBLhNnRAuSTK7Y+yZKVtU=
|
||||
github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83/go.mod h1:xvHjsYWWP7yO8PZwtuIp/k0DBlu07pSJqH4SEC78Vwc=
|
||||
github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62/go.mod h1:66cFKPCO7Sl4vbFnAaSq7e4OXtdMhRSBagJGWgmpJbM=
|
||||
github.com/anacrolix/missinggo v0.0.0-20180725070939-60ef2fbf63df/go.mod h1:kwGiTUTZ0+p4vAz3VbAI5a30t2YbvemcmspjKwrAz5s=
|
||||
github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo=
|
||||
github.com/anacrolix/missinggo v1.1.2-0.20190815015349-b888af804467/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo=
|
||||
github.com/anacrolix/missinggo v1.2.1/go.mod h1:J5cMhif8jPmFoC3+Uvob3OXXNIhOUikzMt+uUjeM21Y=
|
||||
github.com/anacrolix/missinggo v1.3.0 h1:06HlMsudotL7BAELRZs0yDZ4yVXsHXGi323QBjAVASw=
|
||||
github.com/anacrolix/missinggo v1.3.0/go.mod h1:bqHm8cE8xr+15uVfMG3BFui/TxyB6//H5fwlq/TeqMc=
|
||||
github.com/anacrolix/missinggo/perf v1.0.0 h1:7ZOGYziGEBytW49+KmYGTaNfnwUqP1HBsy6BqESAJVw=
|
||||
github.com/anacrolix/missinggo/perf v1.0.0/go.mod h1:ljAFWkBuzkO12MQclXzZrosP5urunoLS0Cbvb4V0uMQ=
|
||||
github.com/anacrolix/missinggo/v2 v2.2.0/go.mod h1:o0jgJoYOyaoYQ4E2ZMISVa9c88BbUBVQQW4QeRkNCGY=
|
||||
github.com/anacrolix/missinggo/v2 v2.5.1/go.mod h1:WEjqh2rmKECd0t1VhQkLGTdIWXO6f6NLjp5GlMZ+6FA=
|
||||
github.com/anacrolix/missinggo/v2 v2.7.4 h1:47h5OXoPV8JbA/ACA+FLwKdYbAinuDO8osc2Cu9xkxg=
|
||||
github.com/anacrolix/missinggo/v2 v2.7.4/go.mod h1:vVO5FEziQm+NFmJesc7StpkquZk+WJFCaL0Wp//2sa0=
|
||||
github.com/anacrolix/mmsg v0.0.0-20180515031531-a4a3ba1fc8bb/go.mod h1:x2/ErsYUmT77kezS63+wzZp8E3byYB0gzirM/WMBLfw=
|
||||
github.com/anacrolix/mmsg v1.0.0 h1:btC7YLjOn29aTUAExJiVUhQOuf/8rhm+/nWCMAnL3Hg=
|
||||
github.com/anacrolix/mmsg v1.0.0/go.mod h1:x8kRaJY/dCrY9Al0PEcj1mb/uFHwP6GCJ9fLl4thEPc=
|
||||
github.com/anacrolix/multiless v0.3.0 h1:5Bu0DZncjE4e06b9r1Ap2tUY4Au0NToBP5RpuEngSis=
|
||||
github.com/anacrolix/multiless v0.3.0/go.mod h1:TrCLEZfIDbMVfLoQt5tOoiBS/uq4y8+ojuEVVvTNPX4=
|
||||
github.com/anacrolix/stm v0.2.0/go.mod h1:zoVQRvSiGjGoTmbM0vSLIiaKjWtNPeTvXUSdJQA4hsg=
|
||||
github.com/anacrolix/stm v0.4.0 h1:tOGvuFwaBjeu1u9X1eIh9TX8OEedEiEQ1se1FjhFnXY=
|
||||
github.com/anacrolix/stm v0.4.0/go.mod h1:GCkwqWoAsP7RfLW+jw+Z0ovrt2OO7wRzcTtFYMYY5t8=
|
||||
github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778/go.mod h1:s735Etp3joe/voe2sdaXLcqDdJSay1O0OPnM0ystjqk=
|
||||
github.com/anacrolix/sync v0.3.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g=
|
||||
github.com/anacrolix/sync v0.5.1 h1:FbGju6GqSjzVoTgcXTUKkF041lnZkG5P0C3T5RL3SGc=
|
||||
github.com/anacrolix/sync v0.5.1/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g=
|
||||
github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw=
|
||||
github.com/anacrolix/tagflag v1.0.0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw=
|
||||
github.com/anacrolix/tagflag v1.1.0/go.mod h1:Scxs9CV10NQatSmbyjqmqmeQNwGzlNe0CMUMIxqHIG8=
|
||||
github.com/anacrolix/torrent v1.57.1 h1:CS8rYfC2Oe15NPBhwCNs/3WBY6HiBCPDFpY+s9aFHbA=
|
||||
github.com/anacrolix/torrent v1.57.1/go.mod h1:NNBg4lP2/us9Hp5+cLNcZRILM69cNoKIkqMGqr9AuR0=
|
||||
github.com/anacrolix/upnp v0.1.4 h1:+2t2KA6QOhm/49zeNyeVwDu1ZYS9dB9wfxyVvh/wk7U=
|
||||
github.com/anacrolix/upnp v0.1.4/go.mod h1:Qyhbqo69gwNWvEk1xNTXsS5j7hMHef9hdr984+9fIic=
|
||||
github.com/anacrolix/utp v0.1.0 h1:FOpQOmIwYsnENnz7tAGohA+r6iXpRjrq8ssKSre2Cp4=
|
||||
github.com/anacrolix/utp v0.1.0/go.mod h1:MDwc+vsGEq7RMw6lr2GKOEqjWny5hO5OZXRVNaBJ2Dk=
|
||||
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
|
||||
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
|
||||
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
|
||||
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
|
||||
github.com/benbjohnson/immutable v0.2.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI=
|
||||
github.com/benbjohnson/immutable v0.3.0 h1:TVRhuZx2wG9SZ0LRdqlbs9S5BZ6Y24hJEHTCgWHZEIw=
|
||||
github.com/benbjohnson/immutable v0.3.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||
github.com/bits-and-blooms/bitset v1.2.2 h1:J5gbX05GpMdBjCvQ9MteIg2KKDExr7DrgK+Yc15FvIk=
|
||||
github.com/bits-and-blooms/bitset v1.2.2/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||
github.com/blinkbean/dingtalk v1.1.3 h1:MbidFZYom7DTFHD/YIs+eaI7kRy52kmWE/sy0xjo6E4=
|
||||
github.com/blinkbean/dingtalk v1.1.3/go.mod h1:9BaLuGSBqY3vT5hstValh48DbsKO7vaHaJnG9pXwbto=
|
||||
github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo=
|
||||
@@ -111,15 +68,12 @@ github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc
|
||||
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
|
||||
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
|
||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=
|
||||
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
||||
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
|
||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/cyruzin/golang-tmdb v1.6.3 h1:TKK9h+uuwiDOaFlsVispG1KxqhsSM5Y4ZELnUF3GlqU=
|
||||
github.com/cyruzin/golang-tmdb v1.6.3/go.mod h1:ZSryJLCcY+9TiKU+LbouXKns++YBrM8Tizannr05c+I=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -128,19 +82,13 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
|
||||
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ=
|
||||
github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q=
|
||||
github.com/frankban/quicktest v1.9.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
|
||||
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
|
||||
@@ -161,17 +109,8 @@ github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e/go.mod h1:Ogl1T
|
||||
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-llsqlite/adapter v0.0.0-20230927005056-7f5ce7f0c916 h1:OyQmpAN302wAopDgwVjgs2HkFawP9ahIEqkUYz7V7CA=
|
||||
github.com/go-llsqlite/adapter v0.0.0-20230927005056-7f5ce7f0c916/go.mod h1:DADrR88ONKPPeSGjFp5iEN55Arx3fi2qXZeKCYDpbmU=
|
||||
github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568 h1:3EpZo8LxIzF4q3BT+vttQQlRfA6uTtTb/cxVisWa5HM=
|
||||
github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568/go.mod h1:/YJdV7uBQaYDE0fwe4z3wwJIZBJxdYzd38ICggWqtaE=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
|
||||
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
@@ -183,7 +122,6 @@ github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91
|
||||
github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8=
|
||||
github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
|
||||
github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho=
|
||||
@@ -207,25 +145,17 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
|
||||
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
@@ -234,8 +164,6 @@ github.com/gopherjs/gopherjs v0.0.0-20190309154008-847fc94819f9/go.mod h1:wJfORR
|
||||
github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gregdel/pushover v1.3.1 h1:4bMLITOZ15+Zpi6qqoGqOPuVHCwSUvMCgVnN5Xhilfo=
|
||||
github.com/gregdel/pushover v1.3.1/go.mod h1:EcaO66Nn1StkpEm1iKtBTV3d2A16SoMsVER1PthX7to=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
@@ -252,7 +180,6 @@ github.com/hekmon/transmissionrpc/v3 v3.0.0/go.mod h1:38SlNhFzinVUuY87wGj3acOmRx
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
|
||||
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
|
||||
github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
|
||||
github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
@@ -275,8 +202,6 @@ github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgSh
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
@@ -312,7 +237,6 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
|
||||
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
||||
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
||||
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
|
||||
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
|
||||
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
|
||||
github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
|
||||
github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
|
||||
@@ -327,68 +251,16 @@ github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt
|
||||
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
|
||||
github.com/nikoksr/notify v1.0.0 h1:qe9/6FRsWdxBgQgWcpvQ0sv8LRGJZDpRB4TkL2uNdO8=
|
||||
github.com/nikoksr/notify v1.0.0/go.mod h1:hPaaDt30d6LAA7/5nb0e48Bp/MctDfycCSs8VEgN29I=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
||||
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
|
||||
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
||||
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pion/datachannel v1.5.2 h1:piB93s8LGmbECrpO84DnkIVWasRMk3IimbcXkTQLE6E=
|
||||
github.com/pion/datachannel v1.5.2/go.mod h1:FTGQWaHrdCwIJ1rw6xBIfZVkslikjShim5yr05XFuCQ=
|
||||
github.com/pion/dtls/v2 v2.1.3/go.mod h1:o6+WvyLDAlXF7YiPB/RlskRoeK+/JtuaZa5emwQcWus=
|
||||
github.com/pion/dtls/v2 v2.1.5/go.mod h1:BqCE7xPZbPSubGasRoDFJeTsyJtdD1FanJYL0JGheqY=
|
||||
github.com/pion/dtls/v2 v2.2.4 h1:YSfYwDQgrxMYXLBc/m7PFY5BVtWlNm/DN4qoU2CbcWg=
|
||||
github.com/pion/dtls/v2 v2.2.4/go.mod h1:WGKfxqhrddne4Kg3p11FUMJrynkOY4lb25zHNO49wuw=
|
||||
github.com/pion/ice/v2 v2.2.6 h1:R/vaLlI1J2gCx141L5PEwtuGAGcyS6e7E0hDeJFq5Ig=
|
||||
github.com/pion/ice/v2 v2.2.6/go.mod h1:SWuHiOGP17lGromHTFadUe1EuPgFh/oCU6FCMZHooVE=
|
||||
github.com/pion/interceptor v0.1.11 h1:00U6OlqxA3FFB50HSg25J/8cWi7P6FbSzw4eFn24Bvs=
|
||||
github.com/pion/interceptor v0.1.11/go.mod h1:tbtKjZY14awXd7Bq0mmWvgtHB5MDaRN7HV3OZ/uy7s8=
|
||||
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
||||
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
|
||||
github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw=
|
||||
github.com/pion/mdns v0.0.5/go.mod h1:UgssrvdD3mxpi8tMxAXbsppL3vJ4Jipw1mTCW+al01g=
|
||||
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
|
||||
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
|
||||
github.com/pion/rtcp v1.2.9 h1:1ujStwg++IOLIEoOiIQ2s+qBuJ1VN81KW+9pMPsif+U=
|
||||
github.com/pion/rtcp v1.2.9/go.mod h1:qVPhiCzAm4D/rxb6XzKeyZiQK69yJpbUDJSF7TgrqNo=
|
||||
github.com/pion/rtp v1.7.13 h1:qcHwlmtiI50t1XivvoawdCGTP4Uiypzfrsap+bijcoA=
|
||||
github.com/pion/rtp v1.7.13/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
|
||||
github.com/pion/sctp v1.8.0/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
|
||||
github.com/pion/sctp v1.8.2 h1:yBBCIrUMJ4yFICL3RIvR4eh/H2BTTvlligmSTy+3kiA=
|
||||
github.com/pion/sctp v1.8.2/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
|
||||
github.com/pion/sdp/v3 v3.0.5 h1:ouvI7IgGl+V4CrqskVtr3AaTrPvPisEOxwgpdktctkU=
|
||||
github.com/pion/sdp/v3 v3.0.5/go.mod h1:iiFWFpQO8Fy3S5ldclBkpXqmWy02ns78NOKoLLL0YQw=
|
||||
github.com/pion/srtp/v2 v2.0.9 h1:JJq3jClmDFBPX/F5roEb0U19jSU7eUhyDqR/NZ34EKQ=
|
||||
github.com/pion/srtp/v2 v2.0.9/go.mod h1:5TtM9yw6lsH0ppNCehB/EjEUli7VkUgKSPJqWVqbhQ4=
|
||||
github.com/pion/stun v0.3.5 h1:uLUCBCkQby4S1cf6CGuR9QrVOKcvUwFeemaC865QHDg=
|
||||
github.com/pion/stun v0.3.5/go.mod h1:gDMim+47EeEtfWogA37n6qXZS88L5V6LqFcf+DZA2UA=
|
||||
github.com/pion/transport v0.12.2/go.mod h1:N3+vZQD9HlDP5GWkZ85LohxNsDcNgofQmyL6ojX5d8Q=
|
||||
github.com/pion/transport v0.12.3/go.mod h1:OViWW9SP2peE/HbwBvARicmAVnesphkNkCVZIWJ6q9A=
|
||||
github.com/pion/transport v0.13.0/go.mod h1:yxm9uXpK9bpBBWkITk13cLo1y5/ur5VQpG22ny6EP7g=
|
||||
github.com/pion/transport v0.13.1 h1:/UH5yLeQtwm2VZIPjxwnNFxjS4DFhyLfS4GlfuKUzfA=
|
||||
github.com/pion/transport v0.13.1/go.mod h1:EBxbqzyv+ZrmDb82XswEE0BjfQFtuw1Nu6sjnjWCsGg=
|
||||
github.com/pion/transport/v2 v2.0.0 h1:bsMYyqHCbkvHwj+eNCFBuxtlKndKfyGI2vaQmM3fIE4=
|
||||
github.com/pion/transport/v2 v2.0.0/go.mod h1:HS2MEBJTwD+1ZI2eSXSvHJx/HnzQqRy2/LXxt6eVMHc=
|
||||
github.com/pion/turn/v2 v2.0.8 h1:KEstL92OUN3k5k8qxsXHpr7WWfrdp7iJZHx99ud8muw=
|
||||
github.com/pion/turn/v2 v2.0.8/go.mod h1:+y7xl719J8bAEVpSXBXvTxStjJv3hbz9YFflvkpcGPw=
|
||||
github.com/pion/udp v0.1.1/go.mod h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M=
|
||||
github.com/pion/udp v0.1.4 h1:OowsTmu1Od3sD6i3fQUJxJn2fEvJO6L1TidgadtbTI8=
|
||||
github.com/pion/udp v0.1.4/go.mod h1:G8LDo56HsFwC24LIcnT4YIDU5qcB6NepqqjP0keL2us=
|
||||
github.com/pion/webrtc/v3 v3.1.42 h1:wJEQFIXVanptnQcHOLTuIo4AtGB2+mG2x4OhIhnITOA=
|
||||
github.com/pion/webrtc/v3 v3.1.42/go.mod h1:ffD9DulDrPxyWvDPUIPAOSAWx9GUlOExiJPf7cCcMLA=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
@@ -412,26 +284,16 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/protolambda/ctxlock v0.1.0 h1:rCUY3+vRdcdZXqT07iXgyr744J2DU2LCBIXowYAjBCE=
|
||||
github.com/protolambda/ctxlock v0.1.0/go.mod h1:vefhX6rIZH8rsg5ZpOJfEDYQOppZi19SfPiGOFrNnwM=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
|
||||
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 h1:Lt9DzQALzHoDwMBGJ6v8ObDPR0dzr2a6sXTB1Fq7IHs=
|
||||
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA=
|
||||
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8=
|
||||
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
|
||||
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
|
||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
|
||||
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
@@ -442,7 +304,6 @@ github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:X
|
||||
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs=
|
||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||
@@ -465,8 +326,6 @@ github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
@@ -480,8 +339,6 @@ github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQ
|
||||
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog=
|
||||
github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g=
|
||||
github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
|
||||
github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg=
|
||||
github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
|
||||
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
@@ -493,22 +350,12 @@ github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+
|
||||
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
|
||||
github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
|
||||
github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
|
||||
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
|
||||
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
|
||||
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
|
||||
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
|
||||
go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
|
||||
go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
|
||||
go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
|
||||
go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
@@ -520,32 +367,18 @@ golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
|
||||
golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
|
||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
|
||||
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
|
||||
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
|
||||
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -556,29 +389,13 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r
|
||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220531201128-c960675eff93/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
||||
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
||||
@@ -590,8 +407,6 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
@@ -602,30 +417,15 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
@@ -633,24 +433,17 @@ golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
@@ -658,18 +451,12 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
|
||||
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
|
||||
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
|
||||
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
@@ -685,9 +472,6 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
@@ -696,7 +480,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
@@ -707,7 +490,6 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -717,15 +499,5 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c=
|
||||
lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA=
|
||||
modernc.org/libc v1.22.3 h1:D/g6O5ftAfavceqlLOFwaZuA5KYafKwmr30A6iSqoyY=
|
||||
modernc.org/libc v1.22.3/go.mod h1:MQrloYP209xa2zHome2a8HLiLm6k0UT8CoHpV74tOFw=
|
||||
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
|
||||
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
|
||||
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||
modernc.org/sqlite v1.21.1 h1:GyDFqNnESLOhwwDRaHGdp2jKLDzpyT/rNLglX3ZkMSU=
|
||||
modernc.org/sqlite v1.21.1/go.mod h1:XwQ0wZPIh1iKb5mkvCJ3szzbhk+tykC8ZWqTRTgYRwI=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
zombiezen.com/go/sqlite v0.13.1 h1:qDzxyWWmMtSSEH5qxamqBFmqA2BLSSbtODi3ojaE02o=
|
||||
zombiezen.com/go/sqlite v0.13.1/go.mod h1:Ht/5Rg3Ae2hoyh1I7gbWtWAl89CNocfqeb/aAMTkJr4=
|
||||
|
||||
@@ -3,12 +3,15 @@ package server
|
||||
import (
|
||||
"fmt"
|
||||
"polaris/ent"
|
||||
"polaris/ent/blacklist"
|
||||
"polaris/ent/episode"
|
||||
"polaris/ent/history"
|
||||
"polaris/ent/schema"
|
||||
"polaris/log"
|
||||
"polaris/pkg/utils"
|
||||
"strconv"
|
||||
|
||||
"github.com/anacrolix/torrent/metainfo"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@@ -63,22 +66,35 @@ func (s *Server) GetAllActivities(c *gin.Context) (interface{}, error) {
|
||||
return activities, nil
|
||||
}
|
||||
|
||||
type removeActivityIn struct {
|
||||
ID int `json:"id"`
|
||||
Add2Blacklist bool `json:"add_2_blacklist"`
|
||||
}
|
||||
|
||||
func (s *Server) RemoveActivity(c *gin.Context) (interface{}, error) {
|
||||
ids := c.Param("id")
|
||||
id, err := strconv.Atoi(ids)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "convert")
|
||||
var in removeActivityIn
|
||||
if err := c.ShouldBindJSON(&in); err != nil {
|
||||
return nil, errors.Wrap(err, "bind json")
|
||||
}
|
||||
his := s.db.GetHistory(id)
|
||||
|
||||
his := s.db.GetHistory(in.ID)
|
||||
if his == nil {
|
||||
log.Errorf("no record of id: %d", id)
|
||||
log.Errorf("no record of id: %d", in.ID)
|
||||
return nil, nil
|
||||
}
|
||||
if in.Add2Blacklist && his.Link != "" {
|
||||
//should add to blacklist
|
||||
if err := s.addTorrent2Blacklist(his.Link); err != nil {
|
||||
return nil, errors.Errorf("add to blacklist: %v", err)
|
||||
} else {
|
||||
log.Infof("success add magnet link to blacklist: %v", his.Link)
|
||||
}
|
||||
}
|
||||
|
||||
if err := s.core.RemoveTaskAndTorrent(his.ID); err != nil {
|
||||
return nil, errors.Wrap(err, "remove torrent")
|
||||
}
|
||||
err = s.db.DeleteHistory(id)
|
||||
err := s.db.DeleteHistory(in.ID)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "db")
|
||||
}
|
||||
@@ -102,6 +118,40 @@ func (s *Server) RemoveActivity(c *gin.Context) (interface{}, error) {
|
||||
log.Infof("history record successful deleted: %v", his.SourceTitle)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (s *Server) addTorrent2Blacklist(link string) error {
|
||||
if link == "" {
|
||||
return nil
|
||||
}
|
||||
if mi, err := metainfo.ParseMagnetV2Uri(link); err != nil {
|
||||
return errors.Errorf("magnet link is not valid: %v", err)
|
||||
} else {
|
||||
hash := ""
|
||||
if mi.InfoHash.Unwrap().HexString() != "" {
|
||||
hash = mi.InfoHash.Unwrap().HexString()
|
||||
} else {
|
||||
btmh := mi.V2InfoHash.Unwrap()
|
||||
if btmh.HexString() != "" {
|
||||
hash = btmh.HexString()
|
||||
}
|
||||
}
|
||||
if hash == "" {
|
||||
return errors.Errorf("magnet has no info hash: %v", link)
|
||||
}
|
||||
item := ent.Blacklist{
|
||||
Type: blacklist.TypeTorrent,
|
||||
Value: schema.BlacklistValue{
|
||||
TorrentHash: hash,
|
||||
},
|
||||
}
|
||||
err := s.db.AddBlacklistItem(&item)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "add to db")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) GetMediaDownloadHistory(c *gin.Context) (interface{}, error) {
|
||||
var ids = c.Param("id")
|
||||
id, err := strconv.Atoi(ids)
|
||||
|
||||
@@ -74,7 +74,7 @@ func (s *Server) Serve() error {
|
||||
activity := api.Group("/activity")
|
||||
{
|
||||
activity.GET("/", HttpHandler(s.GetAllActivities))
|
||||
activity.DELETE("/:id", HttpHandler(s.RemoveActivity))
|
||||
activity.POST("/delete", HttpHandler(s.RemoveActivity))
|
||||
activity.GET("/media/:id", HttpHandler(s.GetMediaDownloadHistory))
|
||||
activity.GET("/torrents", HttpHandler(s.GetAllTorrents))
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class _ActivityPageState extends ConsumerState<ActivityPage>
|
||||
trailing: selectedTab == 0
|
||||
? IconButton(
|
||||
tooltip: "删除任务",
|
||||
onPressed: () => onDelete()(ac.id!.toString()),
|
||||
onPressed: () => onDelete()(ac.id!),
|
||||
icon: const Icon(Icons.delete))
|
||||
: const Text("-"),
|
||||
),
|
||||
@@ -155,7 +155,7 @@ class _ActivityPageState extends ConsumerState<ActivityPage>
|
||||
);
|
||||
}
|
||||
|
||||
Function(String) onDelete() {
|
||||
Function(int) onDelete() {
|
||||
return (id) {
|
||||
final f = ref
|
||||
.read(activitiesDataProvider("active").notifier)
|
||||
|
||||
@@ -30,6 +30,7 @@ class APIs {
|
||||
static final logoutUrl = "$_baseUrl/api/v1/setting/logout";
|
||||
static final loginSettingUrl = "$_baseUrl/api/v1/setting/auth";
|
||||
static final activityUrl = "$_baseUrl/api/v1/activity/";
|
||||
static final activityDeleteUrl = "$_baseUrl/api/v1/activity/delete";
|
||||
static final activityMediaUrl = "$_baseUrl/api/v1/activity/media/";
|
||||
static final imagesUrl = "$_baseUrl/api/v1/img";
|
||||
static final logsBaseUrl = "$_baseUrl/api/v1/logs/";
|
||||
|
||||
@@ -4,9 +4,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:ui/providers/APIs.dart';
|
||||
import 'package:ui/providers/server_response.dart';
|
||||
|
||||
var activitiesDataProvider =
|
||||
AsyncNotifierProvider.autoDispose.family<ActivityData, List<Activity>, String>(
|
||||
ActivityData.new);
|
||||
var activitiesDataProvider = AsyncNotifierProvider.autoDispose
|
||||
.family<ActivityData, List<Activity>, String>(ActivityData.new);
|
||||
|
||||
var mediaHistoryDataProvider = FutureProvider.autoDispose.family(
|
||||
(ref, arg) async {
|
||||
@@ -24,7 +23,8 @@ var mediaHistoryDataProvider = FutureProvider.autoDispose.family(
|
||||
},
|
||||
);
|
||||
|
||||
class ActivityData extends AutoDisposeFamilyAsyncNotifier<List<Activity>, String> {
|
||||
class ActivityData
|
||||
extends AutoDisposeFamilyAsyncNotifier<List<Activity>, String> {
|
||||
@override
|
||||
FutureOr<List<Activity>> build(String arg) async {
|
||||
if (arg == "active") {
|
||||
@@ -47,9 +47,12 @@ class ActivityData extends AutoDisposeFamilyAsyncNotifier<List<Activity>, String
|
||||
return activities;
|
||||
}
|
||||
|
||||
Future<void> deleteActivity(String id) async {
|
||||
final dio = await APIs.getDio();
|
||||
var resp = await dio.delete("${APIs.activityUrl}$id");
|
||||
Future<void> deleteActivity(int id) async {
|
||||
final dio = APIs.getDio();
|
||||
var resp = await dio.post(APIs.activityDeleteUrl, data: {
|
||||
"id": id,
|
||||
"add_2_blacklist": false,
|
||||
});
|
||||
final sp = ServerResponse.fromJson(resp.data);
|
||||
if (sp.code != 0) {
|
||||
throw sp.message;
|
||||
|
||||
Reference in New Issue
Block a user