Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AccessControl
- type AccessControlClient
- func (c *AccessControlClient) Create() *AccessControlCreate
- func (c *AccessControlClient) CreateBulk(builders ...*AccessControlCreate) *AccessControlCreateBulk
- func (c *AccessControlClient) Delete() *AccessControlDelete
- func (c *AccessControlClient) DeleteOne(ac *AccessControl) *AccessControlDeleteOne
- func (c *AccessControlClient) DeleteOneID(id int64) *AccessControlDeleteOne
- func (c *AccessControlClient) Get(ctx context.Context, id int64) (*AccessControl, error)
- func (c *AccessControlClient) GetX(ctx context.Context, id int64) *AccessControl
- func (c *AccessControlClient) Hooks() []Hook
- func (c *AccessControlClient) Intercept(interceptors ...Interceptor)
- func (c *AccessControlClient) Interceptors() []Interceptor
- func (c *AccessControlClient) MapCreateBulk(slice any, setFunc func(*AccessControlCreate, int)) *AccessControlCreateBulk
- func (c *AccessControlClient) Query() *AccessControlQuery
- func (c *AccessControlClient) Update() *AccessControlUpdate
- func (c *AccessControlClient) UpdateOne(ac *AccessControl) *AccessControlUpdateOne
- func (c *AccessControlClient) UpdateOneID(id int64) *AccessControlUpdateOne
- func (c *AccessControlClient) Use(hooks ...Hook)
- type AccessControlCreate
- func (acc *AccessControlCreate) Exec(ctx context.Context) error
- func (acc *AccessControlCreate) ExecX(ctx context.Context)
- func (acc *AccessControlCreate) Mutation() *AccessControlMutation
- func (acc *AccessControlCreate) Save(ctx context.Context) (*AccessControl, error)
- func (acc *AccessControlCreate) SaveX(ctx context.Context) *AccessControl
- func (acc *AccessControlCreate) SetCreatedAt(t time.Time) *AccessControlCreate
- func (acc *AccessControlCreate) SetID(i int64) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableCreatedAt(t *time.Time) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillablePtype(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableUpdatedAt(t *time.Time) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableV0(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableV1(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableV2(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableV3(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableV4(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetNillableV5(s *string) *AccessControlCreate
- func (acc *AccessControlCreate) SetPtype(s string) *AccessControlCreate
- func (acc *AccessControlCreate) SetUpdatedAt(t time.Time) *AccessControlCreate
- func (acc *AccessControlCreate) SetV0(s string) *AccessControlCreate
- func (acc *AccessControlCreate) SetV1(s string) *AccessControlCreate
- func (acc *AccessControlCreate) SetV2(s string) *AccessControlCreate
- func (acc *AccessControlCreate) SetV3(s string) *AccessControlCreate
- func (acc *AccessControlCreate) SetV4(s string) *AccessControlCreate
- func (acc *AccessControlCreate) SetV5(s string) *AccessControlCreate
- type AccessControlCreateBulk
- func (accb *AccessControlCreateBulk) Exec(ctx context.Context) error
- func (accb *AccessControlCreateBulk) ExecX(ctx context.Context)
- func (accb *AccessControlCreateBulk) Save(ctx context.Context) ([]*AccessControl, error)
- func (accb *AccessControlCreateBulk) SaveX(ctx context.Context) []*AccessControl
- type AccessControlDelete
- type AccessControlDeleteOne
- type AccessControlGroupBy
- func (acgb *AccessControlGroupBy) Aggregate(fns ...AggregateFunc) *AccessControlGroupBy
- func (s *AccessControlGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccessControlGroupBy) BoolX(ctx context.Context) bool
- func (s *AccessControlGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AccessControlGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AccessControlGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccessControlGroupBy) Float64X(ctx context.Context) float64
- func (s *AccessControlGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccessControlGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AccessControlGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AccessControlGroupBy) IntX(ctx context.Context) int
- func (s *AccessControlGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AccessControlGroupBy) IntsX(ctx context.Context) []int
- func (acgb *AccessControlGroupBy) Scan(ctx context.Context, v any) error
- func (s *AccessControlGroupBy) ScanX(ctx context.Context, v any)
- func (s *AccessControlGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AccessControlGroupBy) StringX(ctx context.Context) string
- func (s *AccessControlGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AccessControlGroupBy) StringsX(ctx context.Context) []string
- type AccessControlMutation
- func (m *AccessControlMutation) AddField(name string, value ent.Value) error
- func (m *AccessControlMutation) AddedEdges() []string
- func (m *AccessControlMutation) AddedField(name string) (ent.Value, bool)
- func (m *AccessControlMutation) AddedFields() []string
- func (m *AccessControlMutation) AddedIDs(name string) []ent.Value
- func (m *AccessControlMutation) ClearEdge(name string) error
- func (m *AccessControlMutation) ClearField(name string) error
- func (m *AccessControlMutation) ClearedEdges() []string
- func (m *AccessControlMutation) ClearedFields() []string
- func (m AccessControlMutation) Client() *Client
- func (m *AccessControlMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AccessControlMutation) EdgeCleared(name string) bool
- func (m *AccessControlMutation) Field(name string) (ent.Value, bool)
- func (m *AccessControlMutation) FieldCleared(name string) bool
- func (m *AccessControlMutation) Fields() []string
- func (m *AccessControlMutation) ID() (id int64, exists bool)
- func (m *AccessControlMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *AccessControlMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AccessControlMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AccessControlMutation) OldPtype(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AccessControlMutation) OldV0(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) OldV1(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) OldV2(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) OldV3(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) OldV4(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) OldV5(ctx context.Context) (v string, err error)
- func (m *AccessControlMutation) Op() Op
- func (m *AccessControlMutation) Ptype() (r string, exists bool)
- func (m *AccessControlMutation) RemovedEdges() []string
- func (m *AccessControlMutation) RemovedIDs(name string) []ent.Value
- func (m *AccessControlMutation) ResetCreatedAt()
- func (m *AccessControlMutation) ResetEdge(name string) error
- func (m *AccessControlMutation) ResetField(name string) error
- func (m *AccessControlMutation) ResetPtype()
- func (m *AccessControlMutation) ResetUpdatedAt()
- func (m *AccessControlMutation) ResetV0()
- func (m *AccessControlMutation) ResetV1()
- func (m *AccessControlMutation) ResetV2()
- func (m *AccessControlMutation) ResetV3()
- func (m *AccessControlMutation) ResetV4()
- func (m *AccessControlMutation) ResetV5()
- func (m *AccessControlMutation) SetCreatedAt(t time.Time)
- func (m *AccessControlMutation) SetField(name string, value ent.Value) error
- func (m *AccessControlMutation) SetID(id int64)
- func (m *AccessControlMutation) SetOp(op Op)
- func (m *AccessControlMutation) SetPtype(s string)
- func (m *AccessControlMutation) SetUpdatedAt(t time.Time)
- func (m *AccessControlMutation) SetV0(s string)
- func (m *AccessControlMutation) SetV1(s string)
- func (m *AccessControlMutation) SetV2(s string)
- func (m *AccessControlMutation) SetV3(s string)
- func (m *AccessControlMutation) SetV4(s string)
- func (m *AccessControlMutation) SetV5(s string)
- func (m AccessControlMutation) Tx() (*Tx, error)
- func (m *AccessControlMutation) Type() string
- func (m *AccessControlMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *AccessControlMutation) V0() (r string, exists bool)
- func (m *AccessControlMutation) V1() (r string, exists bool)
- func (m *AccessControlMutation) V2() (r string, exists bool)
- func (m *AccessControlMutation) V3() (r string, exists bool)
- func (m *AccessControlMutation) V4() (r string, exists bool)
- func (m *AccessControlMutation) V5() (r string, exists bool)
- func (m *AccessControlMutation) Where(ps ...predicate.AccessControl)
- func (m *AccessControlMutation) WhereP(ps ...func(*sql.Selector))
- type AccessControlQuery
- func (acq *AccessControlQuery) Aggregate(fns ...AggregateFunc) *AccessControlSelect
- func (acq *AccessControlQuery) All(ctx context.Context) ([]*AccessControl, error)
- func (acq *AccessControlQuery) AllX(ctx context.Context) []*AccessControl
- func (acq *AccessControlQuery) Clone() *AccessControlQuery
- func (acq *AccessControlQuery) Count(ctx context.Context) (int, error)
- func (acq *AccessControlQuery) CountX(ctx context.Context) int
- func (acq *AccessControlQuery) Exist(ctx context.Context) (bool, error)
- func (acq *AccessControlQuery) ExistX(ctx context.Context) bool
- func (acq *AccessControlQuery) First(ctx context.Context) (*AccessControl, error)
- func (acq *AccessControlQuery) FirstID(ctx context.Context) (id int64, err error)
- func (acq *AccessControlQuery) FirstIDX(ctx context.Context) int64
- func (acq *AccessControlQuery) FirstX(ctx context.Context) *AccessControl
- func (acq *AccessControlQuery) GroupBy(field string, fields ...string) *AccessControlGroupBy
- func (acq *AccessControlQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (acq *AccessControlQuery) IDsX(ctx context.Context) []int64
- func (acq *AccessControlQuery) Limit(limit int) *AccessControlQuery
- func (acq *AccessControlQuery) Offset(offset int) *AccessControlQuery
- func (acq *AccessControlQuery) Only(ctx context.Context) (*AccessControl, error)
- func (acq *AccessControlQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (acq *AccessControlQuery) OnlyIDX(ctx context.Context) int64
- func (acq *AccessControlQuery) OnlyX(ctx context.Context) *AccessControl
- func (acq *AccessControlQuery) Order(o ...accesscontrol.OrderOption) *AccessControlQuery
- func (acq *AccessControlQuery) Select(fields ...string) *AccessControlSelect
- func (acq *AccessControlQuery) Unique(unique bool) *AccessControlQuery
- func (acq *AccessControlQuery) Where(ps ...predicate.AccessControl) *AccessControlQuery
- type AccessControlSelect
- func (acs *AccessControlSelect) Aggregate(fns ...AggregateFunc) *AccessControlSelect
- func (s *AccessControlSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccessControlSelect) BoolX(ctx context.Context) bool
- func (s *AccessControlSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AccessControlSelect) BoolsX(ctx context.Context) []bool
- func (s *AccessControlSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccessControlSelect) Float64X(ctx context.Context) float64
- func (s *AccessControlSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccessControlSelect) Float64sX(ctx context.Context) []float64
- func (s *AccessControlSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AccessControlSelect) IntX(ctx context.Context) int
- func (s *AccessControlSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AccessControlSelect) IntsX(ctx context.Context) []int
- func (acs *AccessControlSelect) Scan(ctx context.Context, v any) error
- func (s *AccessControlSelect) ScanX(ctx context.Context, v any)
- func (s *AccessControlSelect) String(ctx context.Context) (_ string, err error)
- func (s *AccessControlSelect) StringX(ctx context.Context) string
- func (s *AccessControlSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AccessControlSelect) StringsX(ctx context.Context) []string
- type AccessControlUpdate
- func (acu *AccessControlUpdate) Exec(ctx context.Context) error
- func (acu *AccessControlUpdate) ExecX(ctx context.Context)
- func (acu *AccessControlUpdate) Mutation() *AccessControlMutation
- func (acu *AccessControlUpdate) Save(ctx context.Context) (int, error)
- func (acu *AccessControlUpdate) SaveX(ctx context.Context) int
- func (acu *AccessControlUpdate) SetNillablePtype(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetNillableV0(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetNillableV1(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetNillableV2(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetNillableV3(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetNillableV4(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetNillableV5(s *string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetPtype(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetUpdatedAt(t time.Time) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetV0(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetV1(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetV2(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetV3(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetV4(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) SetV5(s string) *AccessControlUpdate
- func (acu *AccessControlUpdate) Where(ps ...predicate.AccessControl) *AccessControlUpdate
- type AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) Exec(ctx context.Context) error
- func (acuo *AccessControlUpdateOne) ExecX(ctx context.Context)
- func (acuo *AccessControlUpdateOne) Mutation() *AccessControlMutation
- func (acuo *AccessControlUpdateOne) Save(ctx context.Context) (*AccessControl, error)
- func (acuo *AccessControlUpdateOne) SaveX(ctx context.Context) *AccessControl
- func (acuo *AccessControlUpdateOne) Select(field string, fields ...string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillablePtype(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillableV0(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillableV1(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillableV2(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillableV3(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillableV4(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetNillableV5(s *string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetPtype(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetUpdatedAt(t time.Time) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetV0(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetV1(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetV2(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetV3(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetV4(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) SetV5(s string) *AccessControlUpdateOne
- func (acuo *AccessControlUpdateOne) Where(ps ...predicate.AccessControl) *AccessControlUpdateOne
- type AccessControls
- type AggregateFunc
- type Audit
- type AuditClient
- func (c *AuditClient) Create() *AuditCreate
- func (c *AuditClient) CreateBulk(builders ...*AuditCreate) *AuditCreateBulk
- func (c *AuditClient) Delete() *AuditDelete
- func (c *AuditClient) DeleteOne(a *Audit) *AuditDeleteOne
- func (c *AuditClient) DeleteOneID(id int64) *AuditDeleteOne
- func (c *AuditClient) Get(ctx context.Context, id int64) (*Audit, error)
- func (c *AuditClient) GetX(ctx context.Context, id int64) *Audit
- func (c *AuditClient) Hooks() []Hook
- func (c *AuditClient) Intercept(interceptors ...Interceptor)
- func (c *AuditClient) Interceptors() []Interceptor
- func (c *AuditClient) MapCreateBulk(slice any, setFunc func(*AuditCreate, int)) *AuditCreateBulk
- func (c *AuditClient) Query() *AuditQuery
- func (c *AuditClient) QueryUser(a *Audit) *UserQuery
- func (c *AuditClient) Update() *AuditUpdate
- func (c *AuditClient) UpdateOne(a *Audit) *AuditUpdateOne
- func (c *AuditClient) UpdateOneID(id int64) *AuditUpdateOne
- func (c *AuditClient) Use(hooks ...Hook)
- type AuditCreate
- func (ac *AuditCreate) Exec(ctx context.Context) error
- func (ac *AuditCreate) ExecX(ctx context.Context)
- func (ac *AuditCreate) Mutation() *AuditMutation
- func (ac *AuditCreate) Save(ctx context.Context) (*Audit, error)
- func (ac *AuditCreate) SaveX(ctx context.Context) *Audit
- func (ac *AuditCreate) SetCreatedAt(t time.Time) *AuditCreate
- func (ac *AuditCreate) SetDescription(s string) *AuditCreate
- func (ac *AuditCreate) SetEntID(i int64) *AuditCreate
- func (ac *AuditCreate) SetEntName(s string) *AuditCreate
- func (ac *AuditCreate) SetID(i int64) *AuditCreate
- func (ac *AuditCreate) SetIP(s string) *AuditCreate
- func (ac *AuditCreate) SetNillableCreatedAt(t *time.Time) *AuditCreate
- func (ac *AuditCreate) SetNillableIP(s *string) *AuditCreate
- func (ac *AuditCreate) SetNillableUserID(id *int64) *AuditCreate
- func (ac *AuditCreate) SetNillableUserName(s *string) *AuditCreate
- func (ac *AuditCreate) SetOperation(a audit.Operation) *AuditCreate
- func (ac *AuditCreate) SetUser(u *User) *AuditCreate
- func (ac *AuditCreate) SetUserID(id int64) *AuditCreate
- func (ac *AuditCreate) SetUserName(s string) *AuditCreate
- type AuditCreateBulk
- type AuditDelete
- type AuditDeleteOne
- type AuditEdges
- type AuditGroupBy
- func (agb *AuditGroupBy) Aggregate(fns ...AggregateFunc) *AuditGroupBy
- func (s *AuditGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AuditGroupBy) BoolX(ctx context.Context) bool
- func (s *AuditGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AuditGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AuditGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AuditGroupBy) Float64X(ctx context.Context) float64
- func (s *AuditGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AuditGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AuditGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AuditGroupBy) IntX(ctx context.Context) int
- func (s *AuditGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AuditGroupBy) IntsX(ctx context.Context) []int
- func (agb *AuditGroupBy) Scan(ctx context.Context, v any) error
- func (s *AuditGroupBy) ScanX(ctx context.Context, v any)
- func (s *AuditGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AuditGroupBy) StringX(ctx context.Context) string
- func (s *AuditGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AuditGroupBy) StringsX(ctx context.Context) []string
- type AuditMutation
- func (m *AuditMutation) AddEntID(i int64)
- func (m *AuditMutation) AddField(name string, value ent.Value) error
- func (m *AuditMutation) AddedEdges() []string
- func (m *AuditMutation) AddedEntID() (r int64, exists bool)
- func (m *AuditMutation) AddedField(name string) (ent.Value, bool)
- func (m *AuditMutation) AddedFields() []string
- func (m *AuditMutation) AddedIDs(name string) []ent.Value
- func (m *AuditMutation) ClearEdge(name string) error
- func (m *AuditMutation) ClearField(name string) error
- func (m *AuditMutation) ClearIP()
- func (m *AuditMutation) ClearUser()
- func (m *AuditMutation) ClearUserName()
- func (m *AuditMutation) ClearedEdges() []string
- func (m *AuditMutation) ClearedFields() []string
- func (m AuditMutation) Client() *Client
- func (m *AuditMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AuditMutation) Description() (r string, exists bool)
- func (m *AuditMutation) EdgeCleared(name string) bool
- func (m *AuditMutation) EntID() (r int64, exists bool)
- func (m *AuditMutation) EntName() (r string, exists bool)
- func (m *AuditMutation) Field(name string) (ent.Value, bool)
- func (m *AuditMutation) FieldCleared(name string) bool
- func (m *AuditMutation) Fields() []string
- func (m *AuditMutation) ID() (id int64, exists bool)
- func (m *AuditMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *AuditMutation) IP() (r string, exists bool)
- func (m *AuditMutation) IPCleared() bool
- func (m *AuditMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AuditMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *AuditMutation) OldEntID(ctx context.Context) (v int64, err error)
- func (m *AuditMutation) OldEntName(ctx context.Context) (v string, err error)
- func (m *AuditMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AuditMutation) OldIP(ctx context.Context) (v string, err error)
- func (m *AuditMutation) OldOperation(ctx context.Context) (v audit.Operation, err error)
- func (m *AuditMutation) OldUserName(ctx context.Context) (v string, err error)
- func (m *AuditMutation) Op() Op
- func (m *AuditMutation) Operation() (r audit.Operation, exists bool)
- func (m *AuditMutation) RemovedEdges() []string
- func (m *AuditMutation) RemovedIDs(name string) []ent.Value
- func (m *AuditMutation) ResetCreatedAt()
- func (m *AuditMutation) ResetDescription()
- func (m *AuditMutation) ResetEdge(name string) error
- func (m *AuditMutation) ResetEntID()
- func (m *AuditMutation) ResetEntName()
- func (m *AuditMutation) ResetField(name string) error
- func (m *AuditMutation) ResetIP()
- func (m *AuditMutation) ResetOperation()
- func (m *AuditMutation) ResetUser()
- func (m *AuditMutation) ResetUserName()
- func (m *AuditMutation) SetCreatedAt(t time.Time)
- func (m *AuditMutation) SetDescription(s string)
- func (m *AuditMutation) SetEntID(i int64)
- func (m *AuditMutation) SetEntName(s string)
- func (m *AuditMutation) SetField(name string, value ent.Value) error
- func (m *AuditMutation) SetID(id int64)
- func (m *AuditMutation) SetIP(s string)
- func (m *AuditMutation) SetOp(op Op)
- func (m *AuditMutation) SetOperation(a audit.Operation)
- func (m *AuditMutation) SetUserID(id int64)
- func (m *AuditMutation) SetUserName(s string)
- func (m AuditMutation) Tx() (*Tx, error)
- func (m *AuditMutation) Type() string
- func (m *AuditMutation) UserCleared() bool
- func (m *AuditMutation) UserID() (id int64, exists bool)
- func (m *AuditMutation) UserIDs() (ids []int64)
- func (m *AuditMutation) UserName() (r string, exists bool)
- func (m *AuditMutation) UserNameCleared() bool
- func (m *AuditMutation) Where(ps ...predicate.Audit)
- func (m *AuditMutation) WhereP(ps ...func(*sql.Selector))
- type AuditQuery
- func (aq *AuditQuery) Aggregate(fns ...AggregateFunc) *AuditSelect
- func (aq *AuditQuery) All(ctx context.Context) ([]*Audit, error)
- func (aq *AuditQuery) AllX(ctx context.Context) []*Audit
- func (aq *AuditQuery) Clone() *AuditQuery
- func (aq *AuditQuery) Count(ctx context.Context) (int, error)
- func (aq *AuditQuery) CountX(ctx context.Context) int
- func (aq *AuditQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AuditQuery) ExistX(ctx context.Context) bool
- func (aq *AuditQuery) First(ctx context.Context) (*Audit, error)
- func (aq *AuditQuery) FirstID(ctx context.Context) (id int64, err error)
- func (aq *AuditQuery) FirstIDX(ctx context.Context) int64
- func (aq *AuditQuery) FirstX(ctx context.Context) *Audit
- func (aq *AuditQuery) GroupBy(field string, fields ...string) *AuditGroupBy
- func (aq *AuditQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (aq *AuditQuery) IDsX(ctx context.Context) []int64
- func (aq *AuditQuery) Limit(limit int) *AuditQuery
- func (aq *AuditQuery) Offset(offset int) *AuditQuery
- func (aq *AuditQuery) Only(ctx context.Context) (*Audit, error)
- func (aq *AuditQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (aq *AuditQuery) OnlyIDX(ctx context.Context) int64
- func (aq *AuditQuery) OnlyX(ctx context.Context) *Audit
- func (aq *AuditQuery) Order(o ...audit.OrderOption) *AuditQuery
- func (aq *AuditQuery) QueryUser() *UserQuery
- func (aq *AuditQuery) Select(fields ...string) *AuditSelect
- func (aq *AuditQuery) Unique(unique bool) *AuditQuery
- func (aq *AuditQuery) Where(ps ...predicate.Audit) *AuditQuery
- func (aq *AuditQuery) WithUser(opts ...func(*UserQuery)) *AuditQuery
- type AuditSelect
- func (as *AuditSelect) Aggregate(fns ...AggregateFunc) *AuditSelect
- func (s *AuditSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AuditSelect) BoolX(ctx context.Context) bool
- func (s *AuditSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AuditSelect) BoolsX(ctx context.Context) []bool
- func (s *AuditSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AuditSelect) Float64X(ctx context.Context) float64
- func (s *AuditSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AuditSelect) Float64sX(ctx context.Context) []float64
- func (s *AuditSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AuditSelect) IntX(ctx context.Context) int
- func (s *AuditSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AuditSelect) IntsX(ctx context.Context) []int
- func (as *AuditSelect) Scan(ctx context.Context, v any) error
- func (s *AuditSelect) ScanX(ctx context.Context, v any)
- func (s *AuditSelect) String(ctx context.Context) (_ string, err error)
- func (s *AuditSelect) StringX(ctx context.Context) string
- func (s *AuditSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AuditSelect) StringsX(ctx context.Context) []string
- type AuditUpdate
- func (au *AuditUpdate) AddEntID(i int64) *AuditUpdate
- func (au *AuditUpdate) ClearIP() *AuditUpdate
- func (au *AuditUpdate) ClearUser() *AuditUpdate
- func (au *AuditUpdate) ClearUserName() *AuditUpdate
- func (au *AuditUpdate) Exec(ctx context.Context) error
- func (au *AuditUpdate) ExecX(ctx context.Context)
- func (au *AuditUpdate) Mutation() *AuditMutation
- func (au *AuditUpdate) Save(ctx context.Context) (int, error)
- func (au *AuditUpdate) SaveX(ctx context.Context) int
- func (au *AuditUpdate) SetDescription(s string) *AuditUpdate
- func (au *AuditUpdate) SetEntID(i int64) *AuditUpdate
- func (au *AuditUpdate) SetEntName(s string) *AuditUpdate
- func (au *AuditUpdate) SetIP(s string) *AuditUpdate
- func (au *AuditUpdate) SetNillableDescription(s *string) *AuditUpdate
- func (au *AuditUpdate) SetNillableEntID(i *int64) *AuditUpdate
- func (au *AuditUpdate) SetNillableEntName(s *string) *AuditUpdate
- func (au *AuditUpdate) SetNillableIP(s *string) *AuditUpdate
- func (au *AuditUpdate) SetNillableOperation(a *audit.Operation) *AuditUpdate
- func (au *AuditUpdate) SetNillableUserID(id *int64) *AuditUpdate
- func (au *AuditUpdate) SetNillableUserName(s *string) *AuditUpdate
- func (au *AuditUpdate) SetOperation(a audit.Operation) *AuditUpdate
- func (au *AuditUpdate) SetUser(u *User) *AuditUpdate
- func (au *AuditUpdate) SetUserID(id int64) *AuditUpdate
- func (au *AuditUpdate) SetUserName(s string) *AuditUpdate
- func (au *AuditUpdate) Where(ps ...predicate.Audit) *AuditUpdate
- type AuditUpdateOne
- func (auo *AuditUpdateOne) AddEntID(i int64) *AuditUpdateOne
- func (auo *AuditUpdateOne) ClearIP() *AuditUpdateOne
- func (auo *AuditUpdateOne) ClearUser() *AuditUpdateOne
- func (auo *AuditUpdateOne) ClearUserName() *AuditUpdateOne
- func (auo *AuditUpdateOne) Exec(ctx context.Context) error
- func (auo *AuditUpdateOne) ExecX(ctx context.Context)
- func (auo *AuditUpdateOne) Mutation() *AuditMutation
- func (auo *AuditUpdateOne) Save(ctx context.Context) (*Audit, error)
- func (auo *AuditUpdateOne) SaveX(ctx context.Context) *Audit
- func (auo *AuditUpdateOne) Select(field string, fields ...string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetDescription(s string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetEntID(i int64) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetEntName(s string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetIP(s string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableDescription(s *string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableEntID(i *int64) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableEntName(s *string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableIP(s *string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableOperation(a *audit.Operation) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableUserID(id *int64) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetNillableUserName(s *string) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetOperation(a audit.Operation) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetUser(u *User) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetUserID(id int64) *AuditUpdateOne
- func (auo *AuditUpdateOne) SetUserName(s string) *AuditUpdateOne
- func (auo *AuditUpdateOne) Where(ps ...predicate.Audit) *AuditUpdateOne
- type Audits
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type Role
- type RoleClient
- func (c *RoleClient) Create() *RoleCreate
- func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk
- func (c *RoleClient) Delete() *RoleDelete
- func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne
- func (c *RoleClient) DeleteOneID(id int64) *RoleDeleteOne
- func (c *RoleClient) Get(ctx context.Context, id int64) (*Role, error)
- func (c *RoleClient) GetX(ctx context.Context, id int64) *Role
- func (c *RoleClient) Hooks() []Hook
- func (c *RoleClient) Intercept(interceptors ...Interceptor)
- func (c *RoleClient) Interceptors() []Interceptor
- func (c *RoleClient) MapCreateBulk(slice any, setFunc func(*RoleCreate, int)) *RoleCreateBulk
- func (c *RoleClient) Query() *RoleQuery
- func (c *RoleClient) Update() *RoleUpdate
- func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
- func (c *RoleClient) UpdateOneID(id int64) *RoleUpdateOne
- func (c *RoleClient) Use(hooks ...Hook)
- type RoleCreate
- func (rc *RoleCreate) Exec(ctx context.Context) error
- func (rc *RoleCreate) ExecX(ctx context.Context)
- func (rc *RoleCreate) Mutation() *RoleMutation
- func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
- func (rc *RoleCreate) SaveX(ctx context.Context) *Role
- func (rc *RoleCreate) SetID(i int64) *RoleCreate
- func (rc *RoleCreate) SetName(s string) *RoleCreate
- type RoleCreateBulk
- type RoleDelete
- type RoleDeleteOne
- type RoleGroupBy
- func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy
- func (s *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RoleGroupBy) BoolX(ctx context.Context) bool
- func (s *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RoleGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RoleGroupBy) Float64X(ctx context.Context) float64
- func (s *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RoleGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RoleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RoleGroupBy) IntX(ctx context.Context) int
- func (s *RoleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RoleGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error
- func (s *RoleGroupBy) ScanX(ctx context.Context, v any)
- func (s *RoleGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RoleGroupBy) StringX(ctx context.Context) string
- func (s *RoleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RoleGroupBy) StringsX(ctx context.Context) []string
- type RoleMutation
- func (m *RoleMutation) AddField(name string, value ent.Value) error
- func (m *RoleMutation) AddedEdges() []string
- func (m *RoleMutation) AddedField(name string) (ent.Value, bool)
- func (m *RoleMutation) AddedFields() []string
- func (m *RoleMutation) AddedIDs(name string) []ent.Value
- func (m *RoleMutation) ClearEdge(name string) error
- func (m *RoleMutation) ClearField(name string) error
- func (m *RoleMutation) ClearedEdges() []string
- func (m *RoleMutation) ClearedFields() []string
- func (m RoleMutation) Client() *Client
- func (m *RoleMutation) EdgeCleared(name string) bool
- func (m *RoleMutation) Field(name string) (ent.Value, bool)
- func (m *RoleMutation) FieldCleared(name string) bool
- func (m *RoleMutation) Fields() []string
- func (m *RoleMutation) ID() (id int64, exists bool)
- func (m *RoleMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *RoleMutation) Name() (r string, exists bool)
- func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RoleMutation) Op() Op
- func (m *RoleMutation) RemovedEdges() []string
- func (m *RoleMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleMutation) ResetEdge(name string) error
- func (m *RoleMutation) ResetField(name string) error
- func (m *RoleMutation) ResetName()
- func (m *RoleMutation) SetField(name string, value ent.Value) error
- func (m *RoleMutation) SetID(id int64)
- func (m *RoleMutation) SetName(s string)
- func (m *RoleMutation) SetOp(op Op)
- func (m RoleMutation) Tx() (*Tx, error)
- func (m *RoleMutation) Type() string
- func (m *RoleMutation) Where(ps ...predicate.Role)
- func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))
- type RoleQuery
- func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect
- func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)
- func (rq *RoleQuery) AllX(ctx context.Context) []*Role
- func (rq *RoleQuery) Clone() *RoleQuery
- func (rq *RoleQuery) Count(ctx context.Context) (int, error)
- func (rq *RoleQuery) CountX(ctx context.Context) int
- func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RoleQuery) ExistX(ctx context.Context) bool
- func (rq *RoleQuery) First(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) FirstID(ctx context.Context) (id int64, err error)
- func (rq *RoleQuery) FirstIDX(ctx context.Context) int64
- func (rq *RoleQuery) FirstX(ctx context.Context) *Role
- func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
- func (rq *RoleQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (rq *RoleQuery) IDsX(ctx context.Context) []int64
- func (rq *RoleQuery) Limit(limit int) *RoleQuery
- func (rq *RoleQuery) Offset(offset int) *RoleQuery
- func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (rq *RoleQuery) OnlyIDX(ctx context.Context) int64
- func (rq *RoleQuery) OnlyX(ctx context.Context) *Role
- func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery
- func (rq *RoleQuery) Select(fields ...string) *RoleSelect
- func (rq *RoleQuery) Unique(unique bool) *RoleQuery
- func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery
- type RoleSelect
- func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect
- func (s *RoleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RoleSelect) BoolX(ctx context.Context) bool
- func (s *RoleSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RoleSelect) BoolsX(ctx context.Context) []bool
- func (s *RoleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RoleSelect) Float64X(ctx context.Context) float64
- func (s *RoleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RoleSelect) Float64sX(ctx context.Context) []float64
- func (s *RoleSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RoleSelect) IntX(ctx context.Context) int
- func (s *RoleSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RoleSelect) IntsX(ctx context.Context) []int
- func (rs *RoleSelect) Scan(ctx context.Context, v any) error
- func (s *RoleSelect) ScanX(ctx context.Context, v any)
- func (s *RoleSelect) String(ctx context.Context) (_ string, err error)
- func (s *RoleSelect) StringX(ctx context.Context) string
- func (s *RoleSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RoleSelect) StringsX(ctx context.Context) []string
- type RoleUpdate
- func (ru *RoleUpdate) Exec(ctx context.Context) error
- func (ru *RoleUpdate) ExecX(ctx context.Context)
- func (ru *RoleUpdate) Mutation() *RoleMutation
- func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
- func (ru *RoleUpdate) SaveX(ctx context.Context) int
- func (ru *RoleUpdate) SetName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
- func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
- type RoleUpdateOne
- func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
- func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
- func (ruo *RoleUpdateOne) Mutation() *RoleMutation
- func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)
- func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role
- func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne
- type Roles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Todo
- type TodoClient
- func (c *TodoClient) Create() *TodoCreate
- func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk
- func (c *TodoClient) Delete() *TodoDelete
- func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne
- func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne
- func (c *TodoClient) Get(ctx context.Context, id int) (*Todo, error)
- func (c *TodoClient) GetX(ctx context.Context, id int) *Todo
- func (c *TodoClient) Hooks() []Hook
- func (c *TodoClient) Intercept(interceptors ...Interceptor)
- func (c *TodoClient) Interceptors() []Interceptor
- func (c *TodoClient) MapCreateBulk(slice any, setFunc func(*TodoCreate, int)) *TodoCreateBulk
- func (c *TodoClient) Query() *TodoQuery
- func (c *TodoClient) Update() *TodoUpdate
- func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne
- func (c *TodoClient) UpdateOneID(id int) *TodoUpdateOne
- func (c *TodoClient) Use(hooks ...Hook)
- type TodoCreate
- type TodoCreateBulk
- type TodoDelete
- type TodoDeleteOne
- type TodoGroupBy
- func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy
- func (s *TodoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TodoGroupBy) BoolX(ctx context.Context) bool
- func (s *TodoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TodoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TodoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TodoGroupBy) Float64X(ctx context.Context) float64
- func (s *TodoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TodoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TodoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TodoGroupBy) IntX(ctx context.Context) int
- func (s *TodoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TodoGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TodoGroupBy) Scan(ctx context.Context, v any) error
- func (s *TodoGroupBy) ScanX(ctx context.Context, v any)
- func (s *TodoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TodoGroupBy) StringX(ctx context.Context) string
- func (s *TodoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TodoGroupBy) StringsX(ctx context.Context) []string
- type TodoMutation
- func (m *TodoMutation) AddField(name string, value ent.Value) error
- func (m *TodoMutation) AddedEdges() []string
- func (m *TodoMutation) AddedField(name string) (ent.Value, bool)
- func (m *TodoMutation) AddedFields() []string
- func (m *TodoMutation) AddedIDs(name string) []ent.Value
- func (m *TodoMutation) ClearEdge(name string) error
- func (m *TodoMutation) ClearField(name string) error
- func (m *TodoMutation) ClearedEdges() []string
- func (m *TodoMutation) ClearedFields() []string
- func (m TodoMutation) Client() *Client
- func (m *TodoMutation) EdgeCleared(name string) bool
- func (m *TodoMutation) Field(name string) (ent.Value, bool)
- func (m *TodoMutation) FieldCleared(name string) bool
- func (m *TodoMutation) Fields() []string
- func (m *TodoMutation) ID() (id int, exists bool)
- func (m *TodoMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TodoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TodoMutation) Op() Op
- func (m *TodoMutation) RemovedEdges() []string
- func (m *TodoMutation) RemovedIDs(name string) []ent.Value
- func (m *TodoMutation) ResetEdge(name string) error
- func (m *TodoMutation) ResetField(name string) error
- func (m *TodoMutation) SetField(name string, value ent.Value) error
- func (m *TodoMutation) SetOp(op Op)
- func (m TodoMutation) Tx() (*Tx, error)
- func (m *TodoMutation) Type() string
- func (m *TodoMutation) Where(ps ...predicate.Todo)
- func (m *TodoMutation) WhereP(ps ...func(*sql.Selector))
- type TodoQuery
- func (tq *TodoQuery) Aggregate(fns ...AggregateFunc) *TodoSelect
- func (tq *TodoQuery) All(ctx context.Context) ([]*Todo, error)
- func (tq *TodoQuery) AllX(ctx context.Context) []*Todo
- func (tq *TodoQuery) Clone() *TodoQuery
- func (tq *TodoQuery) Count(ctx context.Context) (int, error)
- func (tq *TodoQuery) CountX(ctx context.Context) int
- func (tq *TodoQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TodoQuery) ExistX(ctx context.Context) bool
- func (tq *TodoQuery) First(ctx context.Context) (*Todo, error)
- func (tq *TodoQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TodoQuery) FirstIDX(ctx context.Context) int
- func (tq *TodoQuery) FirstX(ctx context.Context) *Todo
- func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy
- func (tq *TodoQuery) IDs(ctx context.Context) (ids []int, err error)
- func (tq *TodoQuery) IDsX(ctx context.Context) []int
- func (tq *TodoQuery) Limit(limit int) *TodoQuery
- func (tq *TodoQuery) Offset(offset int) *TodoQuery
- func (tq *TodoQuery) Only(ctx context.Context) (*Todo, error)
- func (tq *TodoQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TodoQuery) OnlyIDX(ctx context.Context) int
- func (tq *TodoQuery) OnlyX(ctx context.Context) *Todo
- func (tq *TodoQuery) Order(o ...todo.OrderOption) *TodoQuery
- func (tq *TodoQuery) Select(fields ...string) *TodoSelect
- func (tq *TodoQuery) Unique(unique bool) *TodoQuery
- func (tq *TodoQuery) Where(ps ...predicate.Todo) *TodoQuery
- type TodoSelect
- func (ts *TodoSelect) Aggregate(fns ...AggregateFunc) *TodoSelect
- func (s *TodoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TodoSelect) BoolX(ctx context.Context) bool
- func (s *TodoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TodoSelect) BoolsX(ctx context.Context) []bool
- func (s *TodoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TodoSelect) Float64X(ctx context.Context) float64
- func (s *TodoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TodoSelect) Float64sX(ctx context.Context) []float64
- func (s *TodoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TodoSelect) IntX(ctx context.Context) int
- func (s *TodoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TodoSelect) IntsX(ctx context.Context) []int
- func (ts *TodoSelect) Scan(ctx context.Context, v any) error
- func (s *TodoSelect) ScanX(ctx context.Context, v any)
- func (s *TodoSelect) String(ctx context.Context) (_ string, err error)
- func (s *TodoSelect) StringX(ctx context.Context) string
- func (s *TodoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TodoSelect) StringsX(ctx context.Context) []string
- type TodoUpdate
- func (tu *TodoUpdate) Exec(ctx context.Context) error
- func (tu *TodoUpdate) ExecX(ctx context.Context)
- func (tu *TodoUpdate) Mutation() *TodoMutation
- func (tu *TodoUpdate) Save(ctx context.Context) (int, error)
- func (tu *TodoUpdate) SaveX(ctx context.Context) int
- func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate
- type TodoUpdateOne
- func (tuo *TodoUpdateOne) Exec(ctx context.Context) error
- func (tuo *TodoUpdateOne) ExecX(ctx context.Context)
- func (tuo *TodoUpdateOne) Mutation() *TodoMutation
- func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error)
- func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo
- func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne
- func (tuo *TodoUpdateOne) Where(ps ...predicate.Todo) *TodoUpdateOne
- type Todos
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int64) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int64) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int64) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryAuditLogs(u *User) *AuditQuery
- func (c *UserClient) QuerySessions(u *User) *UserSessionQuery
- func (c *UserClient) QueryVerifyTokens(u *User) *VerifyTokenQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int64) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddAuditLogIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddAuditLogs(a ...*Audit) *UserCreate
- func (uc *UserCreate) AddSessionIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddSessions(u ...*UserSession) *UserCreate
- func (uc *UserCreate) AddVerifyTokenIDs(ids ...int64) *UserCreate
- func (uc *UserCreate) AddVerifyTokens(v ...*VerifyToken) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetEmailVerified(b bool) *UserCreate
- func (uc *UserCreate) SetFirstName(s string) *UserCreate
- func (uc *UserCreate) SetID(i int64) *UserCreate
- func (uc *UserCreate) SetLastName(s string) *UserCreate
- func (uc *UserCreate) SetLoginAttemptOn(t time.Time) *UserCreate
- func (uc *UserCreate) SetLoginFailedCount(u uint8) *UserCreate
- func (uc *UserCreate) SetLoginLockedUntil(t time.Time) *UserCreate
- func (uc *UserCreate) SetMiddleName(s string) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableEmailVerified(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableLoginAttemptOn(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableLoginFailedCount(u *uint8) *UserCreate
- func (uc *UserCreate) SetNillableLoginLockedUntil(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillablePhone(s *string) *UserCreate
- func (uc *UserCreate) SetNillablePhoneVerified(b *bool) *UserCreate
- func (uc *UserCreate) SetNillableStatus(u *user.Status) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetPhone(s string) *UserCreate
- func (uc *UserCreate) SetPhoneVerified(b bool) *UserCreate
- func (uc *UserCreate) SetPwdHash(s string) *UserCreate
- func (uc *UserCreate) SetPwdSalt(s string) *UserCreate
- func (uc *UserCreate) SetStatus(u user.Status) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddAuditLogIDs(ids ...int64)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddLoginFailedCount(u int8)
- func (m *UserMutation) AddSessionIDs(ids ...int64)
- func (m *UserMutation) AddVerifyTokenIDs(ids ...int64)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) AddedLoginFailedCount() (r int8, exists bool)
- func (m *UserMutation) AuditLogsCleared() bool
- func (m *UserMutation) AuditLogsIDs() (ids []int64)
- func (m *UserMutation) ClearAuditLogs()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearLoginAttemptOn()
- func (m *UserMutation) ClearLoginFailedCount()
- func (m *UserMutation) ClearLoginLockedUntil()
- func (m *UserMutation) ClearPhone()
- func (m *UserMutation) ClearSessions()
- func (m *UserMutation) ClearVerifyTokens()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) EmailVerified() (r bool, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) FirstName() (r string, exists bool)
- func (m *UserMutation) ID() (id int64, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *UserMutation) LastName() (r string, exists bool)
- func (m *UserMutation) LoginAttemptOn() (r time.Time, exists bool)
- func (m *UserMutation) LoginAttemptOnCleared() bool
- func (m *UserMutation) LoginFailedCount() (r uint8, exists bool)
- func (m *UserMutation) LoginFailedCountCleared() bool
- func (m *UserMutation) LoginLockedUntil() (r time.Time, exists bool)
- func (m *UserMutation) LoginLockedUntilCleared() bool
- func (m *UserMutation) MiddleName() (r string, exists bool)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldEmailVerified(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldLoginAttemptOn(ctx context.Context) (v *time.Time, err error)
- func (m *UserMutation) OldLoginFailedCount(ctx context.Context) (v uint8, err error)
- func (m *UserMutation) OldLoginLockedUntil(ctx context.Context) (v *time.Time, err error)
- func (m *UserMutation) OldMiddleName(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPhoneVerified(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldPwdHash(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPwdSalt(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldStatus(ctx context.Context) (v user.Status, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Phone() (r string, exists bool)
- func (m *UserMutation) PhoneCleared() bool
- func (m *UserMutation) PhoneVerified() (r bool, exists bool)
- func (m *UserMutation) PwdHash() (r string, exists bool)
- func (m *UserMutation) PwdSalt() (r string, exists bool)
- func (m *UserMutation) RemoveAuditLogIDs(ids ...int64)
- func (m *UserMutation) RemoveSessionIDs(ids ...int64)
- func (m *UserMutation) RemoveVerifyTokenIDs(ids ...int64)
- func (m *UserMutation) RemovedAuditLogsIDs() (ids []int64)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedSessionsIDs() (ids []int64)
- func (m *UserMutation) RemovedVerifyTokensIDs() (ids []int64)
- func (m *UserMutation) ResetAuditLogs()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetEmailVerified()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFirstName()
- func (m *UserMutation) ResetLastName()
- func (m *UserMutation) ResetLoginAttemptOn()
- func (m *UserMutation) ResetLoginFailedCount()
- func (m *UserMutation) ResetLoginLockedUntil()
- func (m *UserMutation) ResetMiddleName()
- func (m *UserMutation) ResetPhone()
- func (m *UserMutation) ResetPhoneVerified()
- func (m *UserMutation) ResetPwdHash()
- func (m *UserMutation) ResetPwdSalt()
- func (m *UserMutation) ResetSessions()
- func (m *UserMutation) ResetStatus()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetVerifyTokens()
- func (m *UserMutation) SessionsCleared() bool
- func (m *UserMutation) SessionsIDs() (ids []int64)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetEmailVerified(b bool)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetFirstName(s string)
- func (m *UserMutation) SetID(id int64)
- func (m *UserMutation) SetLastName(s string)
- func (m *UserMutation) SetLoginAttemptOn(t time.Time)
- func (m *UserMutation) SetLoginFailedCount(u uint8)
- func (m *UserMutation) SetLoginLockedUntil(t time.Time)
- func (m *UserMutation) SetMiddleName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPhone(s string)
- func (m *UserMutation) SetPhoneVerified(b bool)
- func (m *UserMutation) SetPwdHash(s string)
- func (m *UserMutation) SetPwdSalt(s string)
- func (m *UserMutation) SetStatus(u user.Status)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m *UserMutation) Status() (r user.Status, exists bool)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) VerifyTokensCleared() bool
- func (m *UserMutation) VerifyTokensIDs() (ids []int64)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int64, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int64
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int64
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int64
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) QueryAuditLogs() *AuditQuery
- func (uq *UserQuery) QuerySessions() *UserSessionQuery
- func (uq *UserQuery) QueryVerifyTokens() *VerifyTokenQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithAuditLogs(opts ...func(*AuditQuery)) *UserQuery
- func (uq *UserQuery) WithSessions(opts ...func(*UserSessionQuery)) *UserQuery
- func (uq *UserQuery) WithVerifyTokens(opts ...func(*VerifyTokenQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserSession
- type UserSessionClient
- func (c *UserSessionClient) Create() *UserSessionCreate
- func (c *UserSessionClient) CreateBulk(builders ...*UserSessionCreate) *UserSessionCreateBulk
- func (c *UserSessionClient) Delete() *UserSessionDelete
- func (c *UserSessionClient) DeleteOne(us *UserSession) *UserSessionDeleteOne
- func (c *UserSessionClient) DeleteOneID(id int64) *UserSessionDeleteOne
- func (c *UserSessionClient) Get(ctx context.Context, id int64) (*UserSession, error)
- func (c *UserSessionClient) GetX(ctx context.Context, id int64) *UserSession
- func (c *UserSessionClient) Hooks() []Hook
- func (c *UserSessionClient) Intercept(interceptors ...Interceptor)
- func (c *UserSessionClient) Interceptors() []Interceptor
- func (c *UserSessionClient) MapCreateBulk(slice any, setFunc func(*UserSessionCreate, int)) *UserSessionCreateBulk
- func (c *UserSessionClient) Query() *UserSessionQuery
- func (c *UserSessionClient) QueryUser(us *UserSession) *UserQuery
- func (c *UserSessionClient) Update() *UserSessionUpdate
- func (c *UserSessionClient) UpdateOne(us *UserSession) *UserSessionUpdateOne
- func (c *UserSessionClient) UpdateOneID(id int64) *UserSessionUpdateOne
- func (c *UserSessionClient) Use(hooks ...Hook)
- type UserSessionCreate
- func (usc *UserSessionCreate) Exec(ctx context.Context) error
- func (usc *UserSessionCreate) ExecX(ctx context.Context)
- func (usc *UserSessionCreate) Mutation() *UserSessionMutation
- func (usc *UserSessionCreate) Save(ctx context.Context) (*UserSession, error)
- func (usc *UserSessionCreate) SaveX(ctx context.Context) *UserSession
- func (usc *UserSessionCreate) SetExpiresAt(t time.Time) *UserSessionCreate
- func (usc *UserSessionCreate) SetID(i int64) *UserSessionCreate
- func (usc *UserSessionCreate) SetIP(s string) *UserSessionCreate
- func (usc *UserSessionCreate) SetInvalidated(b bool) *UserSessionCreate
- func (usc *UserSessionCreate) SetIssuedAt(t time.Time) *UserSessionCreate
- func (usc *UserSessionCreate) SetNillableInvalidated(b *bool) *UserSessionCreate
- func (usc *UserSessionCreate) SetUser(u *User) *UserSessionCreate
- func (usc *UserSessionCreate) SetUserAgent(s string) *UserSessionCreate
- func (usc *UserSessionCreate) SetUserID(id int64) *UserSessionCreate
- type UserSessionCreateBulk
- type UserSessionDelete
- type UserSessionDeleteOne
- type UserSessionEdges
- type UserSessionGroupBy
- func (usgb *UserSessionGroupBy) Aggregate(fns ...AggregateFunc) *UserSessionGroupBy
- func (s *UserSessionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSessionGroupBy) BoolX(ctx context.Context) bool
- func (s *UserSessionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSessionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserSessionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSessionGroupBy) Float64X(ctx context.Context) float64
- func (s *UserSessionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSessionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserSessionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserSessionGroupBy) IntX(ctx context.Context) int
- func (s *UserSessionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserSessionGroupBy) IntsX(ctx context.Context) []int
- func (usgb *UserSessionGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserSessionGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserSessionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserSessionGroupBy) StringX(ctx context.Context) string
- func (s *UserSessionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserSessionGroupBy) StringsX(ctx context.Context) []string
- type UserSessionMutation
- func (m *UserSessionMutation) AddField(name string, value ent.Value) error
- func (m *UserSessionMutation) AddedEdges() []string
- func (m *UserSessionMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserSessionMutation) AddedFields() []string
- func (m *UserSessionMutation) AddedIDs(name string) []ent.Value
- func (m *UserSessionMutation) ClearEdge(name string) error
- func (m *UserSessionMutation) ClearField(name string) error
- func (m *UserSessionMutation) ClearInvalidated()
- func (m *UserSessionMutation) ClearUser()
- func (m *UserSessionMutation) ClearedEdges() []string
- func (m *UserSessionMutation) ClearedFields() []string
- func (m UserSessionMutation) Client() *Client
- func (m *UserSessionMutation) EdgeCleared(name string) bool
- func (m *UserSessionMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *UserSessionMutation) Field(name string) (ent.Value, bool)
- func (m *UserSessionMutation) FieldCleared(name string) bool
- func (m *UserSessionMutation) Fields() []string
- func (m *UserSessionMutation) ID() (id int64, exists bool)
- func (m *UserSessionMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *UserSessionMutation) IP() (r string, exists bool)
- func (m *UserSessionMutation) Invalidated() (r bool, exists bool)
- func (m *UserSessionMutation) InvalidatedCleared() bool
- func (m *UserSessionMutation) IssuedAt() (r time.Time, exists bool)
- func (m *UserSessionMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *UserSessionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserSessionMutation) OldIP(ctx context.Context) (v string, err error)
- func (m *UserSessionMutation) OldInvalidated(ctx context.Context) (v bool, err error)
- func (m *UserSessionMutation) OldIssuedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserSessionMutation) OldUserAgent(ctx context.Context) (v string, err error)
- func (m *UserSessionMutation) Op() Op
- func (m *UserSessionMutation) RemovedEdges() []string
- func (m *UserSessionMutation) RemovedIDs(name string) []ent.Value
- func (m *UserSessionMutation) ResetEdge(name string) error
- func (m *UserSessionMutation) ResetExpiresAt()
- func (m *UserSessionMutation) ResetField(name string) error
- func (m *UserSessionMutation) ResetIP()
- func (m *UserSessionMutation) ResetInvalidated()
- func (m *UserSessionMutation) ResetIssuedAt()
- func (m *UserSessionMutation) ResetUser()
- func (m *UserSessionMutation) ResetUserAgent()
- func (m *UserSessionMutation) SetExpiresAt(t time.Time)
- func (m *UserSessionMutation) SetField(name string, value ent.Value) error
- func (m *UserSessionMutation) SetID(id int64)
- func (m *UserSessionMutation) SetIP(s string)
- func (m *UserSessionMutation) SetInvalidated(b bool)
- func (m *UserSessionMutation) SetIssuedAt(t time.Time)
- func (m *UserSessionMutation) SetOp(op Op)
- func (m *UserSessionMutation) SetUserAgent(s string)
- func (m *UserSessionMutation) SetUserID(id int64)
- func (m UserSessionMutation) Tx() (*Tx, error)
- func (m *UserSessionMutation) Type() string
- func (m *UserSessionMutation) UserAgent() (r string, exists bool)
- func (m *UserSessionMutation) UserCleared() bool
- func (m *UserSessionMutation) UserID() (id int64, exists bool)
- func (m *UserSessionMutation) UserIDs() (ids []int64)
- func (m *UserSessionMutation) Where(ps ...predicate.UserSession)
- func (m *UserSessionMutation) WhereP(ps ...func(*sql.Selector))
- type UserSessionQuery
- func (usq *UserSessionQuery) Aggregate(fns ...AggregateFunc) *UserSessionSelect
- func (usq *UserSessionQuery) All(ctx context.Context) ([]*UserSession, error)
- func (usq *UserSessionQuery) AllX(ctx context.Context) []*UserSession
- func (usq *UserSessionQuery) Clone() *UserSessionQuery
- func (usq *UserSessionQuery) Count(ctx context.Context) (int, error)
- func (usq *UserSessionQuery) CountX(ctx context.Context) int
- func (usq *UserSessionQuery) Exist(ctx context.Context) (bool, error)
- func (usq *UserSessionQuery) ExistX(ctx context.Context) bool
- func (usq *UserSessionQuery) First(ctx context.Context) (*UserSession, error)
- func (usq *UserSessionQuery) FirstID(ctx context.Context) (id int64, err error)
- func (usq *UserSessionQuery) FirstIDX(ctx context.Context) int64
- func (usq *UserSessionQuery) FirstX(ctx context.Context) *UserSession
- func (usq *UserSessionQuery) GroupBy(field string, fields ...string) *UserSessionGroupBy
- func (usq *UserSessionQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (usq *UserSessionQuery) IDsX(ctx context.Context) []int64
- func (usq *UserSessionQuery) Limit(limit int) *UserSessionQuery
- func (usq *UserSessionQuery) Offset(offset int) *UserSessionQuery
- func (usq *UserSessionQuery) Only(ctx context.Context) (*UserSession, error)
- func (usq *UserSessionQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (usq *UserSessionQuery) OnlyIDX(ctx context.Context) int64
- func (usq *UserSessionQuery) OnlyX(ctx context.Context) *UserSession
- func (usq *UserSessionQuery) Order(o ...usersession.OrderOption) *UserSessionQuery
- func (usq *UserSessionQuery) QueryUser() *UserQuery
- func (usq *UserSessionQuery) Select(fields ...string) *UserSessionSelect
- func (usq *UserSessionQuery) Unique(unique bool) *UserSessionQuery
- func (usq *UserSessionQuery) Where(ps ...predicate.UserSession) *UserSessionQuery
- func (usq *UserSessionQuery) WithUser(opts ...func(*UserQuery)) *UserSessionQuery
- type UserSessionSelect
- func (uss *UserSessionSelect) Aggregate(fns ...AggregateFunc) *UserSessionSelect
- func (s *UserSessionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSessionSelect) BoolX(ctx context.Context) bool
- func (s *UserSessionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSessionSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSessionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSessionSelect) Float64X(ctx context.Context) float64
- func (s *UserSessionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSessionSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSessionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSessionSelect) IntX(ctx context.Context) int
- func (s *UserSessionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSessionSelect) IntsX(ctx context.Context) []int
- func (uss *UserSessionSelect) Scan(ctx context.Context, v any) error
- func (s *UserSessionSelect) ScanX(ctx context.Context, v any)
- func (s *UserSessionSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSessionSelect) StringX(ctx context.Context) string
- func (s *UserSessionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSessionSelect) StringsX(ctx context.Context) []string
- type UserSessionUpdate
- func (usu *UserSessionUpdate) ClearInvalidated() *UserSessionUpdate
- func (usu *UserSessionUpdate) ClearUser() *UserSessionUpdate
- func (usu *UserSessionUpdate) Exec(ctx context.Context) error
- func (usu *UserSessionUpdate) ExecX(ctx context.Context)
- func (usu *UserSessionUpdate) Mutation() *UserSessionMutation
- func (usu *UserSessionUpdate) Save(ctx context.Context) (int, error)
- func (usu *UserSessionUpdate) SaveX(ctx context.Context) int
- func (usu *UserSessionUpdate) SetExpiresAt(t time.Time) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetIP(s string) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetInvalidated(b bool) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetIssuedAt(t time.Time) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetNillableExpiresAt(t *time.Time) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetNillableIP(s *string) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetNillableInvalidated(b *bool) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetNillableIssuedAt(t *time.Time) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetNillableUserAgent(s *string) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetUser(u *User) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetUserAgent(s string) *UserSessionUpdate
- func (usu *UserSessionUpdate) SetUserID(id int64) *UserSessionUpdate
- func (usu *UserSessionUpdate) Where(ps ...predicate.UserSession) *UserSessionUpdate
- type UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) ClearInvalidated() *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) ClearUser() *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) Exec(ctx context.Context) error
- func (usuo *UserSessionUpdateOne) ExecX(ctx context.Context)
- func (usuo *UserSessionUpdateOne) Mutation() *UserSessionMutation
- func (usuo *UserSessionUpdateOne) Save(ctx context.Context) (*UserSession, error)
- func (usuo *UserSessionUpdateOne) SaveX(ctx context.Context) *UserSession
- func (usuo *UserSessionUpdateOne) Select(field string, fields ...string) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetExpiresAt(t time.Time) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetIP(s string) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetInvalidated(b bool) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetIssuedAt(t time.Time) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetNillableExpiresAt(t *time.Time) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetNillableIP(s *string) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetNillableInvalidated(b *bool) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetNillableIssuedAt(t *time.Time) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetNillableUserAgent(s *string) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetUser(u *User) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetUserAgent(s string) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) SetUserID(id int64) *UserSessionUpdateOne
- func (usuo *UserSessionUpdateOne) Where(ps ...predicate.UserSession) *UserSessionUpdateOne
- type UserSessions
- type UserUpdate
- func (uu *UserUpdate) AddAuditLogIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddAuditLogs(a ...*Audit) *UserUpdate
- func (uu *UserUpdate) AddLoginFailedCount(u int8) *UserUpdate
- func (uu *UserUpdate) AddSessionIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddSessions(u ...*UserSession) *UserUpdate
- func (uu *UserUpdate) AddVerifyTokenIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) AddVerifyTokens(v ...*VerifyToken) *UserUpdate
- func (uu *UserUpdate) ClearAuditLogs() *UserUpdate
- func (uu *UserUpdate) ClearLoginAttemptOn() *UserUpdate
- func (uu *UserUpdate) ClearLoginFailedCount() *UserUpdate
- func (uu *UserUpdate) ClearLoginLockedUntil() *UserUpdate
- func (uu *UserUpdate) ClearPhone() *UserUpdate
- func (uu *UserUpdate) ClearSessions() *UserUpdate
- func (uu *UserUpdate) ClearVerifyTokens() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveAuditLogIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveAuditLogs(a ...*Audit) *UserUpdate
- func (uu *UserUpdate) RemoveSessionIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveSessions(u ...*UserSession) *UserUpdate
- func (uu *UserUpdate) RemoveVerifyTokenIDs(ids ...int64) *UserUpdate
- func (uu *UserUpdate) RemoveVerifyTokens(v ...*VerifyToken) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetEmailVerified(b bool) *UserUpdate
- func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
- func (uu *UserUpdate) SetLastName(s string) *UserUpdate
- func (uu *UserUpdate) SetLoginAttemptOn(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetLoginFailedCount(u uint8) *UserUpdate
- func (uu *UserUpdate) SetLoginLockedUntil(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetMiddleName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmailVerified(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableLoginAttemptOn(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableLoginFailedCount(u *uint8) *UserUpdate
- func (uu *UserUpdate) SetNillableLoginLockedUntil(t *time.Time) *UserUpdate
- func (uu *UserUpdate) SetNillableMiddleName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePhoneVerified(b *bool) *UserUpdate
- func (uu *UserUpdate) SetNillablePwdHash(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePwdSalt(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableStatus(u *user.Status) *UserUpdate
- func (uu *UserUpdate) SetPhone(s string) *UserUpdate
- func (uu *UserUpdate) SetPhoneVerified(b bool) *UserUpdate
- func (uu *UserUpdate) SetPwdHash(s string) *UserUpdate
- func (uu *UserUpdate) SetPwdSalt(s string) *UserUpdate
- func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAuditLogIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddAuditLogs(a ...*Audit) *UserUpdateOne
- func (uuo *UserUpdateOne) AddLoginFailedCount(u int8) *UserUpdateOne
- func (uuo *UserUpdateOne) AddSessionIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddSessions(u ...*UserSession) *UserUpdateOne
- func (uuo *UserUpdateOne) AddVerifyTokenIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddVerifyTokens(v ...*VerifyToken) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAuditLogs() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearLoginAttemptOn() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearLoginFailedCount() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearLoginLockedUntil() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearSessions() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearVerifyTokens() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveAuditLogIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveAuditLogs(a ...*Audit) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveSessionIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveSessions(u ...*UserSession) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveVerifyTokenIDs(ids ...int64) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveVerifyTokens(v ...*VerifyToken) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmailVerified(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLoginAttemptOn(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLoginFailedCount(u uint8) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLoginLockedUntil(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetMiddleName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmailVerified(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLoginAttemptOn(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLoginFailedCount(u *uint8) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLoginLockedUntil(t *time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableMiddleName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePhoneVerified(b *bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePwdHash(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePwdSalt(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableStatus(u *user.Status) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPhoneVerified(b bool) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPwdHash(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPwdSalt(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetStatus(u user.Status) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
- type VerifyToken
- type VerifyTokenClient
- func (c *VerifyTokenClient) Create() *VerifyTokenCreate
- func (c *VerifyTokenClient) CreateBulk(builders ...*VerifyTokenCreate) *VerifyTokenCreateBulk
- func (c *VerifyTokenClient) Delete() *VerifyTokenDelete
- func (c *VerifyTokenClient) DeleteOne(vt *VerifyToken) *VerifyTokenDeleteOne
- func (c *VerifyTokenClient) DeleteOneID(id int64) *VerifyTokenDeleteOne
- func (c *VerifyTokenClient) Get(ctx context.Context, id int64) (*VerifyToken, error)
- func (c *VerifyTokenClient) GetX(ctx context.Context, id int64) *VerifyToken
- func (c *VerifyTokenClient) Hooks() []Hook
- func (c *VerifyTokenClient) Intercept(interceptors ...Interceptor)
- func (c *VerifyTokenClient) Interceptors() []Interceptor
- func (c *VerifyTokenClient) MapCreateBulk(slice any, setFunc func(*VerifyTokenCreate, int)) *VerifyTokenCreateBulk
- func (c *VerifyTokenClient) Query() *VerifyTokenQuery
- func (c *VerifyTokenClient) QueryUser(vt *VerifyToken) *UserQuery
- func (c *VerifyTokenClient) Update() *VerifyTokenUpdate
- func (c *VerifyTokenClient) UpdateOne(vt *VerifyToken) *VerifyTokenUpdateOne
- func (c *VerifyTokenClient) UpdateOneID(id int64) *VerifyTokenUpdateOne
- func (c *VerifyTokenClient) Use(hooks ...Hook)
- type VerifyTokenCreate
- func (vtc *VerifyTokenCreate) Exec(ctx context.Context) error
- func (vtc *VerifyTokenCreate) ExecX(ctx context.Context)
- func (vtc *VerifyTokenCreate) Mutation() *VerifyTokenMutation
- func (vtc *VerifyTokenCreate) Save(ctx context.Context) (*VerifyToken, error)
- func (vtc *VerifyTokenCreate) SaveX(ctx context.Context) *VerifyToken
- func (vtc *VerifyTokenCreate) SetCreatedAt(t time.Time) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetExpiresAt(t time.Time) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetID(i int64) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetNillableCreatedAt(t *time.Time) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetNillablePurpose(s *string) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetNillableUserID(id *int64) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetPurpose(s string) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetToken(s string) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetUser(u *User) *VerifyTokenCreate
- func (vtc *VerifyTokenCreate) SetUserID(id int64) *VerifyTokenCreate
- type VerifyTokenCreateBulk
- type VerifyTokenDelete
- type VerifyTokenDeleteOne
- type VerifyTokenEdges
- type VerifyTokenGroupBy
- func (vtgb *VerifyTokenGroupBy) Aggregate(fns ...AggregateFunc) *VerifyTokenGroupBy
- func (s *VerifyTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VerifyTokenGroupBy) BoolX(ctx context.Context) bool
- func (s *VerifyTokenGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VerifyTokenGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VerifyTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VerifyTokenGroupBy) Float64X(ctx context.Context) float64
- func (s *VerifyTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VerifyTokenGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VerifyTokenGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VerifyTokenGroupBy) IntX(ctx context.Context) int
- func (s *VerifyTokenGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VerifyTokenGroupBy) IntsX(ctx context.Context) []int
- func (vtgb *VerifyTokenGroupBy) Scan(ctx context.Context, v any) error
- func (s *VerifyTokenGroupBy) ScanX(ctx context.Context, v any)
- func (s *VerifyTokenGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VerifyTokenGroupBy) StringX(ctx context.Context) string
- func (s *VerifyTokenGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VerifyTokenGroupBy) StringsX(ctx context.Context) []string
- type VerifyTokenMutation
- func (m *VerifyTokenMutation) AddField(name string, value ent.Value) error
- func (m *VerifyTokenMutation) AddedEdges() []string
- func (m *VerifyTokenMutation) AddedField(name string) (ent.Value, bool)
- func (m *VerifyTokenMutation) AddedFields() []string
- func (m *VerifyTokenMutation) AddedIDs(name string) []ent.Value
- func (m *VerifyTokenMutation) ClearEdge(name string) error
- func (m *VerifyTokenMutation) ClearField(name string) error
- func (m *VerifyTokenMutation) ClearPurpose()
- func (m *VerifyTokenMutation) ClearUser()
- func (m *VerifyTokenMutation) ClearedEdges() []string
- func (m *VerifyTokenMutation) ClearedFields() []string
- func (m VerifyTokenMutation) Client() *Client
- func (m *VerifyTokenMutation) CreatedAt() (r time.Time, exists bool)
- func (m *VerifyTokenMutation) EdgeCleared(name string) bool
- func (m *VerifyTokenMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *VerifyTokenMutation) Field(name string) (ent.Value, bool)
- func (m *VerifyTokenMutation) FieldCleared(name string) bool
- func (m *VerifyTokenMutation) Fields() []string
- func (m *VerifyTokenMutation) ID() (id int64, exists bool)
- func (m *VerifyTokenMutation) IDs(ctx context.Context) ([]int64, error)
- func (m *VerifyTokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VerifyTokenMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *VerifyTokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VerifyTokenMutation) OldPurpose(ctx context.Context) (v string, err error)
- func (m *VerifyTokenMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *VerifyTokenMutation) Op() Op
- func (m *VerifyTokenMutation) Purpose() (r string, exists bool)
- func (m *VerifyTokenMutation) PurposeCleared() bool
- func (m *VerifyTokenMutation) RemovedEdges() []string
- func (m *VerifyTokenMutation) RemovedIDs(name string) []ent.Value
- func (m *VerifyTokenMutation) ResetCreatedAt()
- func (m *VerifyTokenMutation) ResetEdge(name string) error
- func (m *VerifyTokenMutation) ResetExpiresAt()
- func (m *VerifyTokenMutation) ResetField(name string) error
- func (m *VerifyTokenMutation) ResetPurpose()
- func (m *VerifyTokenMutation) ResetToken()
- func (m *VerifyTokenMutation) ResetUser()
- func (m *VerifyTokenMutation) SetCreatedAt(t time.Time)
- func (m *VerifyTokenMutation) SetExpiresAt(t time.Time)
- func (m *VerifyTokenMutation) SetField(name string, value ent.Value) error
- func (m *VerifyTokenMutation) SetID(id int64)
- func (m *VerifyTokenMutation) SetOp(op Op)
- func (m *VerifyTokenMutation) SetPurpose(s string)
- func (m *VerifyTokenMutation) SetToken(s string)
- func (m *VerifyTokenMutation) SetUserID(id int64)
- func (m *VerifyTokenMutation) Token() (r string, exists bool)
- func (m VerifyTokenMutation) Tx() (*Tx, error)
- func (m *VerifyTokenMutation) Type() string
- func (m *VerifyTokenMutation) UserCleared() bool
- func (m *VerifyTokenMutation) UserID() (id int64, exists bool)
- func (m *VerifyTokenMutation) UserIDs() (ids []int64)
- func (m *VerifyTokenMutation) Where(ps ...predicate.VerifyToken)
- func (m *VerifyTokenMutation) WhereP(ps ...func(*sql.Selector))
- type VerifyTokenQuery
- func (vtq *VerifyTokenQuery) Aggregate(fns ...AggregateFunc) *VerifyTokenSelect
- func (vtq *VerifyTokenQuery) All(ctx context.Context) ([]*VerifyToken, error)
- func (vtq *VerifyTokenQuery) AllX(ctx context.Context) []*VerifyToken
- func (vtq *VerifyTokenQuery) Clone() *VerifyTokenQuery
- func (vtq *VerifyTokenQuery) Count(ctx context.Context) (int, error)
- func (vtq *VerifyTokenQuery) CountX(ctx context.Context) int
- func (vtq *VerifyTokenQuery) Exist(ctx context.Context) (bool, error)
- func (vtq *VerifyTokenQuery) ExistX(ctx context.Context) bool
- func (vtq *VerifyTokenQuery) First(ctx context.Context) (*VerifyToken, error)
- func (vtq *VerifyTokenQuery) FirstID(ctx context.Context) (id int64, err error)
- func (vtq *VerifyTokenQuery) FirstIDX(ctx context.Context) int64
- func (vtq *VerifyTokenQuery) FirstX(ctx context.Context) *VerifyToken
- func (vtq *VerifyTokenQuery) GroupBy(field string, fields ...string) *VerifyTokenGroupBy
- func (vtq *VerifyTokenQuery) IDs(ctx context.Context) (ids []int64, err error)
- func (vtq *VerifyTokenQuery) IDsX(ctx context.Context) []int64
- func (vtq *VerifyTokenQuery) Limit(limit int) *VerifyTokenQuery
- func (vtq *VerifyTokenQuery) Offset(offset int) *VerifyTokenQuery
- func (vtq *VerifyTokenQuery) Only(ctx context.Context) (*VerifyToken, error)
- func (vtq *VerifyTokenQuery) OnlyID(ctx context.Context) (id int64, err error)
- func (vtq *VerifyTokenQuery) OnlyIDX(ctx context.Context) int64
- func (vtq *VerifyTokenQuery) OnlyX(ctx context.Context) *VerifyToken
- func (vtq *VerifyTokenQuery) Order(o ...verifytoken.OrderOption) *VerifyTokenQuery
- func (vtq *VerifyTokenQuery) QueryUser() *UserQuery
- func (vtq *VerifyTokenQuery) Select(fields ...string) *VerifyTokenSelect
- func (vtq *VerifyTokenQuery) Unique(unique bool) *VerifyTokenQuery
- func (vtq *VerifyTokenQuery) Where(ps ...predicate.VerifyToken) *VerifyTokenQuery
- func (vtq *VerifyTokenQuery) WithUser(opts ...func(*UserQuery)) *VerifyTokenQuery
- type VerifyTokenSelect
- func (vts *VerifyTokenSelect) Aggregate(fns ...AggregateFunc) *VerifyTokenSelect
- func (s *VerifyTokenSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VerifyTokenSelect) BoolX(ctx context.Context) bool
- func (s *VerifyTokenSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VerifyTokenSelect) BoolsX(ctx context.Context) []bool
- func (s *VerifyTokenSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VerifyTokenSelect) Float64X(ctx context.Context) float64
- func (s *VerifyTokenSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VerifyTokenSelect) Float64sX(ctx context.Context) []float64
- func (s *VerifyTokenSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VerifyTokenSelect) IntX(ctx context.Context) int
- func (s *VerifyTokenSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VerifyTokenSelect) IntsX(ctx context.Context) []int
- func (vts *VerifyTokenSelect) Scan(ctx context.Context, v any) error
- func (s *VerifyTokenSelect) ScanX(ctx context.Context, v any)
- func (s *VerifyTokenSelect) String(ctx context.Context) (_ string, err error)
- func (s *VerifyTokenSelect) StringX(ctx context.Context) string
- func (s *VerifyTokenSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VerifyTokenSelect) StringsX(ctx context.Context) []string
- type VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) ClearPurpose() *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) ClearUser() *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) Exec(ctx context.Context) error
- func (vtu *VerifyTokenUpdate) ExecX(ctx context.Context)
- func (vtu *VerifyTokenUpdate) Mutation() *VerifyTokenMutation
- func (vtu *VerifyTokenUpdate) Save(ctx context.Context) (int, error)
- func (vtu *VerifyTokenUpdate) SaveX(ctx context.Context) int
- func (vtu *VerifyTokenUpdate) SetNillablePurpose(s *string) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) SetNillableToken(s *string) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) SetNillableUserID(id *int64) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) SetPurpose(s string) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) SetToken(s string) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) SetUser(u *User) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) SetUserID(id int64) *VerifyTokenUpdate
- func (vtu *VerifyTokenUpdate) Where(ps ...predicate.VerifyToken) *VerifyTokenUpdate
- type VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) ClearPurpose() *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) ClearUser() *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) Exec(ctx context.Context) error
- func (vtuo *VerifyTokenUpdateOne) ExecX(ctx context.Context)
- func (vtuo *VerifyTokenUpdateOne) Mutation() *VerifyTokenMutation
- func (vtuo *VerifyTokenUpdateOne) Save(ctx context.Context) (*VerifyToken, error)
- func (vtuo *VerifyTokenUpdateOne) SaveX(ctx context.Context) *VerifyToken
- func (vtuo *VerifyTokenUpdateOne) Select(field string, fields ...string) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetNillablePurpose(s *string) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetNillableToken(s *string) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetNillableUserID(id *int64) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetPurpose(s string) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetToken(s string) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetUser(u *User) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) SetUserID(id int64) *VerifyTokenUpdateOne
- func (vtuo *VerifyTokenUpdateOne) Where(ps ...predicate.VerifyToken) *VerifyTokenUpdateOne
- type VerifyTokens
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeAccessControl = "AccessControl" TypeAudit = "Audit" TypeRole = "Role" TypeTodo = "Todo" TypeUser = "User" TypeUserSession = "UserSession" TypeVerifyToken = "VerifyToken" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AccessControl ¶
type AccessControl struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updatedAt"` // Ptype holds the value of the "ptype" field. Ptype string `json:"ptype,omitempty"` // V0 holds the value of the "v0" field. V0 string `json:"v0,omitempty"` // V1 holds the value of the "v1" field. V1 string `json:"v1,omitempty"` // V2 holds the value of the "v2" field. V2 string `json:"v2,omitempty"` // V3 holds the value of the "v3" field. V3 string `json:"v3,omitempty"` // V4 holds the value of the "v4" field. V4 string `json:"v4,omitempty"` // V5 holds the value of the "v5" field. V5 string `json:"v5,omitempty"` // contains filtered or unexported fields }
AccessControl is the model entity for the AccessControl schema.
func (*AccessControl) String ¶
func (ac *AccessControl) String() string
String implements the fmt.Stringer.
func (*AccessControl) Unwrap ¶
func (ac *AccessControl) Unwrap() *AccessControl
Unwrap unwraps the AccessControl 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 (*AccessControl) Update ¶
func (ac *AccessControl) Update() *AccessControlUpdateOne
Update returns a builder for updating this AccessControl. Note that you need to call AccessControl.Unwrap() before calling this method if this AccessControl was returned from a transaction, and the transaction was committed or rolled back.
type AccessControlClient ¶
type AccessControlClient struct {
// contains filtered or unexported fields
}
AccessControlClient is a client for the AccessControl schema.
func NewAccessControlClient ¶
func NewAccessControlClient(c config) *AccessControlClient
NewAccessControlClient returns a client for the AccessControl from the given config.
func (*AccessControlClient) Create ¶
func (c *AccessControlClient) Create() *AccessControlCreate
Create returns a builder for creating a AccessControl entity.
func (*AccessControlClient) CreateBulk ¶
func (c *AccessControlClient) CreateBulk(builders ...*AccessControlCreate) *AccessControlCreateBulk
CreateBulk returns a builder for creating a bulk of AccessControl entities.
func (*AccessControlClient) Delete ¶
func (c *AccessControlClient) Delete() *AccessControlDelete
Delete returns a delete builder for AccessControl.
func (*AccessControlClient) DeleteOne ¶
func (c *AccessControlClient) DeleteOne(ac *AccessControl) *AccessControlDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AccessControlClient) DeleteOneID ¶
func (c *AccessControlClient) DeleteOneID(id int64) *AccessControlDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AccessControlClient) Get ¶
func (c *AccessControlClient) Get(ctx context.Context, id int64) (*AccessControl, error)
Get returns a AccessControl entity by its id.
func (*AccessControlClient) GetX ¶
func (c *AccessControlClient) GetX(ctx context.Context, id int64) *AccessControl
GetX is like Get, but panics if an error occurs.
func (*AccessControlClient) Hooks ¶
func (c *AccessControlClient) Hooks() []Hook
Hooks returns the client hooks.
func (*AccessControlClient) Intercept ¶
func (c *AccessControlClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `accesscontrol.Intercept(f(g(h())))`.
func (*AccessControlClient) Interceptors ¶
func (c *AccessControlClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AccessControlClient) MapCreateBulk ¶
func (c *AccessControlClient) MapCreateBulk(slice any, setFunc func(*AccessControlCreate, int)) *AccessControlCreateBulk
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 (*AccessControlClient) Query ¶
func (c *AccessControlClient) Query() *AccessControlQuery
Query returns a query builder for AccessControl.
func (*AccessControlClient) Update ¶
func (c *AccessControlClient) Update() *AccessControlUpdate
Update returns an update builder for AccessControl.
func (*AccessControlClient) UpdateOne ¶
func (c *AccessControlClient) UpdateOne(ac *AccessControl) *AccessControlUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AccessControlClient) UpdateOneID ¶
func (c *AccessControlClient) UpdateOneID(id int64) *AccessControlUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AccessControlClient) Use ¶
func (c *AccessControlClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `accesscontrol.Hooks(f(g(h())))`.
type AccessControlCreate ¶
type AccessControlCreate struct {
// contains filtered or unexported fields
}
AccessControlCreate is the builder for creating a AccessControl entity.
func (*AccessControlCreate) Exec ¶
func (acc *AccessControlCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessControlCreate) ExecX ¶
func (acc *AccessControlCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessControlCreate) Mutation ¶
func (acc *AccessControlCreate) Mutation() *AccessControlMutation
Mutation returns the AccessControlMutation object of the builder.
func (*AccessControlCreate) Save ¶
func (acc *AccessControlCreate) Save(ctx context.Context) (*AccessControl, error)
Save creates the AccessControl in the database.
func (*AccessControlCreate) SaveX ¶
func (acc *AccessControlCreate) SaveX(ctx context.Context) *AccessControl
SaveX calls Save and panics if Save returns an error.
func (*AccessControlCreate) SetCreatedAt ¶
func (acc *AccessControlCreate) SetCreatedAt(t time.Time) *AccessControlCreate
SetCreatedAt sets the "created_at" field.
func (*AccessControlCreate) SetID ¶
func (acc *AccessControlCreate) SetID(i int64) *AccessControlCreate
SetID sets the "id" field.
func (*AccessControlCreate) SetNillableCreatedAt ¶
func (acc *AccessControlCreate) SetNillableCreatedAt(t *time.Time) *AccessControlCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AccessControlCreate) SetNillablePtype ¶
func (acc *AccessControlCreate) SetNillablePtype(s *string) *AccessControlCreate
SetNillablePtype sets the "ptype" field if the given value is not nil.
func (*AccessControlCreate) SetNillableUpdatedAt ¶
func (acc *AccessControlCreate) SetNillableUpdatedAt(t *time.Time) *AccessControlCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*AccessControlCreate) SetNillableV0 ¶
func (acc *AccessControlCreate) SetNillableV0(s *string) *AccessControlCreate
SetNillableV0 sets the "v0" field if the given value is not nil.
func (*AccessControlCreate) SetNillableV1 ¶
func (acc *AccessControlCreate) SetNillableV1(s *string) *AccessControlCreate
SetNillableV1 sets the "v1" field if the given value is not nil.
func (*AccessControlCreate) SetNillableV2 ¶
func (acc *AccessControlCreate) SetNillableV2(s *string) *AccessControlCreate
SetNillableV2 sets the "v2" field if the given value is not nil.
func (*AccessControlCreate) SetNillableV3 ¶
func (acc *AccessControlCreate) SetNillableV3(s *string) *AccessControlCreate
SetNillableV3 sets the "v3" field if the given value is not nil.
func (*AccessControlCreate) SetNillableV4 ¶
func (acc *AccessControlCreate) SetNillableV4(s *string) *AccessControlCreate
SetNillableV4 sets the "v4" field if the given value is not nil.
func (*AccessControlCreate) SetNillableV5 ¶
func (acc *AccessControlCreate) SetNillableV5(s *string) *AccessControlCreate
SetNillableV5 sets the "v5" field if the given value is not nil.
func (*AccessControlCreate) SetPtype ¶
func (acc *AccessControlCreate) SetPtype(s string) *AccessControlCreate
SetPtype sets the "ptype" field.
func (*AccessControlCreate) SetUpdatedAt ¶
func (acc *AccessControlCreate) SetUpdatedAt(t time.Time) *AccessControlCreate
SetUpdatedAt sets the "updated_at" field.
func (*AccessControlCreate) SetV0 ¶
func (acc *AccessControlCreate) SetV0(s string) *AccessControlCreate
SetV0 sets the "v0" field.
func (*AccessControlCreate) SetV1 ¶
func (acc *AccessControlCreate) SetV1(s string) *AccessControlCreate
SetV1 sets the "v1" field.
func (*AccessControlCreate) SetV2 ¶
func (acc *AccessControlCreate) SetV2(s string) *AccessControlCreate
SetV2 sets the "v2" field.
func (*AccessControlCreate) SetV3 ¶
func (acc *AccessControlCreate) SetV3(s string) *AccessControlCreate
SetV3 sets the "v3" field.
func (*AccessControlCreate) SetV4 ¶
func (acc *AccessControlCreate) SetV4(s string) *AccessControlCreate
SetV4 sets the "v4" field.
func (*AccessControlCreate) SetV5 ¶
func (acc *AccessControlCreate) SetV5(s string) *AccessControlCreate
SetV5 sets the "v5" field.
type AccessControlCreateBulk ¶
type AccessControlCreateBulk struct {
// contains filtered or unexported fields
}
AccessControlCreateBulk is the builder for creating many AccessControl entities in bulk.
func (*AccessControlCreateBulk) Exec ¶
func (accb *AccessControlCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessControlCreateBulk) ExecX ¶
func (accb *AccessControlCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessControlCreateBulk) Save ¶
func (accb *AccessControlCreateBulk) Save(ctx context.Context) ([]*AccessControl, error)
Save creates the AccessControl entities in the database.
func (*AccessControlCreateBulk) SaveX ¶
func (accb *AccessControlCreateBulk) SaveX(ctx context.Context) []*AccessControl
SaveX is like Save, but panics if an error occurs.
type AccessControlDelete ¶
type AccessControlDelete struct {
// contains filtered or unexported fields
}
AccessControlDelete is the builder for deleting a AccessControl entity.
func (*AccessControlDelete) Exec ¶
func (acd *AccessControlDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AccessControlDelete) ExecX ¶
func (acd *AccessControlDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AccessControlDelete) Where ¶
func (acd *AccessControlDelete) Where(ps ...predicate.AccessControl) *AccessControlDelete
Where appends a list predicates to the AccessControlDelete builder.
type AccessControlDeleteOne ¶
type AccessControlDeleteOne struct {
// contains filtered or unexported fields
}
AccessControlDeleteOne is the builder for deleting a single AccessControl entity.
func (*AccessControlDeleteOne) Exec ¶
func (acdo *AccessControlDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AccessControlDeleteOne) ExecX ¶
func (acdo *AccessControlDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessControlDeleteOne) Where ¶
func (acdo *AccessControlDeleteOne) Where(ps ...predicate.AccessControl) *AccessControlDeleteOne
Where appends a list predicates to the AccessControlDelete builder.
type AccessControlGroupBy ¶
type AccessControlGroupBy struct {
// contains filtered or unexported fields
}
AccessControlGroupBy is the group-by builder for AccessControl entities.
func (*AccessControlGroupBy) Aggregate ¶
func (acgb *AccessControlGroupBy) Aggregate(fns ...AggregateFunc) *AccessControlGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AccessControlGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccessControlGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccessControlGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccessControlGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccessControlGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccessControlGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccessControlGroupBy) Scan ¶
func (acgb *AccessControlGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AccessControlGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccessControlMutation ¶
type AccessControlMutation struct {
// contains filtered or unexported fields
}
AccessControlMutation represents an operation that mutates the AccessControl nodes in the graph.
func (*AccessControlMutation) AddField ¶
func (m *AccessControlMutation) AddField(name string, value ent.Value) error
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 (*AccessControlMutation) AddedEdges ¶
func (m *AccessControlMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AccessControlMutation) AddedField ¶
func (m *AccessControlMutation) AddedField(name string) (ent.Value, bool)
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 (*AccessControlMutation) AddedFields ¶
func (m *AccessControlMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AccessControlMutation) AddedIDs ¶
func (m *AccessControlMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AccessControlMutation) ClearEdge ¶
func (m *AccessControlMutation) ClearEdge(name string) error
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 (*AccessControlMutation) ClearField ¶
func (m *AccessControlMutation) ClearField(name string) error
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 (*AccessControlMutation) ClearedEdges ¶
func (m *AccessControlMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AccessControlMutation) ClearedFields ¶
func (m *AccessControlMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AccessControlMutation) Client ¶
func (m AccessControlMutation) Client() *Client
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 (*AccessControlMutation) CreatedAt ¶
func (m *AccessControlMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AccessControlMutation) EdgeCleared ¶
func (m *AccessControlMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AccessControlMutation) Field ¶
func (m *AccessControlMutation) Field(name string) (ent.Value, bool)
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 (*AccessControlMutation) FieldCleared ¶
func (m *AccessControlMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AccessControlMutation) Fields ¶
func (m *AccessControlMutation) Fields() []string
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 (*AccessControlMutation) ID ¶
func (m *AccessControlMutation) ID() (id int64, exists bool)
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 (*AccessControlMutation) IDs ¶
func (m *AccessControlMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*AccessControlMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldField ¶
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 (*AccessControlMutation) OldPtype ¶
func (m *AccessControlMutation) OldPtype(ctx context.Context) (v string, err error)
OldPtype returns the old "ptype" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldV0 ¶
func (m *AccessControlMutation) OldV0(ctx context.Context) (v string, err error)
OldV0 returns the old "v0" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldV1 ¶
func (m *AccessControlMutation) OldV1(ctx context.Context) (v string, err error)
OldV1 returns the old "v1" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldV2 ¶
func (m *AccessControlMutation) OldV2(ctx context.Context) (v string, err error)
OldV2 returns the old "v2" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldV3 ¶
func (m *AccessControlMutation) OldV3(ctx context.Context) (v string, err error)
OldV3 returns the old "v3" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldV4 ¶
func (m *AccessControlMutation) OldV4(ctx context.Context) (v string, err error)
OldV4 returns the old "v4" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) OldV5 ¶
func (m *AccessControlMutation) OldV5(ctx context.Context) (v string, err error)
OldV5 returns the old "v5" field's value of the AccessControl entity. If the AccessControl 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 (*AccessControlMutation) Op ¶
func (m *AccessControlMutation) Op() Op
Op returns the operation name.
func (*AccessControlMutation) Ptype ¶
func (m *AccessControlMutation) Ptype() (r string, exists bool)
Ptype returns the value of the "ptype" field in the mutation.
func (*AccessControlMutation) RemovedEdges ¶
func (m *AccessControlMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AccessControlMutation) RemovedIDs ¶
func (m *AccessControlMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*AccessControlMutation) ResetCreatedAt ¶
func (m *AccessControlMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AccessControlMutation) ResetEdge ¶
func (m *AccessControlMutation) ResetEdge(name string) error
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 (*AccessControlMutation) ResetField ¶
func (m *AccessControlMutation) ResetField(name string) error
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 (*AccessControlMutation) ResetPtype ¶
func (m *AccessControlMutation) ResetPtype()
ResetPtype resets all changes to the "ptype" field.
func (*AccessControlMutation) ResetUpdatedAt ¶
func (m *AccessControlMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*AccessControlMutation) ResetV0 ¶
func (m *AccessControlMutation) ResetV0()
ResetV0 resets all changes to the "v0" field.
func (*AccessControlMutation) ResetV1 ¶
func (m *AccessControlMutation) ResetV1()
ResetV1 resets all changes to the "v1" field.
func (*AccessControlMutation) ResetV2 ¶
func (m *AccessControlMutation) ResetV2()
ResetV2 resets all changes to the "v2" field.
func (*AccessControlMutation) ResetV3 ¶
func (m *AccessControlMutation) ResetV3()
ResetV3 resets all changes to the "v3" field.
func (*AccessControlMutation) ResetV4 ¶
func (m *AccessControlMutation) ResetV4()
ResetV4 resets all changes to the "v4" field.
func (*AccessControlMutation) ResetV5 ¶
func (m *AccessControlMutation) ResetV5()
ResetV5 resets all changes to the "v5" field.
func (*AccessControlMutation) SetCreatedAt ¶
func (m *AccessControlMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AccessControlMutation) SetField ¶
func (m *AccessControlMutation) SetField(name string, value ent.Value) error
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 (*AccessControlMutation) SetID ¶
func (m *AccessControlMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of AccessControl entities.
func (*AccessControlMutation) SetOp ¶
func (m *AccessControlMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AccessControlMutation) SetPtype ¶
func (m *AccessControlMutation) SetPtype(s string)
SetPtype sets the "ptype" field.
func (*AccessControlMutation) SetUpdatedAt ¶
func (m *AccessControlMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*AccessControlMutation) SetV0 ¶
func (m *AccessControlMutation) SetV0(s string)
SetV0 sets the "v0" field.
func (*AccessControlMutation) SetV1 ¶
func (m *AccessControlMutation) SetV1(s string)
SetV1 sets the "v1" field.
func (*AccessControlMutation) SetV2 ¶
func (m *AccessControlMutation) SetV2(s string)
SetV2 sets the "v2" field.
func (*AccessControlMutation) SetV3 ¶
func (m *AccessControlMutation) SetV3(s string)
SetV3 sets the "v3" field.
func (*AccessControlMutation) SetV4 ¶
func (m *AccessControlMutation) SetV4(s string)
SetV4 sets the "v4" field.
func (*AccessControlMutation) SetV5 ¶
func (m *AccessControlMutation) SetV5(s string)
SetV5 sets the "v5" field.
func (AccessControlMutation) Tx ¶
func (m AccessControlMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AccessControlMutation) Type ¶
func (m *AccessControlMutation) Type() string
Type returns the node type of this mutation (AccessControl).
func (*AccessControlMutation) UpdatedAt ¶
func (m *AccessControlMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*AccessControlMutation) V0 ¶
func (m *AccessControlMutation) V0() (r string, exists bool)
V0 returns the value of the "v0" field in the mutation.
func (*AccessControlMutation) V1 ¶
func (m *AccessControlMutation) V1() (r string, exists bool)
V1 returns the value of the "v1" field in the mutation.
func (*AccessControlMutation) V2 ¶
func (m *AccessControlMutation) V2() (r string, exists bool)
V2 returns the value of the "v2" field in the mutation.
func (*AccessControlMutation) V3 ¶
func (m *AccessControlMutation) V3() (r string, exists bool)
V3 returns the value of the "v3" field in the mutation.
func (*AccessControlMutation) V4 ¶
func (m *AccessControlMutation) V4() (r string, exists bool)
V4 returns the value of the "v4" field in the mutation.
func (*AccessControlMutation) V5 ¶
func (m *AccessControlMutation) V5() (r string, exists bool)
V5 returns the value of the "v5" field in the mutation.
func (*AccessControlMutation) Where ¶
func (m *AccessControlMutation) Where(ps ...predicate.AccessControl)
Where appends a list predicates to the AccessControlMutation builder.
func (*AccessControlMutation) WhereP ¶
func (m *AccessControlMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AccessControlMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AccessControlQuery ¶
type AccessControlQuery struct {
// contains filtered or unexported fields
}
AccessControlQuery is the builder for querying AccessControl entities.
func (*AccessControlQuery) Aggregate ¶
func (acq *AccessControlQuery) Aggregate(fns ...AggregateFunc) *AccessControlSelect
Aggregate returns a AccessControlSelect configured with the given aggregations.
func (*AccessControlQuery) All ¶
func (acq *AccessControlQuery) All(ctx context.Context) ([]*AccessControl, error)
All executes the query and returns a list of AccessControls.
func (*AccessControlQuery) AllX ¶
func (acq *AccessControlQuery) AllX(ctx context.Context) []*AccessControl
AllX is like All, but panics if an error occurs.
func (*AccessControlQuery) Clone ¶
func (acq *AccessControlQuery) Clone() *AccessControlQuery
Clone returns a duplicate of the AccessControlQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AccessControlQuery) Count ¶
func (acq *AccessControlQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AccessControlQuery) CountX ¶
func (acq *AccessControlQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AccessControlQuery) Exist ¶
func (acq *AccessControlQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AccessControlQuery) ExistX ¶
func (acq *AccessControlQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AccessControlQuery) First ¶
func (acq *AccessControlQuery) First(ctx context.Context) (*AccessControl, error)
First returns the first AccessControl entity from the query. Returns a *NotFoundError when no AccessControl was found.
func (*AccessControlQuery) FirstID ¶
func (acq *AccessControlQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first AccessControl ID from the query. Returns a *NotFoundError when no AccessControl ID was found.
func (*AccessControlQuery) FirstIDX ¶
func (acq *AccessControlQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*AccessControlQuery) FirstX ¶
func (acq *AccessControlQuery) FirstX(ctx context.Context) *AccessControl
FirstX is like First, but panics if an error occurs.
func (*AccessControlQuery) GroupBy ¶
func (acq *AccessControlQuery) GroupBy(field string, fields ...string) *AccessControlGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` Count int `json:"count,omitempty"` } client.AccessControl.Query(). GroupBy(accesscontrol.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AccessControlQuery) IDs ¶
func (acq *AccessControlQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of AccessControl IDs.
func (*AccessControlQuery) IDsX ¶
func (acq *AccessControlQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*AccessControlQuery) Limit ¶
func (acq *AccessControlQuery) Limit(limit int) *AccessControlQuery
Limit the number of records to be returned by this query.
func (*AccessControlQuery) Offset ¶
func (acq *AccessControlQuery) Offset(offset int) *AccessControlQuery
Offset to start from.
func (*AccessControlQuery) Only ¶
func (acq *AccessControlQuery) Only(ctx context.Context) (*AccessControl, error)
Only returns a single AccessControl entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one AccessControl entity is found. Returns a *NotFoundError when no AccessControl entities are found.
func (*AccessControlQuery) OnlyID ¶
func (acq *AccessControlQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only AccessControl ID in the query. Returns a *NotSingularError when more than one AccessControl ID is found. Returns a *NotFoundError when no entities are found.
func (*AccessControlQuery) OnlyIDX ¶
func (acq *AccessControlQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AccessControlQuery) OnlyX ¶
func (acq *AccessControlQuery) OnlyX(ctx context.Context) *AccessControl
OnlyX is like Only, but panics if an error occurs.
func (*AccessControlQuery) Order ¶
func (acq *AccessControlQuery) Order(o ...accesscontrol.OrderOption) *AccessControlQuery
Order specifies how the records should be ordered.
func (*AccessControlQuery) Select ¶
func (acq *AccessControlQuery) Select(fields ...string) *AccessControlSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` } client.AccessControl.Query(). Select(accesscontrol.FieldCreatedAt). Scan(ctx, &v)
func (*AccessControlQuery) Unique ¶
func (acq *AccessControlQuery) Unique(unique bool) *AccessControlQuery
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 (*AccessControlQuery) Where ¶
func (acq *AccessControlQuery) Where(ps ...predicate.AccessControl) *AccessControlQuery
Where adds a new predicate for the AccessControlQuery builder.
type AccessControlSelect ¶
type AccessControlSelect struct { *AccessControlQuery // contains filtered or unexported fields }
AccessControlSelect is the builder for selecting fields of AccessControl entities.
func (*AccessControlSelect) Aggregate ¶
func (acs *AccessControlSelect) Aggregate(fns ...AggregateFunc) *AccessControlSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AccessControlSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccessControlSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccessControlSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccessControlSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccessControlSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccessControlSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AccessControlSelect) Scan ¶
func (acs *AccessControlSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AccessControlSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AccessControlUpdate ¶
type AccessControlUpdate struct {
// contains filtered or unexported fields
}
AccessControlUpdate is the builder for updating AccessControl entities.
func (*AccessControlUpdate) Exec ¶
func (acu *AccessControlUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AccessControlUpdate) ExecX ¶
func (acu *AccessControlUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessControlUpdate) Mutation ¶
func (acu *AccessControlUpdate) Mutation() *AccessControlMutation
Mutation returns the AccessControlMutation object of the builder.
func (*AccessControlUpdate) Save ¶
func (acu *AccessControlUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AccessControlUpdate) SaveX ¶
func (acu *AccessControlUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AccessControlUpdate) SetNillablePtype ¶
func (acu *AccessControlUpdate) SetNillablePtype(s *string) *AccessControlUpdate
SetNillablePtype sets the "ptype" field if the given value is not nil.
func (*AccessControlUpdate) SetNillableV0 ¶
func (acu *AccessControlUpdate) SetNillableV0(s *string) *AccessControlUpdate
SetNillableV0 sets the "v0" field if the given value is not nil.
func (*AccessControlUpdate) SetNillableV1 ¶
func (acu *AccessControlUpdate) SetNillableV1(s *string) *AccessControlUpdate
SetNillableV1 sets the "v1" field if the given value is not nil.
func (*AccessControlUpdate) SetNillableV2 ¶
func (acu *AccessControlUpdate) SetNillableV2(s *string) *AccessControlUpdate
SetNillableV2 sets the "v2" field if the given value is not nil.
func (*AccessControlUpdate) SetNillableV3 ¶
func (acu *AccessControlUpdate) SetNillableV3(s *string) *AccessControlUpdate
SetNillableV3 sets the "v3" field if the given value is not nil.
func (*AccessControlUpdate) SetNillableV4 ¶
func (acu *AccessControlUpdate) SetNillableV4(s *string) *AccessControlUpdate
SetNillableV4 sets the "v4" field if the given value is not nil.
func (*AccessControlUpdate) SetNillableV5 ¶
func (acu *AccessControlUpdate) SetNillableV5(s *string) *AccessControlUpdate
SetNillableV5 sets the "v5" field if the given value is not nil.
func (*AccessControlUpdate) SetPtype ¶
func (acu *AccessControlUpdate) SetPtype(s string) *AccessControlUpdate
SetPtype sets the "ptype" field.
func (*AccessControlUpdate) SetUpdatedAt ¶
func (acu *AccessControlUpdate) SetUpdatedAt(t time.Time) *AccessControlUpdate
SetUpdatedAt sets the "updated_at" field.
func (*AccessControlUpdate) SetV0 ¶
func (acu *AccessControlUpdate) SetV0(s string) *AccessControlUpdate
SetV0 sets the "v0" field.
func (*AccessControlUpdate) SetV1 ¶
func (acu *AccessControlUpdate) SetV1(s string) *AccessControlUpdate
SetV1 sets the "v1" field.
func (*AccessControlUpdate) SetV2 ¶
func (acu *AccessControlUpdate) SetV2(s string) *AccessControlUpdate
SetV2 sets the "v2" field.
func (*AccessControlUpdate) SetV3 ¶
func (acu *AccessControlUpdate) SetV3(s string) *AccessControlUpdate
SetV3 sets the "v3" field.
func (*AccessControlUpdate) SetV4 ¶
func (acu *AccessControlUpdate) SetV4(s string) *AccessControlUpdate
SetV4 sets the "v4" field.
func (*AccessControlUpdate) SetV5 ¶
func (acu *AccessControlUpdate) SetV5(s string) *AccessControlUpdate
SetV5 sets the "v5" field.
func (*AccessControlUpdate) Where ¶
func (acu *AccessControlUpdate) Where(ps ...predicate.AccessControl) *AccessControlUpdate
Where appends a list predicates to the AccessControlUpdate builder.
type AccessControlUpdateOne ¶
type AccessControlUpdateOne struct {
// contains filtered or unexported fields
}
AccessControlUpdateOne is the builder for updating a single AccessControl entity.
func (*AccessControlUpdateOne) Exec ¶
func (acuo *AccessControlUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AccessControlUpdateOne) ExecX ¶
func (acuo *AccessControlUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AccessControlUpdateOne) Mutation ¶
func (acuo *AccessControlUpdateOne) Mutation() *AccessControlMutation
Mutation returns the AccessControlMutation object of the builder.
func (*AccessControlUpdateOne) Save ¶
func (acuo *AccessControlUpdateOne) Save(ctx context.Context) (*AccessControl, error)
Save executes the query and returns the updated AccessControl entity.
func (*AccessControlUpdateOne) SaveX ¶
func (acuo *AccessControlUpdateOne) SaveX(ctx context.Context) *AccessControl
SaveX is like Save, but panics if an error occurs.
func (*AccessControlUpdateOne) Select ¶
func (acuo *AccessControlUpdateOne) Select(field string, fields ...string) *AccessControlUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AccessControlUpdateOne) SetNillablePtype ¶
func (acuo *AccessControlUpdateOne) SetNillablePtype(s *string) *AccessControlUpdateOne
SetNillablePtype sets the "ptype" field if the given value is not nil.
func (*AccessControlUpdateOne) SetNillableV0 ¶
func (acuo *AccessControlUpdateOne) SetNillableV0(s *string) *AccessControlUpdateOne
SetNillableV0 sets the "v0" field if the given value is not nil.
func (*AccessControlUpdateOne) SetNillableV1 ¶
func (acuo *AccessControlUpdateOne) SetNillableV1(s *string) *AccessControlUpdateOne
SetNillableV1 sets the "v1" field if the given value is not nil.
func (*AccessControlUpdateOne) SetNillableV2 ¶
func (acuo *AccessControlUpdateOne) SetNillableV2(s *string) *AccessControlUpdateOne
SetNillableV2 sets the "v2" field if the given value is not nil.
func (*AccessControlUpdateOne) SetNillableV3 ¶
func (acuo *AccessControlUpdateOne) SetNillableV3(s *string) *AccessControlUpdateOne
SetNillableV3 sets the "v3" field if the given value is not nil.
func (*AccessControlUpdateOne) SetNillableV4 ¶
func (acuo *AccessControlUpdateOne) SetNillableV4(s *string) *AccessControlUpdateOne
SetNillableV4 sets the "v4" field if the given value is not nil.
func (*AccessControlUpdateOne) SetNillableV5 ¶
func (acuo *AccessControlUpdateOne) SetNillableV5(s *string) *AccessControlUpdateOne
SetNillableV5 sets the "v5" field if the given value is not nil.
func (*AccessControlUpdateOne) SetPtype ¶
func (acuo *AccessControlUpdateOne) SetPtype(s string) *AccessControlUpdateOne
SetPtype sets the "ptype" field.
func (*AccessControlUpdateOne) SetUpdatedAt ¶
func (acuo *AccessControlUpdateOne) SetUpdatedAt(t time.Time) *AccessControlUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*AccessControlUpdateOne) SetV0 ¶
func (acuo *AccessControlUpdateOne) SetV0(s string) *AccessControlUpdateOne
SetV0 sets the "v0" field.
func (*AccessControlUpdateOne) SetV1 ¶
func (acuo *AccessControlUpdateOne) SetV1(s string) *AccessControlUpdateOne
SetV1 sets the "v1" field.
func (*AccessControlUpdateOne) SetV2 ¶
func (acuo *AccessControlUpdateOne) SetV2(s string) *AccessControlUpdateOne
SetV2 sets the "v2" field.
func (*AccessControlUpdateOne) SetV3 ¶
func (acuo *AccessControlUpdateOne) SetV3(s string) *AccessControlUpdateOne
SetV3 sets the "v3" field.
func (*AccessControlUpdateOne) SetV4 ¶
func (acuo *AccessControlUpdateOne) SetV4(s string) *AccessControlUpdateOne
SetV4 sets the "v4" field.
func (*AccessControlUpdateOne) SetV5 ¶
func (acuo *AccessControlUpdateOne) SetV5(s string) *AccessControlUpdateOne
SetV5 sets the "v5" field.
func (*AccessControlUpdateOne) Where ¶
func (acuo *AccessControlUpdateOne) Where(ps ...predicate.AccessControl) *AccessControlUpdateOne
Where appends a list predicates to the AccessControlUpdate builder.
type AccessControls ¶
type AccessControls []*AccessControl
AccessControls is a parsable slice of AccessControl.
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Audit ¶
type Audit struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt"` // EntName holds the value of the "ent_name" field. EntName string `json:"ent_name,omitempty"` // EntID holds the value of the "ent_id" field. EntID int64 `json:"ent_id,omitempty"` // Operation holds the value of the "operation" field. Operation audit.Operation `json:"operation,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // IP holds the value of the "ip" field. IP string `json:"ip,omitempty"` // UserName holds the value of the "user_name" field. UserName string `json:"user_name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AuditQuery when eager-loading is set. Edges AuditEdges `json:"edges"` // contains filtered or unexported fields }
Audit is the model entity for the Audit schema.
func (*Audit) Unwrap ¶
Unwrap unwraps the Audit 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 (*Audit) Update ¶
func (a *Audit) Update() *AuditUpdateOne
Update returns a builder for updating this Audit. Note that you need to call Audit.Unwrap() before calling this method if this Audit was returned from a transaction, and the transaction was committed or rolled back.
type AuditClient ¶
type AuditClient struct {
// contains filtered or unexported fields
}
AuditClient is a client for the Audit schema.
func NewAuditClient ¶
func NewAuditClient(c config) *AuditClient
NewAuditClient returns a client for the Audit from the given config.
func (*AuditClient) Create ¶
func (c *AuditClient) Create() *AuditCreate
Create returns a builder for creating a Audit entity.
func (*AuditClient) CreateBulk ¶
func (c *AuditClient) CreateBulk(builders ...*AuditCreate) *AuditCreateBulk
CreateBulk returns a builder for creating a bulk of Audit entities.
func (*AuditClient) Delete ¶
func (c *AuditClient) Delete() *AuditDelete
Delete returns a delete builder for Audit.
func (*AuditClient) DeleteOne ¶
func (c *AuditClient) DeleteOne(a *Audit) *AuditDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AuditClient) DeleteOneID ¶
func (c *AuditClient) DeleteOneID(id int64) *AuditDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AuditClient) GetX ¶
func (c *AuditClient) GetX(ctx context.Context, id int64) *Audit
GetX is like Get, but panics if an error occurs.
func (*AuditClient) Intercept ¶
func (c *AuditClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `audit.Intercept(f(g(h())))`.
func (*AuditClient) Interceptors ¶
func (c *AuditClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AuditClient) MapCreateBulk ¶
func (c *AuditClient) MapCreateBulk(slice any, setFunc func(*AuditCreate, int)) *AuditCreateBulk
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 (*AuditClient) Query ¶
func (c *AuditClient) Query() *AuditQuery
Query returns a query builder for Audit.
func (*AuditClient) QueryUser ¶
func (c *AuditClient) QueryUser(a *Audit) *UserQuery
QueryUser queries the user edge of a Audit.
func (*AuditClient) Update ¶
func (c *AuditClient) Update() *AuditUpdate
Update returns an update builder for Audit.
func (*AuditClient) UpdateOne ¶
func (c *AuditClient) UpdateOne(a *Audit) *AuditUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AuditClient) UpdateOneID ¶
func (c *AuditClient) UpdateOneID(id int64) *AuditUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AuditClient) Use ¶
func (c *AuditClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `audit.Hooks(f(g(h())))`.
type AuditCreate ¶
type AuditCreate struct {
// contains filtered or unexported fields
}
AuditCreate is the builder for creating a Audit entity.
func (*AuditCreate) Exec ¶
func (ac *AuditCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AuditCreate) ExecX ¶
func (ac *AuditCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuditCreate) Mutation ¶
func (ac *AuditCreate) Mutation() *AuditMutation
Mutation returns the AuditMutation object of the builder.
func (*AuditCreate) Save ¶
func (ac *AuditCreate) Save(ctx context.Context) (*Audit, error)
Save creates the Audit in the database.
func (*AuditCreate) SaveX ¶
func (ac *AuditCreate) SaveX(ctx context.Context) *Audit
SaveX calls Save and panics if Save returns an error.
func (*AuditCreate) SetCreatedAt ¶
func (ac *AuditCreate) SetCreatedAt(t time.Time) *AuditCreate
SetCreatedAt sets the "created_at" field.
func (*AuditCreate) SetDescription ¶
func (ac *AuditCreate) SetDescription(s string) *AuditCreate
SetDescription sets the "description" field.
func (*AuditCreate) SetEntID ¶
func (ac *AuditCreate) SetEntID(i int64) *AuditCreate
SetEntID sets the "ent_id" field.
func (*AuditCreate) SetEntName ¶
func (ac *AuditCreate) SetEntName(s string) *AuditCreate
SetEntName sets the "ent_name" field.
func (*AuditCreate) SetID ¶
func (ac *AuditCreate) SetID(i int64) *AuditCreate
SetID sets the "id" field.
func (*AuditCreate) SetIP ¶
func (ac *AuditCreate) SetIP(s string) *AuditCreate
SetIP sets the "ip" field.
func (*AuditCreate) SetNillableCreatedAt ¶
func (ac *AuditCreate) SetNillableCreatedAt(t *time.Time) *AuditCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AuditCreate) SetNillableIP ¶
func (ac *AuditCreate) SetNillableIP(s *string) *AuditCreate
SetNillableIP sets the "ip" field if the given value is not nil.
func (*AuditCreate) SetNillableUserID ¶
func (ac *AuditCreate) SetNillableUserID(id *int64) *AuditCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AuditCreate) SetNillableUserName ¶
func (ac *AuditCreate) SetNillableUserName(s *string) *AuditCreate
SetNillableUserName sets the "user_name" field if the given value is not nil.
func (*AuditCreate) SetOperation ¶
func (ac *AuditCreate) SetOperation(a audit.Operation) *AuditCreate
SetOperation sets the "operation" field.
func (*AuditCreate) SetUser ¶
func (ac *AuditCreate) SetUser(u *User) *AuditCreate
SetUser sets the "user" edge to the User entity.
func (*AuditCreate) SetUserID ¶
func (ac *AuditCreate) SetUserID(id int64) *AuditCreate
SetUserID sets the "user" edge to the User entity by ID.
func (*AuditCreate) SetUserName ¶
func (ac *AuditCreate) SetUserName(s string) *AuditCreate
SetUserName sets the "user_name" field.
type AuditCreateBulk ¶
type AuditCreateBulk struct {
// contains filtered or unexported fields
}
AuditCreateBulk is the builder for creating many Audit entities in bulk.
func (*AuditCreateBulk) Exec ¶
func (acb *AuditCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AuditCreateBulk) ExecX ¶
func (acb *AuditCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type AuditDelete ¶
type AuditDelete struct {
// contains filtered or unexported fields
}
AuditDelete is the builder for deleting a Audit entity.
func (*AuditDelete) Exec ¶
func (ad *AuditDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AuditDelete) ExecX ¶
func (ad *AuditDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AuditDelete) Where ¶
func (ad *AuditDelete) Where(ps ...predicate.Audit) *AuditDelete
Where appends a list predicates to the AuditDelete builder.
type AuditDeleteOne ¶
type AuditDeleteOne struct {
// contains filtered or unexported fields
}
AuditDeleteOne is the builder for deleting a single Audit entity.
func (*AuditDeleteOne) Exec ¶
func (ado *AuditDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AuditDeleteOne) ExecX ¶
func (ado *AuditDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuditDeleteOne) Where ¶
func (ado *AuditDeleteOne) Where(ps ...predicate.Audit) *AuditDeleteOne
Where appends a list predicates to the AuditDelete builder.
type AuditEdges ¶
type AuditEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
AuditEdges holds the relations/edges for other nodes in the graph.
func (AuditEdges) UserOrErr ¶
func (e AuditEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type AuditGroupBy ¶
type AuditGroupBy struct {
// contains filtered or unexported fields
}
AuditGroupBy is the group-by builder for Audit entities.
func (*AuditGroupBy) Aggregate ¶
func (agb *AuditGroupBy) Aggregate(fns ...AggregateFunc) *AuditGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AuditGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AuditGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AuditGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AuditGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AuditGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AuditGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AuditGroupBy) Scan ¶
func (agb *AuditGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AuditGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AuditMutation ¶
type AuditMutation struct {
// contains filtered or unexported fields
}
AuditMutation represents an operation that mutates the Audit nodes in the graph.
func (*AuditMutation) AddEntID ¶
func (m *AuditMutation) AddEntID(i int64)
AddEntID adds i to the "ent_id" field.
func (*AuditMutation) AddField ¶
func (m *AuditMutation) AddField(name string, value ent.Value) error
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 (*AuditMutation) AddedEdges ¶
func (m *AuditMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AuditMutation) AddedEntID ¶
func (m *AuditMutation) AddedEntID() (r int64, exists bool)
AddedEntID returns the value that was added to the "ent_id" field in this mutation.
func (*AuditMutation) AddedField ¶
func (m *AuditMutation) AddedField(name string) (ent.Value, bool)
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 (*AuditMutation) AddedFields ¶
func (m *AuditMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AuditMutation) AddedIDs ¶
func (m *AuditMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AuditMutation) ClearEdge ¶
func (m *AuditMutation) ClearEdge(name string) error
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 (*AuditMutation) ClearField ¶
func (m *AuditMutation) ClearField(name string) error
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 (*AuditMutation) ClearIP ¶
func (m *AuditMutation) ClearIP()
ClearIP clears the value of the "ip" field.
func (*AuditMutation) ClearUser ¶
func (m *AuditMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*AuditMutation) ClearUserName ¶
func (m *AuditMutation) ClearUserName()
ClearUserName clears the value of the "user_name" field.
func (*AuditMutation) ClearedEdges ¶
func (m *AuditMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AuditMutation) ClearedFields ¶
func (m *AuditMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AuditMutation) Client ¶
func (m AuditMutation) Client() *Client
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 (*AuditMutation) CreatedAt ¶
func (m *AuditMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AuditMutation) Description ¶
func (m *AuditMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*AuditMutation) EdgeCleared ¶
func (m *AuditMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AuditMutation) EntID ¶
func (m *AuditMutation) EntID() (r int64, exists bool)
EntID returns the value of the "ent_id" field in the mutation.
func (*AuditMutation) EntName ¶
func (m *AuditMutation) EntName() (r string, exists bool)
EntName returns the value of the "ent_name" field in the mutation.
func (*AuditMutation) Field ¶
func (m *AuditMutation) Field(name string) (ent.Value, bool)
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 (*AuditMutation) FieldCleared ¶
func (m *AuditMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AuditMutation) Fields ¶
func (m *AuditMutation) Fields() []string
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 (*AuditMutation) ID ¶
func (m *AuditMutation) ID() (id int64, exists bool)
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 (*AuditMutation) IDs ¶
func (m *AuditMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*AuditMutation) IP ¶
func (m *AuditMutation) IP() (r string, exists bool)
IP returns the value of the "ip" field in the mutation.
func (*AuditMutation) IPCleared ¶
func (m *AuditMutation) IPCleared() bool
IPCleared returns if the "ip" field was cleared in this mutation.
func (*AuditMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Audit entity. If the Audit 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 (*AuditMutation) OldDescription ¶
func (m *AuditMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Audit entity. If the Audit 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 (*AuditMutation) OldEntID ¶
func (m *AuditMutation) OldEntID(ctx context.Context) (v int64, err error)
OldEntID returns the old "ent_id" field's value of the Audit entity. If the Audit 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 (*AuditMutation) OldEntName ¶
func (m *AuditMutation) OldEntName(ctx context.Context) (v string, err error)
OldEntName returns the old "ent_name" field's value of the Audit entity. If the Audit 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 (*AuditMutation) OldField ¶
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 (*AuditMutation) OldIP ¶
func (m *AuditMutation) OldIP(ctx context.Context) (v string, err error)
OldIP returns the old "ip" field's value of the Audit entity. If the Audit 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 (*AuditMutation) OldOperation ¶
OldOperation returns the old "operation" field's value of the Audit entity. If the Audit 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 (*AuditMutation) OldUserName ¶
func (m *AuditMutation) OldUserName(ctx context.Context) (v string, err error)
OldUserName returns the old "user_name" field's value of the Audit entity. If the Audit 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 (*AuditMutation) Operation ¶
func (m *AuditMutation) Operation() (r audit.Operation, exists bool)
Operation returns the value of the "operation" field in the mutation.
func (*AuditMutation) RemovedEdges ¶
func (m *AuditMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AuditMutation) RemovedIDs ¶
func (m *AuditMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*AuditMutation) ResetCreatedAt ¶
func (m *AuditMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AuditMutation) ResetDescription ¶
func (m *AuditMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*AuditMutation) ResetEdge ¶
func (m *AuditMutation) ResetEdge(name string) error
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 (*AuditMutation) ResetEntID ¶
func (m *AuditMutation) ResetEntID()
ResetEntID resets all changes to the "ent_id" field.
func (*AuditMutation) ResetEntName ¶
func (m *AuditMutation) ResetEntName()
ResetEntName resets all changes to the "ent_name" field.
func (*AuditMutation) ResetField ¶
func (m *AuditMutation) ResetField(name string) error
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 (*AuditMutation) ResetIP ¶
func (m *AuditMutation) ResetIP()
ResetIP resets all changes to the "ip" field.
func (*AuditMutation) ResetOperation ¶
func (m *AuditMutation) ResetOperation()
ResetOperation resets all changes to the "operation" field.
func (*AuditMutation) ResetUser ¶
func (m *AuditMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*AuditMutation) ResetUserName ¶
func (m *AuditMutation) ResetUserName()
ResetUserName resets all changes to the "user_name" field.
func (*AuditMutation) SetCreatedAt ¶
func (m *AuditMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AuditMutation) SetDescription ¶
func (m *AuditMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*AuditMutation) SetEntID ¶
func (m *AuditMutation) SetEntID(i int64)
SetEntID sets the "ent_id" field.
func (*AuditMutation) SetEntName ¶
func (m *AuditMutation) SetEntName(s string)
SetEntName sets the "ent_name" field.
func (*AuditMutation) SetField ¶
func (m *AuditMutation) SetField(name string, value ent.Value) error
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 (*AuditMutation) SetID ¶
func (m *AuditMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Audit entities.
func (*AuditMutation) SetOp ¶
func (m *AuditMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AuditMutation) SetOperation ¶
func (m *AuditMutation) SetOperation(a audit.Operation)
SetOperation sets the "operation" field.
func (*AuditMutation) SetUserID ¶
func (m *AuditMutation) SetUserID(id int64)
SetUserID sets the "user" edge to the User entity by id.
func (*AuditMutation) SetUserName ¶
func (m *AuditMutation) SetUserName(s string)
SetUserName sets the "user_name" field.
func (AuditMutation) Tx ¶
func (m AuditMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AuditMutation) Type ¶
func (m *AuditMutation) Type() string
Type returns the node type of this mutation (Audit).
func (*AuditMutation) UserCleared ¶
func (m *AuditMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*AuditMutation) UserID ¶
func (m *AuditMutation) UserID() (id int64, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*AuditMutation) UserIDs ¶
func (m *AuditMutation) UserIDs() (ids []int64)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*AuditMutation) UserName ¶
func (m *AuditMutation) UserName() (r string, exists bool)
UserName returns the value of the "user_name" field in the mutation.
func (*AuditMutation) UserNameCleared ¶
func (m *AuditMutation) UserNameCleared() bool
UserNameCleared returns if the "user_name" field was cleared in this mutation.
func (*AuditMutation) Where ¶
func (m *AuditMutation) Where(ps ...predicate.Audit)
Where appends a list predicates to the AuditMutation builder.
func (*AuditMutation) WhereP ¶
func (m *AuditMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AuditMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type AuditQuery ¶
type AuditQuery struct {
// contains filtered or unexported fields
}
AuditQuery is the builder for querying Audit entities.
func (*AuditQuery) Aggregate ¶
func (aq *AuditQuery) Aggregate(fns ...AggregateFunc) *AuditSelect
Aggregate returns a AuditSelect configured with the given aggregations.
func (*AuditQuery) All ¶
func (aq *AuditQuery) All(ctx context.Context) ([]*Audit, error)
All executes the query and returns a list of Audits.
func (*AuditQuery) AllX ¶
func (aq *AuditQuery) AllX(ctx context.Context) []*Audit
AllX is like All, but panics if an error occurs.
func (*AuditQuery) Clone ¶
func (aq *AuditQuery) Clone() *AuditQuery
Clone returns a duplicate of the AuditQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AuditQuery) Count ¶
func (aq *AuditQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AuditQuery) CountX ¶
func (aq *AuditQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AuditQuery) Exist ¶
func (aq *AuditQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AuditQuery) ExistX ¶
func (aq *AuditQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AuditQuery) First ¶
func (aq *AuditQuery) First(ctx context.Context) (*Audit, error)
First returns the first Audit entity from the query. Returns a *NotFoundError when no Audit was found.
func (*AuditQuery) FirstID ¶
func (aq *AuditQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first Audit ID from the query. Returns a *NotFoundError when no Audit ID was found.
func (*AuditQuery) FirstIDX ¶
func (aq *AuditQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*AuditQuery) FirstX ¶
func (aq *AuditQuery) FirstX(ctx context.Context) *Audit
FirstX is like First, but panics if an error occurs.
func (*AuditQuery) GroupBy ¶
func (aq *AuditQuery) GroupBy(field string, fields ...string) *AuditGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` Count int `json:"count,omitempty"` } client.Audit.Query(). GroupBy(audit.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AuditQuery) IDs ¶
func (aq *AuditQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of Audit IDs.
func (*AuditQuery) IDsX ¶
func (aq *AuditQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*AuditQuery) Limit ¶
func (aq *AuditQuery) Limit(limit int) *AuditQuery
Limit the number of records to be returned by this query.
func (*AuditQuery) Offset ¶
func (aq *AuditQuery) Offset(offset int) *AuditQuery
Offset to start from.
func (*AuditQuery) Only ¶
func (aq *AuditQuery) Only(ctx context.Context) (*Audit, error)
Only returns a single Audit entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Audit entity is found. Returns a *NotFoundError when no Audit entities are found.
func (*AuditQuery) OnlyID ¶
func (aq *AuditQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only Audit ID in the query. Returns a *NotSingularError when more than one Audit ID is found. Returns a *NotFoundError when no entities are found.
func (*AuditQuery) OnlyIDX ¶
func (aq *AuditQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AuditQuery) OnlyX ¶
func (aq *AuditQuery) OnlyX(ctx context.Context) *Audit
OnlyX is like Only, but panics if an error occurs.
func (*AuditQuery) Order ¶
func (aq *AuditQuery) Order(o ...audit.OrderOption) *AuditQuery
Order specifies how the records should be ordered.
func (*AuditQuery) QueryUser ¶
func (aq *AuditQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*AuditQuery) Select ¶
func (aq *AuditQuery) Select(fields ...string) *AuditSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` } client.Audit.Query(). Select(audit.FieldCreatedAt). Scan(ctx, &v)
func (*AuditQuery) Unique ¶
func (aq *AuditQuery) Unique(unique bool) *AuditQuery
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 (*AuditQuery) Where ¶
func (aq *AuditQuery) Where(ps ...predicate.Audit) *AuditQuery
Where adds a new predicate for the AuditQuery builder.
func (*AuditQuery) WithUser ¶
func (aq *AuditQuery) WithUser(opts ...func(*UserQuery)) *AuditQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type AuditSelect ¶
type AuditSelect struct { *AuditQuery // contains filtered or unexported fields }
AuditSelect is the builder for selecting fields of Audit entities.
func (*AuditSelect) Aggregate ¶
func (as *AuditSelect) Aggregate(fns ...AggregateFunc) *AuditSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AuditSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AuditSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AuditSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AuditSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AuditSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AuditSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AuditSelect) Scan ¶
func (as *AuditSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AuditSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AuditUpdate ¶
type AuditUpdate struct {
// contains filtered or unexported fields
}
AuditUpdate is the builder for updating Audit entities.
func (*AuditUpdate) AddEntID ¶
func (au *AuditUpdate) AddEntID(i int64) *AuditUpdate
AddEntID adds i to the "ent_id" field.
func (*AuditUpdate) ClearIP ¶
func (au *AuditUpdate) ClearIP() *AuditUpdate
ClearIP clears the value of the "ip" field.
func (*AuditUpdate) ClearUser ¶
func (au *AuditUpdate) ClearUser() *AuditUpdate
ClearUser clears the "user" edge to the User entity.
func (*AuditUpdate) ClearUserName ¶
func (au *AuditUpdate) ClearUserName() *AuditUpdate
ClearUserName clears the value of the "user_name" field.
func (*AuditUpdate) Exec ¶
func (au *AuditUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AuditUpdate) ExecX ¶
func (au *AuditUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuditUpdate) Mutation ¶
func (au *AuditUpdate) Mutation() *AuditMutation
Mutation returns the AuditMutation object of the builder.
func (*AuditUpdate) Save ¶
func (au *AuditUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AuditUpdate) SaveX ¶
func (au *AuditUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AuditUpdate) SetDescription ¶
func (au *AuditUpdate) SetDescription(s string) *AuditUpdate
SetDescription sets the "description" field.
func (*AuditUpdate) SetEntID ¶
func (au *AuditUpdate) SetEntID(i int64) *AuditUpdate
SetEntID sets the "ent_id" field.
func (*AuditUpdate) SetEntName ¶
func (au *AuditUpdate) SetEntName(s string) *AuditUpdate
SetEntName sets the "ent_name" field.
func (*AuditUpdate) SetIP ¶
func (au *AuditUpdate) SetIP(s string) *AuditUpdate
SetIP sets the "ip" field.
func (*AuditUpdate) SetNillableDescription ¶
func (au *AuditUpdate) SetNillableDescription(s *string) *AuditUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*AuditUpdate) SetNillableEntID ¶
func (au *AuditUpdate) SetNillableEntID(i *int64) *AuditUpdate
SetNillableEntID sets the "ent_id" field if the given value is not nil.
func (*AuditUpdate) SetNillableEntName ¶
func (au *AuditUpdate) SetNillableEntName(s *string) *AuditUpdate
SetNillableEntName sets the "ent_name" field if the given value is not nil.
func (*AuditUpdate) SetNillableIP ¶
func (au *AuditUpdate) SetNillableIP(s *string) *AuditUpdate
SetNillableIP sets the "ip" field if the given value is not nil.
func (*AuditUpdate) SetNillableOperation ¶
func (au *AuditUpdate) SetNillableOperation(a *audit.Operation) *AuditUpdate
SetNillableOperation sets the "operation" field if the given value is not nil.
func (*AuditUpdate) SetNillableUserID ¶
func (au *AuditUpdate) SetNillableUserID(id *int64) *AuditUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AuditUpdate) SetNillableUserName ¶
func (au *AuditUpdate) SetNillableUserName(s *string) *AuditUpdate
SetNillableUserName sets the "user_name" field if the given value is not nil.
func (*AuditUpdate) SetOperation ¶
func (au *AuditUpdate) SetOperation(a audit.Operation) *AuditUpdate
SetOperation sets the "operation" field.
func (*AuditUpdate) SetUser ¶
func (au *AuditUpdate) SetUser(u *User) *AuditUpdate
SetUser sets the "user" edge to the User entity.
func (*AuditUpdate) SetUserID ¶
func (au *AuditUpdate) SetUserID(id int64) *AuditUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*AuditUpdate) SetUserName ¶
func (au *AuditUpdate) SetUserName(s string) *AuditUpdate
SetUserName sets the "user_name" field.
func (*AuditUpdate) Where ¶
func (au *AuditUpdate) Where(ps ...predicate.Audit) *AuditUpdate
Where appends a list predicates to the AuditUpdate builder.
type AuditUpdateOne ¶
type AuditUpdateOne struct {
// contains filtered or unexported fields
}
AuditUpdateOne is the builder for updating a single Audit entity.
func (*AuditUpdateOne) AddEntID ¶
func (auo *AuditUpdateOne) AddEntID(i int64) *AuditUpdateOne
AddEntID adds i to the "ent_id" field.
func (*AuditUpdateOne) ClearIP ¶
func (auo *AuditUpdateOne) ClearIP() *AuditUpdateOne
ClearIP clears the value of the "ip" field.
func (*AuditUpdateOne) ClearUser ¶
func (auo *AuditUpdateOne) ClearUser() *AuditUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*AuditUpdateOne) ClearUserName ¶
func (auo *AuditUpdateOne) ClearUserName() *AuditUpdateOne
ClearUserName clears the value of the "user_name" field.
func (*AuditUpdateOne) Exec ¶
func (auo *AuditUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AuditUpdateOne) ExecX ¶
func (auo *AuditUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AuditUpdateOne) Mutation ¶
func (auo *AuditUpdateOne) Mutation() *AuditMutation
Mutation returns the AuditMutation object of the builder.
func (*AuditUpdateOne) Save ¶
func (auo *AuditUpdateOne) Save(ctx context.Context) (*Audit, error)
Save executes the query and returns the updated Audit entity.
func (*AuditUpdateOne) SaveX ¶
func (auo *AuditUpdateOne) SaveX(ctx context.Context) *Audit
SaveX is like Save, but panics if an error occurs.
func (*AuditUpdateOne) Select ¶
func (auo *AuditUpdateOne) Select(field string, fields ...string) *AuditUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AuditUpdateOne) SetDescription ¶
func (auo *AuditUpdateOne) SetDescription(s string) *AuditUpdateOne
SetDescription sets the "description" field.
func (*AuditUpdateOne) SetEntID ¶
func (auo *AuditUpdateOne) SetEntID(i int64) *AuditUpdateOne
SetEntID sets the "ent_id" field.
func (*AuditUpdateOne) SetEntName ¶
func (auo *AuditUpdateOne) SetEntName(s string) *AuditUpdateOne
SetEntName sets the "ent_name" field.
func (*AuditUpdateOne) SetIP ¶
func (auo *AuditUpdateOne) SetIP(s string) *AuditUpdateOne
SetIP sets the "ip" field.
func (*AuditUpdateOne) SetNillableDescription ¶
func (auo *AuditUpdateOne) SetNillableDescription(s *string) *AuditUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*AuditUpdateOne) SetNillableEntID ¶
func (auo *AuditUpdateOne) SetNillableEntID(i *int64) *AuditUpdateOne
SetNillableEntID sets the "ent_id" field if the given value is not nil.
func (*AuditUpdateOne) SetNillableEntName ¶
func (auo *AuditUpdateOne) SetNillableEntName(s *string) *AuditUpdateOne
SetNillableEntName sets the "ent_name" field if the given value is not nil.
func (*AuditUpdateOne) SetNillableIP ¶
func (auo *AuditUpdateOne) SetNillableIP(s *string) *AuditUpdateOne
SetNillableIP sets the "ip" field if the given value is not nil.
func (*AuditUpdateOne) SetNillableOperation ¶
func (auo *AuditUpdateOne) SetNillableOperation(a *audit.Operation) *AuditUpdateOne
SetNillableOperation sets the "operation" field if the given value is not nil.
func (*AuditUpdateOne) SetNillableUserID ¶
func (auo *AuditUpdateOne) SetNillableUserID(id *int64) *AuditUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*AuditUpdateOne) SetNillableUserName ¶
func (auo *AuditUpdateOne) SetNillableUserName(s *string) *AuditUpdateOne
SetNillableUserName sets the "user_name" field if the given value is not nil.
func (*AuditUpdateOne) SetOperation ¶
func (auo *AuditUpdateOne) SetOperation(a audit.Operation) *AuditUpdateOne
SetOperation sets the "operation" field.
func (*AuditUpdateOne) SetUser ¶
func (auo *AuditUpdateOne) SetUser(u *User) *AuditUpdateOne
SetUser sets the "user" edge to the User entity.
func (*AuditUpdateOne) SetUserID ¶
func (auo *AuditUpdateOne) SetUserID(id int64) *AuditUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*AuditUpdateOne) SetUserName ¶
func (auo *AuditUpdateOne) SetUserName(s string) *AuditUpdateOne
SetUserName sets the "user_name" field.
func (*AuditUpdateOne) Where ¶
func (auo *AuditUpdateOne) Where(ps ...predicate.Audit) *AuditUpdateOne
Where appends a list predicates to the AuditUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // AccessControl is the client for interacting with the AccessControl builders. AccessControl *AccessControlClient // Audit is the client for interacting with the Audit builders. Audit *AuditClient // Role is the client for interacting with the Role builders. Role *RoleClient // Todo is the client for interacting with the Todo builders. Todo *TodoClient // User is the client for interacting with the User builders. User *UserClient // UserSession is the client for interacting with the UserSession builders. UserSession *UserSessionClient // VerifyToken is the client for interacting with the VerifyToken builders. VerifyToken *VerifyTokenClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). AccessControl. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type Role ¶
type Role struct { // ID of the ent. ID int64 `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // contains filtered or unexported fields }
Role is the model entity for the Role schema.
func (*Role) Unwrap ¶
Unwrap unwraps the Role 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 (*Role) Update ¶
func (r *Role) Update() *RoleUpdateOne
Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.
type RoleClient ¶
type RoleClient struct {
// contains filtered or unexported fields
}
RoleClient is a client for the Role schema.
func NewRoleClient ¶
func NewRoleClient(c config) *RoleClient
NewRoleClient returns a client for the Role from the given config.
func (*RoleClient) Create ¶
func (c *RoleClient) Create() *RoleCreate
Create returns a builder for creating a Role entity.
func (*RoleClient) CreateBulk ¶
func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk
CreateBulk returns a builder for creating a bulk of Role entities.
func (*RoleClient) Delete ¶
func (c *RoleClient) Delete() *RoleDelete
Delete returns a delete builder for Role.
func (*RoleClient) DeleteOne ¶
func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RoleClient) DeleteOneID ¶
func (c *RoleClient) DeleteOneID(id int64) *RoleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RoleClient) GetX ¶
func (c *RoleClient) GetX(ctx context.Context, id int64) *Role
GetX is like Get, but panics if an error occurs.
func (*RoleClient) Intercept ¶
func (c *RoleClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`.
func (*RoleClient) Interceptors ¶
func (c *RoleClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RoleClient) MapCreateBulk ¶
func (c *RoleClient) MapCreateBulk(slice any, setFunc func(*RoleCreate, int)) *RoleCreateBulk
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 (*RoleClient) Query ¶
func (c *RoleClient) Query() *RoleQuery
Query returns a query builder for Role.
func (*RoleClient) Update ¶
func (c *RoleClient) Update() *RoleUpdate
Update returns an update builder for Role.
func (*RoleClient) UpdateOne ¶
func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RoleClient) UpdateOneID ¶
func (c *RoleClient) UpdateOneID(id int64) *RoleUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RoleClient) Use ¶
func (c *RoleClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`.
type RoleCreate ¶
type RoleCreate struct {
// contains filtered or unexported fields
}
RoleCreate is the builder for creating a Role entity.
func (*RoleCreate) Exec ¶
func (rc *RoleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreate) ExecX ¶
func (rc *RoleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleCreate) Mutation ¶
func (rc *RoleCreate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleCreate) Save ¶
func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
Save creates the Role in the database.
func (*RoleCreate) SaveX ¶
func (rc *RoleCreate) SaveX(ctx context.Context) *Role
SaveX calls Save and panics if Save returns an error.
func (*RoleCreate) SetID ¶
func (rc *RoleCreate) SetID(i int64) *RoleCreate
SetID sets the "id" field.
func (*RoleCreate) SetName ¶
func (rc *RoleCreate) SetName(s string) *RoleCreate
SetName sets the "name" field.
type RoleCreateBulk ¶
type RoleCreateBulk struct {
// contains filtered or unexported fields
}
RoleCreateBulk is the builder for creating many Role entities in bulk.
func (*RoleCreateBulk) Exec ¶
func (rcb *RoleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreateBulk) ExecX ¶
func (rcb *RoleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RoleDelete ¶
type RoleDelete struct {
// contains filtered or unexported fields
}
RoleDelete is the builder for deleting a Role entity.
func (*RoleDelete) Exec ¶
func (rd *RoleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RoleDelete) ExecX ¶
func (rd *RoleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RoleDelete) Where ¶
func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete
Where appends a list predicates to the RoleDelete builder.
type RoleDeleteOne ¶
type RoleDeleteOne struct {
// contains filtered or unexported fields
}
RoleDeleteOne is the builder for deleting a single Role entity.
func (*RoleDeleteOne) Exec ¶
func (rdo *RoleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RoleDeleteOne) ExecX ¶
func (rdo *RoleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleDeleteOne) Where ¶
func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne
Where appends a list predicates to the RoleDelete builder.
type RoleGroupBy ¶
type RoleGroupBy struct {
// contains filtered or unexported fields
}
RoleGroupBy is the group-by builder for Role entities.
func (*RoleGroupBy) Aggregate ¶
func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RoleGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleGroupBy) Scan ¶
func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RoleGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RoleMutation ¶
type RoleMutation struct {
// contains filtered or unexported fields
}
RoleMutation represents an operation that mutates the Role nodes in the graph.
func (*RoleMutation) AddField ¶
func (m *RoleMutation) AddField(name string, value ent.Value) error
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 (*RoleMutation) AddedEdges ¶
func (m *RoleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RoleMutation) AddedField ¶
func (m *RoleMutation) AddedField(name string) (ent.Value, bool)
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 (*RoleMutation) AddedFields ¶
func (m *RoleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RoleMutation) AddedIDs ¶
func (m *RoleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RoleMutation) ClearEdge ¶
func (m *RoleMutation) ClearEdge(name string) error
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 (*RoleMutation) ClearField ¶
func (m *RoleMutation) ClearField(name string) error
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 (*RoleMutation) ClearedEdges ¶
func (m *RoleMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RoleMutation) ClearedFields ¶
func (m *RoleMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RoleMutation) Client ¶
func (m RoleMutation) Client() *Client
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 (*RoleMutation) EdgeCleared ¶
func (m *RoleMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RoleMutation) Field ¶
func (m *RoleMutation) Field(name string) (ent.Value, bool)
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 (*RoleMutation) FieldCleared ¶
func (m *RoleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RoleMutation) Fields ¶
func (m *RoleMutation) Fields() []string
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 (*RoleMutation) ID ¶
func (m *RoleMutation) ID() (id int64, exists bool)
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 (*RoleMutation) IDs ¶
func (m *RoleMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*RoleMutation) Name ¶
func (m *RoleMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RoleMutation) OldField ¶
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 (*RoleMutation) OldName ¶
func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Role entity. If the Role 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 (*RoleMutation) RemovedEdges ¶
func (m *RoleMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RoleMutation) RemovedIDs ¶
func (m *RoleMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*RoleMutation) ResetEdge ¶
func (m *RoleMutation) ResetEdge(name string) error
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 (*RoleMutation) ResetField ¶
func (m *RoleMutation) ResetField(name string) error
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 (*RoleMutation) ResetName ¶
func (m *RoleMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RoleMutation) SetField ¶
func (m *RoleMutation) SetField(name string, value ent.Value) error
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 (*RoleMutation) SetID ¶
func (m *RoleMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Role entities.
func (*RoleMutation) SetName ¶
func (m *RoleMutation) SetName(s string)
SetName sets the "name" field.
func (*RoleMutation) SetOp ¶
func (m *RoleMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (RoleMutation) Tx ¶
func (m RoleMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RoleMutation) Type ¶
func (m *RoleMutation) Type() string
Type returns the node type of this mutation (Role).
func (*RoleMutation) Where ¶
func (m *RoleMutation) Where(ps ...predicate.Role)
Where appends a list predicates to the RoleMutation builder.
func (*RoleMutation) WhereP ¶
func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RoleQuery ¶
type RoleQuery struct {
// contains filtered or unexported fields
}
RoleQuery is the builder for querying Role entities.
func (*RoleQuery) Aggregate ¶
func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect
Aggregate returns a RoleSelect configured with the given aggregations.
func (*RoleQuery) Clone ¶
Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RoleQuery) First ¶
First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.
func (*RoleQuery) FirstID ¶
FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.
func (*RoleQuery) GroupBy ¶
func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Role.Query(). GroupBy(role.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RoleQuery) Only ¶
Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.
func (*RoleQuery) OnlyID ¶
OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.
func (*RoleQuery) Order ¶
func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery
Order specifies how the records should be ordered.
func (*RoleQuery) Select ¶
func (rq *RoleQuery) Select(fields ...string) *RoleSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Role.Query(). Select(role.FieldName). Scan(ctx, &v)
type RoleSelect ¶
type RoleSelect struct { *RoleQuery // contains filtered or unexported fields }
RoleSelect is the builder for selecting fields of Role entities.
func (*RoleSelect) Aggregate ¶
func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RoleSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Scan ¶
func (rs *RoleSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RoleSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RoleUpdate ¶
type RoleUpdate struct {
// contains filtered or unexported fields
}
RoleUpdate is the builder for updating Role entities.
func (*RoleUpdate) Exec ¶
func (ru *RoleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleUpdate) ExecX ¶
func (ru *RoleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdate) Mutation ¶
func (ru *RoleUpdate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdate) Save ¶
func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RoleUpdate) SaveX ¶
func (ru *RoleUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RoleUpdate) SetName ¶
func (ru *RoleUpdate) SetName(s string) *RoleUpdate
SetName sets the "name" field.
func (*RoleUpdate) SetNillableName ¶
func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleUpdate) Where ¶
func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
Where appends a list predicates to the RoleUpdate builder.
type RoleUpdateOne ¶
type RoleUpdateOne struct {
// contains filtered or unexported fields
}
RoleUpdateOne is the builder for updating a single Role entity.
func (*RoleUpdateOne) Exec ¶
func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RoleUpdateOne) ExecX ¶
func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdateOne) Mutation ¶
func (ruo *RoleUpdateOne) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdateOne) Save ¶
func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)
Save executes the query and returns the updated Role entity.
func (*RoleUpdateOne) SaveX ¶
func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role
SaveX is like Save, but panics if an error occurs.
func (*RoleUpdateOne) Select ¶
func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RoleUpdateOne) SetName ¶
func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
SetName sets the "name" field.
func (*RoleUpdateOne) SetNillableName ¶
func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleUpdateOne) Where ¶
func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne
Where appends a list predicates to the RoleUpdate builder.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Todo ¶
type Todo struct { // ID of the ent. ID int `json:"id,omitempty"` // contains filtered or unexported fields }
Todo is the model entity for the Todo schema.
func (*Todo) Unwrap ¶
Unwrap unwraps the Todo 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 (*Todo) Update ¶
func (t *Todo) Update() *TodoUpdateOne
Update returns a builder for updating this Todo. Note that you need to call Todo.Unwrap() before calling this method if this Todo was returned from a transaction, and the transaction was committed or rolled back.
type TodoClient ¶
type TodoClient struct {
// contains filtered or unexported fields
}
TodoClient is a client for the Todo schema.
func NewTodoClient ¶
func NewTodoClient(c config) *TodoClient
NewTodoClient returns a client for the Todo from the given config.
func (*TodoClient) Create ¶
func (c *TodoClient) Create() *TodoCreate
Create returns a builder for creating a Todo entity.
func (*TodoClient) CreateBulk ¶
func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk
CreateBulk returns a builder for creating a bulk of Todo entities.
func (*TodoClient) Delete ¶
func (c *TodoClient) Delete() *TodoDelete
Delete returns a delete builder for Todo.
func (*TodoClient) DeleteOne ¶
func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TodoClient) DeleteOneID ¶
func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TodoClient) GetX ¶
func (c *TodoClient) GetX(ctx context.Context, id int) *Todo
GetX is like Get, but panics if an error occurs.
func (*TodoClient) Intercept ¶
func (c *TodoClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `todo.Intercept(f(g(h())))`.
func (*TodoClient) Interceptors ¶
func (c *TodoClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TodoClient) MapCreateBulk ¶
func (c *TodoClient) MapCreateBulk(slice any, setFunc func(*TodoCreate, int)) *TodoCreateBulk
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 (*TodoClient) Query ¶
func (c *TodoClient) Query() *TodoQuery
Query returns a query builder for Todo.
func (*TodoClient) Update ¶
func (c *TodoClient) Update() *TodoUpdate
Update returns an update builder for Todo.
func (*TodoClient) UpdateOne ¶
func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TodoClient) UpdateOneID ¶
func (c *TodoClient) UpdateOneID(id int) *TodoUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TodoClient) Use ¶
func (c *TodoClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `todo.Hooks(f(g(h())))`.
type TodoCreate ¶
type TodoCreate struct {
// contains filtered or unexported fields
}
TodoCreate is the builder for creating a Todo entity.
func (*TodoCreate) Exec ¶
func (tc *TodoCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TodoCreate) ExecX ¶
func (tc *TodoCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TodoCreate) Mutation ¶
func (tc *TodoCreate) Mutation() *TodoMutation
Mutation returns the TodoMutation object of the builder.
type TodoCreateBulk ¶
type TodoCreateBulk struct {
// contains filtered or unexported fields
}
TodoCreateBulk is the builder for creating many Todo entities in bulk.
func (*TodoCreateBulk) Exec ¶
func (tcb *TodoCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TodoCreateBulk) ExecX ¶
func (tcb *TodoCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TodoDelete ¶
type TodoDelete struct {
// contains filtered or unexported fields
}
TodoDelete is the builder for deleting a Todo entity.
func (*TodoDelete) Exec ¶
func (td *TodoDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TodoDelete) ExecX ¶
func (td *TodoDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TodoDelete) Where ¶
func (td *TodoDelete) Where(ps ...predicate.Todo) *TodoDelete
Where appends a list predicates to the TodoDelete builder.
type TodoDeleteOne ¶
type TodoDeleteOne struct {
// contains filtered or unexported fields
}
TodoDeleteOne is the builder for deleting a single Todo entity.
func (*TodoDeleteOne) Exec ¶
func (tdo *TodoDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TodoDeleteOne) ExecX ¶
func (tdo *TodoDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TodoDeleteOne) Where ¶
func (tdo *TodoDeleteOne) Where(ps ...predicate.Todo) *TodoDeleteOne
Where appends a list predicates to the TodoDelete builder.
type TodoGroupBy ¶
type TodoGroupBy struct {
// contains filtered or unexported fields
}
TodoGroupBy is the group-by builder for Todo entities.
func (*TodoGroupBy) Aggregate ¶
func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TodoGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Scan ¶
func (tgb *TodoGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TodoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TodoMutation ¶
type TodoMutation struct {
// contains filtered or unexported fields
}
TodoMutation represents an operation that mutates the Todo nodes in the graph.
func (*TodoMutation) AddField ¶
func (m *TodoMutation) AddField(name string, value ent.Value) error
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 (*TodoMutation) AddedEdges ¶
func (m *TodoMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TodoMutation) AddedField ¶
func (m *TodoMutation) AddedField(name string) (ent.Value, bool)
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 (*TodoMutation) AddedFields ¶
func (m *TodoMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TodoMutation) AddedIDs ¶
func (m *TodoMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TodoMutation) ClearEdge ¶
func (m *TodoMutation) ClearEdge(name string) error
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 (*TodoMutation) ClearField ¶
func (m *TodoMutation) ClearField(name string) error
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 (*TodoMutation) ClearedEdges ¶
func (m *TodoMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TodoMutation) ClearedFields ¶
func (m *TodoMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TodoMutation) Client ¶
func (m TodoMutation) Client() *Client
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 (*TodoMutation) EdgeCleared ¶
func (m *TodoMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TodoMutation) Field ¶
func (m *TodoMutation) Field(name string) (ent.Value, bool)
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 (*TodoMutation) FieldCleared ¶
func (m *TodoMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TodoMutation) Fields ¶
func (m *TodoMutation) Fields() []string
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 (*TodoMutation) ID ¶
func (m *TodoMutation) ID() (id int, exists bool)
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 (*TodoMutation) IDs ¶
func (m *TodoMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*TodoMutation) OldField ¶
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 (*TodoMutation) RemovedEdges ¶
func (m *TodoMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TodoMutation) RemovedIDs ¶
func (m *TodoMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*TodoMutation) ResetEdge ¶
func (m *TodoMutation) ResetEdge(name string) error
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 (*TodoMutation) ResetField ¶
func (m *TodoMutation) ResetField(name string) error
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 (*TodoMutation) SetField ¶
func (m *TodoMutation) SetField(name string, value ent.Value) error
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 (*TodoMutation) SetOp ¶
func (m *TodoMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (TodoMutation) Tx ¶
func (m TodoMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TodoMutation) Type ¶
func (m *TodoMutation) Type() string
Type returns the node type of this mutation (Todo).
func (*TodoMutation) Where ¶
func (m *TodoMutation) Where(ps ...predicate.Todo)
Where appends a list predicates to the TodoMutation builder.
func (*TodoMutation) WhereP ¶
func (m *TodoMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TodoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TodoQuery ¶
type TodoQuery struct {
// contains filtered or unexported fields
}
TodoQuery is the builder for querying Todo entities.
func (*TodoQuery) Aggregate ¶
func (tq *TodoQuery) Aggregate(fns ...AggregateFunc) *TodoSelect
Aggregate returns a TodoSelect configured with the given aggregations.
func (*TodoQuery) Clone ¶
Clone returns a duplicate of the TodoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TodoQuery) First ¶
First returns the first Todo entity from the query. Returns a *NotFoundError when no Todo was found.
func (*TodoQuery) FirstID ¶
FirstID returns the first Todo ID from the query. Returns a *NotFoundError when no Todo ID was found.
func (*TodoQuery) GroupBy ¶
func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
func (*TodoQuery) Only ¶
Only returns a single Todo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Todo entity is found. Returns a *NotFoundError when no Todo entities are found.
func (*TodoQuery) OnlyID ¶
OnlyID is like Only, but returns the only Todo ID in the query. Returns a *NotSingularError when more than one Todo ID is found. Returns a *NotFoundError when no entities are found.
func (*TodoQuery) Order ¶
func (tq *TodoQuery) Order(o ...todo.OrderOption) *TodoQuery
Order specifies how the records should be ordered.
func (*TodoQuery) Select ¶
func (tq *TodoQuery) Select(fields ...string) *TodoSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
type TodoSelect ¶
type TodoSelect struct { *TodoQuery // contains filtered or unexported fields }
TodoSelect is the builder for selecting fields of Todo entities.
func (*TodoSelect) Aggregate ¶
func (ts *TodoSelect) Aggregate(fns ...AggregateFunc) *TodoSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TodoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Scan ¶
func (ts *TodoSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TodoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TodoUpdate ¶
type TodoUpdate struct {
// contains filtered or unexported fields
}
TodoUpdate is the builder for updating Todo entities.
func (*TodoUpdate) Exec ¶
func (tu *TodoUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TodoUpdate) ExecX ¶
func (tu *TodoUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TodoUpdate) Mutation ¶
func (tu *TodoUpdate) Mutation() *TodoMutation
Mutation returns the TodoMutation object of the builder.
func (*TodoUpdate) Save ¶
func (tu *TodoUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TodoUpdate) SaveX ¶
func (tu *TodoUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TodoUpdate) Where ¶
func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate
Where appends a list predicates to the TodoUpdate builder.
type TodoUpdateOne ¶
type TodoUpdateOne struct {
// contains filtered or unexported fields
}
TodoUpdateOne is the builder for updating a single Todo entity.
func (*TodoUpdateOne) Exec ¶
func (tuo *TodoUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TodoUpdateOne) ExecX ¶
func (tuo *TodoUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TodoUpdateOne) Mutation ¶
func (tuo *TodoUpdateOne) Mutation() *TodoMutation
Mutation returns the TodoMutation object of the builder.
func (*TodoUpdateOne) Save ¶
func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error)
Save executes the query and returns the updated Todo entity.
func (*TodoUpdateOne) SaveX ¶
func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo
SaveX is like Save, but panics if an error occurs.
func (*TodoUpdateOne) Select ¶
func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TodoUpdateOne) Where ¶
func (tuo *TodoUpdateOne) Where(ps ...predicate.Todo) *TodoUpdateOne
Where appends a list predicates to the TodoUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // AccessControl is the client for interacting with the AccessControl builders. AccessControl *AccessControlClient // Audit is the client for interacting with the Audit builders. Audit *AuditClient // Role is the client for interacting with the Role builders. Role *RoleClient // Todo is the client for interacting with the Todo builders. Todo *TodoClient // User is the client for interacting with the User builders. User *UserClient // UserSession is the client for interacting with the UserSession builders. UserSession *UserSessionClient // VerifyToken is the client for interacting with the VerifyToken builders. VerifyToken *VerifyTokenClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updatedAt"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // EmailVerified holds the value of the "email_verified" field. EmailVerified bool `json:"email_verified,omitempty"` // Phone holds the value of the "phone" field. Phone string `json:"phone,omitempty"` // PhoneVerified holds the value of the "phone_verified" field. PhoneVerified bool `json:"phone_verified,omitempty"` // PwdSalt holds the value of the "pwd_salt" field. PwdSalt string `json:"pwd_salt,omitempty"` // PwdHash holds the value of the "pwd_hash" field. PwdHash string `json:"pwd_hash,omitempty"` // LoginFailedCount holds the value of the "login_failed_count" field. LoginFailedCount uint8 `json:"login_failed_count,omitempty"` // LoginAttemptOn holds the value of the "login_attempt_on" field. LoginAttemptOn *time.Time `json:"login_attempt_on,omitempty"` // LoginLockedUntil holds the value of the "login_locked_until" field. LoginLockedUntil *time.Time `json:"login_locked_until,omitempty"` // FirstName holds the value of the "first_name" field. FirstName string `json:"first_name,omitempty"` // MiddleName holds the value of the "middle_name" field. MiddleName *string `json:"middle_name,omitempty"` // LastName holds the value of the "last_name" field. LastName string `json:"last_name,omitempty"` // Status holds the value of the "status" field. Status user.Status `json:"status,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QueryAuditLogs ¶
func (u *User) QueryAuditLogs() *AuditQuery
QueryAuditLogs queries the "audit_logs" edge of the User entity.
func (*User) QuerySessions ¶
func (u *User) QuerySessions() *UserSessionQuery
QuerySessions queries the "sessions" edge of the User entity.
func (*User) QueryVerifyTokens ¶
func (u *User) QueryVerifyTokens() *VerifyTokenQuery
QueryVerifyTokens queries the "verify_tokens" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User 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 (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int64) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int64) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
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 (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryAuditLogs ¶
func (c *UserClient) QueryAuditLogs(u *User) *AuditQuery
QueryAuditLogs queries the audit_logs edge of a User.
func (*UserClient) QuerySessions ¶
func (c *UserClient) QuerySessions(u *User) *UserSessionQuery
QuerySessions queries the sessions edge of a User.
func (*UserClient) QueryVerifyTokens ¶
func (c *UserClient) QueryVerifyTokens(u *User) *VerifyTokenQuery
QueryVerifyTokens queries the verify_tokens edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int64) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddAuditLogIDs ¶
func (uc *UserCreate) AddAuditLogIDs(ids ...int64) *UserCreate
AddAuditLogIDs adds the "audit_logs" edge to the Audit entity by IDs.
func (*UserCreate) AddAuditLogs ¶
func (uc *UserCreate) AddAuditLogs(a ...*Audit) *UserCreate
AddAuditLogs adds the "audit_logs" edges to the Audit entity.
func (*UserCreate) AddSessionIDs ¶
func (uc *UserCreate) AddSessionIDs(ids ...int64) *UserCreate
AddSessionIDs adds the "sessions" edge to the UserSession entity by IDs.
func (*UserCreate) AddSessions ¶
func (uc *UserCreate) AddSessions(u ...*UserSession) *UserCreate
AddSessions adds the "sessions" edges to the UserSession entity.
func (*UserCreate) AddVerifyTokenIDs ¶
func (uc *UserCreate) AddVerifyTokenIDs(ids ...int64) *UserCreate
AddVerifyTokenIDs adds the "verify_tokens" edge to the VerifyToken entity by IDs.
func (*UserCreate) AddVerifyTokens ¶
func (uc *UserCreate) AddVerifyTokens(v ...*VerifyToken) *UserCreate
AddVerifyTokens adds the "verify_tokens" edges to the VerifyToken entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetEmailVerified ¶
func (uc *UserCreate) SetEmailVerified(b bool) *UserCreate
SetEmailVerified sets the "email_verified" field.
func (*UserCreate) SetFirstName ¶
func (uc *UserCreate) SetFirstName(s string) *UserCreate
SetFirstName sets the "first_name" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(i int64) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetLastName ¶
func (uc *UserCreate) SetLastName(s string) *UserCreate
SetLastName sets the "last_name" field.
func (*UserCreate) SetLoginAttemptOn ¶
func (uc *UserCreate) SetLoginAttemptOn(t time.Time) *UserCreate
SetLoginAttemptOn sets the "login_attempt_on" field.
func (*UserCreate) SetLoginFailedCount ¶
func (uc *UserCreate) SetLoginFailedCount(u uint8) *UserCreate
SetLoginFailedCount sets the "login_failed_count" field.
func (*UserCreate) SetLoginLockedUntil ¶
func (uc *UserCreate) SetLoginLockedUntil(t time.Time) *UserCreate
SetLoginLockedUntil sets the "login_locked_until" field.
func (*UserCreate) SetMiddleName ¶
func (uc *UserCreate) SetMiddleName(s string) *UserCreate
SetMiddleName sets the "middle_name" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableEmailVerified ¶
func (uc *UserCreate) SetNillableEmailVerified(b *bool) *UserCreate
SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (*UserCreate) SetNillableLoginAttemptOn ¶
func (uc *UserCreate) SetNillableLoginAttemptOn(t *time.Time) *UserCreate
SetNillableLoginAttemptOn sets the "login_attempt_on" field if the given value is not nil.
func (*UserCreate) SetNillableLoginFailedCount ¶
func (uc *UserCreate) SetNillableLoginFailedCount(u *uint8) *UserCreate
SetNillableLoginFailedCount sets the "login_failed_count" field if the given value is not nil.
func (*UserCreate) SetNillableLoginLockedUntil ¶
func (uc *UserCreate) SetNillableLoginLockedUntil(t *time.Time) *UserCreate
SetNillableLoginLockedUntil sets the "login_locked_until" field if the given value is not nil.
func (*UserCreate) SetNillablePhone ¶
func (uc *UserCreate) SetNillablePhone(s *string) *UserCreate
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*UserCreate) SetNillablePhoneVerified ¶
func (uc *UserCreate) SetNillablePhoneVerified(b *bool) *UserCreate
SetNillablePhoneVerified sets the "phone_verified" field if the given value is not nil.
func (*UserCreate) SetNillableStatus ¶
func (uc *UserCreate) SetNillableStatus(u *user.Status) *UserCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetPhone ¶
func (uc *UserCreate) SetPhone(s string) *UserCreate
SetPhone sets the "phone" field.
func (*UserCreate) SetPhoneVerified ¶
func (uc *UserCreate) SetPhoneVerified(b bool) *UserCreate
SetPhoneVerified sets the "phone_verified" field.
func (*UserCreate) SetPwdHash ¶
func (uc *UserCreate) SetPwdHash(s string) *UserCreate
SetPwdHash sets the "pwd_hash" field.
func (*UserCreate) SetPwdSalt ¶
func (uc *UserCreate) SetPwdSalt(s string) *UserCreate
SetPwdSalt sets the "pwd_salt" field.
func (*UserCreate) SetStatus ¶
func (uc *UserCreate) SetStatus(u user.Status) *UserCreate
SetStatus sets the "status" field.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct { // Sessions holds the value of the sessions edge. Sessions []*UserSession `json:"sessions,omitempty"` // AuditLogs holds the value of the audit_logs edge. AuditLogs []*Audit `json:"audit_logs,omitempty"` // VerifyTokens holds the value of the verify_tokens edge. VerifyTokens []*VerifyToken `json:"verify_tokens,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) AuditLogsOrErr ¶
AuditLogsOrErr returns the AuditLogs value or an error if the edge was not loaded in eager-loading.
func (UserEdges) SessionsOrErr ¶
func (e UserEdges) SessionsOrErr() ([]*UserSession, error)
SessionsOrErr returns the Sessions value or an error if the edge was not loaded in eager-loading.
func (UserEdges) VerifyTokensOrErr ¶
func (e UserEdges) VerifyTokensOrErr() ([]*VerifyToken, error)
VerifyTokensOrErr returns the VerifyTokens value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddAuditLogIDs ¶
func (m *UserMutation) AddAuditLogIDs(ids ...int64)
AddAuditLogIDs adds the "audit_logs" edge to the Audit entity by ids.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
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 (*UserMutation) AddLoginFailedCount ¶
func (m *UserMutation) AddLoginFailedCount(u int8)
AddLoginFailedCount adds u to the "login_failed_count" field.
func (*UserMutation) AddSessionIDs ¶
func (m *UserMutation) AddSessionIDs(ids ...int64)
AddSessionIDs adds the "sessions" edge to the UserSession entity by ids.
func (*UserMutation) AddVerifyTokenIDs ¶
func (m *UserMutation) AddVerifyTokenIDs(ids ...int64)
AddVerifyTokenIDs adds the "verify_tokens" edge to the VerifyToken entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
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 (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) AddedLoginFailedCount ¶
func (m *UserMutation) AddedLoginFailedCount() (r int8, exists bool)
AddedLoginFailedCount returns the value that was added to the "login_failed_count" field in this mutation.
func (*UserMutation) AuditLogsCleared ¶
func (m *UserMutation) AuditLogsCleared() bool
AuditLogsCleared reports if the "audit_logs" edge to the Audit entity was cleared.
func (*UserMutation) AuditLogsIDs ¶
func (m *UserMutation) AuditLogsIDs() (ids []int64)
AuditLogsIDs returns the "audit_logs" edge IDs in the mutation.
func (*UserMutation) ClearAuditLogs ¶
func (m *UserMutation) ClearAuditLogs()
ClearAuditLogs clears the "audit_logs" edge to the Audit entity.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
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 (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
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 (*UserMutation) ClearLoginAttemptOn ¶
func (m *UserMutation) ClearLoginAttemptOn()
ClearLoginAttemptOn clears the value of the "login_attempt_on" field.
func (*UserMutation) ClearLoginFailedCount ¶
func (m *UserMutation) ClearLoginFailedCount()
ClearLoginFailedCount clears the value of the "login_failed_count" field.
func (*UserMutation) ClearLoginLockedUntil ¶
func (m *UserMutation) ClearLoginLockedUntil()
ClearLoginLockedUntil clears the value of the "login_locked_until" field.
func (*UserMutation) ClearPhone ¶
func (m *UserMutation) ClearPhone()
ClearPhone clears the value of the "phone" field.
func (*UserMutation) ClearSessions ¶
func (m *UserMutation) ClearSessions()
ClearSessions clears the "sessions" edge to the UserSession entity.
func (*UserMutation) ClearVerifyTokens ¶
func (m *UserMutation) ClearVerifyTokens()
ClearVerifyTokens clears the "verify_tokens" edge to the VerifyToken entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
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 (*UserMutation) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) EmailVerified ¶
func (m *UserMutation) EmailVerified() (r bool, exists bool)
EmailVerified returns the value of the "email_verified" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
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 (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
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 (*UserMutation) FirstName ¶
func (m *UserMutation) FirstName() (r string, exists bool)
FirstName returns the value of the "first_name" field in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int64, exists bool)
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 (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*UserMutation) LastName ¶
func (m *UserMutation) LastName() (r string, exists bool)
LastName returns the value of the "last_name" field in the mutation.
func (*UserMutation) LoginAttemptOn ¶
func (m *UserMutation) LoginAttemptOn() (r time.Time, exists bool)
LoginAttemptOn returns the value of the "login_attempt_on" field in the mutation.
func (*UserMutation) LoginAttemptOnCleared ¶
func (m *UserMutation) LoginAttemptOnCleared() bool
LoginAttemptOnCleared returns if the "login_attempt_on" field was cleared in this mutation.
func (*UserMutation) LoginFailedCount ¶
func (m *UserMutation) LoginFailedCount() (r uint8, exists bool)
LoginFailedCount returns the value of the "login_failed_count" field in the mutation.
func (*UserMutation) LoginFailedCountCleared ¶
func (m *UserMutation) LoginFailedCountCleared() bool
LoginFailedCountCleared returns if the "login_failed_count" field was cleared in this mutation.
func (*UserMutation) LoginLockedUntil ¶
func (m *UserMutation) LoginLockedUntil() (r time.Time, exists bool)
LoginLockedUntil returns the value of the "login_locked_until" field in the mutation.
func (*UserMutation) LoginLockedUntilCleared ¶
func (m *UserMutation) LoginLockedUntilCleared() bool
LoginLockedUntilCleared returns if the "login_locked_until" field was cleared in this mutation.
func (*UserMutation) MiddleName ¶
func (m *UserMutation) MiddleName() (r string, exists bool)
MiddleName returns the value of the "middle_name" field in the mutation.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User 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 (*UserMutation) OldEmailVerified ¶
func (m *UserMutation) OldEmailVerified(ctx context.Context) (v bool, err error)
OldEmailVerified returns the old "email_verified" field's value of the User entity. If the User 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 (*UserMutation) OldField ¶
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 (*UserMutation) OldFirstName ¶
func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)
OldFirstName returns the old "first_name" field's value of the User entity. If the User 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 (*UserMutation) OldLastName ¶
func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)
OldLastName returns the old "last_name" field's value of the User entity. If the User 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 (*UserMutation) OldLoginAttemptOn ¶
OldLoginAttemptOn returns the old "login_attempt_on" field's value of the User entity. If the User 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 (*UserMutation) OldLoginFailedCount ¶
func (m *UserMutation) OldLoginFailedCount(ctx context.Context) (v uint8, err error)
OldLoginFailedCount returns the old "login_failed_count" field's value of the User entity. If the User 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 (*UserMutation) OldLoginLockedUntil ¶
OldLoginLockedUntil returns the old "login_locked_until" field's value of the User entity. If the User 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 (*UserMutation) OldMiddleName ¶
func (m *UserMutation) OldMiddleName(ctx context.Context) (v *string, err error)
OldMiddleName returns the old "middle_name" field's value of the User entity. If the User 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 (*UserMutation) OldPhone ¶
func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)
OldPhone returns the old "phone" field's value of the User entity. If the User 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 (*UserMutation) OldPhoneVerified ¶
func (m *UserMutation) OldPhoneVerified(ctx context.Context) (v bool, err error)
OldPhoneVerified returns the old "phone_verified" field's value of the User entity. If the User 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 (*UserMutation) OldPwdHash ¶
func (m *UserMutation) OldPwdHash(ctx context.Context) (v string, err error)
OldPwdHash returns the old "pwd_hash" field's value of the User entity. If the User 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 (*UserMutation) OldPwdSalt ¶
func (m *UserMutation) OldPwdSalt(ctx context.Context) (v string, err error)
OldPwdSalt returns the old "pwd_salt" field's value of the User entity. If the User 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 (*UserMutation) OldStatus ¶
OldStatus returns the old "status" field's value of the User entity. If the User 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 (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User 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 (*UserMutation) Phone ¶
func (m *UserMutation) Phone() (r string, exists bool)
Phone returns the value of the "phone" field in the mutation.
func (*UserMutation) PhoneCleared ¶
func (m *UserMutation) PhoneCleared() bool
PhoneCleared returns if the "phone" field was cleared in this mutation.
func (*UserMutation) PhoneVerified ¶
func (m *UserMutation) PhoneVerified() (r bool, exists bool)
PhoneVerified returns the value of the "phone_verified" field in the mutation.
func (*UserMutation) PwdHash ¶
func (m *UserMutation) PwdHash() (r string, exists bool)
PwdHash returns the value of the "pwd_hash" field in the mutation.
func (*UserMutation) PwdSalt ¶
func (m *UserMutation) PwdSalt() (r string, exists bool)
PwdSalt returns the value of the "pwd_salt" field in the mutation.
func (*UserMutation) RemoveAuditLogIDs ¶
func (m *UserMutation) RemoveAuditLogIDs(ids ...int64)
RemoveAuditLogIDs removes the "audit_logs" edge to the Audit entity by IDs.
func (*UserMutation) RemoveSessionIDs ¶
func (m *UserMutation) RemoveSessionIDs(ids ...int64)
RemoveSessionIDs removes the "sessions" edge to the UserSession entity by IDs.
func (*UserMutation) RemoveVerifyTokenIDs ¶
func (m *UserMutation) RemoveVerifyTokenIDs(ids ...int64)
RemoveVerifyTokenIDs removes the "verify_tokens" edge to the VerifyToken entity by IDs.
func (*UserMutation) RemovedAuditLogsIDs ¶
func (m *UserMutation) RemovedAuditLogsIDs() (ids []int64)
RemovedAuditLogs returns the removed IDs of the "audit_logs" edge to the Audit entity.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedSessionsIDs ¶
func (m *UserMutation) RemovedSessionsIDs() (ids []int64)
RemovedSessions returns the removed IDs of the "sessions" edge to the UserSession entity.
func (*UserMutation) RemovedVerifyTokensIDs ¶
func (m *UserMutation) RemovedVerifyTokensIDs() (ids []int64)
RemovedVerifyTokens returns the removed IDs of the "verify_tokens" edge to the VerifyToken entity.
func (*UserMutation) ResetAuditLogs ¶
func (m *UserMutation) ResetAuditLogs()
ResetAuditLogs resets all changes to the "audit_logs" edge.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
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 (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetEmailVerified ¶
func (m *UserMutation) ResetEmailVerified()
ResetEmailVerified resets all changes to the "email_verified" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
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 (*UserMutation) ResetFirstName ¶
func (m *UserMutation) ResetFirstName()
ResetFirstName resets all changes to the "first_name" field.
func (*UserMutation) ResetLastName ¶
func (m *UserMutation) ResetLastName()
ResetLastName resets all changes to the "last_name" field.
func (*UserMutation) ResetLoginAttemptOn ¶
func (m *UserMutation) ResetLoginAttemptOn()
ResetLoginAttemptOn resets all changes to the "login_attempt_on" field.
func (*UserMutation) ResetLoginFailedCount ¶
func (m *UserMutation) ResetLoginFailedCount()
ResetLoginFailedCount resets all changes to the "login_failed_count" field.
func (*UserMutation) ResetLoginLockedUntil ¶
func (m *UserMutation) ResetLoginLockedUntil()
ResetLoginLockedUntil resets all changes to the "login_locked_until" field.
func (*UserMutation) ResetMiddleName ¶
func (m *UserMutation) ResetMiddleName()
ResetMiddleName resets all changes to the "middle_name" field.
func (*UserMutation) ResetPhone ¶
func (m *UserMutation) ResetPhone()
ResetPhone resets all changes to the "phone" field.
func (*UserMutation) ResetPhoneVerified ¶
func (m *UserMutation) ResetPhoneVerified()
ResetPhoneVerified resets all changes to the "phone_verified" field.
func (*UserMutation) ResetPwdHash ¶
func (m *UserMutation) ResetPwdHash()
ResetPwdHash resets all changes to the "pwd_hash" field.
func (*UserMutation) ResetPwdSalt ¶
func (m *UserMutation) ResetPwdSalt()
ResetPwdSalt resets all changes to the "pwd_salt" field.
func (*UserMutation) ResetSessions ¶
func (m *UserMutation) ResetSessions()
ResetSessions resets all changes to the "sessions" edge.
func (*UserMutation) ResetStatus ¶
func (m *UserMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetVerifyTokens ¶
func (m *UserMutation) ResetVerifyTokens()
ResetVerifyTokens resets all changes to the "verify_tokens" edge.
func (*UserMutation) SessionsCleared ¶
func (m *UserMutation) SessionsCleared() bool
SessionsCleared reports if the "sessions" edge to the UserSession entity was cleared.
func (*UserMutation) SessionsIDs ¶
func (m *UserMutation) SessionsIDs() (ids []int64)
SessionsIDs returns the "sessions" edge IDs in the mutation.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetEmailVerified ¶
func (m *UserMutation) SetEmailVerified(b bool)
SetEmailVerified sets the "email_verified" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
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 (*UserMutation) SetFirstName ¶
func (m *UserMutation) SetFirstName(s string)
SetFirstName sets the "first_name" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetLastName ¶
func (m *UserMutation) SetLastName(s string)
SetLastName sets the "last_name" field.
func (*UserMutation) SetLoginAttemptOn ¶
func (m *UserMutation) SetLoginAttemptOn(t time.Time)
SetLoginAttemptOn sets the "login_attempt_on" field.
func (*UserMutation) SetLoginFailedCount ¶
func (m *UserMutation) SetLoginFailedCount(u uint8)
SetLoginFailedCount sets the "login_failed_count" field.
func (*UserMutation) SetLoginLockedUntil ¶
func (m *UserMutation) SetLoginLockedUntil(t time.Time)
SetLoginLockedUntil sets the "login_locked_until" field.
func (*UserMutation) SetMiddleName ¶
func (m *UserMutation) SetMiddleName(s string)
SetMiddleName sets the "middle_name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPhone ¶
func (m *UserMutation) SetPhone(s string)
SetPhone sets the "phone" field.
func (*UserMutation) SetPhoneVerified ¶
func (m *UserMutation) SetPhoneVerified(b bool)
SetPhoneVerified sets the "phone_verified" field.
func (*UserMutation) SetPwdHash ¶
func (m *UserMutation) SetPwdHash(s string)
SetPwdHash sets the "pwd_hash" field.
func (*UserMutation) SetPwdSalt ¶
func (m *UserMutation) SetPwdSalt(s string)
SetPwdSalt sets the "pwd_salt" field.
func (*UserMutation) SetStatus ¶
func (m *UserMutation) SetStatus(u user.Status)
SetStatus sets the "status" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserMutation) Status ¶
func (m *UserMutation) Status() (r user.Status, exists bool)
Status returns the value of the "status" field in the mutation.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) VerifyTokensCleared ¶
func (m *UserMutation) VerifyTokensCleared() bool
VerifyTokensCleared reports if the "verify_tokens" edge to the VerifyToken entity was cleared.
func (*UserMutation) VerifyTokensIDs ¶
func (m *UserMutation) VerifyTokensIDs() (ids []int64)
VerifyTokensIDs returns the "verify_tokens" edge IDs in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QueryAuditLogs ¶
func (uq *UserQuery) QueryAuditLogs() *AuditQuery
QueryAuditLogs chains the current query on the "audit_logs" edge.
func (*UserQuery) QuerySessions ¶
func (uq *UserQuery) QuerySessions() *UserSessionQuery
QuerySessions chains the current query on the "sessions" edge.
func (*UserQuery) QueryVerifyTokens ¶
func (uq *UserQuery) QueryVerifyTokens() *VerifyTokenQuery
QueryVerifyTokens chains the current query on the "verify_tokens" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` } client.User.Query(). Select(user.FieldCreatedAt). Scan(ctx, &v)
func (*UserQuery) Unique ¶
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 (*UserQuery) WithAuditLogs ¶
func (uq *UserQuery) WithAuditLogs(opts ...func(*AuditQuery)) *UserQuery
WithAuditLogs tells the query-builder to eager-load the nodes that are connected to the "audit_logs" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithSessions ¶
func (uq *UserQuery) WithSessions(opts ...func(*UserSessionQuery)) *UserQuery
WithSessions tells the query-builder to eager-load the nodes that are connected to the "sessions" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithVerifyTokens ¶
func (uq *UserQuery) WithVerifyTokens(opts ...func(*VerifyTokenQuery)) *UserQuery
WithVerifyTokens tells the query-builder to eager-load the nodes that are connected to the "verify_tokens" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserSession ¶
type UserSession struct { // ID of the ent. ID int64 `json:"id,omitempty"` // IssuedAt holds the value of the "issued_at" field. IssuedAt time.Time `json:"issued_at,omitempty"` // ExpiresAt holds the value of the "expires_at" field. ExpiresAt time.Time `json:"expires_at,omitempty"` // Invalidated holds the value of the "invalidated" field. Invalidated bool `json:"invalidated,omitempty"` // UserAgent holds the value of the "user_agent" field. UserAgent string `json:"user_agent,omitempty"` // IP holds the value of the "ip" field. IP string `json:"ip,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserSessionQuery when eager-loading is set. Edges UserSessionEdges `json:"edges"` // contains filtered or unexported fields }
UserSession is the model entity for the UserSession schema.
func (*UserSession) QueryUser ¶
func (us *UserSession) QueryUser() *UserQuery
QueryUser queries the "user" edge of the UserSession entity.
func (*UserSession) String ¶
func (us *UserSession) String() string
String implements the fmt.Stringer.
func (*UserSession) Unwrap ¶
func (us *UserSession) Unwrap() *UserSession
Unwrap unwraps the UserSession 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 (*UserSession) Update ¶
func (us *UserSession) Update() *UserSessionUpdateOne
Update returns a builder for updating this UserSession. Note that you need to call UserSession.Unwrap() before calling this method if this UserSession was returned from a transaction, and the transaction was committed or rolled back.
type UserSessionClient ¶
type UserSessionClient struct {
// contains filtered or unexported fields
}
UserSessionClient is a client for the UserSession schema.
func NewUserSessionClient ¶
func NewUserSessionClient(c config) *UserSessionClient
NewUserSessionClient returns a client for the UserSession from the given config.
func (*UserSessionClient) Create ¶
func (c *UserSessionClient) Create() *UserSessionCreate
Create returns a builder for creating a UserSession entity.
func (*UserSessionClient) CreateBulk ¶
func (c *UserSessionClient) CreateBulk(builders ...*UserSessionCreate) *UserSessionCreateBulk
CreateBulk returns a builder for creating a bulk of UserSession entities.
func (*UserSessionClient) Delete ¶
func (c *UserSessionClient) Delete() *UserSessionDelete
Delete returns a delete builder for UserSession.
func (*UserSessionClient) DeleteOne ¶
func (c *UserSessionClient) DeleteOne(us *UserSession) *UserSessionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserSessionClient) DeleteOneID ¶
func (c *UserSessionClient) DeleteOneID(id int64) *UserSessionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserSessionClient) Get ¶
func (c *UserSessionClient) Get(ctx context.Context, id int64) (*UserSession, error)
Get returns a UserSession entity by its id.
func (*UserSessionClient) GetX ¶
func (c *UserSessionClient) GetX(ctx context.Context, id int64) *UserSession
GetX is like Get, but panics if an error occurs.
func (*UserSessionClient) Hooks ¶
func (c *UserSessionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserSessionClient) Intercept ¶
func (c *UserSessionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `usersession.Intercept(f(g(h())))`.
func (*UserSessionClient) Interceptors ¶
func (c *UserSessionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserSessionClient) MapCreateBulk ¶
func (c *UserSessionClient) MapCreateBulk(slice any, setFunc func(*UserSessionCreate, int)) *UserSessionCreateBulk
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 (*UserSessionClient) Query ¶
func (c *UserSessionClient) Query() *UserSessionQuery
Query returns a query builder for UserSession.
func (*UserSessionClient) QueryUser ¶
func (c *UserSessionClient) QueryUser(us *UserSession) *UserQuery
QueryUser queries the user edge of a UserSession.
func (*UserSessionClient) Update ¶
func (c *UserSessionClient) Update() *UserSessionUpdate
Update returns an update builder for UserSession.
func (*UserSessionClient) UpdateOne ¶
func (c *UserSessionClient) UpdateOne(us *UserSession) *UserSessionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserSessionClient) UpdateOneID ¶
func (c *UserSessionClient) UpdateOneID(id int64) *UserSessionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserSessionClient) Use ¶
func (c *UserSessionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `usersession.Hooks(f(g(h())))`.
type UserSessionCreate ¶
type UserSessionCreate struct {
// contains filtered or unexported fields
}
UserSessionCreate is the builder for creating a UserSession entity.
func (*UserSessionCreate) Exec ¶
func (usc *UserSessionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSessionCreate) ExecX ¶
func (usc *UserSessionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSessionCreate) Mutation ¶
func (usc *UserSessionCreate) Mutation() *UserSessionMutation
Mutation returns the UserSessionMutation object of the builder.
func (*UserSessionCreate) Save ¶
func (usc *UserSessionCreate) Save(ctx context.Context) (*UserSession, error)
Save creates the UserSession in the database.
func (*UserSessionCreate) SaveX ¶
func (usc *UserSessionCreate) SaveX(ctx context.Context) *UserSession
SaveX calls Save and panics if Save returns an error.
func (*UserSessionCreate) SetExpiresAt ¶
func (usc *UserSessionCreate) SetExpiresAt(t time.Time) *UserSessionCreate
SetExpiresAt sets the "expires_at" field.
func (*UserSessionCreate) SetID ¶
func (usc *UserSessionCreate) SetID(i int64) *UserSessionCreate
SetID sets the "id" field.
func (*UserSessionCreate) SetIP ¶
func (usc *UserSessionCreate) SetIP(s string) *UserSessionCreate
SetIP sets the "ip" field.
func (*UserSessionCreate) SetInvalidated ¶
func (usc *UserSessionCreate) SetInvalidated(b bool) *UserSessionCreate
SetInvalidated sets the "invalidated" field.
func (*UserSessionCreate) SetIssuedAt ¶
func (usc *UserSessionCreate) SetIssuedAt(t time.Time) *UserSessionCreate
SetIssuedAt sets the "issued_at" field.
func (*UserSessionCreate) SetNillableInvalidated ¶
func (usc *UserSessionCreate) SetNillableInvalidated(b *bool) *UserSessionCreate
SetNillableInvalidated sets the "invalidated" field if the given value is not nil.
func (*UserSessionCreate) SetUser ¶
func (usc *UserSessionCreate) SetUser(u *User) *UserSessionCreate
SetUser sets the "user" edge to the User entity.
func (*UserSessionCreate) SetUserAgent ¶
func (usc *UserSessionCreate) SetUserAgent(s string) *UserSessionCreate
SetUserAgent sets the "user_agent" field.
func (*UserSessionCreate) SetUserID ¶
func (usc *UserSessionCreate) SetUserID(id int64) *UserSessionCreate
SetUserID sets the "user" edge to the User entity by ID.
type UserSessionCreateBulk ¶
type UserSessionCreateBulk struct {
// contains filtered or unexported fields
}
UserSessionCreateBulk is the builder for creating many UserSession entities in bulk.
func (*UserSessionCreateBulk) Exec ¶
func (uscb *UserSessionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSessionCreateBulk) ExecX ¶
func (uscb *UserSessionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSessionCreateBulk) Save ¶
func (uscb *UserSessionCreateBulk) Save(ctx context.Context) ([]*UserSession, error)
Save creates the UserSession entities in the database.
func (*UserSessionCreateBulk) SaveX ¶
func (uscb *UserSessionCreateBulk) SaveX(ctx context.Context) []*UserSession
SaveX is like Save, but panics if an error occurs.
type UserSessionDelete ¶
type UserSessionDelete struct {
// contains filtered or unexported fields
}
UserSessionDelete is the builder for deleting a UserSession entity.
func (*UserSessionDelete) Exec ¶
func (usd *UserSessionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserSessionDelete) ExecX ¶
func (usd *UserSessionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserSessionDelete) Where ¶
func (usd *UserSessionDelete) Where(ps ...predicate.UserSession) *UserSessionDelete
Where appends a list predicates to the UserSessionDelete builder.
type UserSessionDeleteOne ¶
type UserSessionDeleteOne struct {
// contains filtered or unexported fields
}
UserSessionDeleteOne is the builder for deleting a single UserSession entity.
func (*UserSessionDeleteOne) Exec ¶
func (usdo *UserSessionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserSessionDeleteOne) ExecX ¶
func (usdo *UserSessionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSessionDeleteOne) Where ¶
func (usdo *UserSessionDeleteOne) Where(ps ...predicate.UserSession) *UserSessionDeleteOne
Where appends a list predicates to the UserSessionDelete builder.
type UserSessionEdges ¶
type UserSessionEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
UserSessionEdges holds the relations/edges for other nodes in the graph.
func (UserSessionEdges) UserOrErr ¶
func (e UserSessionEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type UserSessionGroupBy ¶
type UserSessionGroupBy struct {
// contains filtered or unexported fields
}
UserSessionGroupBy is the group-by builder for UserSession entities.
func (*UserSessionGroupBy) Aggregate ¶
func (usgb *UserSessionGroupBy) Aggregate(fns ...AggregateFunc) *UserSessionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserSessionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSessionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSessionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSessionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSessionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSessionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSessionGroupBy) Scan ¶
func (usgb *UserSessionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSessionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserSessionMutation ¶
type UserSessionMutation struct {
// contains filtered or unexported fields
}
UserSessionMutation represents an operation that mutates the UserSession nodes in the graph.
func (*UserSessionMutation) AddField ¶
func (m *UserSessionMutation) AddField(name string, value ent.Value) error
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 (*UserSessionMutation) AddedEdges ¶
func (m *UserSessionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserSessionMutation) AddedField ¶
func (m *UserSessionMutation) AddedField(name string) (ent.Value, bool)
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 (*UserSessionMutation) AddedFields ¶
func (m *UserSessionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserSessionMutation) AddedIDs ¶
func (m *UserSessionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserSessionMutation) ClearEdge ¶
func (m *UserSessionMutation) ClearEdge(name string) error
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 (*UserSessionMutation) ClearField ¶
func (m *UserSessionMutation) ClearField(name string) error
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 (*UserSessionMutation) ClearInvalidated ¶
func (m *UserSessionMutation) ClearInvalidated()
ClearInvalidated clears the value of the "invalidated" field.
func (*UserSessionMutation) ClearUser ¶
func (m *UserSessionMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*UserSessionMutation) ClearedEdges ¶
func (m *UserSessionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserSessionMutation) ClearedFields ¶
func (m *UserSessionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserSessionMutation) Client ¶
func (m UserSessionMutation) Client() *Client
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 (*UserSessionMutation) EdgeCleared ¶
func (m *UserSessionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserSessionMutation) ExpiresAt ¶
func (m *UserSessionMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*UserSessionMutation) Field ¶
func (m *UserSessionMutation) Field(name string) (ent.Value, bool)
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 (*UserSessionMutation) FieldCleared ¶
func (m *UserSessionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserSessionMutation) Fields ¶
func (m *UserSessionMutation) Fields() []string
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 (*UserSessionMutation) ID ¶
func (m *UserSessionMutation) ID() (id int64, exists bool)
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 (*UserSessionMutation) IDs ¶
func (m *UserSessionMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*UserSessionMutation) IP ¶
func (m *UserSessionMutation) IP() (r string, exists bool)
IP returns the value of the "ip" field in the mutation.
func (*UserSessionMutation) Invalidated ¶
func (m *UserSessionMutation) Invalidated() (r bool, exists bool)
Invalidated returns the value of the "invalidated" field in the mutation.
func (*UserSessionMutation) InvalidatedCleared ¶
func (m *UserSessionMutation) InvalidatedCleared() bool
InvalidatedCleared returns if the "invalidated" field was cleared in this mutation.
func (*UserSessionMutation) IssuedAt ¶
func (m *UserSessionMutation) IssuedAt() (r time.Time, exists bool)
IssuedAt returns the value of the "issued_at" field in the mutation.
func (*UserSessionMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldField ¶
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 (*UserSessionMutation) OldIP ¶
func (m *UserSessionMutation) OldIP(ctx context.Context) (v string, err error)
OldIP returns the old "ip" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldInvalidated ¶
func (m *UserSessionMutation) OldInvalidated(ctx context.Context) (v bool, err error)
OldInvalidated returns the old "invalidated" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldIssuedAt ¶
OldIssuedAt returns the old "issued_at" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) OldUserAgent ¶
func (m *UserSessionMutation) OldUserAgent(ctx context.Context) (v string, err error)
OldUserAgent returns the old "user_agent" field's value of the UserSession entity. If the UserSession 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 (*UserSessionMutation) Op ¶
func (m *UserSessionMutation) Op() Op
Op returns the operation name.
func (*UserSessionMutation) RemovedEdges ¶
func (m *UserSessionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserSessionMutation) RemovedIDs ¶
func (m *UserSessionMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserSessionMutation) ResetEdge ¶
func (m *UserSessionMutation) ResetEdge(name string) error
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 (*UserSessionMutation) ResetExpiresAt ¶
func (m *UserSessionMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*UserSessionMutation) ResetField ¶
func (m *UserSessionMutation) ResetField(name string) error
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 (*UserSessionMutation) ResetIP ¶
func (m *UserSessionMutation) ResetIP()
ResetIP resets all changes to the "ip" field.
func (*UserSessionMutation) ResetInvalidated ¶
func (m *UserSessionMutation) ResetInvalidated()
ResetInvalidated resets all changes to the "invalidated" field.
func (*UserSessionMutation) ResetIssuedAt ¶
func (m *UserSessionMutation) ResetIssuedAt()
ResetIssuedAt resets all changes to the "issued_at" field.
func (*UserSessionMutation) ResetUser ¶
func (m *UserSessionMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*UserSessionMutation) ResetUserAgent ¶
func (m *UserSessionMutation) ResetUserAgent()
ResetUserAgent resets all changes to the "user_agent" field.
func (*UserSessionMutation) SetExpiresAt ¶
func (m *UserSessionMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*UserSessionMutation) SetField ¶
func (m *UserSessionMutation) SetField(name string, value ent.Value) error
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 (*UserSessionMutation) SetID ¶
func (m *UserSessionMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of UserSession entities.
func (*UserSessionMutation) SetIP ¶
func (m *UserSessionMutation) SetIP(s string)
SetIP sets the "ip" field.
func (*UserSessionMutation) SetInvalidated ¶
func (m *UserSessionMutation) SetInvalidated(b bool)
SetInvalidated sets the "invalidated" field.
func (*UserSessionMutation) SetIssuedAt ¶
func (m *UserSessionMutation) SetIssuedAt(t time.Time)
SetIssuedAt sets the "issued_at" field.
func (*UserSessionMutation) SetOp ¶
func (m *UserSessionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserSessionMutation) SetUserAgent ¶
func (m *UserSessionMutation) SetUserAgent(s string)
SetUserAgent sets the "user_agent" field.
func (*UserSessionMutation) SetUserID ¶
func (m *UserSessionMutation) SetUserID(id int64)
SetUserID sets the "user" edge to the User entity by id.
func (UserSessionMutation) Tx ¶
func (m UserSessionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserSessionMutation) Type ¶
func (m *UserSessionMutation) Type() string
Type returns the node type of this mutation (UserSession).
func (*UserSessionMutation) UserAgent ¶
func (m *UserSessionMutation) UserAgent() (r string, exists bool)
UserAgent returns the value of the "user_agent" field in the mutation.
func (*UserSessionMutation) UserCleared ¶
func (m *UserSessionMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*UserSessionMutation) UserID ¶
func (m *UserSessionMutation) UserID() (id int64, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*UserSessionMutation) UserIDs ¶
func (m *UserSessionMutation) UserIDs() (ids []int64)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*UserSessionMutation) Where ¶
func (m *UserSessionMutation) Where(ps ...predicate.UserSession)
Where appends a list predicates to the UserSessionMutation builder.
func (*UserSessionMutation) WhereP ¶
func (m *UserSessionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserSessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserSessionQuery ¶
type UserSessionQuery struct {
// contains filtered or unexported fields
}
UserSessionQuery is the builder for querying UserSession entities.
func (*UserSessionQuery) Aggregate ¶
func (usq *UserSessionQuery) Aggregate(fns ...AggregateFunc) *UserSessionSelect
Aggregate returns a UserSessionSelect configured with the given aggregations.
func (*UserSessionQuery) All ¶
func (usq *UserSessionQuery) All(ctx context.Context) ([]*UserSession, error)
All executes the query and returns a list of UserSessions.
func (*UserSessionQuery) AllX ¶
func (usq *UserSessionQuery) AllX(ctx context.Context) []*UserSession
AllX is like All, but panics if an error occurs.
func (*UserSessionQuery) Clone ¶
func (usq *UserSessionQuery) Clone() *UserSessionQuery
Clone returns a duplicate of the UserSessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserSessionQuery) Count ¶
func (usq *UserSessionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserSessionQuery) CountX ¶
func (usq *UserSessionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserSessionQuery) Exist ¶
func (usq *UserSessionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserSessionQuery) ExistX ¶
func (usq *UserSessionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserSessionQuery) First ¶
func (usq *UserSessionQuery) First(ctx context.Context) (*UserSession, error)
First returns the first UserSession entity from the query. Returns a *NotFoundError when no UserSession was found.
func (*UserSessionQuery) FirstID ¶
func (usq *UserSessionQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first UserSession ID from the query. Returns a *NotFoundError when no UserSession ID was found.
func (*UserSessionQuery) FirstIDX ¶
func (usq *UserSessionQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserSessionQuery) FirstX ¶
func (usq *UserSessionQuery) FirstX(ctx context.Context) *UserSession
FirstX is like First, but panics if an error occurs.
func (*UserSessionQuery) GroupBy ¶
func (usq *UserSessionQuery) GroupBy(field string, fields ...string) *UserSessionGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { IssuedAt time.Time `json:"issued_at,omitempty"` Count int `json:"count,omitempty"` } client.UserSession.Query(). GroupBy(usersession.FieldIssuedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserSessionQuery) IDs ¶
func (usq *UserSessionQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of UserSession IDs.
func (*UserSessionQuery) IDsX ¶
func (usq *UserSessionQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*UserSessionQuery) Limit ¶
func (usq *UserSessionQuery) Limit(limit int) *UserSessionQuery
Limit the number of records to be returned by this query.
func (*UserSessionQuery) Offset ¶
func (usq *UserSessionQuery) Offset(offset int) *UserSessionQuery
Offset to start from.
func (*UserSessionQuery) Only ¶
func (usq *UserSessionQuery) Only(ctx context.Context) (*UserSession, error)
Only returns a single UserSession entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserSession entity is found. Returns a *NotFoundError when no UserSession entities are found.
func (*UserSessionQuery) OnlyID ¶
func (usq *UserSessionQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only UserSession ID in the query. Returns a *NotSingularError when more than one UserSession ID is found. Returns a *NotFoundError when no entities are found.
func (*UserSessionQuery) OnlyIDX ¶
func (usq *UserSessionQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserSessionQuery) OnlyX ¶
func (usq *UserSessionQuery) OnlyX(ctx context.Context) *UserSession
OnlyX is like Only, but panics if an error occurs.
func (*UserSessionQuery) Order ¶
func (usq *UserSessionQuery) Order(o ...usersession.OrderOption) *UserSessionQuery
Order specifies how the records should be ordered.
func (*UserSessionQuery) QueryUser ¶
func (usq *UserSessionQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*UserSessionQuery) Select ¶
func (usq *UserSessionQuery) Select(fields ...string) *UserSessionSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { IssuedAt time.Time `json:"issued_at,omitempty"` } client.UserSession.Query(). Select(usersession.FieldIssuedAt). Scan(ctx, &v)
func (*UserSessionQuery) Unique ¶
func (usq *UserSessionQuery) Unique(unique bool) *UserSessionQuery
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 (*UserSessionQuery) Where ¶
func (usq *UserSessionQuery) Where(ps ...predicate.UserSession) *UserSessionQuery
Where adds a new predicate for the UserSessionQuery builder.
func (*UserSessionQuery) WithUser ¶
func (usq *UserSessionQuery) WithUser(opts ...func(*UserQuery)) *UserSessionQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type UserSessionSelect ¶
type UserSessionSelect struct { *UserSessionQuery // contains filtered or unexported fields }
UserSessionSelect is the builder for selecting fields of UserSession entities.
func (*UserSessionSelect) Aggregate ¶
func (uss *UserSessionSelect) Aggregate(fns ...AggregateFunc) *UserSessionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSessionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSessionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSessionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSessionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSessionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSessionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSessionSelect) Scan ¶
func (uss *UserSessionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSessionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserSessionUpdate ¶
type UserSessionUpdate struct {
// contains filtered or unexported fields
}
UserSessionUpdate is the builder for updating UserSession entities.
func (*UserSessionUpdate) ClearInvalidated ¶
func (usu *UserSessionUpdate) ClearInvalidated() *UserSessionUpdate
ClearInvalidated clears the value of the "invalidated" field.
func (*UserSessionUpdate) ClearUser ¶
func (usu *UserSessionUpdate) ClearUser() *UserSessionUpdate
ClearUser clears the "user" edge to the User entity.
func (*UserSessionUpdate) Exec ¶
func (usu *UserSessionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserSessionUpdate) ExecX ¶
func (usu *UserSessionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSessionUpdate) Mutation ¶
func (usu *UserSessionUpdate) Mutation() *UserSessionMutation
Mutation returns the UserSessionMutation object of the builder.
func (*UserSessionUpdate) Save ¶
func (usu *UserSessionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserSessionUpdate) SaveX ¶
func (usu *UserSessionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserSessionUpdate) SetExpiresAt ¶
func (usu *UserSessionUpdate) SetExpiresAt(t time.Time) *UserSessionUpdate
SetExpiresAt sets the "expires_at" field.
func (*UserSessionUpdate) SetIP ¶
func (usu *UserSessionUpdate) SetIP(s string) *UserSessionUpdate
SetIP sets the "ip" field.
func (*UserSessionUpdate) SetInvalidated ¶
func (usu *UserSessionUpdate) SetInvalidated(b bool) *UserSessionUpdate
SetInvalidated sets the "invalidated" field.
func (*UserSessionUpdate) SetIssuedAt ¶
func (usu *UserSessionUpdate) SetIssuedAt(t time.Time) *UserSessionUpdate
SetIssuedAt sets the "issued_at" field.
func (*UserSessionUpdate) SetNillableExpiresAt ¶
func (usu *UserSessionUpdate) SetNillableExpiresAt(t *time.Time) *UserSessionUpdate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*UserSessionUpdate) SetNillableIP ¶
func (usu *UserSessionUpdate) SetNillableIP(s *string) *UserSessionUpdate
SetNillableIP sets the "ip" field if the given value is not nil.
func (*UserSessionUpdate) SetNillableInvalidated ¶
func (usu *UserSessionUpdate) SetNillableInvalidated(b *bool) *UserSessionUpdate
SetNillableInvalidated sets the "invalidated" field if the given value is not nil.
func (*UserSessionUpdate) SetNillableIssuedAt ¶
func (usu *UserSessionUpdate) SetNillableIssuedAt(t *time.Time) *UserSessionUpdate
SetNillableIssuedAt sets the "issued_at" field if the given value is not nil.
func (*UserSessionUpdate) SetNillableUserAgent ¶
func (usu *UserSessionUpdate) SetNillableUserAgent(s *string) *UserSessionUpdate
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*UserSessionUpdate) SetUser ¶
func (usu *UserSessionUpdate) SetUser(u *User) *UserSessionUpdate
SetUser sets the "user" edge to the User entity.
func (*UserSessionUpdate) SetUserAgent ¶
func (usu *UserSessionUpdate) SetUserAgent(s string) *UserSessionUpdate
SetUserAgent sets the "user_agent" field.
func (*UserSessionUpdate) SetUserID ¶
func (usu *UserSessionUpdate) SetUserID(id int64) *UserSessionUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*UserSessionUpdate) Where ¶
func (usu *UserSessionUpdate) Where(ps ...predicate.UserSession) *UserSessionUpdate
Where appends a list predicates to the UserSessionUpdate builder.
type UserSessionUpdateOne ¶
type UserSessionUpdateOne struct {
// contains filtered or unexported fields
}
UserSessionUpdateOne is the builder for updating a single UserSession entity.
func (*UserSessionUpdateOne) ClearInvalidated ¶
func (usuo *UserSessionUpdateOne) ClearInvalidated() *UserSessionUpdateOne
ClearInvalidated clears the value of the "invalidated" field.
func (*UserSessionUpdateOne) ClearUser ¶
func (usuo *UserSessionUpdateOne) ClearUser() *UserSessionUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*UserSessionUpdateOne) Exec ¶
func (usuo *UserSessionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserSessionUpdateOne) ExecX ¶
func (usuo *UserSessionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserSessionUpdateOne) Mutation ¶
func (usuo *UserSessionUpdateOne) Mutation() *UserSessionMutation
Mutation returns the UserSessionMutation object of the builder.
func (*UserSessionUpdateOne) Save ¶
func (usuo *UserSessionUpdateOne) Save(ctx context.Context) (*UserSession, error)
Save executes the query and returns the updated UserSession entity.
func (*UserSessionUpdateOne) SaveX ¶
func (usuo *UserSessionUpdateOne) SaveX(ctx context.Context) *UserSession
SaveX is like Save, but panics if an error occurs.
func (*UserSessionUpdateOne) Select ¶
func (usuo *UserSessionUpdateOne) Select(field string, fields ...string) *UserSessionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserSessionUpdateOne) SetExpiresAt ¶
func (usuo *UserSessionUpdateOne) SetExpiresAt(t time.Time) *UserSessionUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*UserSessionUpdateOne) SetIP ¶
func (usuo *UserSessionUpdateOne) SetIP(s string) *UserSessionUpdateOne
SetIP sets the "ip" field.
func (*UserSessionUpdateOne) SetInvalidated ¶
func (usuo *UserSessionUpdateOne) SetInvalidated(b bool) *UserSessionUpdateOne
SetInvalidated sets the "invalidated" field.
func (*UserSessionUpdateOne) SetIssuedAt ¶
func (usuo *UserSessionUpdateOne) SetIssuedAt(t time.Time) *UserSessionUpdateOne
SetIssuedAt sets the "issued_at" field.
func (*UserSessionUpdateOne) SetNillableExpiresAt ¶
func (usuo *UserSessionUpdateOne) SetNillableExpiresAt(t *time.Time) *UserSessionUpdateOne
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*UserSessionUpdateOne) SetNillableIP ¶
func (usuo *UserSessionUpdateOne) SetNillableIP(s *string) *UserSessionUpdateOne
SetNillableIP sets the "ip" field if the given value is not nil.
func (*UserSessionUpdateOne) SetNillableInvalidated ¶
func (usuo *UserSessionUpdateOne) SetNillableInvalidated(b *bool) *UserSessionUpdateOne
SetNillableInvalidated sets the "invalidated" field if the given value is not nil.
func (*UserSessionUpdateOne) SetNillableIssuedAt ¶
func (usuo *UserSessionUpdateOne) SetNillableIssuedAt(t *time.Time) *UserSessionUpdateOne
SetNillableIssuedAt sets the "issued_at" field if the given value is not nil.
func (*UserSessionUpdateOne) SetNillableUserAgent ¶
func (usuo *UserSessionUpdateOne) SetNillableUserAgent(s *string) *UserSessionUpdateOne
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*UserSessionUpdateOne) SetUser ¶
func (usuo *UserSessionUpdateOne) SetUser(u *User) *UserSessionUpdateOne
SetUser sets the "user" edge to the User entity.
func (*UserSessionUpdateOne) SetUserAgent ¶
func (usuo *UserSessionUpdateOne) SetUserAgent(s string) *UserSessionUpdateOne
SetUserAgent sets the "user_agent" field.
func (*UserSessionUpdateOne) SetUserID ¶
func (usuo *UserSessionUpdateOne) SetUserID(id int64) *UserSessionUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*UserSessionUpdateOne) Where ¶
func (usuo *UserSessionUpdateOne) Where(ps ...predicate.UserSession) *UserSessionUpdateOne
Where appends a list predicates to the UserSessionUpdate builder.
type UserSessions ¶
type UserSessions []*UserSession
UserSessions is a parsable slice of UserSession.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAuditLogIDs ¶
func (uu *UserUpdate) AddAuditLogIDs(ids ...int64) *UserUpdate
AddAuditLogIDs adds the "audit_logs" edge to the Audit entity by IDs.
func (*UserUpdate) AddAuditLogs ¶
func (uu *UserUpdate) AddAuditLogs(a ...*Audit) *UserUpdate
AddAuditLogs adds the "audit_logs" edges to the Audit entity.
func (*UserUpdate) AddLoginFailedCount ¶
func (uu *UserUpdate) AddLoginFailedCount(u int8) *UserUpdate
AddLoginFailedCount adds u to the "login_failed_count" field.
func (*UserUpdate) AddSessionIDs ¶
func (uu *UserUpdate) AddSessionIDs(ids ...int64) *UserUpdate
AddSessionIDs adds the "sessions" edge to the UserSession entity by IDs.
func (*UserUpdate) AddSessions ¶
func (uu *UserUpdate) AddSessions(u ...*UserSession) *UserUpdate
AddSessions adds the "sessions" edges to the UserSession entity.
func (*UserUpdate) AddVerifyTokenIDs ¶
func (uu *UserUpdate) AddVerifyTokenIDs(ids ...int64) *UserUpdate
AddVerifyTokenIDs adds the "verify_tokens" edge to the VerifyToken entity by IDs.
func (*UserUpdate) AddVerifyTokens ¶
func (uu *UserUpdate) AddVerifyTokens(v ...*VerifyToken) *UserUpdate
AddVerifyTokens adds the "verify_tokens" edges to the VerifyToken entity.
func (*UserUpdate) ClearAuditLogs ¶
func (uu *UserUpdate) ClearAuditLogs() *UserUpdate
ClearAuditLogs clears all "audit_logs" edges to the Audit entity.
func (*UserUpdate) ClearLoginAttemptOn ¶
func (uu *UserUpdate) ClearLoginAttemptOn() *UserUpdate
ClearLoginAttemptOn clears the value of the "login_attempt_on" field.
func (*UserUpdate) ClearLoginFailedCount ¶
func (uu *UserUpdate) ClearLoginFailedCount() *UserUpdate
ClearLoginFailedCount clears the value of the "login_failed_count" field.
func (*UserUpdate) ClearLoginLockedUntil ¶
func (uu *UserUpdate) ClearLoginLockedUntil() *UserUpdate
ClearLoginLockedUntil clears the value of the "login_locked_until" field.
func (*UserUpdate) ClearPhone ¶
func (uu *UserUpdate) ClearPhone() *UserUpdate
ClearPhone clears the value of the "phone" field.
func (*UserUpdate) ClearSessions ¶
func (uu *UserUpdate) ClearSessions() *UserUpdate
ClearSessions clears all "sessions" edges to the UserSession entity.
func (*UserUpdate) ClearVerifyTokens ¶
func (uu *UserUpdate) ClearVerifyTokens() *UserUpdate
ClearVerifyTokens clears all "verify_tokens" edges to the VerifyToken entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveAuditLogIDs ¶
func (uu *UserUpdate) RemoveAuditLogIDs(ids ...int64) *UserUpdate
RemoveAuditLogIDs removes the "audit_logs" edge to Audit entities by IDs.
func (*UserUpdate) RemoveAuditLogs ¶
func (uu *UserUpdate) RemoveAuditLogs(a ...*Audit) *UserUpdate
RemoveAuditLogs removes "audit_logs" edges to Audit entities.
func (*UserUpdate) RemoveSessionIDs ¶
func (uu *UserUpdate) RemoveSessionIDs(ids ...int64) *UserUpdate
RemoveSessionIDs removes the "sessions" edge to UserSession entities by IDs.
func (*UserUpdate) RemoveSessions ¶
func (uu *UserUpdate) RemoveSessions(u ...*UserSession) *UserUpdate
RemoveSessions removes "sessions" edges to UserSession entities.
func (*UserUpdate) RemoveVerifyTokenIDs ¶
func (uu *UserUpdate) RemoveVerifyTokenIDs(ids ...int64) *UserUpdate
RemoveVerifyTokenIDs removes the "verify_tokens" edge to VerifyToken entities by IDs.
func (*UserUpdate) RemoveVerifyTokens ¶
func (uu *UserUpdate) RemoveVerifyTokens(v ...*VerifyToken) *UserUpdate
RemoveVerifyTokens removes "verify_tokens" edges to VerifyToken entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetEmailVerified ¶
func (uu *UserUpdate) SetEmailVerified(b bool) *UserUpdate
SetEmailVerified sets the "email_verified" field.
func (*UserUpdate) SetFirstName ¶
func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
SetFirstName sets the "first_name" field.
func (*UserUpdate) SetLastName ¶
func (uu *UserUpdate) SetLastName(s string) *UserUpdate
SetLastName sets the "last_name" field.
func (*UserUpdate) SetLoginAttemptOn ¶
func (uu *UserUpdate) SetLoginAttemptOn(t time.Time) *UserUpdate
SetLoginAttemptOn sets the "login_attempt_on" field.
func (*UserUpdate) SetLoginFailedCount ¶
func (uu *UserUpdate) SetLoginFailedCount(u uint8) *UserUpdate
SetLoginFailedCount sets the "login_failed_count" field.
func (*UserUpdate) SetLoginLockedUntil ¶
func (uu *UserUpdate) SetLoginLockedUntil(t time.Time) *UserUpdate
SetLoginLockedUntil sets the "login_locked_until" field.
func (*UserUpdate) SetMiddleName ¶
func (uu *UserUpdate) SetMiddleName(s string) *UserUpdate
SetMiddleName sets the "middle_name" field.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableEmailVerified ¶
func (uu *UserUpdate) SetNillableEmailVerified(b *bool) *UserUpdate
SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (*UserUpdate) SetNillableFirstName ¶
func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate
SetNillableFirstName sets the "first_name" field if the given value is not nil.
func (*UserUpdate) SetNillableLastName ¶
func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate
SetNillableLastName sets the "last_name" field if the given value is not nil.
func (*UserUpdate) SetNillableLoginAttemptOn ¶
func (uu *UserUpdate) SetNillableLoginAttemptOn(t *time.Time) *UserUpdate
SetNillableLoginAttemptOn sets the "login_attempt_on" field if the given value is not nil.
func (*UserUpdate) SetNillableLoginFailedCount ¶
func (uu *UserUpdate) SetNillableLoginFailedCount(u *uint8) *UserUpdate
SetNillableLoginFailedCount sets the "login_failed_count" field if the given value is not nil.
func (*UserUpdate) SetNillableLoginLockedUntil ¶
func (uu *UserUpdate) SetNillableLoginLockedUntil(t *time.Time) *UserUpdate
SetNillableLoginLockedUntil sets the "login_locked_until" field if the given value is not nil.
func (*UserUpdate) SetNillableMiddleName ¶
func (uu *UserUpdate) SetNillableMiddleName(s *string) *UserUpdate
SetNillableMiddleName sets the "middle_name" field if the given value is not nil.
func (*UserUpdate) SetNillablePhone ¶
func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*UserUpdate) SetNillablePhoneVerified ¶
func (uu *UserUpdate) SetNillablePhoneVerified(b *bool) *UserUpdate
SetNillablePhoneVerified sets the "phone_verified" field if the given value is not nil.
func (*UserUpdate) SetNillablePwdHash ¶
func (uu *UserUpdate) SetNillablePwdHash(s *string) *UserUpdate
SetNillablePwdHash sets the "pwd_hash" field if the given value is not nil.
func (*UserUpdate) SetNillablePwdSalt ¶
func (uu *UserUpdate) SetNillablePwdSalt(s *string) *UserUpdate
SetNillablePwdSalt sets the "pwd_salt" field if the given value is not nil.
func (*UserUpdate) SetNillableStatus ¶
func (uu *UserUpdate) SetNillableStatus(u *user.Status) *UserUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*UserUpdate) SetPhone ¶
func (uu *UserUpdate) SetPhone(s string) *UserUpdate
SetPhone sets the "phone" field.
func (*UserUpdate) SetPhoneVerified ¶
func (uu *UserUpdate) SetPhoneVerified(b bool) *UserUpdate
SetPhoneVerified sets the "phone_verified" field.
func (*UserUpdate) SetPwdHash ¶
func (uu *UserUpdate) SetPwdHash(s string) *UserUpdate
SetPwdHash sets the "pwd_hash" field.
func (*UserUpdate) SetPwdSalt ¶
func (uu *UserUpdate) SetPwdSalt(s string) *UserUpdate
SetPwdSalt sets the "pwd_salt" field.
func (*UserUpdate) SetStatus ¶
func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate
SetStatus sets the "status" field.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAuditLogIDs ¶
func (uuo *UserUpdateOne) AddAuditLogIDs(ids ...int64) *UserUpdateOne
AddAuditLogIDs adds the "audit_logs" edge to the Audit entity by IDs.
func (*UserUpdateOne) AddAuditLogs ¶
func (uuo *UserUpdateOne) AddAuditLogs(a ...*Audit) *UserUpdateOne
AddAuditLogs adds the "audit_logs" edges to the Audit entity.
func (*UserUpdateOne) AddLoginFailedCount ¶
func (uuo *UserUpdateOne) AddLoginFailedCount(u int8) *UserUpdateOne
AddLoginFailedCount adds u to the "login_failed_count" field.
func (*UserUpdateOne) AddSessionIDs ¶
func (uuo *UserUpdateOne) AddSessionIDs(ids ...int64) *UserUpdateOne
AddSessionIDs adds the "sessions" edge to the UserSession entity by IDs.
func (*UserUpdateOne) AddSessions ¶
func (uuo *UserUpdateOne) AddSessions(u ...*UserSession) *UserUpdateOne
AddSessions adds the "sessions" edges to the UserSession entity.
func (*UserUpdateOne) AddVerifyTokenIDs ¶
func (uuo *UserUpdateOne) AddVerifyTokenIDs(ids ...int64) *UserUpdateOne
AddVerifyTokenIDs adds the "verify_tokens" edge to the VerifyToken entity by IDs.
func (*UserUpdateOne) AddVerifyTokens ¶
func (uuo *UserUpdateOne) AddVerifyTokens(v ...*VerifyToken) *UserUpdateOne
AddVerifyTokens adds the "verify_tokens" edges to the VerifyToken entity.
func (*UserUpdateOne) ClearAuditLogs ¶
func (uuo *UserUpdateOne) ClearAuditLogs() *UserUpdateOne
ClearAuditLogs clears all "audit_logs" edges to the Audit entity.
func (*UserUpdateOne) ClearLoginAttemptOn ¶
func (uuo *UserUpdateOne) ClearLoginAttemptOn() *UserUpdateOne
ClearLoginAttemptOn clears the value of the "login_attempt_on" field.
func (*UserUpdateOne) ClearLoginFailedCount ¶
func (uuo *UserUpdateOne) ClearLoginFailedCount() *UserUpdateOne
ClearLoginFailedCount clears the value of the "login_failed_count" field.
func (*UserUpdateOne) ClearLoginLockedUntil ¶
func (uuo *UserUpdateOne) ClearLoginLockedUntil() *UserUpdateOne
ClearLoginLockedUntil clears the value of the "login_locked_until" field.
func (*UserUpdateOne) ClearPhone ¶
func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne
ClearPhone clears the value of the "phone" field.
func (*UserUpdateOne) ClearSessions ¶
func (uuo *UserUpdateOne) ClearSessions() *UserUpdateOne
ClearSessions clears all "sessions" edges to the UserSession entity.
func (*UserUpdateOne) ClearVerifyTokens ¶
func (uuo *UserUpdateOne) ClearVerifyTokens() *UserUpdateOne
ClearVerifyTokens clears all "verify_tokens" edges to the VerifyToken entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveAuditLogIDs ¶
func (uuo *UserUpdateOne) RemoveAuditLogIDs(ids ...int64) *UserUpdateOne
RemoveAuditLogIDs removes the "audit_logs" edge to Audit entities by IDs.
func (*UserUpdateOne) RemoveAuditLogs ¶
func (uuo *UserUpdateOne) RemoveAuditLogs(a ...*Audit) *UserUpdateOne
RemoveAuditLogs removes "audit_logs" edges to Audit entities.
func (*UserUpdateOne) RemoveSessionIDs ¶
func (uuo *UserUpdateOne) RemoveSessionIDs(ids ...int64) *UserUpdateOne
RemoveSessionIDs removes the "sessions" edge to UserSession entities by IDs.
func (*UserUpdateOne) RemoveSessions ¶
func (uuo *UserUpdateOne) RemoveSessions(u ...*UserSession) *UserUpdateOne
RemoveSessions removes "sessions" edges to UserSession entities.
func (*UserUpdateOne) RemoveVerifyTokenIDs ¶
func (uuo *UserUpdateOne) RemoveVerifyTokenIDs(ids ...int64) *UserUpdateOne
RemoveVerifyTokenIDs removes the "verify_tokens" edge to VerifyToken entities by IDs.
func (*UserUpdateOne) RemoveVerifyTokens ¶
func (uuo *UserUpdateOne) RemoveVerifyTokens(v ...*VerifyToken) *UserUpdateOne
RemoveVerifyTokens removes "verify_tokens" edges to VerifyToken entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetEmailVerified ¶
func (uuo *UserUpdateOne) SetEmailVerified(b bool) *UserUpdateOne
SetEmailVerified sets the "email_verified" field.
func (*UserUpdateOne) SetFirstName ¶
func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
SetFirstName sets the "first_name" field.
func (*UserUpdateOne) SetLastName ¶
func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
SetLastName sets the "last_name" field.
func (*UserUpdateOne) SetLoginAttemptOn ¶
func (uuo *UserUpdateOne) SetLoginAttemptOn(t time.Time) *UserUpdateOne
SetLoginAttemptOn sets the "login_attempt_on" field.
func (*UserUpdateOne) SetLoginFailedCount ¶
func (uuo *UserUpdateOne) SetLoginFailedCount(u uint8) *UserUpdateOne
SetLoginFailedCount sets the "login_failed_count" field.
func (*UserUpdateOne) SetLoginLockedUntil ¶
func (uuo *UserUpdateOne) SetLoginLockedUntil(t time.Time) *UserUpdateOne
SetLoginLockedUntil sets the "login_locked_until" field.
func (*UserUpdateOne) SetMiddleName ¶
func (uuo *UserUpdateOne) SetMiddleName(s string) *UserUpdateOne
SetMiddleName sets the "middle_name" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmailVerified ¶
func (uuo *UserUpdateOne) SetNillableEmailVerified(b *bool) *UserUpdateOne
SetNillableEmailVerified sets the "email_verified" field if the given value is not nil.
func (*UserUpdateOne) SetNillableFirstName ¶
func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne
SetNillableFirstName sets the "first_name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastName ¶
func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne
SetNillableLastName sets the "last_name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLoginAttemptOn ¶
func (uuo *UserUpdateOne) SetNillableLoginAttemptOn(t *time.Time) *UserUpdateOne
SetNillableLoginAttemptOn sets the "login_attempt_on" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLoginFailedCount ¶
func (uuo *UserUpdateOne) SetNillableLoginFailedCount(u *uint8) *UserUpdateOne
SetNillableLoginFailedCount sets the "login_failed_count" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLoginLockedUntil ¶
func (uuo *UserUpdateOne) SetNillableLoginLockedUntil(t *time.Time) *UserUpdateOne
SetNillableLoginLockedUntil sets the "login_locked_until" field if the given value is not nil.
func (*UserUpdateOne) SetNillableMiddleName ¶
func (uuo *UserUpdateOne) SetNillableMiddleName(s *string) *UserUpdateOne
SetNillableMiddleName sets the "middle_name" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePhone ¶
func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne
SetNillablePhone sets the "phone" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePhoneVerified ¶
func (uuo *UserUpdateOne) SetNillablePhoneVerified(b *bool) *UserUpdateOne
SetNillablePhoneVerified sets the "phone_verified" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePwdHash ¶
func (uuo *UserUpdateOne) SetNillablePwdHash(s *string) *UserUpdateOne
SetNillablePwdHash sets the "pwd_hash" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePwdSalt ¶
func (uuo *UserUpdateOne) SetNillablePwdSalt(s *string) *UserUpdateOne
SetNillablePwdSalt sets the "pwd_salt" field if the given value is not nil.
func (*UserUpdateOne) SetNillableStatus ¶
func (uuo *UserUpdateOne) SetNillableStatus(u *user.Status) *UserUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*UserUpdateOne) SetPhone ¶
func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne
SetPhone sets the "phone" field.
func (*UserUpdateOne) SetPhoneVerified ¶
func (uuo *UserUpdateOne) SetPhoneVerified(b bool) *UserUpdateOne
SetPhoneVerified sets the "phone_verified" field.
func (*UserUpdateOne) SetPwdHash ¶
func (uuo *UserUpdateOne) SetPwdHash(s string) *UserUpdateOne
SetPwdHash sets the "pwd_hash" field.
func (*UserUpdateOne) SetPwdSalt ¶
func (uuo *UserUpdateOne) SetPwdSalt(s string) *UserUpdateOne
SetPwdSalt sets the "pwd_salt" field.
func (*UserUpdateOne) SetStatus ¶
func (uuo *UserUpdateOne) SetStatus(u user.Status) *UserUpdateOne
SetStatus sets the "status" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type VerifyToken ¶
type VerifyToken struct { // ID of the ent. ID int64 `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt"` // ExpiresAt holds the value of the "expires_at" field. ExpiresAt time.Time `json:"expires_at,omitempty"` // Token holds the value of the "token" field. Token string `json:"token,omitempty"` // Purpose holds the value of the "purpose" field. Purpose string `json:"purpose,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the VerifyTokenQuery when eager-loading is set. Edges VerifyTokenEdges `json:"edges"` // contains filtered or unexported fields }
VerifyToken is the model entity for the VerifyToken schema.
func (*VerifyToken) QueryUser ¶
func (vt *VerifyToken) QueryUser() *UserQuery
QueryUser queries the "user" edge of the VerifyToken entity.
func (*VerifyToken) String ¶
func (vt *VerifyToken) String() string
String implements the fmt.Stringer.
func (*VerifyToken) Unwrap ¶
func (vt *VerifyToken) Unwrap() *VerifyToken
Unwrap unwraps the VerifyToken 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 (*VerifyToken) Update ¶
func (vt *VerifyToken) Update() *VerifyTokenUpdateOne
Update returns a builder for updating this VerifyToken. Note that you need to call VerifyToken.Unwrap() before calling this method if this VerifyToken was returned from a transaction, and the transaction was committed or rolled back.
type VerifyTokenClient ¶
type VerifyTokenClient struct {
// contains filtered or unexported fields
}
VerifyTokenClient is a client for the VerifyToken schema.
func NewVerifyTokenClient ¶
func NewVerifyTokenClient(c config) *VerifyTokenClient
NewVerifyTokenClient returns a client for the VerifyToken from the given config.
func (*VerifyTokenClient) Create ¶
func (c *VerifyTokenClient) Create() *VerifyTokenCreate
Create returns a builder for creating a VerifyToken entity.
func (*VerifyTokenClient) CreateBulk ¶
func (c *VerifyTokenClient) CreateBulk(builders ...*VerifyTokenCreate) *VerifyTokenCreateBulk
CreateBulk returns a builder for creating a bulk of VerifyToken entities.
func (*VerifyTokenClient) Delete ¶
func (c *VerifyTokenClient) Delete() *VerifyTokenDelete
Delete returns a delete builder for VerifyToken.
func (*VerifyTokenClient) DeleteOne ¶
func (c *VerifyTokenClient) DeleteOne(vt *VerifyToken) *VerifyTokenDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VerifyTokenClient) DeleteOneID ¶
func (c *VerifyTokenClient) DeleteOneID(id int64) *VerifyTokenDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VerifyTokenClient) Get ¶
func (c *VerifyTokenClient) Get(ctx context.Context, id int64) (*VerifyToken, error)
Get returns a VerifyToken entity by its id.
func (*VerifyTokenClient) GetX ¶
func (c *VerifyTokenClient) GetX(ctx context.Context, id int64) *VerifyToken
GetX is like Get, but panics if an error occurs.
func (*VerifyTokenClient) Hooks ¶
func (c *VerifyTokenClient) Hooks() []Hook
Hooks returns the client hooks.
func (*VerifyTokenClient) Intercept ¶
func (c *VerifyTokenClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `verifytoken.Intercept(f(g(h())))`.
func (*VerifyTokenClient) Interceptors ¶
func (c *VerifyTokenClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*VerifyTokenClient) MapCreateBulk ¶
func (c *VerifyTokenClient) MapCreateBulk(slice any, setFunc func(*VerifyTokenCreate, int)) *VerifyTokenCreateBulk
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 (*VerifyTokenClient) Query ¶
func (c *VerifyTokenClient) Query() *VerifyTokenQuery
Query returns a query builder for VerifyToken.
func (*VerifyTokenClient) QueryUser ¶
func (c *VerifyTokenClient) QueryUser(vt *VerifyToken) *UserQuery
QueryUser queries the user edge of a VerifyToken.
func (*VerifyTokenClient) Update ¶
func (c *VerifyTokenClient) Update() *VerifyTokenUpdate
Update returns an update builder for VerifyToken.
func (*VerifyTokenClient) UpdateOne ¶
func (c *VerifyTokenClient) UpdateOne(vt *VerifyToken) *VerifyTokenUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VerifyTokenClient) UpdateOneID ¶
func (c *VerifyTokenClient) UpdateOneID(id int64) *VerifyTokenUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VerifyTokenClient) Use ¶
func (c *VerifyTokenClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `verifytoken.Hooks(f(g(h())))`.
type VerifyTokenCreate ¶
type VerifyTokenCreate struct {
// contains filtered or unexported fields
}
VerifyTokenCreate is the builder for creating a VerifyToken entity.
func (*VerifyTokenCreate) Exec ¶
func (vtc *VerifyTokenCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VerifyTokenCreate) ExecX ¶
func (vtc *VerifyTokenCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VerifyTokenCreate) Mutation ¶
func (vtc *VerifyTokenCreate) Mutation() *VerifyTokenMutation
Mutation returns the VerifyTokenMutation object of the builder.
func (*VerifyTokenCreate) Save ¶
func (vtc *VerifyTokenCreate) Save(ctx context.Context) (*VerifyToken, error)
Save creates the VerifyToken in the database.
func (*VerifyTokenCreate) SaveX ¶
func (vtc *VerifyTokenCreate) SaveX(ctx context.Context) *VerifyToken
SaveX calls Save and panics if Save returns an error.
func (*VerifyTokenCreate) SetCreatedAt ¶
func (vtc *VerifyTokenCreate) SetCreatedAt(t time.Time) *VerifyTokenCreate
SetCreatedAt sets the "created_at" field.
func (*VerifyTokenCreate) SetExpiresAt ¶
func (vtc *VerifyTokenCreate) SetExpiresAt(t time.Time) *VerifyTokenCreate
SetExpiresAt sets the "expires_at" field.
func (*VerifyTokenCreate) SetID ¶
func (vtc *VerifyTokenCreate) SetID(i int64) *VerifyTokenCreate
SetID sets the "id" field.
func (*VerifyTokenCreate) SetNillableCreatedAt ¶
func (vtc *VerifyTokenCreate) SetNillableCreatedAt(t *time.Time) *VerifyTokenCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VerifyTokenCreate) SetNillablePurpose ¶
func (vtc *VerifyTokenCreate) SetNillablePurpose(s *string) *VerifyTokenCreate
SetNillablePurpose sets the "purpose" field if the given value is not nil.
func (*VerifyTokenCreate) SetNillableUserID ¶
func (vtc *VerifyTokenCreate) SetNillableUserID(id *int64) *VerifyTokenCreate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*VerifyTokenCreate) SetPurpose ¶
func (vtc *VerifyTokenCreate) SetPurpose(s string) *VerifyTokenCreate
SetPurpose sets the "purpose" field.
func (*VerifyTokenCreate) SetToken ¶
func (vtc *VerifyTokenCreate) SetToken(s string) *VerifyTokenCreate
SetToken sets the "token" field.
func (*VerifyTokenCreate) SetUser ¶
func (vtc *VerifyTokenCreate) SetUser(u *User) *VerifyTokenCreate
SetUser sets the "user" edge to the User entity.
func (*VerifyTokenCreate) SetUserID ¶
func (vtc *VerifyTokenCreate) SetUserID(id int64) *VerifyTokenCreate
SetUserID sets the "user" edge to the User entity by ID.
type VerifyTokenCreateBulk ¶
type VerifyTokenCreateBulk struct {
// contains filtered or unexported fields
}
VerifyTokenCreateBulk is the builder for creating many VerifyToken entities in bulk.
func (*VerifyTokenCreateBulk) Exec ¶
func (vtcb *VerifyTokenCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VerifyTokenCreateBulk) ExecX ¶
func (vtcb *VerifyTokenCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VerifyTokenCreateBulk) Save ¶
func (vtcb *VerifyTokenCreateBulk) Save(ctx context.Context) ([]*VerifyToken, error)
Save creates the VerifyToken entities in the database.
func (*VerifyTokenCreateBulk) SaveX ¶
func (vtcb *VerifyTokenCreateBulk) SaveX(ctx context.Context) []*VerifyToken
SaveX is like Save, but panics if an error occurs.
type VerifyTokenDelete ¶
type VerifyTokenDelete struct {
// contains filtered or unexported fields
}
VerifyTokenDelete is the builder for deleting a VerifyToken entity.
func (*VerifyTokenDelete) Exec ¶
func (vtd *VerifyTokenDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VerifyTokenDelete) ExecX ¶
func (vtd *VerifyTokenDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VerifyTokenDelete) Where ¶
func (vtd *VerifyTokenDelete) Where(ps ...predicate.VerifyToken) *VerifyTokenDelete
Where appends a list predicates to the VerifyTokenDelete builder.
type VerifyTokenDeleteOne ¶
type VerifyTokenDeleteOne struct {
// contains filtered or unexported fields
}
VerifyTokenDeleteOne is the builder for deleting a single VerifyToken entity.
func (*VerifyTokenDeleteOne) Exec ¶
func (vtdo *VerifyTokenDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VerifyTokenDeleteOne) ExecX ¶
func (vtdo *VerifyTokenDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VerifyTokenDeleteOne) Where ¶
func (vtdo *VerifyTokenDeleteOne) Where(ps ...predicate.VerifyToken) *VerifyTokenDeleteOne
Where appends a list predicates to the VerifyTokenDelete builder.
type VerifyTokenEdges ¶
type VerifyTokenEdges struct { // User holds the value of the user edge. User *User `json:"user,omitempty"` // contains filtered or unexported fields }
VerifyTokenEdges holds the relations/edges for other nodes in the graph.
func (VerifyTokenEdges) UserOrErr ¶
func (e VerifyTokenEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type VerifyTokenGroupBy ¶
type VerifyTokenGroupBy struct {
// contains filtered or unexported fields
}
VerifyTokenGroupBy is the group-by builder for VerifyToken entities.
func (*VerifyTokenGroupBy) Aggregate ¶
func (vtgb *VerifyTokenGroupBy) Aggregate(fns ...AggregateFunc) *VerifyTokenGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VerifyTokenGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VerifyTokenGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VerifyTokenGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VerifyTokenGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VerifyTokenGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VerifyTokenGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VerifyTokenGroupBy) Scan ¶
func (vtgb *VerifyTokenGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VerifyTokenGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VerifyTokenMutation ¶
type VerifyTokenMutation struct {
// contains filtered or unexported fields
}
VerifyTokenMutation represents an operation that mutates the VerifyToken nodes in the graph.
func (*VerifyTokenMutation) AddField ¶
func (m *VerifyTokenMutation) AddField(name string, value ent.Value) error
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 (*VerifyTokenMutation) AddedEdges ¶
func (m *VerifyTokenMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VerifyTokenMutation) AddedField ¶
func (m *VerifyTokenMutation) AddedField(name string) (ent.Value, bool)
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 (*VerifyTokenMutation) AddedFields ¶
func (m *VerifyTokenMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VerifyTokenMutation) AddedIDs ¶
func (m *VerifyTokenMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VerifyTokenMutation) ClearEdge ¶
func (m *VerifyTokenMutation) ClearEdge(name string) error
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 (*VerifyTokenMutation) ClearField ¶
func (m *VerifyTokenMutation) ClearField(name string) error
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 (*VerifyTokenMutation) ClearPurpose ¶
func (m *VerifyTokenMutation) ClearPurpose()
ClearPurpose clears the value of the "purpose" field.
func (*VerifyTokenMutation) ClearUser ¶
func (m *VerifyTokenMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*VerifyTokenMutation) ClearedEdges ¶
func (m *VerifyTokenMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VerifyTokenMutation) ClearedFields ¶
func (m *VerifyTokenMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VerifyTokenMutation) Client ¶
func (m VerifyTokenMutation) Client() *Client
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 (*VerifyTokenMutation) CreatedAt ¶
func (m *VerifyTokenMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*VerifyTokenMutation) EdgeCleared ¶
func (m *VerifyTokenMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VerifyTokenMutation) ExpiresAt ¶
func (m *VerifyTokenMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*VerifyTokenMutation) Field ¶
func (m *VerifyTokenMutation) Field(name string) (ent.Value, bool)
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 (*VerifyTokenMutation) FieldCleared ¶
func (m *VerifyTokenMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VerifyTokenMutation) Fields ¶
func (m *VerifyTokenMutation) Fields() []string
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 (*VerifyTokenMutation) ID ¶
func (m *VerifyTokenMutation) ID() (id int64, exists bool)
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 (*VerifyTokenMutation) IDs ¶
func (m *VerifyTokenMutation) IDs(ctx context.Context) ([]int64, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. 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 (*VerifyTokenMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the VerifyToken entity. If the VerifyToken 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 (*VerifyTokenMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the VerifyToken entity. If the VerifyToken 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 (*VerifyTokenMutation) OldField ¶
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 (*VerifyTokenMutation) OldPurpose ¶
func (m *VerifyTokenMutation) OldPurpose(ctx context.Context) (v string, err error)
OldPurpose returns the old "purpose" field's value of the VerifyToken entity. If the VerifyToken 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 (*VerifyTokenMutation) OldToken ¶
func (m *VerifyTokenMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the VerifyToken entity. If the VerifyToken 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 (*VerifyTokenMutation) Op ¶
func (m *VerifyTokenMutation) Op() Op
Op returns the operation name.
func (*VerifyTokenMutation) Purpose ¶
func (m *VerifyTokenMutation) Purpose() (r string, exists bool)
Purpose returns the value of the "purpose" field in the mutation.
func (*VerifyTokenMutation) PurposeCleared ¶
func (m *VerifyTokenMutation) PurposeCleared() bool
PurposeCleared returns if the "purpose" field was cleared in this mutation.
func (*VerifyTokenMutation) RemovedEdges ¶
func (m *VerifyTokenMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VerifyTokenMutation) RemovedIDs ¶
func (m *VerifyTokenMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*VerifyTokenMutation) ResetCreatedAt ¶
func (m *VerifyTokenMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*VerifyTokenMutation) ResetEdge ¶
func (m *VerifyTokenMutation) ResetEdge(name string) error
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 (*VerifyTokenMutation) ResetExpiresAt ¶
func (m *VerifyTokenMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*VerifyTokenMutation) ResetField ¶
func (m *VerifyTokenMutation) ResetField(name string) error
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 (*VerifyTokenMutation) ResetPurpose ¶
func (m *VerifyTokenMutation) ResetPurpose()
ResetPurpose resets all changes to the "purpose" field.
func (*VerifyTokenMutation) ResetToken ¶
func (m *VerifyTokenMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*VerifyTokenMutation) ResetUser ¶
func (m *VerifyTokenMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*VerifyTokenMutation) SetCreatedAt ¶
func (m *VerifyTokenMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*VerifyTokenMutation) SetExpiresAt ¶
func (m *VerifyTokenMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*VerifyTokenMutation) SetField ¶
func (m *VerifyTokenMutation) SetField(name string, value ent.Value) error
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 (*VerifyTokenMutation) SetID ¶
func (m *VerifyTokenMutation) SetID(id int64)
SetID sets the value of the id field. Note that this operation is only accepted on creation of VerifyToken entities.
func (*VerifyTokenMutation) SetOp ¶
func (m *VerifyTokenMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*VerifyTokenMutation) SetPurpose ¶
func (m *VerifyTokenMutation) SetPurpose(s string)
SetPurpose sets the "purpose" field.
func (*VerifyTokenMutation) SetToken ¶
func (m *VerifyTokenMutation) SetToken(s string)
SetToken sets the "token" field.
func (*VerifyTokenMutation) SetUserID ¶
func (m *VerifyTokenMutation) SetUserID(id int64)
SetUserID sets the "user" edge to the User entity by id.
func (*VerifyTokenMutation) Token ¶
func (m *VerifyTokenMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (VerifyTokenMutation) Tx ¶
func (m VerifyTokenMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VerifyTokenMutation) Type ¶
func (m *VerifyTokenMutation) Type() string
Type returns the node type of this mutation (VerifyToken).
func (*VerifyTokenMutation) UserCleared ¶
func (m *VerifyTokenMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*VerifyTokenMutation) UserID ¶
func (m *VerifyTokenMutation) UserID() (id int64, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*VerifyTokenMutation) UserIDs ¶
func (m *VerifyTokenMutation) UserIDs() (ids []int64)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*VerifyTokenMutation) Where ¶
func (m *VerifyTokenMutation) Where(ps ...predicate.VerifyToken)
Where appends a list predicates to the VerifyTokenMutation builder.
func (*VerifyTokenMutation) WhereP ¶
func (m *VerifyTokenMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the VerifyTokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type VerifyTokenQuery ¶
type VerifyTokenQuery struct {
// contains filtered or unexported fields
}
VerifyTokenQuery is the builder for querying VerifyToken entities.
func (*VerifyTokenQuery) Aggregate ¶
func (vtq *VerifyTokenQuery) Aggregate(fns ...AggregateFunc) *VerifyTokenSelect
Aggregate returns a VerifyTokenSelect configured with the given aggregations.
func (*VerifyTokenQuery) All ¶
func (vtq *VerifyTokenQuery) All(ctx context.Context) ([]*VerifyToken, error)
All executes the query and returns a list of VerifyTokens.
func (*VerifyTokenQuery) AllX ¶
func (vtq *VerifyTokenQuery) AllX(ctx context.Context) []*VerifyToken
AllX is like All, but panics if an error occurs.
func (*VerifyTokenQuery) Clone ¶
func (vtq *VerifyTokenQuery) Clone() *VerifyTokenQuery
Clone returns a duplicate of the VerifyTokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VerifyTokenQuery) Count ¶
func (vtq *VerifyTokenQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VerifyTokenQuery) CountX ¶
func (vtq *VerifyTokenQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VerifyTokenQuery) Exist ¶
func (vtq *VerifyTokenQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VerifyTokenQuery) ExistX ¶
func (vtq *VerifyTokenQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VerifyTokenQuery) First ¶
func (vtq *VerifyTokenQuery) First(ctx context.Context) (*VerifyToken, error)
First returns the first VerifyToken entity from the query. Returns a *NotFoundError when no VerifyToken was found.
func (*VerifyTokenQuery) FirstID ¶
func (vtq *VerifyTokenQuery) FirstID(ctx context.Context) (id int64, err error)
FirstID returns the first VerifyToken ID from the query. Returns a *NotFoundError when no VerifyToken ID was found.
func (*VerifyTokenQuery) FirstIDX ¶
func (vtq *VerifyTokenQuery) FirstIDX(ctx context.Context) int64
FirstIDX is like FirstID, but panics if an error occurs.
func (*VerifyTokenQuery) FirstX ¶
func (vtq *VerifyTokenQuery) FirstX(ctx context.Context) *VerifyToken
FirstX is like First, but panics if an error occurs.
func (*VerifyTokenQuery) GroupBy ¶
func (vtq *VerifyTokenQuery) GroupBy(field string, fields ...string) *VerifyTokenGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` Count int `json:"count,omitempty"` } client.VerifyToken.Query(). GroupBy(verifytoken.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VerifyTokenQuery) IDs ¶
func (vtq *VerifyTokenQuery) IDs(ctx context.Context) (ids []int64, err error)
IDs executes the query and returns a list of VerifyToken IDs.
func (*VerifyTokenQuery) IDsX ¶
func (vtq *VerifyTokenQuery) IDsX(ctx context.Context) []int64
IDsX is like IDs, but panics if an error occurs.
func (*VerifyTokenQuery) Limit ¶
func (vtq *VerifyTokenQuery) Limit(limit int) *VerifyTokenQuery
Limit the number of records to be returned by this query.
func (*VerifyTokenQuery) Offset ¶
func (vtq *VerifyTokenQuery) Offset(offset int) *VerifyTokenQuery
Offset to start from.
func (*VerifyTokenQuery) Only ¶
func (vtq *VerifyTokenQuery) Only(ctx context.Context) (*VerifyToken, error)
Only returns a single VerifyToken entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one VerifyToken entity is found. Returns a *NotFoundError when no VerifyToken entities are found.
func (*VerifyTokenQuery) OnlyID ¶
func (vtq *VerifyTokenQuery) OnlyID(ctx context.Context) (id int64, err error)
OnlyID is like Only, but returns the only VerifyToken ID in the query. Returns a *NotSingularError when more than one VerifyToken ID is found. Returns a *NotFoundError when no entities are found.
func (*VerifyTokenQuery) OnlyIDX ¶
func (vtq *VerifyTokenQuery) OnlyIDX(ctx context.Context) int64
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VerifyTokenQuery) OnlyX ¶
func (vtq *VerifyTokenQuery) OnlyX(ctx context.Context) *VerifyToken
OnlyX is like Only, but panics if an error occurs.
func (*VerifyTokenQuery) Order ¶
func (vtq *VerifyTokenQuery) Order(o ...verifytoken.OrderOption) *VerifyTokenQuery
Order specifies how the records should be ordered.
func (*VerifyTokenQuery) QueryUser ¶
func (vtq *VerifyTokenQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*VerifyTokenQuery) Select ¶
func (vtq *VerifyTokenQuery) Select(fields ...string) *VerifyTokenSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt"` } client.VerifyToken.Query(). Select(verifytoken.FieldCreatedAt). Scan(ctx, &v)
func (*VerifyTokenQuery) Unique ¶
func (vtq *VerifyTokenQuery) Unique(unique bool) *VerifyTokenQuery
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 (*VerifyTokenQuery) Where ¶
func (vtq *VerifyTokenQuery) Where(ps ...predicate.VerifyToken) *VerifyTokenQuery
Where adds a new predicate for the VerifyTokenQuery builder.
func (*VerifyTokenQuery) WithUser ¶
func (vtq *VerifyTokenQuery) WithUser(opts ...func(*UserQuery)) *VerifyTokenQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type VerifyTokenSelect ¶
type VerifyTokenSelect struct { *VerifyTokenQuery // contains filtered or unexported fields }
VerifyTokenSelect is the builder for selecting fields of VerifyToken entities.
func (*VerifyTokenSelect) Aggregate ¶
func (vts *VerifyTokenSelect) Aggregate(fns ...AggregateFunc) *VerifyTokenSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VerifyTokenSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VerifyTokenSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VerifyTokenSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VerifyTokenSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VerifyTokenSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VerifyTokenSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VerifyTokenSelect) Scan ¶
func (vts *VerifyTokenSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VerifyTokenSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VerifyTokenUpdate ¶
type VerifyTokenUpdate struct {
// contains filtered or unexported fields
}
VerifyTokenUpdate is the builder for updating VerifyToken entities.
func (*VerifyTokenUpdate) ClearPurpose ¶
func (vtu *VerifyTokenUpdate) ClearPurpose() *VerifyTokenUpdate
ClearPurpose clears the value of the "purpose" field.
func (*VerifyTokenUpdate) ClearUser ¶
func (vtu *VerifyTokenUpdate) ClearUser() *VerifyTokenUpdate
ClearUser clears the "user" edge to the User entity.
func (*VerifyTokenUpdate) Exec ¶
func (vtu *VerifyTokenUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VerifyTokenUpdate) ExecX ¶
func (vtu *VerifyTokenUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VerifyTokenUpdate) Mutation ¶
func (vtu *VerifyTokenUpdate) Mutation() *VerifyTokenMutation
Mutation returns the VerifyTokenMutation object of the builder.
func (*VerifyTokenUpdate) Save ¶
func (vtu *VerifyTokenUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VerifyTokenUpdate) SaveX ¶
func (vtu *VerifyTokenUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VerifyTokenUpdate) SetNillablePurpose ¶
func (vtu *VerifyTokenUpdate) SetNillablePurpose(s *string) *VerifyTokenUpdate
SetNillablePurpose sets the "purpose" field if the given value is not nil.
func (*VerifyTokenUpdate) SetNillableToken ¶
func (vtu *VerifyTokenUpdate) SetNillableToken(s *string) *VerifyTokenUpdate
SetNillableToken sets the "token" field if the given value is not nil.
func (*VerifyTokenUpdate) SetNillableUserID ¶
func (vtu *VerifyTokenUpdate) SetNillableUserID(id *int64) *VerifyTokenUpdate
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*VerifyTokenUpdate) SetPurpose ¶
func (vtu *VerifyTokenUpdate) SetPurpose(s string) *VerifyTokenUpdate
SetPurpose sets the "purpose" field.
func (*VerifyTokenUpdate) SetToken ¶
func (vtu *VerifyTokenUpdate) SetToken(s string) *VerifyTokenUpdate
SetToken sets the "token" field.
func (*VerifyTokenUpdate) SetUser ¶
func (vtu *VerifyTokenUpdate) SetUser(u *User) *VerifyTokenUpdate
SetUser sets the "user" edge to the User entity.
func (*VerifyTokenUpdate) SetUserID ¶
func (vtu *VerifyTokenUpdate) SetUserID(id int64) *VerifyTokenUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*VerifyTokenUpdate) Where ¶
func (vtu *VerifyTokenUpdate) Where(ps ...predicate.VerifyToken) *VerifyTokenUpdate
Where appends a list predicates to the VerifyTokenUpdate builder.
type VerifyTokenUpdateOne ¶
type VerifyTokenUpdateOne struct {
// contains filtered or unexported fields
}
VerifyTokenUpdateOne is the builder for updating a single VerifyToken entity.
func (*VerifyTokenUpdateOne) ClearPurpose ¶
func (vtuo *VerifyTokenUpdateOne) ClearPurpose() *VerifyTokenUpdateOne
ClearPurpose clears the value of the "purpose" field.
func (*VerifyTokenUpdateOne) ClearUser ¶
func (vtuo *VerifyTokenUpdateOne) ClearUser() *VerifyTokenUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*VerifyTokenUpdateOne) Exec ¶
func (vtuo *VerifyTokenUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VerifyTokenUpdateOne) ExecX ¶
func (vtuo *VerifyTokenUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VerifyTokenUpdateOne) Mutation ¶
func (vtuo *VerifyTokenUpdateOne) Mutation() *VerifyTokenMutation
Mutation returns the VerifyTokenMutation object of the builder.
func (*VerifyTokenUpdateOne) Save ¶
func (vtuo *VerifyTokenUpdateOne) Save(ctx context.Context) (*VerifyToken, error)
Save executes the query and returns the updated VerifyToken entity.
func (*VerifyTokenUpdateOne) SaveX ¶
func (vtuo *VerifyTokenUpdateOne) SaveX(ctx context.Context) *VerifyToken
SaveX is like Save, but panics if an error occurs.
func (*VerifyTokenUpdateOne) Select ¶
func (vtuo *VerifyTokenUpdateOne) Select(field string, fields ...string) *VerifyTokenUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VerifyTokenUpdateOne) SetNillablePurpose ¶
func (vtuo *VerifyTokenUpdateOne) SetNillablePurpose(s *string) *VerifyTokenUpdateOne
SetNillablePurpose sets the "purpose" field if the given value is not nil.
func (*VerifyTokenUpdateOne) SetNillableToken ¶
func (vtuo *VerifyTokenUpdateOne) SetNillableToken(s *string) *VerifyTokenUpdateOne
SetNillableToken sets the "token" field if the given value is not nil.
func (*VerifyTokenUpdateOne) SetNillableUserID ¶
func (vtuo *VerifyTokenUpdateOne) SetNillableUserID(id *int64) *VerifyTokenUpdateOne
SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
func (*VerifyTokenUpdateOne) SetPurpose ¶
func (vtuo *VerifyTokenUpdateOne) SetPurpose(s string) *VerifyTokenUpdateOne
SetPurpose sets the "purpose" field.
func (*VerifyTokenUpdateOne) SetToken ¶
func (vtuo *VerifyTokenUpdateOne) SetToken(s string) *VerifyTokenUpdateOne
SetToken sets the "token" field.
func (*VerifyTokenUpdateOne) SetUser ¶
func (vtuo *VerifyTokenUpdateOne) SetUser(u *User) *VerifyTokenUpdateOne
SetUser sets the "user" edge to the User entity.
func (*VerifyTokenUpdateOne) SetUserID ¶
func (vtuo *VerifyTokenUpdateOne) SetUserID(id int64) *VerifyTokenUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*VerifyTokenUpdateOne) Where ¶
func (vtuo *VerifyTokenUpdateOne) Where(ps ...predicate.VerifyToken) *VerifyTokenUpdateOne
Where appends a list predicates to the VerifyTokenUpdate builder.
type VerifyTokens ¶
type VerifyTokens []*VerifyToken
VerifyTokens is a parsable slice of VerifyToken.
Source Files
¶
- accesscontrol.go
- accesscontrol_create.go
- accesscontrol_delete.go
- accesscontrol_query.go
- accesscontrol_update.go
- audit.go
- audit_create.go
- audit_delete.go
- audit_query.go
- audit_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- role.go
- role_create.go
- role_delete.go
- role_query.go
- role_update.go
- runtime.go
- todo.go
- todo_create.go
- todo_delete.go
- todo_query.go
- todo_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go
- usersession.go
- usersession_create.go
- usersession_delete.go
- usersession_query.go
- usersession_update.go
- verifytoken.go
- verifytoken_create.go
- verifytoken_delete.go
- verifytoken_query.go
- verifytoken_update.go