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 AggregateFunc
- 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 Org
- type OrgClient
- func (c *OrgClient) Create() *OrgCreate
- func (c *OrgClient) CreateBulk(builders ...*OrgCreate) *OrgCreateBulk
- func (c *OrgClient) Delete() *OrgDelete
- func (c *OrgClient) DeleteOne(o *Org) *OrgDeleteOne
- func (c *OrgClient) DeleteOneID(id string) *OrgDeleteOne
- func (c *OrgClient) Get(ctx context.Context, id string) (*Org, error)
- func (c *OrgClient) GetX(ctx context.Context, id string) *Org
- func (c *OrgClient) Hooks() []Hook
- func (c *OrgClient) Intercept(interceptors ...Interceptor)
- func (c *OrgClient) Interceptors() []Interceptor
- func (c *OrgClient) MapCreateBulk(slice any, setFunc func(*OrgCreate, int)) *OrgCreateBulk
- func (c *OrgClient) Query() *OrgQuery
- func (c *OrgClient) Update() *OrgUpdate
- func (c *OrgClient) UpdateOne(o *Org) *OrgUpdateOne
- func (c *OrgClient) UpdateOneID(id string) *OrgUpdateOne
- func (c *OrgClient) Use(hooks ...Hook)
- type OrgCreate
- func (oc *OrgCreate) Exec(ctx context.Context) error
- func (oc *OrgCreate) ExecX(ctx context.Context)
- func (oc *OrgCreate) Mutation() *OrgMutation
- func (oc *OrgCreate) Save(ctx context.Context) (*Org, error)
- func (oc *OrgCreate) SaveX(ctx context.Context) *Org
- func (oc *OrgCreate) SetCreateTime(t time.Time) *OrgCreate
- func (oc *OrgCreate) SetDeleteTime(i int64) *OrgCreate
- func (oc *OrgCreate) SetDescription(s string) *OrgCreate
- func (oc *OrgCreate) SetDisplayName(s string) *OrgCreate
- func (oc *OrgCreate) SetID(s string) *OrgCreate
- func (oc *OrgCreate) SetLogo(s string) *OrgCreate
- func (oc *OrgCreate) SetName(s string) *OrgCreate
- func (oc *OrgCreate) SetNillableCreateTime(t *time.Time) *OrgCreate
- func (oc *OrgCreate) SetNillableDeleteTime(i *int64) *OrgCreate
- func (oc *OrgCreate) SetNillableDescription(s *string) *OrgCreate
- func (oc *OrgCreate) SetNillableDisplayName(s *string) *OrgCreate
- func (oc *OrgCreate) SetNillableID(s *string) *OrgCreate
- func (oc *OrgCreate) SetNillableUpdateTime(t *time.Time) *OrgCreate
- func (oc *OrgCreate) SetStatus(s string) *OrgCreate
- func (oc *OrgCreate) SetType(s string) *OrgCreate
- func (oc *OrgCreate) SetUpdateTime(t time.Time) *OrgCreate
- type OrgCreateBulk
- type OrgDelete
- type OrgDeleteOne
- type OrgGroupBy
- func (ogb *OrgGroupBy) Aggregate(fns ...AggregateFunc) *OrgGroupBy
- func (s *OrgGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrgGroupBy) BoolX(ctx context.Context) bool
- func (s *OrgGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OrgGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OrgGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrgGroupBy) Float64X(ctx context.Context) float64
- func (s *OrgGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrgGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OrgGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OrgGroupBy) IntX(ctx context.Context) int
- func (s *OrgGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OrgGroupBy) IntsX(ctx context.Context) []int
- func (ogb *OrgGroupBy) Scan(ctx context.Context, v any) error
- func (s *OrgGroupBy) ScanX(ctx context.Context, v any)
- func (s *OrgGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OrgGroupBy) StringX(ctx context.Context) string
- func (s *OrgGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OrgGroupBy) StringsX(ctx context.Context) []string
- type OrgMutation
- func (m *OrgMutation) AddDeleteTime(i int64)
- func (m *OrgMutation) AddField(name string, value ent.Value) error
- func (m *OrgMutation) AddedDeleteTime() (r int64, exists bool)
- func (m *OrgMutation) AddedEdges() []string
- func (m *OrgMutation) AddedField(name string) (ent.Value, bool)
- func (m *OrgMutation) AddedFields() []string
- func (m *OrgMutation) AddedIDs(name string) []ent.Value
- func (m *OrgMutation) ClearDescription()
- func (m *OrgMutation) ClearDisplayName()
- func (m *OrgMutation) ClearEdge(name string) error
- func (m *OrgMutation) ClearField(name string) error
- func (m *OrgMutation) ClearedEdges() []string
- func (m *OrgMutation) ClearedFields() []string
- func (m OrgMutation) Client() *Client
- func (m *OrgMutation) CreateTime() (r time.Time, exists bool)
- func (m *OrgMutation) DeleteTime() (r int64, exists bool)
- func (m *OrgMutation) Description() (r string, exists bool)
- func (m *OrgMutation) DescriptionCleared() bool
- func (m *OrgMutation) DisplayName() (r string, exists bool)
- func (m *OrgMutation) DisplayNameCleared() bool
- func (m *OrgMutation) EdgeCleared(name string) bool
- func (m *OrgMutation) Field(name string) (ent.Value, bool)
- func (m *OrgMutation) FieldCleared(name string) bool
- func (m *OrgMutation) Fields() []string
- func (m *OrgMutation) GetType() (r string, exists bool)
- func (m *OrgMutation) ID() (id string, exists bool)
- func (m *OrgMutation) IDs(ctx context.Context) ([]string, error)
- func (m *OrgMutation) Logo() (r string, exists bool)
- func (m *OrgMutation) Name() (r string, exists bool)
- func (m *OrgMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *OrgMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
- func (m *OrgMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldDisplayName(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OrgMutation) OldLogo(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldName(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldStatus(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldType(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *OrgMutation) Op() Op
- func (m *OrgMutation) RemovedEdges() []string
- func (m *OrgMutation) RemovedIDs(name string) []ent.Value
- func (m *OrgMutation) ResetCreateTime()
- func (m *OrgMutation) ResetDeleteTime()
- func (m *OrgMutation) ResetDescription()
- func (m *OrgMutation) ResetDisplayName()
- func (m *OrgMutation) ResetEdge(name string) error
- func (m *OrgMutation) ResetField(name string) error
- func (m *OrgMutation) ResetLogo()
- func (m *OrgMutation) ResetName()
- func (m *OrgMutation) ResetStatus()
- func (m *OrgMutation) ResetType()
- func (m *OrgMutation) ResetUpdateTime()
- func (m *OrgMutation) SetCreateTime(t time.Time)
- func (m *OrgMutation) SetDeleteTime(i int64)
- func (m *OrgMutation) SetDescription(s string)
- func (m *OrgMutation) SetDisplayName(s string)
- func (m *OrgMutation) SetField(name string, value ent.Value) error
- func (m *OrgMutation) SetID(id string)
- func (m *OrgMutation) SetLogo(s string)
- func (m *OrgMutation) SetName(s string)
- func (m *OrgMutation) SetOp(op Op)
- func (m *OrgMutation) SetStatus(s string)
- func (m *OrgMutation) SetType(s string)
- func (m *OrgMutation) SetUpdateTime(t time.Time)
- func (m *OrgMutation) Status() (r string, exists bool)
- func (m OrgMutation) Tx() (*Tx, error)
- func (m *OrgMutation) Type() string
- func (m *OrgMutation) UpdateTime() (r time.Time, exists bool)
- func (m *OrgMutation) Where(ps ...predicate.Org)
- func (m *OrgMutation) WhereP(ps ...func(*sql.Selector))
- type OrgQuery
- func (oq *OrgQuery) Aggregate(fns ...AggregateFunc) *OrgSelect
- func (oq *OrgQuery) All(ctx context.Context) ([]*Org, error)
- func (oq *OrgQuery) AllX(ctx context.Context) []*Org
- func (oq *OrgQuery) Clone() *OrgQuery
- func (oq *OrgQuery) Count(ctx context.Context) (int, error)
- func (oq *OrgQuery) CountX(ctx context.Context) int
- func (oq *OrgQuery) Exist(ctx context.Context) (bool, error)
- func (oq *OrgQuery) ExistX(ctx context.Context) bool
- func (oq *OrgQuery) First(ctx context.Context) (*Org, error)
- func (oq *OrgQuery) FirstID(ctx context.Context) (id string, err error)
- func (oq *OrgQuery) FirstIDX(ctx context.Context) string
- func (oq *OrgQuery) FirstX(ctx context.Context) *Org
- func (oq *OrgQuery) GroupBy(field string, fields ...string) *OrgGroupBy
- func (oq *OrgQuery) IDs(ctx context.Context) (ids []string, err error)
- func (oq *OrgQuery) IDsX(ctx context.Context) []string
- func (oq *OrgQuery) Limit(limit int) *OrgQuery
- func (oq *OrgQuery) Offset(offset int) *OrgQuery
- func (oq *OrgQuery) Only(ctx context.Context) (*Org, error)
- func (oq *OrgQuery) OnlyID(ctx context.Context) (id string, err error)
- func (oq *OrgQuery) OnlyIDX(ctx context.Context) string
- func (oq *OrgQuery) OnlyX(ctx context.Context) *Org
- func (oq *OrgQuery) Order(o ...org.OrderOption) *OrgQuery
- func (oq *OrgQuery) Select(fields ...string) *OrgSelect
- func (oq *OrgQuery) Unique(unique bool) *OrgQuery
- func (oq *OrgQuery) Where(ps ...predicate.Org) *OrgQuery
- type OrgSelect
- func (os *OrgSelect) Aggregate(fns ...AggregateFunc) *OrgSelect
- func (s *OrgSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrgSelect) BoolX(ctx context.Context) bool
- func (s *OrgSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OrgSelect) BoolsX(ctx context.Context) []bool
- func (s *OrgSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrgSelect) Float64X(ctx context.Context) float64
- func (s *OrgSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrgSelect) Float64sX(ctx context.Context) []float64
- func (s *OrgSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OrgSelect) IntX(ctx context.Context) int
- func (s *OrgSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OrgSelect) IntsX(ctx context.Context) []int
- func (os *OrgSelect) Scan(ctx context.Context, v any) error
- func (s *OrgSelect) ScanX(ctx context.Context, v any)
- func (s *OrgSelect) String(ctx context.Context) (_ string, err error)
- func (s *OrgSelect) StringX(ctx context.Context) string
- func (s *OrgSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OrgSelect) StringsX(ctx context.Context) []string
- type OrgUpdate
- func (ou *OrgUpdate) AddDeleteTime(i int64) *OrgUpdate
- func (ou *OrgUpdate) ClearDescription() *OrgUpdate
- func (ou *OrgUpdate) ClearDisplayName() *OrgUpdate
- func (ou *OrgUpdate) Exec(ctx context.Context) error
- func (ou *OrgUpdate) ExecX(ctx context.Context)
- func (ou *OrgUpdate) Mutation() *OrgMutation
- func (ou *OrgUpdate) Save(ctx context.Context) (int, error)
- func (ou *OrgUpdate) SaveX(ctx context.Context) int
- func (ou *OrgUpdate) SetDeleteTime(i int64) *OrgUpdate
- func (ou *OrgUpdate) SetDescription(s string) *OrgUpdate
- func (ou *OrgUpdate) SetDisplayName(s string) *OrgUpdate
- func (ou *OrgUpdate) SetLogo(s string) *OrgUpdate
- func (ou *OrgUpdate) SetName(s string) *OrgUpdate
- func (ou *OrgUpdate) SetNillableDeleteTime(i *int64) *OrgUpdate
- func (ou *OrgUpdate) SetNillableDescription(s *string) *OrgUpdate
- func (ou *OrgUpdate) SetNillableDisplayName(s *string) *OrgUpdate
- func (ou *OrgUpdate) SetNillableLogo(s *string) *OrgUpdate
- func (ou *OrgUpdate) SetNillableName(s *string) *OrgUpdate
- func (ou *OrgUpdate) SetNillableStatus(s *string) *OrgUpdate
- func (ou *OrgUpdate) SetNillableType(s *string) *OrgUpdate
- func (ou *OrgUpdate) SetStatus(s string) *OrgUpdate
- func (ou *OrgUpdate) SetType(s string) *OrgUpdate
- func (ou *OrgUpdate) SetUpdateTime(t time.Time) *OrgUpdate
- func (ou *OrgUpdate) Where(ps ...predicate.Org) *OrgUpdate
- type OrgUpdateOne
- func (ouo *OrgUpdateOne) AddDeleteTime(i int64) *OrgUpdateOne
- func (ouo *OrgUpdateOne) ClearDescription() *OrgUpdateOne
- func (ouo *OrgUpdateOne) ClearDisplayName() *OrgUpdateOne
- func (ouo *OrgUpdateOne) Exec(ctx context.Context) error
- func (ouo *OrgUpdateOne) ExecX(ctx context.Context)
- func (ouo *OrgUpdateOne) Mutation() *OrgMutation
- func (ouo *OrgUpdateOne) Save(ctx context.Context) (*Org, error)
- func (ouo *OrgUpdateOne) SaveX(ctx context.Context) *Org
- func (ouo *OrgUpdateOne) Select(field string, fields ...string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetDeleteTime(i int64) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetDescription(s string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetDisplayName(s string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetLogo(s string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetName(s string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableDeleteTime(i *int64) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableDescription(s *string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableDisplayName(s *string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableLogo(s *string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableName(s *string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableStatus(s *string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetNillableType(s *string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetStatus(s string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetType(s string) *OrgUpdateOne
- func (ouo *OrgUpdateOne) SetUpdateTime(t time.Time) *OrgUpdateOne
- func (ouo *OrgUpdateOne) Where(ps ...predicate.Org) *OrgUpdateOne
- type Orgs
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type Role
- type RoleBinding
- type RoleBindingClient
- func (c *RoleBindingClient) Create() *RoleBindingCreate
- func (c *RoleBindingClient) CreateBulk(builders ...*RoleBindingCreate) *RoleBindingCreateBulk
- func (c *RoleBindingClient) Delete() *RoleBindingDelete
- func (c *RoleBindingClient) DeleteOne(rb *RoleBinding) *RoleBindingDeleteOne
- func (c *RoleBindingClient) DeleteOneID(id string) *RoleBindingDeleteOne
- func (c *RoleBindingClient) Get(ctx context.Context, id string) (*RoleBinding, error)
- func (c *RoleBindingClient) GetX(ctx context.Context, id string) *RoleBinding
- func (c *RoleBindingClient) Hooks() []Hook
- func (c *RoleBindingClient) Intercept(interceptors ...Interceptor)
- func (c *RoleBindingClient) Interceptors() []Interceptor
- func (c *RoleBindingClient) MapCreateBulk(slice any, setFunc func(*RoleBindingCreate, int)) *RoleBindingCreateBulk
- func (c *RoleBindingClient) Query() *RoleBindingQuery
- func (c *RoleBindingClient) Update() *RoleBindingUpdate
- func (c *RoleBindingClient) UpdateOne(rb *RoleBinding) *RoleBindingUpdateOne
- func (c *RoleBindingClient) UpdateOneID(id string) *RoleBindingUpdateOne
- func (c *RoleBindingClient) Use(hooks ...Hook)
- type RoleBindingCreate
- func (rbc *RoleBindingCreate) Exec(ctx context.Context) error
- func (rbc *RoleBindingCreate) ExecX(ctx context.Context)
- func (rbc *RoleBindingCreate) Mutation() *RoleBindingMutation
- func (rbc *RoleBindingCreate) Save(ctx context.Context) (*RoleBinding, error)
- func (rbc *RoleBindingCreate) SaveX(ctx context.Context) *RoleBinding
- func (rbc *RoleBindingCreate) SetCreateTime(t time.Time) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetDeleteTime(i int64) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetDeletedTime(i int64) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetDisplayName(s string) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetID(s string) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetName(s string) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetNillableCreateTime(t *time.Time) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetNillableDeleteTime(i *int64) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetNillableDeletedTime(i *int64) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetNillableDisplayName(s *string) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetNillableID(s *string) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetNillableUpdateTime(t *time.Time) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetRoleName(s string) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetUpdateTime(t time.Time) *RoleBindingCreate
- func (rbc *RoleBindingCreate) SetUserID(s string) *RoleBindingCreate
- type RoleBindingCreateBulk
- type RoleBindingDelete
- type RoleBindingDeleteOne
- type RoleBindingGroupBy
- func (rbgb *RoleBindingGroupBy) Aggregate(fns ...AggregateFunc) *RoleBindingGroupBy
- func (s *RoleBindingGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RoleBindingGroupBy) BoolX(ctx context.Context) bool
- func (s *RoleBindingGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RoleBindingGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RoleBindingGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RoleBindingGroupBy) Float64X(ctx context.Context) float64
- func (s *RoleBindingGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RoleBindingGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RoleBindingGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RoleBindingGroupBy) IntX(ctx context.Context) int
- func (s *RoleBindingGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RoleBindingGroupBy) IntsX(ctx context.Context) []int
- func (rbgb *RoleBindingGroupBy) Scan(ctx context.Context, v any) error
- func (s *RoleBindingGroupBy) ScanX(ctx context.Context, v any)
- func (s *RoleBindingGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RoleBindingGroupBy) StringX(ctx context.Context) string
- func (s *RoleBindingGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RoleBindingGroupBy) StringsX(ctx context.Context) []string
- type RoleBindingMutation
- func (m *RoleBindingMutation) AddDeleteTime(i int64)
- func (m *RoleBindingMutation) AddDeletedTime(i int64)
- func (m *RoleBindingMutation) AddField(name string, value ent.Value) error
- func (m *RoleBindingMutation) AddedDeleteTime() (r int64, exists bool)
- func (m *RoleBindingMutation) AddedDeletedTime() (r int64, exists bool)
- func (m *RoleBindingMutation) AddedEdges() []string
- func (m *RoleBindingMutation) AddedField(name string) (ent.Value, bool)
- func (m *RoleBindingMutation) AddedFields() []string
- func (m *RoleBindingMutation) AddedIDs(name string) []ent.Value
- func (m *RoleBindingMutation) ClearDeletedTime()
- func (m *RoleBindingMutation) ClearDisplayName()
- func (m *RoleBindingMutation) ClearEdge(name string) error
- func (m *RoleBindingMutation) ClearField(name string) error
- func (m *RoleBindingMutation) ClearedEdges() []string
- func (m *RoleBindingMutation) ClearedFields() []string
- func (m RoleBindingMutation) Client() *Client
- func (m *RoleBindingMutation) CreateTime() (r time.Time, exists bool)
- func (m *RoleBindingMutation) DeleteTime() (r int64, exists bool)
- func (m *RoleBindingMutation) DeletedTime() (r int64, exists bool)
- func (m *RoleBindingMutation) DeletedTimeCleared() bool
- func (m *RoleBindingMutation) DisplayName() (r string, exists bool)
- func (m *RoleBindingMutation) DisplayNameCleared() bool
- func (m *RoleBindingMutation) EdgeCleared(name string) bool
- func (m *RoleBindingMutation) Field(name string) (ent.Value, bool)
- func (m *RoleBindingMutation) FieldCleared(name string) bool
- func (m *RoleBindingMutation) Fields() []string
- func (m *RoleBindingMutation) ID() (id string, exists bool)
- func (m *RoleBindingMutation) IDs(ctx context.Context) ([]string, error)
- func (m *RoleBindingMutation) Name() (r string, exists bool)
- func (m *RoleBindingMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *RoleBindingMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
- func (m *RoleBindingMutation) OldDeletedTime(ctx context.Context) (v int64, err error)
- func (m *RoleBindingMutation) OldDisplayName(ctx context.Context) (v string, err error)
- func (m *RoleBindingMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RoleBindingMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RoleBindingMutation) OldRoleName(ctx context.Context) (v string, err error)
- func (m *RoleBindingMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *RoleBindingMutation) OldUserID(ctx context.Context) (v string, err error)
- func (m *RoleBindingMutation) Op() Op
- func (m *RoleBindingMutation) RemovedEdges() []string
- func (m *RoleBindingMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleBindingMutation) ResetCreateTime()
- func (m *RoleBindingMutation) ResetDeleteTime()
- func (m *RoleBindingMutation) ResetDeletedTime()
- func (m *RoleBindingMutation) ResetDisplayName()
- func (m *RoleBindingMutation) ResetEdge(name string) error
- func (m *RoleBindingMutation) ResetField(name string) error
- func (m *RoleBindingMutation) ResetName()
- func (m *RoleBindingMutation) ResetRoleName()
- func (m *RoleBindingMutation) ResetUpdateTime()
- func (m *RoleBindingMutation) ResetUserID()
- func (m *RoleBindingMutation) RoleName() (r string, exists bool)
- func (m *RoleBindingMutation) SetCreateTime(t time.Time)
- func (m *RoleBindingMutation) SetDeleteTime(i int64)
- func (m *RoleBindingMutation) SetDeletedTime(i int64)
- func (m *RoleBindingMutation) SetDisplayName(s string)
- func (m *RoleBindingMutation) SetField(name string, value ent.Value) error
- func (m *RoleBindingMutation) SetID(id string)
- func (m *RoleBindingMutation) SetName(s string)
- func (m *RoleBindingMutation) SetOp(op Op)
- func (m *RoleBindingMutation) SetRoleName(s string)
- func (m *RoleBindingMutation) SetUpdateTime(t time.Time)
- func (m *RoleBindingMutation) SetUserID(s string)
- func (m RoleBindingMutation) Tx() (*Tx, error)
- func (m *RoleBindingMutation) Type() string
- func (m *RoleBindingMutation) UpdateTime() (r time.Time, exists bool)
- func (m *RoleBindingMutation) UserID() (r string, exists bool)
- func (m *RoleBindingMutation) Where(ps ...predicate.RoleBinding)
- func (m *RoleBindingMutation) WhereP(ps ...func(*sql.Selector))
- type RoleBindingQuery
- func (rbq *RoleBindingQuery) Aggregate(fns ...AggregateFunc) *RoleBindingSelect
- func (rbq *RoleBindingQuery) All(ctx context.Context) ([]*RoleBinding, error)
- func (rbq *RoleBindingQuery) AllX(ctx context.Context) []*RoleBinding
- func (rbq *RoleBindingQuery) Clone() *RoleBindingQuery
- func (rbq *RoleBindingQuery) Count(ctx context.Context) (int, error)
- func (rbq *RoleBindingQuery) CountX(ctx context.Context) int
- func (rbq *RoleBindingQuery) Exist(ctx context.Context) (bool, error)
- func (rbq *RoleBindingQuery) ExistX(ctx context.Context) bool
- func (rbq *RoleBindingQuery) First(ctx context.Context) (*RoleBinding, error)
- func (rbq *RoleBindingQuery) FirstID(ctx context.Context) (id string, err error)
- func (rbq *RoleBindingQuery) FirstIDX(ctx context.Context) string
- func (rbq *RoleBindingQuery) FirstX(ctx context.Context) *RoleBinding
- func (rbq *RoleBindingQuery) GroupBy(field string, fields ...string) *RoleBindingGroupBy
- func (rbq *RoleBindingQuery) IDs(ctx context.Context) (ids []string, err error)
- func (rbq *RoleBindingQuery) IDsX(ctx context.Context) []string
- func (rbq *RoleBindingQuery) Limit(limit int) *RoleBindingQuery
- func (rbq *RoleBindingQuery) Offset(offset int) *RoleBindingQuery
- func (rbq *RoleBindingQuery) Only(ctx context.Context) (*RoleBinding, error)
- func (rbq *RoleBindingQuery) OnlyID(ctx context.Context) (id string, err error)
- func (rbq *RoleBindingQuery) OnlyIDX(ctx context.Context) string
- func (rbq *RoleBindingQuery) OnlyX(ctx context.Context) *RoleBinding
- func (rbq *RoleBindingQuery) Order(o ...rolebinding.OrderOption) *RoleBindingQuery
- func (rbq *RoleBindingQuery) Select(fields ...string) *RoleBindingSelect
- func (rbq *RoleBindingQuery) Unique(unique bool) *RoleBindingQuery
- func (rbq *RoleBindingQuery) Where(ps ...predicate.RoleBinding) *RoleBindingQuery
- type RoleBindingSelect
- func (rbs *RoleBindingSelect) Aggregate(fns ...AggregateFunc) *RoleBindingSelect
- func (s *RoleBindingSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RoleBindingSelect) BoolX(ctx context.Context) bool
- func (s *RoleBindingSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RoleBindingSelect) BoolsX(ctx context.Context) []bool
- func (s *RoleBindingSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RoleBindingSelect) Float64X(ctx context.Context) float64
- func (s *RoleBindingSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RoleBindingSelect) Float64sX(ctx context.Context) []float64
- func (s *RoleBindingSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RoleBindingSelect) IntX(ctx context.Context) int
- func (s *RoleBindingSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RoleBindingSelect) IntsX(ctx context.Context) []int
- func (rbs *RoleBindingSelect) Scan(ctx context.Context, v any) error
- func (s *RoleBindingSelect) ScanX(ctx context.Context, v any)
- func (s *RoleBindingSelect) String(ctx context.Context) (_ string, err error)
- func (s *RoleBindingSelect) StringX(ctx context.Context) string
- func (s *RoleBindingSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RoleBindingSelect) StringsX(ctx context.Context) []string
- type RoleBindingUpdate
- func (rbu *RoleBindingUpdate) AddDeleteTime(i int64) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) AddDeletedTime(i int64) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) ClearDeletedTime() *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) ClearDisplayName() *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) Exec(ctx context.Context) error
- func (rbu *RoleBindingUpdate) ExecX(ctx context.Context)
- func (rbu *RoleBindingUpdate) Mutation() *RoleBindingMutation
- func (rbu *RoleBindingUpdate) Save(ctx context.Context) (int, error)
- func (rbu *RoleBindingUpdate) SaveX(ctx context.Context) int
- func (rbu *RoleBindingUpdate) SetDeleteTime(i int64) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetDeletedTime(i int64) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetDisplayName(s string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetName(s string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetNillableDeleteTime(i *int64) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetNillableDeletedTime(i *int64) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetNillableDisplayName(s *string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetNillableName(s *string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetNillableRoleName(s *string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetNillableUserID(s *string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetRoleName(s string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetUpdateTime(t time.Time) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) SetUserID(s string) *RoleBindingUpdate
- func (rbu *RoleBindingUpdate) Where(ps ...predicate.RoleBinding) *RoleBindingUpdate
- type RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) AddDeleteTime(i int64) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) AddDeletedTime(i int64) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) ClearDeletedTime() *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) ClearDisplayName() *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) Exec(ctx context.Context) error
- func (rbuo *RoleBindingUpdateOne) ExecX(ctx context.Context)
- func (rbuo *RoleBindingUpdateOne) Mutation() *RoleBindingMutation
- func (rbuo *RoleBindingUpdateOne) Save(ctx context.Context) (*RoleBinding, error)
- func (rbuo *RoleBindingUpdateOne) SaveX(ctx context.Context) *RoleBinding
- func (rbuo *RoleBindingUpdateOne) Select(field string, fields ...string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetDeleteTime(i int64) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetDeletedTime(i int64) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetDisplayName(s string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetName(s string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetNillableDeleteTime(i *int64) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetNillableDeletedTime(i *int64) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetNillableDisplayName(s *string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetNillableName(s *string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetNillableRoleName(s *string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetNillableUserID(s *string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetRoleName(s string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetUpdateTime(t time.Time) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) SetUserID(s string) *RoleBindingUpdateOne
- func (rbuo *RoleBindingUpdateOne) Where(ps ...predicate.RoleBinding) *RoleBindingUpdateOne
- type RoleBindings
- 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 string) *RoleDeleteOne
- func (c *RoleClient) Get(ctx context.Context, id string) (*Role, error)
- func (c *RoleClient) GetX(ctx context.Context, id string) *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 string) *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) SetCreateTime(t time.Time) *RoleCreate
- func (rc *RoleCreate) SetDeleteTime(i int64) *RoleCreate
- func (rc *RoleCreate) SetDeletedTime(i int64) *RoleCreate
- func (rc *RoleCreate) SetDisplayName(s string) *RoleCreate
- func (rc *RoleCreate) SetID(s string) *RoleCreate
- func (rc *RoleCreate) SetName(s string) *RoleCreate
- func (rc *RoleCreate) SetNillableCreateTime(t *time.Time) *RoleCreate
- func (rc *RoleCreate) SetNillableDeleteTime(i *int64) *RoleCreate
- func (rc *RoleCreate) SetNillableDisplayName(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableID(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableRemark(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableUpdateTime(t *time.Time) *RoleCreate
- func (rc *RoleCreate) SetRemark(s string) *RoleCreate
- func (rc *RoleCreate) SetUpdateTime(t time.Time) *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) AddDeleteTime(i int64)
- func (m *RoleMutation) AddDeletedTime(i int64)
- func (m *RoleMutation) AddField(name string, value ent.Value) error
- func (m *RoleMutation) AddedDeleteTime() (r int64, exists bool)
- func (m *RoleMutation) AddedDeletedTime() (r int64, exists bool)
- 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) ClearDisplayName()
- func (m *RoleMutation) ClearEdge(name string) error
- func (m *RoleMutation) ClearField(name string) error
- func (m *RoleMutation) ClearRemark()
- func (m *RoleMutation) ClearedEdges() []string
- func (m *RoleMutation) ClearedFields() []string
- func (m RoleMutation) Client() *Client
- func (m *RoleMutation) CreateTime() (r time.Time, exists bool)
- func (m *RoleMutation) DeleteTime() (r int64, exists bool)
- func (m *RoleMutation) DeletedTime() (r int64, exists bool)
- func (m *RoleMutation) DisplayName() (r string, exists bool)
- func (m *RoleMutation) DisplayNameCleared() bool
- 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 string, exists bool)
- func (m *RoleMutation) IDs(ctx context.Context) ([]string, error)
- func (m *RoleMutation) Name() (r string, exists bool)
- func (m *RoleMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *RoleMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
- func (m *RoleMutation) OldDeletedTime(ctx context.Context) (v int64, err error)
- func (m *RoleMutation) OldDisplayName(ctx context.Context) (v string, err error)
- 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) OldRemark(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *RoleMutation) Op() Op
- func (m *RoleMutation) Remark() (r string, exists bool)
- func (m *RoleMutation) RemarkCleared() bool
- func (m *RoleMutation) RemovedEdges() []string
- func (m *RoleMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleMutation) ResetCreateTime()
- func (m *RoleMutation) ResetDeleteTime()
- func (m *RoleMutation) ResetDeletedTime()
- func (m *RoleMutation) ResetDisplayName()
- func (m *RoleMutation) ResetEdge(name string) error
- func (m *RoleMutation) ResetField(name string) error
- func (m *RoleMutation) ResetName()
- func (m *RoleMutation) ResetRemark()
- func (m *RoleMutation) ResetUpdateTime()
- func (m *RoleMutation) SetCreateTime(t time.Time)
- func (m *RoleMutation) SetDeleteTime(i int64)
- func (m *RoleMutation) SetDeletedTime(i int64)
- func (m *RoleMutation) SetDisplayName(s string)
- func (m *RoleMutation) SetField(name string, value ent.Value) error
- func (m *RoleMutation) SetID(id string)
- func (m *RoleMutation) SetName(s string)
- func (m *RoleMutation) SetOp(op Op)
- func (m *RoleMutation) SetRemark(s string)
- func (m *RoleMutation) SetUpdateTime(t time.Time)
- func (m RoleMutation) Tx() (*Tx, error)
- func (m *RoleMutation) Type() string
- func (m *RoleMutation) UpdateTime() (r time.Time, exists bool)
- 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 string, err error)
- func (rq *RoleQuery) FirstIDX(ctx context.Context) string
- 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 []string, err error)
- func (rq *RoleQuery) IDsX(ctx context.Context) []string
- 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 string, err error)
- func (rq *RoleQuery) OnlyIDX(ctx context.Context) string
- 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) AddDeleteTime(i int64) *RoleUpdate
- func (ru *RoleUpdate) AddDeletedTime(i int64) *RoleUpdate
- func (ru *RoleUpdate) ClearDisplayName() *RoleUpdate
- func (ru *RoleUpdate) ClearRemark() *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) SetDeleteTime(i int64) *RoleUpdate
- func (ru *RoleUpdate) SetDeletedTime(i int64) *RoleUpdate
- func (ru *RoleUpdate) SetDisplayName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableDeleteTime(i *int64) *RoleUpdate
- func (ru *RoleUpdate) SetNillableDeletedTime(i *int64) *RoleUpdate
- func (ru *RoleUpdate) SetNillableDisplayName(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableRemark(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetRemark(s string) *RoleUpdate
- func (ru *RoleUpdate) SetUpdateTime(t time.Time) *RoleUpdate
- func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
- type RoleUpdateOne
- func (ruo *RoleUpdateOne) AddDeleteTime(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddDeletedTime(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearDisplayName() *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearRemark() *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) SetDeleteTime(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetDeletedTime(i int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetDisplayName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableDeleteTime(i *int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableDeletedTime(i *int64) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableDisplayName(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableRemark(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetRemark(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUpdateTime(t time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne
- type Roles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- 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 string) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id string) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id string) *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) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id string) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type 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) SetAvatar(s string) *UserCreate
- func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate
- func (uc *UserCreate) SetDeleteTime(i int64) *UserCreate
- func (uc *UserCreate) SetDisplayName(s string) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetGender(s string) *UserCreate
- func (uc *UserCreate) SetID(s string) *UserCreate
- func (uc *UserCreate) SetName(s string) *UserCreate
- func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate
- func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableDeleteTime(i *int64) *UserCreate
- func (uc *UserCreate) SetNillableDisplayName(s *string) *UserCreate
- func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
- func (uc *UserCreate) SetNillableGender(s *string) *UserCreate
- func (uc *UserCreate) SetNillableID(s *string) *UserCreate
- func (uc *UserCreate) SetNillableName(s *string) *UserCreate
- func (uc *UserCreate) SetNillableNonLocked(i *int) *UserCreate
- func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate
- func (uc *UserCreate) SetNillablePhone(s *string) *UserCreate
- func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNonLocked(i int) *UserCreate
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetPhone(s string) *UserCreate
- func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- 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) AddDeleteTime(i int64)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddNonLocked(i int)
- func (m *UserMutation) AddedDeleteTime() (r int64, exists bool)
- 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) AddedNonLocked() (r int, exists bool)
- func (m *UserMutation) Avatar() (r string, exists bool)
- func (m *UserMutation) AvatarCleared() bool
- func (m *UserMutation) ClearAvatar()
- func (m *UserMutation) ClearDisplayName()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearEmail()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearGender()
- func (m *UserMutation) ClearName()
- func (m *UserMutation) ClearNonLocked()
- func (m *UserMutation) ClearPassword()
- func (m *UserMutation) ClearPhone()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreateTime() (r time.Time, exists bool)
- func (m *UserMutation) DeleteTime() (r int64, exists bool)
- func (m *UserMutation) DisplayName() (r string, exists bool)
- func (m *UserMutation) DisplayNameCleared() bool
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) EmailCleared() 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) Gender() (r string, exists bool)
- func (m *UserMutation) GenderCleared() bool
- func (m *UserMutation) ID() (id string, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]string, error)
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) NameCleared() bool
- func (m *UserMutation) NonLocked() (r int, exists bool)
- func (m *UserMutation) NonLockedCleared() bool
- func (m *UserMutation) OldAvatar(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
- func (m *UserMutation) OldDisplayName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldGender(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldNonLocked(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) PasswordCleared() bool
- func (m *UserMutation) Phone() (r string, exists bool)
- func (m *UserMutation) PhoneCleared() bool
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetAvatar()
- func (m *UserMutation) ResetCreateTime()
- func (m *UserMutation) ResetDeleteTime()
- func (m *UserMutation) ResetDisplayName()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetGender()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetNonLocked()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetPhone()
- func (m *UserMutation) ResetUpdateTime()
- func (m *UserMutation) SetAvatar(s string)
- func (m *UserMutation) SetCreateTime(t time.Time)
- func (m *UserMutation) SetDeleteTime(i int64)
- func (m *UserMutation) SetDisplayName(s string)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetGender(s string)
- func (m *UserMutation) SetID(id string)
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetNonLocked(i int)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetPhone(s string)
- func (m *UserMutation) SetUpdateTime(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdateTime() (r time.Time, exists bool)
- 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 string, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) string
- 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 []string, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []string
- 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 string, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) string
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *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 UserUpdate
- func (uu *UserUpdate) AddDeleteTime(i int64) *UserUpdate
- func (uu *UserUpdate) AddNonLocked(i int) *UserUpdate
- func (uu *UserUpdate) ClearAvatar() *UserUpdate
- func (uu *UserUpdate) ClearDisplayName() *UserUpdate
- func (uu *UserUpdate) ClearEmail() *UserUpdate
- func (uu *UserUpdate) ClearGender() *UserUpdate
- func (uu *UserUpdate) ClearName() *UserUpdate
- func (uu *UserUpdate) ClearNonLocked() *UserUpdate
- func (uu *UserUpdate) ClearPassword() *UserUpdate
- func (uu *UserUpdate) ClearPhone() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAvatar(s string) *UserUpdate
- func (uu *UserUpdate) SetDeleteTime(i int64) *UserUpdate
- func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetGender(s string) *UserUpdate
- func (uu *UserUpdate) SetName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableDeleteTime(i *int64) *UserUpdate
- func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableGender(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableNonLocked(i *int) *UserUpdate
- func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate
- func (uu *UserUpdate) SetNonLocked(i int) *UserUpdate
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetPhone(s string) *UserUpdate
- func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddDeleteTime(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) AddNonLocked(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearDisplayName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearGender() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearNonLocked() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- 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) SetAvatar(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetDeleteTime(i int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetGender(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDeleteTime(i *int64) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableGender(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableNonLocked(i *int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNonLocked(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeOrg = "Org" TypeRole = "Role" TypeRoleBinding = "RoleBinding" TypeUser = "User" )
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 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 Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Org is the client for interacting with the Org builders. Org *OrgClient // Role is the client for interacting with the Role builders. Role *RoleClient // RoleBinding is the client for interacting with the RoleBinding builders. RoleBinding *RoleBindingClient // User is the client for interacting with the User builders. User *UserClient // 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(). Org. 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 Org ¶
type Org struct { // ID of the ent. // ID ID string `json:"id,omitempty"` // delete time stamp DeleteTime int64 `json:"delete_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // 组织名称 Name string `json:"name,omitempty"` // 显示名称 DisplayName string `json:"display_name,omitempty"` // 描述 Description string `json:"description,omitempty"` // logo Logo string `json:"logo,omitempty"` // 状态 Status string `json:"status,omitempty"` // 类型 Type string `json:"type,omitempty"` // contains filtered or unexported fields }
Org is the model entity for the Org schema.
func (*Org) Unwrap ¶
Unwrap unwraps the Org 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 (*Org) Update ¶
func (o *Org) Update() *OrgUpdateOne
Update returns a builder for updating this Org. Note that you need to call Org.Unwrap() before calling this method if this Org was returned from a transaction, and the transaction was committed or rolled back.
type OrgClient ¶
type OrgClient struct {
// contains filtered or unexported fields
}
OrgClient is a client for the Org schema.
func NewOrgClient ¶
func NewOrgClient(c config) *OrgClient
NewOrgClient returns a client for the Org from the given config.
func (*OrgClient) CreateBulk ¶
func (c *OrgClient) CreateBulk(builders ...*OrgCreate) *OrgCreateBulk
CreateBulk returns a builder for creating a bulk of Org entities.
func (*OrgClient) DeleteOne ¶
func (c *OrgClient) DeleteOne(o *Org) *OrgDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OrgClient) DeleteOneID ¶
func (c *OrgClient) DeleteOneID(id string) *OrgDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OrgClient) Intercept ¶
func (c *OrgClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `org.Intercept(f(g(h())))`.
func (*OrgClient) Interceptors ¶
func (c *OrgClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OrgClient) MapCreateBulk ¶
func (c *OrgClient) MapCreateBulk(slice any, setFunc func(*OrgCreate, int)) *OrgCreateBulk
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 (*OrgClient) UpdateOne ¶
func (c *OrgClient) UpdateOne(o *Org) *OrgUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OrgClient) UpdateOneID ¶
func (c *OrgClient) UpdateOneID(id string) *OrgUpdateOne
UpdateOneID returns an update builder for the given id.
type OrgCreate ¶
type OrgCreate struct {
// contains filtered or unexported fields
}
OrgCreate is the builder for creating a Org entity.
func (*OrgCreate) Mutation ¶
func (oc *OrgCreate) Mutation() *OrgMutation
Mutation returns the OrgMutation object of the builder.
func (*OrgCreate) SetCreateTime ¶
SetCreateTime sets the "create_time" field.
func (*OrgCreate) SetDeleteTime ¶
SetDeleteTime sets the "delete_time" field.
func (*OrgCreate) SetDescription ¶
SetDescription sets the "description" field.
func (*OrgCreate) SetDisplayName ¶
SetDisplayName sets the "display_name" field.
func (*OrgCreate) SetNillableCreateTime ¶
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*OrgCreate) SetNillableDeleteTime ¶
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*OrgCreate) SetNillableDescription ¶
SetNillableDescription sets the "description" field if the given value is not nil.
func (*OrgCreate) SetNillableDisplayName ¶
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*OrgCreate) SetNillableID ¶
SetNillableID sets the "id" field if the given value is not nil.
func (*OrgCreate) SetNillableUpdateTime ¶
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
type OrgCreateBulk ¶
type OrgCreateBulk struct {
// contains filtered or unexported fields
}
OrgCreateBulk is the builder for creating many Org entities in bulk.
func (*OrgCreateBulk) Exec ¶
func (ocb *OrgCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrgCreateBulk) ExecX ¶
func (ocb *OrgCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type OrgDelete ¶
type OrgDelete struct {
// contains filtered or unexported fields
}
OrgDelete is the builder for deleting a Org entity.
func (*OrgDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type OrgDeleteOne ¶
type OrgDeleteOne struct {
// contains filtered or unexported fields
}
OrgDeleteOne is the builder for deleting a single Org entity.
func (*OrgDeleteOne) Exec ¶
func (odo *OrgDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OrgDeleteOne) ExecX ¶
func (odo *OrgDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgDeleteOne) Where ¶
func (odo *OrgDeleteOne) Where(ps ...predicate.Org) *OrgDeleteOne
Where appends a list predicates to the OrgDelete builder.
type OrgGroupBy ¶
type OrgGroupBy struct {
// contains filtered or unexported fields
}
OrgGroupBy is the group-by builder for Org entities.
func (*OrgGroupBy) Aggregate ¶
func (ogb *OrgGroupBy) Aggregate(fns ...AggregateFunc) *OrgGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OrgGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Scan ¶
func (ogb *OrgGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrgGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrgMutation ¶
type OrgMutation struct {
// contains filtered or unexported fields
}
OrgMutation represents an operation that mutates the Org nodes in the graph.
func (*OrgMutation) AddDeleteTime ¶
func (m *OrgMutation) AddDeleteTime(i int64)
AddDeleteTime adds i to the "delete_time" field.
func (*OrgMutation) AddField ¶
func (m *OrgMutation) 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 (*OrgMutation) AddedDeleteTime ¶
func (m *OrgMutation) AddedDeleteTime() (r int64, exists bool)
AddedDeleteTime returns the value that was added to the "delete_time" field in this mutation.
func (*OrgMutation) AddedEdges ¶
func (m *OrgMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OrgMutation) AddedField ¶
func (m *OrgMutation) 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 (*OrgMutation) AddedFields ¶
func (m *OrgMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OrgMutation) AddedIDs ¶
func (m *OrgMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OrgMutation) ClearDescription ¶
func (m *OrgMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*OrgMutation) ClearDisplayName ¶
func (m *OrgMutation) ClearDisplayName()
ClearDisplayName clears the value of the "display_name" field.
func (*OrgMutation) ClearEdge ¶
func (m *OrgMutation) 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 (*OrgMutation) ClearField ¶
func (m *OrgMutation) 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 (*OrgMutation) ClearedEdges ¶
func (m *OrgMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OrgMutation) ClearedFields ¶
func (m *OrgMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OrgMutation) Client ¶
func (m OrgMutation) 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 (*OrgMutation) CreateTime ¶
func (m *OrgMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*OrgMutation) DeleteTime ¶
func (m *OrgMutation) DeleteTime() (r int64, exists bool)
DeleteTime returns the value of the "delete_time" field in the mutation.
func (*OrgMutation) Description ¶
func (m *OrgMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*OrgMutation) DescriptionCleared ¶
func (m *OrgMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*OrgMutation) DisplayName ¶
func (m *OrgMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*OrgMutation) DisplayNameCleared ¶
func (m *OrgMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "display_name" field was cleared in this mutation.
func (*OrgMutation) EdgeCleared ¶
func (m *OrgMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OrgMutation) Field ¶
func (m *OrgMutation) 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 (*OrgMutation) FieldCleared ¶
func (m *OrgMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OrgMutation) Fields ¶
func (m *OrgMutation) 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 (*OrgMutation) GetType ¶
func (m *OrgMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*OrgMutation) ID ¶
func (m *OrgMutation) ID() (id string, 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 (*OrgMutation) IDs ¶
func (m *OrgMutation) IDs(ctx context.Context) ([]string, 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 (*OrgMutation) Logo ¶
func (m *OrgMutation) Logo() (r string, exists bool)
Logo returns the value of the "logo" field in the mutation.
func (*OrgMutation) Name ¶
func (m *OrgMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*OrgMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the Org entity. If the Org 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 (*OrgMutation) OldDeleteTime ¶
func (m *OrgMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
OldDeleteTime returns the old "delete_time" field's value of the Org entity. If the Org 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 (*OrgMutation) OldDescription ¶
func (m *OrgMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Org entity. If the Org 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 (*OrgMutation) OldDisplayName ¶
func (m *OrgMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_name" field's value of the Org entity. If the Org 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 (*OrgMutation) 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 (*OrgMutation) OldLogo ¶
func (m *OrgMutation) OldLogo(ctx context.Context) (v string, err error)
OldLogo returns the old "logo" field's value of the Org entity. If the Org 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 (*OrgMutation) OldName ¶
func (m *OrgMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Org entity. If the Org 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 (*OrgMutation) OldStatus ¶
func (m *OrgMutation) OldStatus(ctx context.Context) (v string, err error)
OldStatus returns the old "status" field's value of the Org entity. If the Org 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 (*OrgMutation) OldType ¶
func (m *OrgMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the Org entity. If the Org 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 (*OrgMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the Org entity. If the Org 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 (*OrgMutation) RemovedEdges ¶
func (m *OrgMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OrgMutation) RemovedIDs ¶
func (m *OrgMutation) 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 (*OrgMutation) ResetCreateTime ¶
func (m *OrgMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*OrgMutation) ResetDeleteTime ¶
func (m *OrgMutation) ResetDeleteTime()
ResetDeleteTime resets all changes to the "delete_time" field.
func (*OrgMutation) ResetDescription ¶
func (m *OrgMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*OrgMutation) ResetDisplayName ¶
func (m *OrgMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" field.
func (*OrgMutation) ResetEdge ¶
func (m *OrgMutation) 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 (*OrgMutation) ResetField ¶
func (m *OrgMutation) 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 (*OrgMutation) ResetLogo ¶
func (m *OrgMutation) ResetLogo()
ResetLogo resets all changes to the "logo" field.
func (*OrgMutation) ResetName ¶
func (m *OrgMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*OrgMutation) ResetStatus ¶
func (m *OrgMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*OrgMutation) ResetType ¶
func (m *OrgMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*OrgMutation) ResetUpdateTime ¶
func (m *OrgMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*OrgMutation) SetCreateTime ¶
func (m *OrgMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*OrgMutation) SetDeleteTime ¶
func (m *OrgMutation) SetDeleteTime(i int64)
SetDeleteTime sets the "delete_time" field.
func (*OrgMutation) SetDescription ¶
func (m *OrgMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*OrgMutation) SetDisplayName ¶
func (m *OrgMutation) SetDisplayName(s string)
SetDisplayName sets the "display_name" field.
func (*OrgMutation) SetField ¶
func (m *OrgMutation) 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 (*OrgMutation) SetID ¶
func (m *OrgMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Org entities.
func (*OrgMutation) SetLogo ¶
func (m *OrgMutation) SetLogo(s string)
SetLogo sets the "logo" field.
func (*OrgMutation) SetName ¶
func (m *OrgMutation) SetName(s string)
SetName sets the "name" field.
func (*OrgMutation) SetOp ¶
func (m *OrgMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OrgMutation) SetStatus ¶
func (m *OrgMutation) SetStatus(s string)
SetStatus sets the "status" field.
func (*OrgMutation) SetType ¶
func (m *OrgMutation) SetType(s string)
SetType sets the "type" field.
func (*OrgMutation) SetUpdateTime ¶
func (m *OrgMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*OrgMutation) Status ¶
func (m *OrgMutation) Status() (r string, exists bool)
Status returns the value of the "status" field in the mutation.
func (OrgMutation) Tx ¶
func (m OrgMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OrgMutation) Type ¶
func (m *OrgMutation) Type() string
Type returns the node type of this mutation (Org).
func (*OrgMutation) UpdateTime ¶
func (m *OrgMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*OrgMutation) Where ¶
func (m *OrgMutation) Where(ps ...predicate.Org)
Where appends a list predicates to the OrgMutation builder.
func (*OrgMutation) WhereP ¶
func (m *OrgMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OrgMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OrgQuery ¶
type OrgQuery struct {
// contains filtered or unexported fields
}
OrgQuery is the builder for querying Org entities.
func (*OrgQuery) Aggregate ¶
func (oq *OrgQuery) Aggregate(fns ...AggregateFunc) *OrgSelect
Aggregate returns a OrgSelect configured with the given aggregations.
func (*OrgQuery) Clone ¶
Clone returns a duplicate of the OrgQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OrgQuery) First ¶
First returns the first Org entity from the query. Returns a *NotFoundError when no Org was found.
func (*OrgQuery) FirstID ¶
FirstID returns the first Org ID from the query. Returns a *NotFoundError when no Org ID was found.
func (*OrgQuery) GroupBy ¶
func (oq *OrgQuery) GroupBy(field string, fields ...string) *OrgGroupBy
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 { DeleteTime int64 `json:"delete_time,omitempty"` Count int `json:"count,omitempty"` } client.Org.Query(). GroupBy(org.FieldDeleteTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*OrgQuery) Only ¶
Only returns a single Org entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Org entity is found. Returns a *NotFoundError when no Org entities are found.
func (*OrgQuery) OnlyID ¶
OnlyID is like Only, but returns the only Org ID in the query. Returns a *NotSingularError when more than one Org ID is found. Returns a *NotFoundError when no entities are found.
func (*OrgQuery) Order ¶
func (oq *OrgQuery) Order(o ...org.OrderOption) *OrgQuery
Order specifies how the records should be ordered.
func (*OrgQuery) Select ¶
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 { DeleteTime int64 `json:"delete_time,omitempty"` } client.Org.Query(). Select(org.FieldDeleteTime). Scan(ctx, &v)
type OrgSelect ¶
type OrgSelect struct { *OrgQuery // contains filtered or unexported fields }
OrgSelect is the builder for selecting fields of Org entities.
func (*OrgSelect) Aggregate ¶
func (os *OrgSelect) Aggregate(fns ...AggregateFunc) *OrgSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OrgSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrgSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrgUpdate ¶
type OrgUpdate struct {
// contains filtered or unexported fields
}
OrgUpdate is the builder for updating Org entities.
func (*OrgUpdate) AddDeleteTime ¶
AddDeleteTime adds i to the "delete_time" field.
func (*OrgUpdate) ClearDescription ¶
ClearDescription clears the value of the "description" field.
func (*OrgUpdate) ClearDisplayName ¶
ClearDisplayName clears the value of the "display_name" field.
func (*OrgUpdate) Mutation ¶
func (ou *OrgUpdate) Mutation() *OrgMutation
Mutation returns the OrgMutation object of the builder.
func (*OrgUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*OrgUpdate) SetDeleteTime ¶
SetDeleteTime sets the "delete_time" field.
func (*OrgUpdate) SetDescription ¶
SetDescription sets the "description" field.
func (*OrgUpdate) SetDisplayName ¶
SetDisplayName sets the "display_name" field.
func (*OrgUpdate) SetNillableDeleteTime ¶
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*OrgUpdate) SetNillableDescription ¶
SetNillableDescription sets the "description" field if the given value is not nil.
func (*OrgUpdate) SetNillableDisplayName ¶
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*OrgUpdate) SetNillableLogo ¶
SetNillableLogo sets the "logo" field if the given value is not nil.
func (*OrgUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*OrgUpdate) SetNillableStatus ¶
SetNillableStatus sets the "status" field if the given value is not nil.
func (*OrgUpdate) SetNillableType ¶
SetNillableType sets the "type" field if the given value is not nil.
func (*OrgUpdate) SetUpdateTime ¶
SetUpdateTime sets the "update_time" field.
type OrgUpdateOne ¶
type OrgUpdateOne struct {
// contains filtered or unexported fields
}
OrgUpdateOne is the builder for updating a single Org entity.
func (*OrgUpdateOne) AddDeleteTime ¶
func (ouo *OrgUpdateOne) AddDeleteTime(i int64) *OrgUpdateOne
AddDeleteTime adds i to the "delete_time" field.
func (*OrgUpdateOne) ClearDescription ¶
func (ouo *OrgUpdateOne) ClearDescription() *OrgUpdateOne
ClearDescription clears the value of the "description" field.
func (*OrgUpdateOne) ClearDisplayName ¶
func (ouo *OrgUpdateOne) ClearDisplayName() *OrgUpdateOne
ClearDisplayName clears the value of the "display_name" field.
func (*OrgUpdateOne) Exec ¶
func (ouo *OrgUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OrgUpdateOne) ExecX ¶
func (ouo *OrgUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgUpdateOne) Mutation ¶
func (ouo *OrgUpdateOne) Mutation() *OrgMutation
Mutation returns the OrgMutation object of the builder.
func (*OrgUpdateOne) Save ¶
func (ouo *OrgUpdateOne) Save(ctx context.Context) (*Org, error)
Save executes the query and returns the updated Org entity.
func (*OrgUpdateOne) SaveX ¶
func (ouo *OrgUpdateOne) SaveX(ctx context.Context) *Org
SaveX is like Save, but panics if an error occurs.
func (*OrgUpdateOne) Select ¶
func (ouo *OrgUpdateOne) Select(field string, fields ...string) *OrgUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OrgUpdateOne) SetDeleteTime ¶
func (ouo *OrgUpdateOne) SetDeleteTime(i int64) *OrgUpdateOne
SetDeleteTime sets the "delete_time" field.
func (*OrgUpdateOne) SetDescription ¶
func (ouo *OrgUpdateOne) SetDescription(s string) *OrgUpdateOne
SetDescription sets the "description" field.
func (*OrgUpdateOne) SetDisplayName ¶
func (ouo *OrgUpdateOne) SetDisplayName(s string) *OrgUpdateOne
SetDisplayName sets the "display_name" field.
func (*OrgUpdateOne) SetLogo ¶
func (ouo *OrgUpdateOne) SetLogo(s string) *OrgUpdateOne
SetLogo sets the "logo" field.
func (*OrgUpdateOne) SetName ¶
func (ouo *OrgUpdateOne) SetName(s string) *OrgUpdateOne
SetName sets the "name" field.
func (*OrgUpdateOne) SetNillableDeleteTime ¶
func (ouo *OrgUpdateOne) SetNillableDeleteTime(i *int64) *OrgUpdateOne
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableDescription ¶
func (ouo *OrgUpdateOne) SetNillableDescription(s *string) *OrgUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableDisplayName ¶
func (ouo *OrgUpdateOne) SetNillableDisplayName(s *string) *OrgUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableLogo ¶
func (ouo *OrgUpdateOne) SetNillableLogo(s *string) *OrgUpdateOne
SetNillableLogo sets the "logo" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableName ¶
func (ouo *OrgUpdateOne) SetNillableName(s *string) *OrgUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableStatus ¶
func (ouo *OrgUpdateOne) SetNillableStatus(s *string) *OrgUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableType ¶
func (ouo *OrgUpdateOne) SetNillableType(s *string) *OrgUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*OrgUpdateOne) SetStatus ¶
func (ouo *OrgUpdateOne) SetStatus(s string) *OrgUpdateOne
SetStatus sets the "status" field.
func (*OrgUpdateOne) SetType ¶
func (ouo *OrgUpdateOne) SetType(s string) *OrgUpdateOne
SetType sets the "type" field.
func (*OrgUpdateOne) SetUpdateTime ¶
func (ouo *OrgUpdateOne) SetUpdateTime(t time.Time) *OrgUpdateOne
SetUpdateTime sets the "update_time" field.
func (*OrgUpdateOne) Where ¶
func (ouo *OrgUpdateOne) Where(ps ...predicate.Org) *OrgUpdateOne
Where appends a list predicates to the OrgUpdate builder.
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 ID string `json:"id,omitempty"` // delete time stamp DeleteTime int64 `json:"delete_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // 角色名称 Name string `json:"name,omitempty"` // 角色显示名称 DisplayName string `json:"display_name,omitempty"` // 角色描述 Remark string `json:"remark,omitempty"` // 删除标志(0代表存在) DeletedTime int64 `json:"deleted_time,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 RoleBinding ¶
type RoleBinding struct { // ID of the ent. // ID ID string `json:"id,omitempty"` // delete time stamp DeleteTime int64 `json:"delete_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // 角色名称 Name string `json:"name,omitempty"` // 角色显示名称 DisplayName string `json:"display_name,omitempty"` // 角色名称 RoleName string `json:"role_name,omitempty"` // 用户名称 UserID string `json:"user_id,omitempty"` // 删除标志(0代表存在) DeletedTime int64 `json:"deleted_time,omitempty"` // contains filtered or unexported fields }
RoleBinding is the model entity for the RoleBinding schema.
func (*RoleBinding) String ¶
func (rb *RoleBinding) String() string
String implements the fmt.Stringer.
func (*RoleBinding) Unwrap ¶
func (rb *RoleBinding) Unwrap() *RoleBinding
Unwrap unwraps the RoleBinding 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 (*RoleBinding) Update ¶
func (rb *RoleBinding) Update() *RoleBindingUpdateOne
Update returns a builder for updating this RoleBinding. Note that you need to call RoleBinding.Unwrap() before calling this method if this RoleBinding was returned from a transaction, and the transaction was committed or rolled back.
type RoleBindingClient ¶
type RoleBindingClient struct {
// contains filtered or unexported fields
}
RoleBindingClient is a client for the RoleBinding schema.
func NewRoleBindingClient ¶
func NewRoleBindingClient(c config) *RoleBindingClient
NewRoleBindingClient returns a client for the RoleBinding from the given config.
func (*RoleBindingClient) Create ¶
func (c *RoleBindingClient) Create() *RoleBindingCreate
Create returns a builder for creating a RoleBinding entity.
func (*RoleBindingClient) CreateBulk ¶
func (c *RoleBindingClient) CreateBulk(builders ...*RoleBindingCreate) *RoleBindingCreateBulk
CreateBulk returns a builder for creating a bulk of RoleBinding entities.
func (*RoleBindingClient) Delete ¶
func (c *RoleBindingClient) Delete() *RoleBindingDelete
Delete returns a delete builder for RoleBinding.
func (*RoleBindingClient) DeleteOne ¶
func (c *RoleBindingClient) DeleteOne(rb *RoleBinding) *RoleBindingDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RoleBindingClient) DeleteOneID ¶
func (c *RoleBindingClient) DeleteOneID(id string) *RoleBindingDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RoleBindingClient) Get ¶
func (c *RoleBindingClient) Get(ctx context.Context, id string) (*RoleBinding, error)
Get returns a RoleBinding entity by its id.
func (*RoleBindingClient) GetX ¶
func (c *RoleBindingClient) GetX(ctx context.Context, id string) *RoleBinding
GetX is like Get, but panics if an error occurs.
func (*RoleBindingClient) Hooks ¶
func (c *RoleBindingClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RoleBindingClient) Intercept ¶
func (c *RoleBindingClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `rolebinding.Intercept(f(g(h())))`.
func (*RoleBindingClient) Interceptors ¶
func (c *RoleBindingClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RoleBindingClient) MapCreateBulk ¶
func (c *RoleBindingClient) MapCreateBulk(slice any, setFunc func(*RoleBindingCreate, int)) *RoleBindingCreateBulk
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 (*RoleBindingClient) Query ¶
func (c *RoleBindingClient) Query() *RoleBindingQuery
Query returns a query builder for RoleBinding.
func (*RoleBindingClient) Update ¶
func (c *RoleBindingClient) Update() *RoleBindingUpdate
Update returns an update builder for RoleBinding.
func (*RoleBindingClient) UpdateOne ¶
func (c *RoleBindingClient) UpdateOne(rb *RoleBinding) *RoleBindingUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RoleBindingClient) UpdateOneID ¶
func (c *RoleBindingClient) UpdateOneID(id string) *RoleBindingUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RoleBindingClient) Use ¶
func (c *RoleBindingClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rolebinding.Hooks(f(g(h())))`.
type RoleBindingCreate ¶
type RoleBindingCreate struct {
// contains filtered or unexported fields
}
RoleBindingCreate is the builder for creating a RoleBinding entity.
func (*RoleBindingCreate) Exec ¶
func (rbc *RoleBindingCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleBindingCreate) ExecX ¶
func (rbc *RoleBindingCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleBindingCreate) Mutation ¶
func (rbc *RoleBindingCreate) Mutation() *RoleBindingMutation
Mutation returns the RoleBindingMutation object of the builder.
func (*RoleBindingCreate) Save ¶
func (rbc *RoleBindingCreate) Save(ctx context.Context) (*RoleBinding, error)
Save creates the RoleBinding in the database.
func (*RoleBindingCreate) SaveX ¶
func (rbc *RoleBindingCreate) SaveX(ctx context.Context) *RoleBinding
SaveX calls Save and panics if Save returns an error.
func (*RoleBindingCreate) SetCreateTime ¶
func (rbc *RoleBindingCreate) SetCreateTime(t time.Time) *RoleBindingCreate
SetCreateTime sets the "create_time" field.
func (*RoleBindingCreate) SetDeleteTime ¶
func (rbc *RoleBindingCreate) SetDeleteTime(i int64) *RoleBindingCreate
SetDeleteTime sets the "delete_time" field.
func (*RoleBindingCreate) SetDeletedTime ¶
func (rbc *RoleBindingCreate) SetDeletedTime(i int64) *RoleBindingCreate
SetDeletedTime sets the "deleted_time" field.
func (*RoleBindingCreate) SetDisplayName ¶
func (rbc *RoleBindingCreate) SetDisplayName(s string) *RoleBindingCreate
SetDisplayName sets the "display_name" field.
func (*RoleBindingCreate) SetID ¶
func (rbc *RoleBindingCreate) SetID(s string) *RoleBindingCreate
SetID sets the "id" field.
func (*RoleBindingCreate) SetName ¶
func (rbc *RoleBindingCreate) SetName(s string) *RoleBindingCreate
SetName sets the "name" field.
func (*RoleBindingCreate) SetNillableCreateTime ¶
func (rbc *RoleBindingCreate) SetNillableCreateTime(t *time.Time) *RoleBindingCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*RoleBindingCreate) SetNillableDeleteTime ¶
func (rbc *RoleBindingCreate) SetNillableDeleteTime(i *int64) *RoleBindingCreate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*RoleBindingCreate) SetNillableDeletedTime ¶
func (rbc *RoleBindingCreate) SetNillableDeletedTime(i *int64) *RoleBindingCreate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*RoleBindingCreate) SetNillableDisplayName ¶
func (rbc *RoleBindingCreate) SetNillableDisplayName(s *string) *RoleBindingCreate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*RoleBindingCreate) SetNillableID ¶
func (rbc *RoleBindingCreate) SetNillableID(s *string) *RoleBindingCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*RoleBindingCreate) SetNillableUpdateTime ¶
func (rbc *RoleBindingCreate) SetNillableUpdateTime(t *time.Time) *RoleBindingCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*RoleBindingCreate) SetRoleName ¶
func (rbc *RoleBindingCreate) SetRoleName(s string) *RoleBindingCreate
SetRoleName sets the "role_name" field.
func (*RoleBindingCreate) SetUpdateTime ¶
func (rbc *RoleBindingCreate) SetUpdateTime(t time.Time) *RoleBindingCreate
SetUpdateTime sets the "update_time" field.
func (*RoleBindingCreate) SetUserID ¶
func (rbc *RoleBindingCreate) SetUserID(s string) *RoleBindingCreate
SetUserID sets the "user_id" field.
type RoleBindingCreateBulk ¶
type RoleBindingCreateBulk struct {
// contains filtered or unexported fields
}
RoleBindingCreateBulk is the builder for creating many RoleBinding entities in bulk.
func (*RoleBindingCreateBulk) Exec ¶
func (rbcb *RoleBindingCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleBindingCreateBulk) ExecX ¶
func (rbcb *RoleBindingCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleBindingCreateBulk) Save ¶
func (rbcb *RoleBindingCreateBulk) Save(ctx context.Context) ([]*RoleBinding, error)
Save creates the RoleBinding entities in the database.
func (*RoleBindingCreateBulk) SaveX ¶
func (rbcb *RoleBindingCreateBulk) SaveX(ctx context.Context) []*RoleBinding
SaveX is like Save, but panics if an error occurs.
type RoleBindingDelete ¶
type RoleBindingDelete struct {
// contains filtered or unexported fields
}
RoleBindingDelete is the builder for deleting a RoleBinding entity.
func (*RoleBindingDelete) Exec ¶
func (rbd *RoleBindingDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RoleBindingDelete) ExecX ¶
func (rbd *RoleBindingDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RoleBindingDelete) Where ¶
func (rbd *RoleBindingDelete) Where(ps ...predicate.RoleBinding) *RoleBindingDelete
Where appends a list predicates to the RoleBindingDelete builder.
type RoleBindingDeleteOne ¶
type RoleBindingDeleteOne struct {
// contains filtered or unexported fields
}
RoleBindingDeleteOne is the builder for deleting a single RoleBinding entity.
func (*RoleBindingDeleteOne) Exec ¶
func (rbdo *RoleBindingDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RoleBindingDeleteOne) ExecX ¶
func (rbdo *RoleBindingDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleBindingDeleteOne) Where ¶
func (rbdo *RoleBindingDeleteOne) Where(ps ...predicate.RoleBinding) *RoleBindingDeleteOne
Where appends a list predicates to the RoleBindingDelete builder.
type RoleBindingGroupBy ¶
type RoleBindingGroupBy struct {
// contains filtered or unexported fields
}
RoleBindingGroupBy is the group-by builder for RoleBinding entities.
func (*RoleBindingGroupBy) Aggregate ¶
func (rbgb *RoleBindingGroupBy) Aggregate(fns ...AggregateFunc) *RoleBindingGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RoleBindingGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleBindingGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleBindingGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleBindingGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleBindingGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleBindingGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleBindingGroupBy) Scan ¶
func (rbgb *RoleBindingGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RoleBindingGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RoleBindingMutation ¶
type RoleBindingMutation struct {
// contains filtered or unexported fields
}
RoleBindingMutation represents an operation that mutates the RoleBinding nodes in the graph.
func (*RoleBindingMutation) AddDeleteTime ¶
func (m *RoleBindingMutation) AddDeleteTime(i int64)
AddDeleteTime adds i to the "delete_time" field.
func (*RoleBindingMutation) AddDeletedTime ¶
func (m *RoleBindingMutation) AddDeletedTime(i int64)
AddDeletedTime adds i to the "deleted_time" field.
func (*RoleBindingMutation) AddField ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) AddedDeleteTime ¶
func (m *RoleBindingMutation) AddedDeleteTime() (r int64, exists bool)
AddedDeleteTime returns the value that was added to the "delete_time" field in this mutation.
func (*RoleBindingMutation) AddedDeletedTime ¶
func (m *RoleBindingMutation) AddedDeletedTime() (r int64, exists bool)
AddedDeletedTime returns the value that was added to the "deleted_time" field in this mutation.
func (*RoleBindingMutation) AddedEdges ¶
func (m *RoleBindingMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RoleBindingMutation) AddedField ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) AddedFields ¶
func (m *RoleBindingMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RoleBindingMutation) AddedIDs ¶
func (m *RoleBindingMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RoleBindingMutation) ClearDeletedTime ¶
func (m *RoleBindingMutation) ClearDeletedTime()
ClearDeletedTime clears the value of the "deleted_time" field.
func (*RoleBindingMutation) ClearDisplayName ¶
func (m *RoleBindingMutation) ClearDisplayName()
ClearDisplayName clears the value of the "display_name" field.
func (*RoleBindingMutation) ClearEdge ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) ClearField ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) ClearedEdges ¶
func (m *RoleBindingMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RoleBindingMutation) ClearedFields ¶
func (m *RoleBindingMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RoleBindingMutation) Client ¶
func (m RoleBindingMutation) 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 (*RoleBindingMutation) CreateTime ¶
func (m *RoleBindingMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*RoleBindingMutation) DeleteTime ¶
func (m *RoleBindingMutation) DeleteTime() (r int64, exists bool)
DeleteTime returns the value of the "delete_time" field in the mutation.
func (*RoleBindingMutation) DeletedTime ¶
func (m *RoleBindingMutation) DeletedTime() (r int64, exists bool)
DeletedTime returns the value of the "deleted_time" field in the mutation.
func (*RoleBindingMutation) DeletedTimeCleared ¶
func (m *RoleBindingMutation) DeletedTimeCleared() bool
DeletedTimeCleared returns if the "deleted_time" field was cleared in this mutation.
func (*RoleBindingMutation) DisplayName ¶
func (m *RoleBindingMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*RoleBindingMutation) DisplayNameCleared ¶
func (m *RoleBindingMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "display_name" field was cleared in this mutation.
func (*RoleBindingMutation) EdgeCleared ¶
func (m *RoleBindingMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RoleBindingMutation) Field ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) FieldCleared ¶
func (m *RoleBindingMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RoleBindingMutation) Fields ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) ID ¶
func (m *RoleBindingMutation) ID() (id string, 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 (*RoleBindingMutation) IDs ¶
func (m *RoleBindingMutation) IDs(ctx context.Context) ([]string, 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 (*RoleBindingMutation) Name ¶
func (m *RoleBindingMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RoleBindingMutation) OldCreateTime ¶
OldCreateTime returns the old "create_time" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) OldDeleteTime ¶
func (m *RoleBindingMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
OldDeleteTime returns the old "delete_time" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) OldDeletedTime ¶
func (m *RoleBindingMutation) OldDeletedTime(ctx context.Context) (v int64, err error)
OldDeletedTime returns the old "deleted_time" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) OldDisplayName ¶
func (m *RoleBindingMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_name" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) 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 (*RoleBindingMutation) OldName ¶
func (m *RoleBindingMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) OldRoleName ¶
func (m *RoleBindingMutation) OldRoleName(ctx context.Context) (v string, err error)
OldRoleName returns the old "role_name" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) OldUserID ¶
func (m *RoleBindingMutation) OldUserID(ctx context.Context) (v string, err error)
OldUserID returns the old "user_id" field's value of the RoleBinding entity. If the RoleBinding 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 (*RoleBindingMutation) Op ¶
func (m *RoleBindingMutation) Op() Op
Op returns the operation name.
func (*RoleBindingMutation) RemovedEdges ¶
func (m *RoleBindingMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RoleBindingMutation) RemovedIDs ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) ResetCreateTime ¶
func (m *RoleBindingMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*RoleBindingMutation) ResetDeleteTime ¶
func (m *RoleBindingMutation) ResetDeleteTime()
ResetDeleteTime resets all changes to the "delete_time" field.
func (*RoleBindingMutation) ResetDeletedTime ¶
func (m *RoleBindingMutation) ResetDeletedTime()
ResetDeletedTime resets all changes to the "deleted_time" field.
func (*RoleBindingMutation) ResetDisplayName ¶
func (m *RoleBindingMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" field.
func (*RoleBindingMutation) ResetEdge ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) ResetField ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) ResetName ¶
func (m *RoleBindingMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RoleBindingMutation) ResetRoleName ¶
func (m *RoleBindingMutation) ResetRoleName()
ResetRoleName resets all changes to the "role_name" field.
func (*RoleBindingMutation) ResetUpdateTime ¶
func (m *RoleBindingMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*RoleBindingMutation) ResetUserID ¶
func (m *RoleBindingMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*RoleBindingMutation) RoleName ¶
func (m *RoleBindingMutation) RoleName() (r string, exists bool)
RoleName returns the value of the "role_name" field in the mutation.
func (*RoleBindingMutation) SetCreateTime ¶
func (m *RoleBindingMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*RoleBindingMutation) SetDeleteTime ¶
func (m *RoleBindingMutation) SetDeleteTime(i int64)
SetDeleteTime sets the "delete_time" field.
func (*RoleBindingMutation) SetDeletedTime ¶
func (m *RoleBindingMutation) SetDeletedTime(i int64)
SetDeletedTime sets the "deleted_time" field.
func (*RoleBindingMutation) SetDisplayName ¶
func (m *RoleBindingMutation) SetDisplayName(s string)
SetDisplayName sets the "display_name" field.
func (*RoleBindingMutation) SetField ¶
func (m *RoleBindingMutation) 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 (*RoleBindingMutation) SetID ¶
func (m *RoleBindingMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of RoleBinding entities.
func (*RoleBindingMutation) SetName ¶
func (m *RoleBindingMutation) SetName(s string)
SetName sets the "name" field.
func (*RoleBindingMutation) SetOp ¶
func (m *RoleBindingMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RoleBindingMutation) SetRoleName ¶
func (m *RoleBindingMutation) SetRoleName(s string)
SetRoleName sets the "role_name" field.
func (*RoleBindingMutation) SetUpdateTime ¶
func (m *RoleBindingMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
func (*RoleBindingMutation) SetUserID ¶
func (m *RoleBindingMutation) SetUserID(s string)
SetUserID sets the "user_id" field.
func (RoleBindingMutation) Tx ¶
func (m RoleBindingMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RoleBindingMutation) Type ¶
func (m *RoleBindingMutation) Type() string
Type returns the node type of this mutation (RoleBinding).
func (*RoleBindingMutation) UpdateTime ¶
func (m *RoleBindingMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
func (*RoleBindingMutation) UserID ¶
func (m *RoleBindingMutation) UserID() (r string, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*RoleBindingMutation) Where ¶
func (m *RoleBindingMutation) Where(ps ...predicate.RoleBinding)
Where appends a list predicates to the RoleBindingMutation builder.
func (*RoleBindingMutation) WhereP ¶
func (m *RoleBindingMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RoleBindingMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RoleBindingQuery ¶
type RoleBindingQuery struct {
// contains filtered or unexported fields
}
RoleBindingQuery is the builder for querying RoleBinding entities.
func (*RoleBindingQuery) Aggregate ¶
func (rbq *RoleBindingQuery) Aggregate(fns ...AggregateFunc) *RoleBindingSelect
Aggregate returns a RoleBindingSelect configured with the given aggregations.
func (*RoleBindingQuery) All ¶
func (rbq *RoleBindingQuery) All(ctx context.Context) ([]*RoleBinding, error)
All executes the query and returns a list of RoleBindings.
func (*RoleBindingQuery) AllX ¶
func (rbq *RoleBindingQuery) AllX(ctx context.Context) []*RoleBinding
AllX is like All, but panics if an error occurs.
func (*RoleBindingQuery) Clone ¶
func (rbq *RoleBindingQuery) Clone() *RoleBindingQuery
Clone returns a duplicate of the RoleBindingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RoleBindingQuery) Count ¶
func (rbq *RoleBindingQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RoleBindingQuery) CountX ¶
func (rbq *RoleBindingQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RoleBindingQuery) Exist ¶
func (rbq *RoleBindingQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RoleBindingQuery) ExistX ¶
func (rbq *RoleBindingQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RoleBindingQuery) First ¶
func (rbq *RoleBindingQuery) First(ctx context.Context) (*RoleBinding, error)
First returns the first RoleBinding entity from the query. Returns a *NotFoundError when no RoleBinding was found.
func (*RoleBindingQuery) FirstID ¶
func (rbq *RoleBindingQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first RoleBinding ID from the query. Returns a *NotFoundError when no RoleBinding ID was found.
func (*RoleBindingQuery) FirstIDX ¶
func (rbq *RoleBindingQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*RoleBindingQuery) FirstX ¶
func (rbq *RoleBindingQuery) FirstX(ctx context.Context) *RoleBinding
FirstX is like First, but panics if an error occurs.
func (*RoleBindingQuery) GroupBy ¶
func (rbq *RoleBindingQuery) GroupBy(field string, fields ...string) *RoleBindingGroupBy
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 { DeleteTime int64 `json:"delete_time,omitempty"` Count int `json:"count,omitempty"` } client.RoleBinding.Query(). GroupBy(rolebinding.FieldDeleteTime). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RoleBindingQuery) IDs ¶
func (rbq *RoleBindingQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of RoleBinding IDs.
func (*RoleBindingQuery) IDsX ¶
func (rbq *RoleBindingQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*RoleBindingQuery) Limit ¶
func (rbq *RoleBindingQuery) Limit(limit int) *RoleBindingQuery
Limit the number of records to be returned by this query.
func (*RoleBindingQuery) Offset ¶
func (rbq *RoleBindingQuery) Offset(offset int) *RoleBindingQuery
Offset to start from.
func (*RoleBindingQuery) Only ¶
func (rbq *RoleBindingQuery) Only(ctx context.Context) (*RoleBinding, error)
Only returns a single RoleBinding entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RoleBinding entity is found. Returns a *NotFoundError when no RoleBinding entities are found.
func (*RoleBindingQuery) OnlyID ¶
func (rbq *RoleBindingQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only RoleBinding ID in the query. Returns a *NotSingularError when more than one RoleBinding ID is found. Returns a *NotFoundError when no entities are found.
func (*RoleBindingQuery) OnlyIDX ¶
func (rbq *RoleBindingQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RoleBindingQuery) OnlyX ¶
func (rbq *RoleBindingQuery) OnlyX(ctx context.Context) *RoleBinding
OnlyX is like Only, but panics if an error occurs.
func (*RoleBindingQuery) Order ¶
func (rbq *RoleBindingQuery) Order(o ...rolebinding.OrderOption) *RoleBindingQuery
Order specifies how the records should be ordered.
func (*RoleBindingQuery) Select ¶
func (rbq *RoleBindingQuery) Select(fields ...string) *RoleBindingSelect
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 { DeleteTime int64 `json:"delete_time,omitempty"` } client.RoleBinding.Query(). Select(rolebinding.FieldDeleteTime). Scan(ctx, &v)
func (*RoleBindingQuery) Unique ¶
func (rbq *RoleBindingQuery) Unique(unique bool) *RoleBindingQuery
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 (*RoleBindingQuery) Where ¶
func (rbq *RoleBindingQuery) Where(ps ...predicate.RoleBinding) *RoleBindingQuery
Where adds a new predicate for the RoleBindingQuery builder.
type RoleBindingSelect ¶
type RoleBindingSelect struct { *RoleBindingQuery // contains filtered or unexported fields }
RoleBindingSelect is the builder for selecting fields of RoleBinding entities.
func (*RoleBindingSelect) Aggregate ¶
func (rbs *RoleBindingSelect) Aggregate(fns ...AggregateFunc) *RoleBindingSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RoleBindingSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleBindingSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleBindingSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleBindingSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleBindingSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleBindingSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleBindingSelect) Scan ¶
func (rbs *RoleBindingSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RoleBindingSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RoleBindingUpdate ¶
type RoleBindingUpdate struct {
// contains filtered or unexported fields
}
RoleBindingUpdate is the builder for updating RoleBinding entities.
func (*RoleBindingUpdate) AddDeleteTime ¶
func (rbu *RoleBindingUpdate) AddDeleteTime(i int64) *RoleBindingUpdate
AddDeleteTime adds i to the "delete_time" field.
func (*RoleBindingUpdate) AddDeletedTime ¶
func (rbu *RoleBindingUpdate) AddDeletedTime(i int64) *RoleBindingUpdate
AddDeletedTime adds i to the "deleted_time" field.
func (*RoleBindingUpdate) ClearDeletedTime ¶
func (rbu *RoleBindingUpdate) ClearDeletedTime() *RoleBindingUpdate
ClearDeletedTime clears the value of the "deleted_time" field.
func (*RoleBindingUpdate) ClearDisplayName ¶
func (rbu *RoleBindingUpdate) ClearDisplayName() *RoleBindingUpdate
ClearDisplayName clears the value of the "display_name" field.
func (*RoleBindingUpdate) Exec ¶
func (rbu *RoleBindingUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleBindingUpdate) ExecX ¶
func (rbu *RoleBindingUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleBindingUpdate) Mutation ¶
func (rbu *RoleBindingUpdate) Mutation() *RoleBindingMutation
Mutation returns the RoleBindingMutation object of the builder.
func (*RoleBindingUpdate) Save ¶
func (rbu *RoleBindingUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RoleBindingUpdate) SaveX ¶
func (rbu *RoleBindingUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RoleBindingUpdate) SetDeleteTime ¶
func (rbu *RoleBindingUpdate) SetDeleteTime(i int64) *RoleBindingUpdate
SetDeleteTime sets the "delete_time" field.
func (*RoleBindingUpdate) SetDeletedTime ¶
func (rbu *RoleBindingUpdate) SetDeletedTime(i int64) *RoleBindingUpdate
SetDeletedTime sets the "deleted_time" field.
func (*RoleBindingUpdate) SetDisplayName ¶
func (rbu *RoleBindingUpdate) SetDisplayName(s string) *RoleBindingUpdate
SetDisplayName sets the "display_name" field.
func (*RoleBindingUpdate) SetName ¶
func (rbu *RoleBindingUpdate) SetName(s string) *RoleBindingUpdate
SetName sets the "name" field.
func (*RoleBindingUpdate) SetNillableDeleteTime ¶
func (rbu *RoleBindingUpdate) SetNillableDeleteTime(i *int64) *RoleBindingUpdate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*RoleBindingUpdate) SetNillableDeletedTime ¶
func (rbu *RoleBindingUpdate) SetNillableDeletedTime(i *int64) *RoleBindingUpdate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*RoleBindingUpdate) SetNillableDisplayName ¶
func (rbu *RoleBindingUpdate) SetNillableDisplayName(s *string) *RoleBindingUpdate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*RoleBindingUpdate) SetNillableName ¶
func (rbu *RoleBindingUpdate) SetNillableName(s *string) *RoleBindingUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleBindingUpdate) SetNillableRoleName ¶
func (rbu *RoleBindingUpdate) SetNillableRoleName(s *string) *RoleBindingUpdate
SetNillableRoleName sets the "role_name" field if the given value is not nil.
func (*RoleBindingUpdate) SetNillableUserID ¶
func (rbu *RoleBindingUpdate) SetNillableUserID(s *string) *RoleBindingUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*RoleBindingUpdate) SetRoleName ¶
func (rbu *RoleBindingUpdate) SetRoleName(s string) *RoleBindingUpdate
SetRoleName sets the "role_name" field.
func (*RoleBindingUpdate) SetUpdateTime ¶
func (rbu *RoleBindingUpdate) SetUpdateTime(t time.Time) *RoleBindingUpdate
SetUpdateTime sets the "update_time" field.
func (*RoleBindingUpdate) SetUserID ¶
func (rbu *RoleBindingUpdate) SetUserID(s string) *RoleBindingUpdate
SetUserID sets the "user_id" field.
func (*RoleBindingUpdate) Where ¶
func (rbu *RoleBindingUpdate) Where(ps ...predicate.RoleBinding) *RoleBindingUpdate
Where appends a list predicates to the RoleBindingUpdate builder.
type RoleBindingUpdateOne ¶
type RoleBindingUpdateOne struct {
// contains filtered or unexported fields
}
RoleBindingUpdateOne is the builder for updating a single RoleBinding entity.
func (*RoleBindingUpdateOne) AddDeleteTime ¶
func (rbuo *RoleBindingUpdateOne) AddDeleteTime(i int64) *RoleBindingUpdateOne
AddDeleteTime adds i to the "delete_time" field.
func (*RoleBindingUpdateOne) AddDeletedTime ¶
func (rbuo *RoleBindingUpdateOne) AddDeletedTime(i int64) *RoleBindingUpdateOne
AddDeletedTime adds i to the "deleted_time" field.
func (*RoleBindingUpdateOne) ClearDeletedTime ¶
func (rbuo *RoleBindingUpdateOne) ClearDeletedTime() *RoleBindingUpdateOne
ClearDeletedTime clears the value of the "deleted_time" field.
func (*RoleBindingUpdateOne) ClearDisplayName ¶
func (rbuo *RoleBindingUpdateOne) ClearDisplayName() *RoleBindingUpdateOne
ClearDisplayName clears the value of the "display_name" field.
func (*RoleBindingUpdateOne) Exec ¶
func (rbuo *RoleBindingUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RoleBindingUpdateOne) ExecX ¶
func (rbuo *RoleBindingUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleBindingUpdateOne) Mutation ¶
func (rbuo *RoleBindingUpdateOne) Mutation() *RoleBindingMutation
Mutation returns the RoleBindingMutation object of the builder.
func (*RoleBindingUpdateOne) Save ¶
func (rbuo *RoleBindingUpdateOne) Save(ctx context.Context) (*RoleBinding, error)
Save executes the query and returns the updated RoleBinding entity.
func (*RoleBindingUpdateOne) SaveX ¶
func (rbuo *RoleBindingUpdateOne) SaveX(ctx context.Context) *RoleBinding
SaveX is like Save, but panics if an error occurs.
func (*RoleBindingUpdateOne) Select ¶
func (rbuo *RoleBindingUpdateOne) Select(field string, fields ...string) *RoleBindingUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RoleBindingUpdateOne) SetDeleteTime ¶
func (rbuo *RoleBindingUpdateOne) SetDeleteTime(i int64) *RoleBindingUpdateOne
SetDeleteTime sets the "delete_time" field.
func (*RoleBindingUpdateOne) SetDeletedTime ¶
func (rbuo *RoleBindingUpdateOne) SetDeletedTime(i int64) *RoleBindingUpdateOne
SetDeletedTime sets the "deleted_time" field.
func (*RoleBindingUpdateOne) SetDisplayName ¶
func (rbuo *RoleBindingUpdateOne) SetDisplayName(s string) *RoleBindingUpdateOne
SetDisplayName sets the "display_name" field.
func (*RoleBindingUpdateOne) SetName ¶
func (rbuo *RoleBindingUpdateOne) SetName(s string) *RoleBindingUpdateOne
SetName sets the "name" field.
func (*RoleBindingUpdateOne) SetNillableDeleteTime ¶
func (rbuo *RoleBindingUpdateOne) SetNillableDeleteTime(i *int64) *RoleBindingUpdateOne
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*RoleBindingUpdateOne) SetNillableDeletedTime ¶
func (rbuo *RoleBindingUpdateOne) SetNillableDeletedTime(i *int64) *RoleBindingUpdateOne
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*RoleBindingUpdateOne) SetNillableDisplayName ¶
func (rbuo *RoleBindingUpdateOne) SetNillableDisplayName(s *string) *RoleBindingUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*RoleBindingUpdateOne) SetNillableName ¶
func (rbuo *RoleBindingUpdateOne) SetNillableName(s *string) *RoleBindingUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleBindingUpdateOne) SetNillableRoleName ¶
func (rbuo *RoleBindingUpdateOne) SetNillableRoleName(s *string) *RoleBindingUpdateOne
SetNillableRoleName sets the "role_name" field if the given value is not nil.
func (*RoleBindingUpdateOne) SetNillableUserID ¶
func (rbuo *RoleBindingUpdateOne) SetNillableUserID(s *string) *RoleBindingUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*RoleBindingUpdateOne) SetRoleName ¶
func (rbuo *RoleBindingUpdateOne) SetRoleName(s string) *RoleBindingUpdateOne
SetRoleName sets the "role_name" field.
func (*RoleBindingUpdateOne) SetUpdateTime ¶
func (rbuo *RoleBindingUpdateOne) SetUpdateTime(t time.Time) *RoleBindingUpdateOne
SetUpdateTime sets the "update_time" field.
func (*RoleBindingUpdateOne) SetUserID ¶
func (rbuo *RoleBindingUpdateOne) SetUserID(s string) *RoleBindingUpdateOne
SetUserID sets the "user_id" field.
func (*RoleBindingUpdateOne) Where ¶
func (rbuo *RoleBindingUpdateOne) Where(ps ...predicate.RoleBinding) *RoleBindingUpdateOne
Where appends a list predicates to the RoleBindingUpdate builder.
type RoleBindings ¶
type RoleBindings []*RoleBinding
RoleBindings is a parsable slice of RoleBinding.
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 string) *RoleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RoleClient) GetX ¶
func (c *RoleClient) GetX(ctx context.Context, id string) *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 string) *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) SetCreateTime ¶
func (rc *RoleCreate) SetCreateTime(t time.Time) *RoleCreate
SetCreateTime sets the "create_time" field.
func (*RoleCreate) SetDeleteTime ¶
func (rc *RoleCreate) SetDeleteTime(i int64) *RoleCreate
SetDeleteTime sets the "delete_time" field.
func (*RoleCreate) SetDeletedTime ¶
func (rc *RoleCreate) SetDeletedTime(i int64) *RoleCreate
SetDeletedTime sets the "deleted_time" field.
func (*RoleCreate) SetDisplayName ¶
func (rc *RoleCreate) SetDisplayName(s string) *RoleCreate
SetDisplayName sets the "display_name" field.
func (*RoleCreate) SetID ¶
func (rc *RoleCreate) SetID(s string) *RoleCreate
SetID sets the "id" field.
func (*RoleCreate) SetName ¶
func (rc *RoleCreate) SetName(s string) *RoleCreate
SetName sets the "name" field.
func (*RoleCreate) SetNillableCreateTime ¶
func (rc *RoleCreate) SetNillableCreateTime(t *time.Time) *RoleCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*RoleCreate) SetNillableDeleteTime ¶
func (rc *RoleCreate) SetNillableDeleteTime(i *int64) *RoleCreate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*RoleCreate) SetNillableDisplayName ¶
func (rc *RoleCreate) SetNillableDisplayName(s *string) *RoleCreate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*RoleCreate) SetNillableID ¶
func (rc *RoleCreate) SetNillableID(s *string) *RoleCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*RoleCreate) SetNillableRemark ¶
func (rc *RoleCreate) SetNillableRemark(s *string) *RoleCreate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*RoleCreate) SetNillableUpdateTime ¶
func (rc *RoleCreate) SetNillableUpdateTime(t *time.Time) *RoleCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*RoleCreate) SetRemark ¶
func (rc *RoleCreate) SetRemark(s string) *RoleCreate
SetRemark sets the "remark" field.
func (*RoleCreate) SetUpdateTime ¶
func (rc *RoleCreate) SetUpdateTime(t time.Time) *RoleCreate
SetUpdateTime sets the "update_time" 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) AddDeleteTime ¶
func (m *RoleMutation) AddDeleteTime(i int64)
AddDeleteTime adds i to the "delete_time" field.
func (*RoleMutation) AddDeletedTime ¶
func (m *RoleMutation) AddDeletedTime(i int64)
AddDeletedTime adds i to the "deleted_time" field.
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) AddedDeleteTime ¶
func (m *RoleMutation) AddedDeleteTime() (r int64, exists bool)
AddedDeleteTime returns the value that was added to the "delete_time" field in this mutation.
func (*RoleMutation) AddedDeletedTime ¶
func (m *RoleMutation) AddedDeletedTime() (r int64, exists bool)
AddedDeletedTime returns the value that was added to the "deleted_time" field in this mutation.
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) ClearDisplayName ¶
func (m *RoleMutation) ClearDisplayName()
ClearDisplayName clears the value of the "display_name" field.
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) ClearRemark ¶
func (m *RoleMutation) ClearRemark()
ClearRemark clears the value of the "remark" field.
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) CreateTime ¶
func (m *RoleMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*RoleMutation) DeleteTime ¶
func (m *RoleMutation) DeleteTime() (r int64, exists bool)
DeleteTime returns the value of the "delete_time" field in the mutation.
func (*RoleMutation) DeletedTime ¶
func (m *RoleMutation) DeletedTime() (r int64, exists bool)
DeletedTime returns the value of the "deleted_time" field in the mutation.
func (*RoleMutation) DisplayName ¶
func (m *RoleMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*RoleMutation) DisplayNameCleared ¶
func (m *RoleMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "display_name" field was cleared in this mutation.
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 string, 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) ([]string, 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) OldCreateTime ¶
OldCreateTime returns the old "create_time" 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) OldDeleteTime ¶
func (m *RoleMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
OldDeleteTime returns the old "delete_time" 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) OldDeletedTime ¶
func (m *RoleMutation) OldDeletedTime(ctx context.Context) (v int64, err error)
OldDeletedTime returns the old "deleted_time" 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) OldDisplayName ¶
func (m *RoleMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_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) 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) OldRemark ¶
func (m *RoleMutation) OldRemark(ctx context.Context) (v string, err error)
OldRemark returns the old "remark" 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) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" 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) Remark ¶
func (m *RoleMutation) Remark() (r string, exists bool)
Remark returns the value of the "remark" field in the mutation.
func (*RoleMutation) RemarkCleared ¶
func (m *RoleMutation) RemarkCleared() bool
RemarkCleared returns if the "remark" field was cleared in this mutation.
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) ResetCreateTime ¶
func (m *RoleMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*RoleMutation) ResetDeleteTime ¶
func (m *RoleMutation) ResetDeleteTime()
ResetDeleteTime resets all changes to the "delete_time" field.
func (*RoleMutation) ResetDeletedTime ¶
func (m *RoleMutation) ResetDeletedTime()
ResetDeletedTime resets all changes to the "deleted_time" field.
func (*RoleMutation) ResetDisplayName ¶
func (m *RoleMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" field.
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) ResetRemark ¶
func (m *RoleMutation) ResetRemark()
ResetRemark resets all changes to the "remark" field.
func (*RoleMutation) ResetUpdateTime ¶
func (m *RoleMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*RoleMutation) SetCreateTime ¶
func (m *RoleMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*RoleMutation) SetDeleteTime ¶
func (m *RoleMutation) SetDeleteTime(i int64)
SetDeleteTime sets the "delete_time" field.
func (*RoleMutation) SetDeletedTime ¶
func (m *RoleMutation) SetDeletedTime(i int64)
SetDeletedTime sets the "deleted_time" field.
func (*RoleMutation) SetDisplayName ¶
func (m *RoleMutation) SetDisplayName(s string)
SetDisplayName sets the "display_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 string)
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) SetRemark ¶
func (m *RoleMutation) SetRemark(s string)
SetRemark sets the "remark" field.
func (*RoleMutation) SetUpdateTime ¶
func (m *RoleMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
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) UpdateTime ¶
func (m *RoleMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field in the mutation.
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 { DeleteTime int64 `json:"delete_time,omitempty"` Count int `json:"count,omitempty"` } client.Role.Query(). GroupBy(role.FieldDeleteTime). 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 { DeleteTime int64 `json:"delete_time,omitempty"` } client.Role.Query(). Select(role.FieldDeleteTime). 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) AddDeleteTime ¶
func (ru *RoleUpdate) AddDeleteTime(i int64) *RoleUpdate
AddDeleteTime adds i to the "delete_time" field.
func (*RoleUpdate) AddDeletedTime ¶
func (ru *RoleUpdate) AddDeletedTime(i int64) *RoleUpdate
AddDeletedTime adds i to the "deleted_time" field.
func (*RoleUpdate) ClearDisplayName ¶
func (ru *RoleUpdate) ClearDisplayName() *RoleUpdate
ClearDisplayName clears the value of the "display_name" field.
func (*RoleUpdate) ClearRemark ¶
func (ru *RoleUpdate) ClearRemark() *RoleUpdate
ClearRemark clears the value of the "remark" field.
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) SetDeleteTime ¶
func (ru *RoleUpdate) SetDeleteTime(i int64) *RoleUpdate
SetDeleteTime sets the "delete_time" field.
func (*RoleUpdate) SetDeletedTime ¶
func (ru *RoleUpdate) SetDeletedTime(i int64) *RoleUpdate
SetDeletedTime sets the "deleted_time" field.
func (*RoleUpdate) SetDisplayName ¶
func (ru *RoleUpdate) SetDisplayName(s string) *RoleUpdate
SetDisplayName sets the "display_name" field.
func (*RoleUpdate) SetName ¶
func (ru *RoleUpdate) SetName(s string) *RoleUpdate
SetName sets the "name" field.
func (*RoleUpdate) SetNillableDeleteTime ¶
func (ru *RoleUpdate) SetNillableDeleteTime(i *int64) *RoleUpdate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*RoleUpdate) SetNillableDeletedTime ¶
func (ru *RoleUpdate) SetNillableDeletedTime(i *int64) *RoleUpdate
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*RoleUpdate) SetNillableDisplayName ¶
func (ru *RoleUpdate) SetNillableDisplayName(s *string) *RoleUpdate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*RoleUpdate) SetNillableName ¶
func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleUpdate) SetNillableRemark ¶
func (ru *RoleUpdate) SetNillableRemark(s *string) *RoleUpdate
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*RoleUpdate) SetRemark ¶
func (ru *RoleUpdate) SetRemark(s string) *RoleUpdate
SetRemark sets the "remark" field.
func (*RoleUpdate) SetUpdateTime ¶
func (ru *RoleUpdate) SetUpdateTime(t time.Time) *RoleUpdate
SetUpdateTime sets the "update_time" field.
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) AddDeleteTime ¶
func (ruo *RoleUpdateOne) AddDeleteTime(i int64) *RoleUpdateOne
AddDeleteTime adds i to the "delete_time" field.
func (*RoleUpdateOne) AddDeletedTime ¶
func (ruo *RoleUpdateOne) AddDeletedTime(i int64) *RoleUpdateOne
AddDeletedTime adds i to the "deleted_time" field.
func (*RoleUpdateOne) ClearDisplayName ¶
func (ruo *RoleUpdateOne) ClearDisplayName() *RoleUpdateOne
ClearDisplayName clears the value of the "display_name" field.
func (*RoleUpdateOne) ClearRemark ¶
func (ruo *RoleUpdateOne) ClearRemark() *RoleUpdateOne
ClearRemark clears the value of the "remark" field.
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) SetDeleteTime ¶
func (ruo *RoleUpdateOne) SetDeleteTime(i int64) *RoleUpdateOne
SetDeleteTime sets the "delete_time" field.
func (*RoleUpdateOne) SetDeletedTime ¶
func (ruo *RoleUpdateOne) SetDeletedTime(i int64) *RoleUpdateOne
SetDeletedTime sets the "deleted_time" field.
func (*RoleUpdateOne) SetDisplayName ¶
func (ruo *RoleUpdateOne) SetDisplayName(s string) *RoleUpdateOne
SetDisplayName sets the "display_name" field.
func (*RoleUpdateOne) SetName ¶
func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
SetName sets the "name" field.
func (*RoleUpdateOne) SetNillableDeleteTime ¶
func (ruo *RoleUpdateOne) SetNillableDeleteTime(i *int64) *RoleUpdateOne
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableDeletedTime ¶
func (ruo *RoleUpdateOne) SetNillableDeletedTime(i *int64) *RoleUpdateOne
SetNillableDeletedTime sets the "deleted_time" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableDisplayName ¶
func (ruo *RoleUpdateOne) SetNillableDisplayName(s *string) *RoleUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableName ¶
func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableRemark ¶
func (ruo *RoleUpdateOne) SetNillableRemark(s *string) *RoleUpdateOne
SetNillableRemark sets the "remark" field if the given value is not nil.
func (*RoleUpdateOne) SetRemark ¶
func (ruo *RoleUpdateOne) SetRemark(s string) *RoleUpdateOne
SetRemark sets the "remark" field.
func (*RoleUpdateOne) SetUpdateTime ¶
func (ruo *RoleUpdateOne) SetUpdateTime(t time.Time) *RoleUpdateOne
SetUpdateTime sets the "update_time" field.
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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Org is the client for interacting with the Org builders. Org *OrgClient // Role is the client for interacting with the Role builders. Role *RoleClient // RoleBinding is the client for interacting with the RoleBinding builders. RoleBinding *RoleBindingClient // User is the client for interacting with the User builders. User *UserClient // 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 ID string `json:"id,omitempty"` // delete time stamp DeleteTime int64 `json:"delete_time,omitempty"` // CreateTime holds the value of the "create_time" field. CreateTime time.Time `json:"create_time,omitempty"` // UpdateTime holds the value of the "update_time" field. UpdateTime time.Time `json:"update_time,omitempty"` // 用户账号 Name string `json:"name,omitempty"` // 显示名称 DisplayName string `json:"display_name,omitempty"` // 用户邮箱 Email string `json:"email,omitempty"` // 手机号码 Phone string `json:"phone,omitempty"` // 用户性别(0保密 1男 2女) Gender string `json:"gender,omitempty"` // 头像路径 Avatar string `json:"avatar,omitempty"` // 密码 Password string `json:"-"` // 锁定标志(0锁定 1正常) NonLocked int `json:"non_locked,omitempty"` // contains filtered or unexported fields }
User is the model entity for the User schema.
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 string) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id string) *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) 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 string) *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) 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) SetAvatar ¶
func (uc *UserCreate) SetAvatar(s string) *UserCreate
SetAvatar sets the "avatar" field.
func (*UserCreate) SetCreateTime ¶
func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate
SetCreateTime sets the "create_time" field.
func (*UserCreate) SetDeleteTime ¶
func (uc *UserCreate) SetDeleteTime(i int64) *UserCreate
SetDeleteTime sets the "delete_time" field.
func (*UserCreate) SetDisplayName ¶
func (uc *UserCreate) SetDisplayName(s string) *UserCreate
SetDisplayName sets the "display_name" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetGender ¶
func (uc *UserCreate) SetGender(s string) *UserCreate
SetGender sets the "gender" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(s string) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetName ¶
func (uc *UserCreate) SetName(s string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableAvatar ¶
func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UserCreate) SetNillableCreateTime ¶
func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate
SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (*UserCreate) SetNillableDeleteTime ¶
func (uc *UserCreate) SetNillableDeleteTime(i *int64) *UserCreate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*UserCreate) SetNillableDisplayName ¶
func (uc *UserCreate) SetNillableDisplayName(s *string) *UserCreate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*UserCreate) SetNillableEmail ¶
func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserCreate) SetNillableGender ¶
func (uc *UserCreate) SetNillableGender(s *string) *UserCreate
SetNillableGender sets the "gender" field if the given value is not nil.
func (*UserCreate) SetNillableID ¶
func (uc *UserCreate) SetNillableID(s *string) *UserCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*UserCreate) SetNillableName ¶
func (uc *UserCreate) SetNillableName(s *string) *UserCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserCreate) SetNillableNonLocked ¶
func (uc *UserCreate) SetNillableNonLocked(i *int) *UserCreate
SetNillableNonLocked sets the "non_locked" field if the given value is not nil.
func (*UserCreate) SetNillablePassword ¶
func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate
SetNillablePassword sets the "password" 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) SetNillableUpdateTime ¶
func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate
SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (*UserCreate) SetNonLocked ¶
func (uc *UserCreate) SetNonLocked(i int) *UserCreate
SetNonLocked sets the "non_locked" field.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetPhone ¶
func (uc *UserCreate) SetPhone(s string) *UserCreate
SetPhone sets the "phone" field.
func (*UserCreate) SetUpdateTime ¶
func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate
SetUpdateTime sets the "update_time" 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 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) AddDeleteTime ¶
func (m *UserMutation) AddDeleteTime(i int64)
AddDeleteTime adds i to the "delete_time" field.
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) AddNonLocked ¶
func (m *UserMutation) AddNonLocked(i int)
AddNonLocked adds i to the "non_locked" field.
func (*UserMutation) AddedDeleteTime ¶
func (m *UserMutation) AddedDeleteTime() (r int64, exists bool)
AddedDeleteTime returns the value that was added to the "delete_time" field in this mutation.
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) AddedNonLocked ¶
func (m *UserMutation) AddedNonLocked() (r int, exists bool)
AddedNonLocked returns the value that was added to the "non_locked" field in this mutation.
func (*UserMutation) Avatar ¶
func (m *UserMutation) Avatar() (r string, exists bool)
Avatar returns the value of the "avatar" field in the mutation.
func (*UserMutation) AvatarCleared ¶
func (m *UserMutation) AvatarCleared() bool
AvatarCleared returns if the "avatar" field was cleared in this mutation.
func (*UserMutation) ClearAvatar ¶
func (m *UserMutation) ClearAvatar()
ClearAvatar clears the value of the "avatar" field.
func (*UserMutation) ClearDisplayName ¶
func (m *UserMutation) ClearDisplayName()
ClearDisplayName clears the value of the "display_name" field.
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) ClearEmail ¶
func (m *UserMutation) ClearEmail()
ClearEmail clears the value of the "email" field.
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) ClearGender ¶
func (m *UserMutation) ClearGender()
ClearGender clears the value of the "gender" field.
func (*UserMutation) ClearName ¶
func (m *UserMutation) ClearName()
ClearName clears the value of the "name" field.
func (*UserMutation) ClearNonLocked ¶
func (m *UserMutation) ClearNonLocked()
ClearNonLocked clears the value of the "non_locked" field.
func (*UserMutation) ClearPassword ¶
func (m *UserMutation) ClearPassword()
ClearPassword clears the value of the "password" field.
func (*UserMutation) ClearPhone ¶
func (m *UserMutation) ClearPhone()
ClearPhone clears the value of the "phone" field.
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) CreateTime ¶
func (m *UserMutation) CreateTime() (r time.Time, exists bool)
CreateTime returns the value of the "create_time" field in the mutation.
func (*UserMutation) DeleteTime ¶
func (m *UserMutation) DeleteTime() (r int64, exists bool)
DeleteTime returns the value of the "delete_time" field in the mutation.
func (*UserMutation) DisplayName ¶
func (m *UserMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*UserMutation) DisplayNameCleared ¶
func (m *UserMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "display_name" field was cleared in this 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) EmailCleared ¶
func (m *UserMutation) EmailCleared() bool
EmailCleared returns if the "email" field was cleared in this 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) Gender ¶
func (m *UserMutation) Gender() (r string, exists bool)
Gender returns the value of the "gender" field in the mutation.
func (*UserMutation) GenderCleared ¶
func (m *UserMutation) GenderCleared() bool
GenderCleared returns if the "gender" field was cleared in this mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id string, 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) ([]string, 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) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) NameCleared ¶
func (m *UserMutation) NameCleared() bool
NameCleared returns if the "name" field was cleared in this mutation.
func (*UserMutation) NonLocked ¶
func (m *UserMutation) NonLocked() (r int, exists bool)
NonLocked returns the value of the "non_locked" field in the mutation.
func (*UserMutation) NonLockedCleared ¶
func (m *UserMutation) NonLockedCleared() bool
NonLockedCleared returns if the "non_locked" field was cleared in this mutation.
func (*UserMutation) OldAvatar ¶
func (m *UserMutation) OldAvatar(ctx context.Context) (v string, err error)
OldAvatar returns the old "avatar" 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) OldCreateTime ¶
OldCreateTime returns the old "create_time" 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) OldDeleteTime ¶
func (m *UserMutation) OldDeleteTime(ctx context.Context) (v int64, err error)
OldDeleteTime returns the old "delete_time" 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) OldDisplayName ¶
func (m *UserMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_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) 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) 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) OldGender ¶
func (m *UserMutation) OldGender(ctx context.Context) (v string, err error)
OldGender returns the old "gender" 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) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "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) OldNonLocked ¶
func (m *UserMutation) OldNonLocked(ctx context.Context) (v int, err error)
OldNonLocked returns the old "non_locked" 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) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" 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) OldUpdateTime ¶
OldUpdateTime returns the old "update_time" 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) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) PasswordCleared ¶
func (m *UserMutation) PasswordCleared() bool
PasswordCleared returns if the "password" field was cleared in this mutation.
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) 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) ResetAvatar ¶
func (m *UserMutation) ResetAvatar()
ResetAvatar resets all changes to the "avatar" field.
func (*UserMutation) ResetCreateTime ¶
func (m *UserMutation) ResetCreateTime()
ResetCreateTime resets all changes to the "create_time" field.
func (*UserMutation) ResetDeleteTime ¶
func (m *UserMutation) ResetDeleteTime()
ResetDeleteTime resets all changes to the "delete_time" field.
func (*UserMutation) ResetDisplayName ¶
func (m *UserMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" 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) 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) ResetGender ¶
func (m *UserMutation) ResetGender()
ResetGender resets all changes to the "gender" field.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetNonLocked ¶
func (m *UserMutation) ResetNonLocked()
ResetNonLocked resets all changes to the "non_locked" field.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetPhone ¶
func (m *UserMutation) ResetPhone()
ResetPhone resets all changes to the "phone" field.
func (*UserMutation) ResetUpdateTime ¶
func (m *UserMutation) ResetUpdateTime()
ResetUpdateTime resets all changes to the "update_time" field.
func (*UserMutation) SetAvatar ¶
func (m *UserMutation) SetAvatar(s string)
SetAvatar sets the "avatar" field.
func (*UserMutation) SetCreateTime ¶
func (m *UserMutation) SetCreateTime(t time.Time)
SetCreateTime sets the "create_time" field.
func (*UserMutation) SetDeleteTime ¶
func (m *UserMutation) SetDeleteTime(i int64)
SetDeleteTime sets the "delete_time" field.
func (*UserMutation) SetDisplayName ¶
func (m *UserMutation) SetDisplayName(s string)
SetDisplayName sets the "display_name" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" 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) SetGender ¶
func (m *UserMutation) SetGender(s string)
SetGender sets the "gender" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetNonLocked ¶
func (m *UserMutation) SetNonLocked(i int)
SetNonLocked sets the "non_locked" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetPhone ¶
func (m *UserMutation) SetPhone(s string)
SetPhone sets the "phone" field.
func (*UserMutation) SetUpdateTime ¶
func (m *UserMutation) SetUpdateTime(t time.Time)
SetUpdateTime sets the "update_time" field.
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) UpdateTime ¶
func (m *UserMutation) UpdateTime() (r time.Time, exists bool)
UpdateTime returns the value of the "update_time" field 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 { DeleteTime int64 `json:"delete_time,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldDeleteTime). 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) 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 { DeleteTime int64 `json:"delete_time,omitempty"` } client.User.Query(). Select(user.FieldDeleteTime). Scan(ctx, &v)
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 UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddDeleteTime ¶
func (uu *UserUpdate) AddDeleteTime(i int64) *UserUpdate
AddDeleteTime adds i to the "delete_time" field.
func (*UserUpdate) AddNonLocked ¶
func (uu *UserUpdate) AddNonLocked(i int) *UserUpdate
AddNonLocked adds i to the "non_locked" field.
func (*UserUpdate) ClearAvatar ¶
func (uu *UserUpdate) ClearAvatar() *UserUpdate
ClearAvatar clears the value of the "avatar" field.
func (*UserUpdate) ClearDisplayName ¶
func (uu *UserUpdate) ClearDisplayName() *UserUpdate
ClearDisplayName clears the value of the "display_name" field.
func (*UserUpdate) ClearEmail ¶
func (uu *UserUpdate) ClearEmail() *UserUpdate
ClearEmail clears the value of the "email" field.
func (*UserUpdate) ClearGender ¶
func (uu *UserUpdate) ClearGender() *UserUpdate
ClearGender clears the value of the "gender" field.
func (*UserUpdate) ClearName ¶
func (uu *UserUpdate) ClearName() *UserUpdate
ClearName clears the value of the "name" field.
func (*UserUpdate) ClearNonLocked ¶
func (uu *UserUpdate) ClearNonLocked() *UserUpdate
ClearNonLocked clears the value of the "non_locked" field.
func (*UserUpdate) ClearPassword ¶
func (uu *UserUpdate) ClearPassword() *UserUpdate
ClearPassword clears the value of the "password" field.
func (*UserUpdate) ClearPhone ¶
func (uu *UserUpdate) ClearPhone() *UserUpdate
ClearPhone clears the value of the "phone" field.
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) 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) SetAvatar ¶
func (uu *UserUpdate) SetAvatar(s string) *UserUpdate
SetAvatar sets the "avatar" field.
func (*UserUpdate) SetDeleteTime ¶
func (uu *UserUpdate) SetDeleteTime(i int64) *UserUpdate
SetDeleteTime sets the "delete_time" field.
func (*UserUpdate) SetDisplayName ¶
func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate
SetDisplayName sets the "display_name" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetGender ¶
func (uu *UserUpdate) SetGender(s string) *UserUpdate
SetGender sets the "gender" field.
func (*UserUpdate) SetName ¶
func (uu *UserUpdate) SetName(s string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableAvatar ¶
func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UserUpdate) SetNillableDeleteTime ¶
func (uu *UserUpdate) SetNillableDeleteTime(i *int64) *UserUpdate
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*UserUpdate) SetNillableDisplayName ¶
func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableGender ¶
func (uu *UserUpdate) SetNillableGender(s *string) *UserUpdate
SetNillableGender sets the "gender" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillableNonLocked ¶
func (uu *UserUpdate) SetNillableNonLocked(i *int) *UserUpdate
SetNillableNonLocked sets the "non_locked" field if the given value is not nil.
func (*UserUpdate) SetNillablePassword ¶
func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate
SetNillablePassword sets the "password" 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) SetNonLocked ¶
func (uu *UserUpdate) SetNonLocked(i int) *UserUpdate
SetNonLocked sets the "non_locked" field.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetPhone ¶
func (uu *UserUpdate) SetPhone(s string) *UserUpdate
SetPhone sets the "phone" field.
func (*UserUpdate) SetUpdateTime ¶
func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate
SetUpdateTime sets the "update_time" 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) AddDeleteTime ¶
func (uuo *UserUpdateOne) AddDeleteTime(i int64) *UserUpdateOne
AddDeleteTime adds i to the "delete_time" field.
func (*UserUpdateOne) AddNonLocked ¶
func (uuo *UserUpdateOne) AddNonLocked(i int) *UserUpdateOne
AddNonLocked adds i to the "non_locked" field.
func (*UserUpdateOne) ClearAvatar ¶
func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne
ClearAvatar clears the value of the "avatar" field.
func (*UserUpdateOne) ClearDisplayName ¶
func (uuo *UserUpdateOne) ClearDisplayName() *UserUpdateOne
ClearDisplayName clears the value of the "display_name" field.
func (*UserUpdateOne) ClearEmail ¶
func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne
ClearEmail clears the value of the "email" field.
func (*UserUpdateOne) ClearGender ¶
func (uuo *UserUpdateOne) ClearGender() *UserUpdateOne
ClearGender clears the value of the "gender" field.
func (*UserUpdateOne) ClearName ¶
func (uuo *UserUpdateOne) ClearName() *UserUpdateOne
ClearName clears the value of the "name" field.
func (*UserUpdateOne) ClearNonLocked ¶
func (uuo *UserUpdateOne) ClearNonLocked() *UserUpdateOne
ClearNonLocked clears the value of the "non_locked" field.
func (*UserUpdateOne) ClearPassword ¶
func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne
ClearPassword clears the value of the "password" field.
func (*UserUpdateOne) ClearPhone ¶
func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne
ClearPhone clears the value of the "phone" field.
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) 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) SetAvatar ¶
func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne
SetAvatar sets the "avatar" field.
func (*UserUpdateOne) SetDeleteTime ¶
func (uuo *UserUpdateOne) SetDeleteTime(i int64) *UserUpdateOne
SetDeleteTime sets the "delete_time" field.
func (*UserUpdateOne) SetDisplayName ¶
func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne
SetDisplayName sets the "display_name" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetGender ¶
func (uuo *UserUpdateOne) SetGender(s string) *UserUpdateOne
SetGender sets the "gender" field.
func (*UserUpdateOne) SetName ¶
func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableAvatar ¶
func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne
SetNillableAvatar sets the "avatar" field if the given value is not nil.
func (*UserUpdateOne) SetNillableDeleteTime ¶
func (uuo *UserUpdateOne) SetNillableDeleteTime(i *int64) *UserUpdateOne
SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.
func (*UserUpdateOne) SetNillableDisplayName ¶
func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableGender ¶
func (uuo *UserUpdateOne) SetNillableGender(s *string) *UserUpdateOne
SetNillableGender sets the "gender" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableNonLocked ¶
func (uuo *UserUpdateOne) SetNillableNonLocked(i *int) *UserUpdateOne
SetNillableNonLocked sets the "non_locked" field if the given value is not nil.
func (*UserUpdateOne) SetNillablePassword ¶
func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne
SetNillablePassword sets the "password" 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) SetNonLocked ¶
func (uuo *UserUpdateOne) SetNonLocked(i int) *UserUpdateOne
SetNonLocked sets the "non_locked" field.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetPhone ¶
func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne
SetPhone sets the "phone" field.
func (*UserUpdateOne) SetUpdateTime ¶
func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne
SetUpdateTime sets the "update_time" 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.
Source Files
¶
- client.go
- ent.go
- generate.go
- mutation.go
- org.go
- org_create.go
- org_delete.go
- org_query.go
- org_update.go
- role.go
- role_create.go
- role_delete.go
- role_query.go
- role_update.go
- rolebinding.go
- rolebinding_create.go
- rolebinding_delete.go
- rolebinding_query.go
- rolebinding_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go