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 Admin
- func (c *Admin) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Admin) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (a *Admin) QueryRoles() *RoleQuery
- func (a *Admin) String() string
- func (a *Admin) Unwrap() *Admin
- func (a *Admin) Update() *AdminUpdateOne
- func (a *Admin) Value(name string) (ent.Value, error)
- type AdminClient
- func (c *AdminClient) Create() *AdminCreate
- func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk
- func (c *AdminClient) Delete() *AdminDelete
- func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne
- func (c *AdminClient) DeleteOneID(id int) *AdminDeleteOne
- func (c *AdminClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *AdminClient) Get(ctx context.Context, id int) (*Admin, error)
- func (c *AdminClient) GetX(ctx context.Context, id int) *Admin
- func (c *AdminClient) Hooks() []Hook
- func (c *AdminClient) Intercept(interceptors ...Interceptor)
- func (c *AdminClient) Interceptors() []Interceptor
- func (c *AdminClient) MapCreateBulk(slice any, setFunc func(*AdminCreate, int)) *AdminCreateBulk
- func (c *AdminClient) Query() *AdminQuery
- func (c *AdminClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *AdminClient) QueryRoles(a *Admin) *RoleQuery
- func (c *AdminClient) Update() *AdminUpdate
- func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne
- func (c *AdminClient) UpdateOneID(id int) *AdminUpdateOne
- func (c *AdminClient) Use(hooks ...Hook)
- type AdminCreate
- func (ac *AdminCreate) AddRoleIDs(ids ...int) *AdminCreate
- func (ac *AdminCreate) AddRoles(r ...*Role) *AdminCreate
- func (ac *AdminCreate) Exec(ctx context.Context) error
- func (c *AdminCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ac *AdminCreate) ExecX(ctx context.Context)
- func (ac *AdminCreate) Mutation() *AdminMutation
- func (c *AdminCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)
- func (ac *AdminCreate) SaveX(ctx context.Context) *Admin
- func (ac *AdminCreate) SetCreatedAt(t time.Time) *AdminCreate
- func (ac *AdminCreate) SetDeletedAt(i int) *AdminCreate
- func (ac *AdminCreate) SetDisplayName(s string) *AdminCreate
- func (ac *AdminCreate) SetIsEnable(b bool) *AdminCreate
- func (ac *AdminCreate) SetNillableCreatedAt(t *time.Time) *AdminCreate
- func (ac *AdminCreate) SetNillableDeletedAt(i *int) *AdminCreate
- func (ac *AdminCreate) SetNillableDisplayName(s *string) *AdminCreate
- func (ac *AdminCreate) SetNillableIsEnable(b *bool) *AdminCreate
- func (ac *AdminCreate) SetNillableUpdatedAt(t *time.Time) *AdminCreate
- func (ac *AdminCreate) SetPassword(s string) *AdminCreate
- func (ac *AdminCreate) SetUpdatedAt(t time.Time) *AdminCreate
- func (ac *AdminCreate) SetUsername(s string) *AdminCreate
- func (ac *AdminCreate) SetWhitelistIps(s []string) *AdminCreate
- type AdminCreateBulk
- func (acb *AdminCreateBulk) Exec(ctx context.Context) error
- func (c *AdminCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (acb *AdminCreateBulk) ExecX(ctx context.Context)
- func (c *AdminCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (acb *AdminCreateBulk) Save(ctx context.Context) ([]*Admin, error)
- func (acb *AdminCreateBulk) SaveX(ctx context.Context) []*Admin
- type AdminDelete
- func (ad *AdminDelete) Exec(ctx context.Context) (int, error)
- func (c *AdminDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ad *AdminDelete) ExecX(ctx context.Context) int
- func (c *AdminDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ad *AdminDelete) Where(ps ...predicate.Admin) *AdminDelete
- type AdminDeleteOne
- type AdminEdges
- type AdminGroupBy
- func (agb *AdminGroupBy) Aggregate(fns ...AggregateFunc) *AdminGroupBy
- func (s *AdminGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AdminGroupBy) BoolX(ctx context.Context) bool
- func (s *AdminGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AdminGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AdminGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AdminGroupBy) Float64X(ctx context.Context) float64
- func (s *AdminGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AdminGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AdminGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AdminGroupBy) IntX(ctx context.Context) int
- func (s *AdminGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AdminGroupBy) IntsX(ctx context.Context) []int
- func (agb *AdminGroupBy) Scan(ctx context.Context, v any) error
- func (s *AdminGroupBy) ScanX(ctx context.Context, v any)
- func (s *AdminGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AdminGroupBy) StringX(ctx context.Context) string
- func (s *AdminGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AdminGroupBy) StringsX(ctx context.Context) []string
- type AdminMutation
- func (m *AdminMutation) AddDeletedAt(i int)
- func (m *AdminMutation) AddField(name string, value ent.Value) error
- func (m *AdminMutation) AddRoleIDs(ids ...int)
- func (m *AdminMutation) AddedDeletedAt() (r int, exists bool)
- func (m *AdminMutation) AddedEdges() []string
- func (m *AdminMutation) AddedField(name string) (ent.Value, bool)
- func (m *AdminMutation) AddedFields() []string
- func (m *AdminMutation) AddedIDs(name string) []ent.Value
- func (m *AdminMutation) AppendWhitelistIps(s []string)
- func (m *AdminMutation) AppendedWhitelistIps() ([]string, bool)
- func (m *AdminMutation) ClearDisplayName()
- func (m *AdminMutation) ClearEdge(name string) error
- func (m *AdminMutation) ClearField(name string) error
- func (m *AdminMutation) ClearRoles()
- func (m *AdminMutation) ClearedEdges() []string
- func (m *AdminMutation) ClearedFields() []string
- func (m AdminMutation) Client() *Client
- func (m *AdminMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AdminMutation) DeletedAt() (r int, exists bool)
- func (m *AdminMutation) DisplayName() (r string, exists bool)
- func (m *AdminMutation) DisplayNameCleared() bool
- func (m *AdminMutation) EdgeCleared(name string) bool
- func (c *AdminMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (m *AdminMutation) Field(name string) (ent.Value, bool)
- func (m *AdminMutation) FieldCleared(name string) bool
- func (m *AdminMutation) Fields() []string
- func (m *AdminMutation) ID() (id int, exists bool)
- func (m *AdminMutation) IDs(ctx context.Context) ([]int, error)
- func (m *AdminMutation) IsEnable() (r bool, exists bool)
- func (m *AdminMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AdminMutation) OldDeletedAt(ctx context.Context) (v int, err error)
- func (m *AdminMutation) OldDisplayName(ctx context.Context) (v string, err error)
- func (m *AdminMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AdminMutation) OldIsEnable(ctx context.Context) (v bool, err error)
- func (m *AdminMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *AdminMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AdminMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *AdminMutation) OldWhitelistIps(ctx context.Context) (v []string, err error)
- func (m *AdminMutation) Op() Op
- func (m *AdminMutation) Password() (r string, exists bool)
- func (c *AdminMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *AdminMutation) RemoveRoleIDs(ids ...int)
- func (m *AdminMutation) RemovedEdges() []string
- func (m *AdminMutation) RemovedIDs(name string) []ent.Value
- func (m *AdminMutation) RemovedRolesIDs() (ids []int)
- func (m *AdminMutation) ResetCreatedAt()
- func (m *AdminMutation) ResetDeletedAt()
- func (m *AdminMutation) ResetDisplayName()
- func (m *AdminMutation) ResetEdge(name string) error
- func (m *AdminMutation) ResetField(name string) error
- func (m *AdminMutation) ResetIsEnable()
- func (m *AdminMutation) ResetPassword()
- func (m *AdminMutation) ResetRoles()
- func (m *AdminMutation) ResetUpdatedAt()
- func (m *AdminMutation) ResetUsername()
- func (m *AdminMutation) ResetWhitelistIps()
- func (m *AdminMutation) RolesCleared() bool
- func (m *AdminMutation) RolesIDs() (ids []int)
- func (m *AdminMutation) SetCreatedAt(t time.Time)
- func (m *AdminMutation) SetDeletedAt(i int)
- func (m *AdminMutation) SetDisplayName(s string)
- func (m *AdminMutation) SetField(name string, value ent.Value) error
- func (m *AdminMutation) SetIsEnable(b bool)
- func (m *AdminMutation) SetOp(op Op)
- func (m *AdminMutation) SetPassword(s string)
- func (m *AdminMutation) SetUpdatedAt(t time.Time)
- func (m *AdminMutation) SetUsername(s string)
- func (m *AdminMutation) SetWhitelistIps(s []string)
- func (m AdminMutation) Tx() (*Tx, error)
- func (m *AdminMutation) Type() string
- func (m *AdminMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *AdminMutation) Username() (r string, exists bool)
- func (m *AdminMutation) Where(ps ...predicate.Admin)
- func (m *AdminMutation) WhereP(ps ...func(*sql.Selector))
- func (m *AdminMutation) WhitelistIps() (r []string, exists bool)
- type AdminQuery
- func (aq *AdminQuery) Aggregate(fns ...AggregateFunc) *AdminSelect
- func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)
- func (aq *AdminQuery) AllX(ctx context.Context) []*Admin
- func (aq *AdminQuery) Clone() *AdminQuery
- func (aq *AdminQuery) Count(ctx context.Context) (int, error)
- func (aq *AdminQuery) CountX(ctx context.Context) int
- func (c *AdminQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (aq *AdminQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AdminQuery) ExistX(ctx context.Context) bool
- func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)
- func (aq *AdminQuery) FirstID(ctx context.Context) (id int, err error)
- func (aq *AdminQuery) FirstIDX(ctx context.Context) int
- func (aq *AdminQuery) FirstX(ctx context.Context) *Admin
- func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy
- func (aq *AdminQuery) IDs(ctx context.Context) (ids []int, err error)
- func (aq *AdminQuery) IDsX(ctx context.Context) []int
- func (aq *AdminQuery) Limit(limit int) *AdminQuery
- func (aq *AdminQuery) Modify(modifiers ...func(s *sql.Selector)) *AdminSelect
- func (aq *AdminQuery) Offset(offset int) *AdminQuery
- func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)
- func (aq *AdminQuery) OnlyID(ctx context.Context) (id int, err error)
- func (aq *AdminQuery) OnlyIDX(ctx context.Context) int
- func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin
- func (aq *AdminQuery) Order(o ...admin.OrderOption) *AdminQuery
- func (c *AdminQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (aq *AdminQuery) QueryRoles() *RoleQuery
- func (aq *AdminQuery) Select(fields ...string) *AdminSelect
- func (aq *AdminQuery) Unique(unique bool) *AdminQuery
- func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery
- func (aq *AdminQuery) WithRoles(opts ...func(*RoleQuery)) *AdminQuery
- type AdminSelect
- func (as *AdminSelect) Aggregate(fns ...AggregateFunc) *AdminSelect
- func (s *AdminSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AdminSelect) BoolX(ctx context.Context) bool
- func (s *AdminSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AdminSelect) BoolsX(ctx context.Context) []bool
- func (c AdminSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (s *AdminSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AdminSelect) Float64X(ctx context.Context) float64
- func (s *AdminSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AdminSelect) Float64sX(ctx context.Context) []float64
- func (s *AdminSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AdminSelect) IntX(ctx context.Context) int
- func (s *AdminSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AdminSelect) IntsX(ctx context.Context) []int
- func (as *AdminSelect) Modify(modifiers ...func(s *sql.Selector)) *AdminSelect
- func (c AdminSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (as *AdminSelect) Scan(ctx context.Context, v any) error
- func (s *AdminSelect) ScanX(ctx context.Context, v any)
- func (s *AdminSelect) String(ctx context.Context) (_ string, err error)
- func (s *AdminSelect) StringX(ctx context.Context) string
- func (s *AdminSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AdminSelect) StringsX(ctx context.Context) []string
- type AdminUpdate
- func (au *AdminUpdate) AddDeletedAt(i int) *AdminUpdate
- func (au *AdminUpdate) AddRoleIDs(ids ...int) *AdminUpdate
- func (au *AdminUpdate) AddRoles(r ...*Role) *AdminUpdate
- func (au *AdminUpdate) AppendWhitelistIps(s []string) *AdminUpdate
- func (au *AdminUpdate) ClearDisplayName() *AdminUpdate
- func (au *AdminUpdate) ClearRoles() *AdminUpdate
- func (au *AdminUpdate) Exec(ctx context.Context) error
- func (c *AdminUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (au *AdminUpdate) ExecX(ctx context.Context)
- func (au *AdminUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AdminUpdate
- func (au *AdminUpdate) Mutation() *AdminMutation
- func (c *AdminUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (au *AdminUpdate) RemoveRoleIDs(ids ...int) *AdminUpdate
- func (au *AdminUpdate) RemoveRoles(r ...*Role) *AdminUpdate
- func (au *AdminUpdate) Save(ctx context.Context) (int, error)
- func (au *AdminUpdate) SaveX(ctx context.Context) int
- func (au *AdminUpdate) SetCreatedAt(t time.Time) *AdminUpdate
- func (au *AdminUpdate) SetDeletedAt(i int) *AdminUpdate
- func (au *AdminUpdate) SetDisplayName(s string) *AdminUpdate
- func (au *AdminUpdate) SetIsEnable(b bool) *AdminUpdate
- func (au *AdminUpdate) SetNillableCreatedAt(t *time.Time) *AdminUpdate
- func (au *AdminUpdate) SetNillableDeletedAt(i *int) *AdminUpdate
- func (au *AdminUpdate) SetNillableDisplayName(s *string) *AdminUpdate
- func (au *AdminUpdate) SetNillableIsEnable(b *bool) *AdminUpdate
- func (au *AdminUpdate) SetNillablePassword(s *string) *AdminUpdate
- func (au *AdminUpdate) SetNillableUsername(s *string) *AdminUpdate
- func (au *AdminUpdate) SetPassword(s string) *AdminUpdate
- func (au *AdminUpdate) SetUpdatedAt(t time.Time) *AdminUpdate
- func (au *AdminUpdate) SetUsername(s string) *AdminUpdate
- func (au *AdminUpdate) SetWhitelistIps(s []string) *AdminUpdate
- func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate
- type AdminUpdateOne
- func (auo *AdminUpdateOne) AddDeletedAt(i int) *AdminUpdateOne
- func (auo *AdminUpdateOne) AddRoleIDs(ids ...int) *AdminUpdateOne
- func (auo *AdminUpdateOne) AddRoles(r ...*Role) *AdminUpdateOne
- func (auo *AdminUpdateOne) AppendWhitelistIps(s []string) *AdminUpdateOne
- func (auo *AdminUpdateOne) ClearDisplayName() *AdminUpdateOne
- func (auo *AdminUpdateOne) ClearRoles() *AdminUpdateOne
- func (auo *AdminUpdateOne) Exec(ctx context.Context) error
- func (c *AdminUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (auo *AdminUpdateOne) ExecX(ctx context.Context)
- func (auo *AdminUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AdminUpdateOne
- func (auo *AdminUpdateOne) Mutation() *AdminMutation
- func (c *AdminUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (auo *AdminUpdateOne) RemoveRoleIDs(ids ...int) *AdminUpdateOne
- func (auo *AdminUpdateOne) RemoveRoles(r ...*Role) *AdminUpdateOne
- func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)
- func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin
- func (auo *AdminUpdateOne) Select(field string, fields ...string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetCreatedAt(t time.Time) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetDeletedAt(i int) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetDisplayName(s string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetIsEnable(b bool) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetNillableCreatedAt(t *time.Time) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetNillableDeletedAt(i *int) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetNillableDisplayName(s *string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetNillableIsEnable(b *bool) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetNillablePassword(s *string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetNillableUsername(s *string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetPassword(s string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetUpdatedAt(t time.Time) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetUsername(s string) *AdminUpdateOne
- func (auo *AdminUpdateOne) SetWhitelistIps(s []string) *AdminUpdateOne
- func (auo *AdminUpdateOne) Where(ps ...predicate.Admin) *AdminUpdateOne
- type Admins
- 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) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, 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 Permission
- func (c *Permission) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *Permission) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (pe *Permission) QueryRoles() *RoleQuery
- func (pe *Permission) String() string
- func (pe *Permission) Unwrap() *Permission
- func (pe *Permission) Update() *PermissionUpdateOne
- func (pe *Permission) Value(name string) (ent.Value, error)
- type PermissionClient
- func (c *PermissionClient) Create() *PermissionCreate
- func (c *PermissionClient) CreateBulk(builders ...*PermissionCreate) *PermissionCreateBulk
- func (c *PermissionClient) Delete() *PermissionDelete
- func (c *PermissionClient) DeleteOne(pe *Permission) *PermissionDeleteOne
- func (c *PermissionClient) DeleteOneID(id int) *PermissionDeleteOne
- func (c *PermissionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *PermissionClient) Get(ctx context.Context, id int) (*Permission, error)
- func (c *PermissionClient) GetX(ctx context.Context, id int) *Permission
- func (c *PermissionClient) Hooks() []Hook
- func (c *PermissionClient) Intercept(interceptors ...Interceptor)
- func (c *PermissionClient) Interceptors() []Interceptor
- func (c *PermissionClient) MapCreateBulk(slice any, setFunc func(*PermissionCreate, int)) *PermissionCreateBulk
- func (c *PermissionClient) Query() *PermissionQuery
- func (c *PermissionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *PermissionClient) QueryRoles(pe *Permission) *RoleQuery
- func (c *PermissionClient) Update() *PermissionUpdate
- func (c *PermissionClient) UpdateOne(pe *Permission) *PermissionUpdateOne
- func (c *PermissionClient) UpdateOneID(id int) *PermissionUpdateOne
- func (c *PermissionClient) Use(hooks ...Hook)
- type PermissionCreate
- func (pc *PermissionCreate) AddRoleIDs(ids ...int) *PermissionCreate
- func (pc *PermissionCreate) AddRoles(r ...*Role) *PermissionCreate
- func (pc *PermissionCreate) Exec(ctx context.Context) error
- func (c *PermissionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (pc *PermissionCreate) ExecX(ctx context.Context)
- func (pc *PermissionCreate) Mutation() *PermissionMutation
- func (c *PermissionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (pc *PermissionCreate) Save(ctx context.Context) (*Permission, error)
- func (pc *PermissionCreate) SaveX(ctx context.Context) *Permission
- func (pc *PermissionCreate) SetCreatedAt(t time.Time) *PermissionCreate
- func (pc *PermissionCreate) SetGroup(s string) *PermissionCreate
- func (pc *PermissionCreate) SetKey(s string) *PermissionCreate
- func (pc *PermissionCreate) SetName(s string) *PermissionCreate
- func (pc *PermissionCreate) SetNillableCreatedAt(t *time.Time) *PermissionCreate
- func (pc *PermissionCreate) SetNillableUpdatedAt(t *time.Time) *PermissionCreate
- func (pc *PermissionCreate) SetOrder(i int) *PermissionCreate
- func (pc *PermissionCreate) SetUpdatedAt(t time.Time) *PermissionCreate
- type PermissionCreateBulk
- func (pcb *PermissionCreateBulk) Exec(ctx context.Context) error
- func (c *PermissionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (pcb *PermissionCreateBulk) ExecX(ctx context.Context)
- func (c *PermissionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (pcb *PermissionCreateBulk) Save(ctx context.Context) ([]*Permission, error)
- func (pcb *PermissionCreateBulk) SaveX(ctx context.Context) []*Permission
- type PermissionDelete
- func (pd *PermissionDelete) Exec(ctx context.Context) (int, error)
- func (c *PermissionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (pd *PermissionDelete) ExecX(ctx context.Context) int
- func (c *PermissionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (pd *PermissionDelete) Where(ps ...predicate.Permission) *PermissionDelete
- type PermissionDeleteOne
- type PermissionEdges
- type PermissionGroupBy
- func (pgb *PermissionGroupBy) Aggregate(fns ...AggregateFunc) *PermissionGroupBy
- func (s *PermissionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *PermissionGroupBy) BoolX(ctx context.Context) bool
- func (s *PermissionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *PermissionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *PermissionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *PermissionGroupBy) Float64X(ctx context.Context) float64
- func (s *PermissionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *PermissionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *PermissionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *PermissionGroupBy) IntX(ctx context.Context) int
- func (s *PermissionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *PermissionGroupBy) IntsX(ctx context.Context) []int
- func (pgb *PermissionGroupBy) Scan(ctx context.Context, v any) error
- func (s *PermissionGroupBy) ScanX(ctx context.Context, v any)
- func (s *PermissionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *PermissionGroupBy) StringX(ctx context.Context) string
- func (s *PermissionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *PermissionGroupBy) StringsX(ctx context.Context) []string
- type PermissionMutation
- func (m *PermissionMutation) AddField(name string, value ent.Value) error
- func (m *PermissionMutation) AddOrder(i int)
- func (m *PermissionMutation) AddRoleIDs(ids ...int)
- func (m *PermissionMutation) AddedEdges() []string
- func (m *PermissionMutation) AddedField(name string) (ent.Value, bool)
- func (m *PermissionMutation) AddedFields() []string
- func (m *PermissionMutation) AddedIDs(name string) []ent.Value
- func (m *PermissionMutation) AddedOrder() (r int, exists bool)
- func (m *PermissionMutation) ClearEdge(name string) error
- func (m *PermissionMutation) ClearField(name string) error
- func (m *PermissionMutation) ClearRoles()
- func (m *PermissionMutation) ClearedEdges() []string
- func (m *PermissionMutation) ClearedFields() []string
- func (m PermissionMutation) Client() *Client
- func (m *PermissionMutation) CreatedAt() (r time.Time, exists bool)
- func (m *PermissionMutation) EdgeCleared(name string) bool
- func (c *PermissionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (m *PermissionMutation) Field(name string) (ent.Value, bool)
- func (m *PermissionMutation) FieldCleared(name string) bool
- func (m *PermissionMutation) Fields() []string
- func (m *PermissionMutation) Group() (r string, exists bool)
- func (m *PermissionMutation) ID() (id int, exists bool)
- func (m *PermissionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *PermissionMutation) Key() (r string, exists bool)
- func (m *PermissionMutation) Name() (r string, exists bool)
- func (m *PermissionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PermissionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *PermissionMutation) OldGroup(ctx context.Context) (v string, err error)
- func (m *PermissionMutation) OldKey(ctx context.Context) (v string, err error)
- func (m *PermissionMutation) OldName(ctx context.Context) (v string, err error)
- func (m *PermissionMutation) OldOrder(ctx context.Context) (v int, err error)
- func (m *PermissionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *PermissionMutation) Op() Op
- func (m *PermissionMutation) Order() (r int, exists bool)
- func (c *PermissionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *PermissionMutation) RemoveRoleIDs(ids ...int)
- func (m *PermissionMutation) RemovedEdges() []string
- func (m *PermissionMutation) RemovedIDs(name string) []ent.Value
- func (m *PermissionMutation) RemovedRolesIDs() (ids []int)
- func (m *PermissionMutation) ResetCreatedAt()
- func (m *PermissionMutation) ResetEdge(name string) error
- func (m *PermissionMutation) ResetField(name string) error
- func (m *PermissionMutation) ResetGroup()
- func (m *PermissionMutation) ResetKey()
- func (m *PermissionMutation) ResetName()
- func (m *PermissionMutation) ResetOrder()
- func (m *PermissionMutation) ResetRoles()
- func (m *PermissionMutation) ResetUpdatedAt()
- func (m *PermissionMutation) RolesCleared() bool
- func (m *PermissionMutation) RolesIDs() (ids []int)
- func (m *PermissionMutation) SetCreatedAt(t time.Time)
- func (m *PermissionMutation) SetField(name string, value ent.Value) error
- func (m *PermissionMutation) SetGroup(s string)
- func (m *PermissionMutation) SetKey(s string)
- func (m *PermissionMutation) SetName(s string)
- func (m *PermissionMutation) SetOp(op Op)
- func (m *PermissionMutation) SetOrder(i int)
- func (m *PermissionMutation) SetUpdatedAt(t time.Time)
- func (m PermissionMutation) Tx() (*Tx, error)
- func (m *PermissionMutation) Type() string
- func (m *PermissionMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *PermissionMutation) Where(ps ...predicate.Permission)
- func (m *PermissionMutation) WhereP(ps ...func(*sql.Selector))
- type PermissionQuery
- func (pq *PermissionQuery) Aggregate(fns ...AggregateFunc) *PermissionSelect
- func (pq *PermissionQuery) All(ctx context.Context) ([]*Permission, error)
- func (pq *PermissionQuery) AllX(ctx context.Context) []*Permission
- func (pq *PermissionQuery) Clone() *PermissionQuery
- func (pq *PermissionQuery) Count(ctx context.Context) (int, error)
- func (pq *PermissionQuery) CountX(ctx context.Context) int
- func (c *PermissionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (pq *PermissionQuery) Exist(ctx context.Context) (bool, error)
- func (pq *PermissionQuery) ExistX(ctx context.Context) bool
- func (pq *PermissionQuery) First(ctx context.Context) (*Permission, error)
- func (pq *PermissionQuery) FirstID(ctx context.Context) (id int, err error)
- func (pq *PermissionQuery) FirstIDX(ctx context.Context) int
- func (pq *PermissionQuery) FirstX(ctx context.Context) *Permission
- func (pq *PermissionQuery) GroupBy(field string, fields ...string) *PermissionGroupBy
- func (pq *PermissionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (pq *PermissionQuery) IDsX(ctx context.Context) []int
- func (pq *PermissionQuery) Limit(limit int) *PermissionQuery
- func (pq *PermissionQuery) Modify(modifiers ...func(s *sql.Selector)) *PermissionSelect
- func (pq *PermissionQuery) Offset(offset int) *PermissionQuery
- func (pq *PermissionQuery) Only(ctx context.Context) (*Permission, error)
- func (pq *PermissionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (pq *PermissionQuery) OnlyIDX(ctx context.Context) int
- func (pq *PermissionQuery) OnlyX(ctx context.Context) *Permission
- func (pq *PermissionQuery) Order(o ...permission.OrderOption) *PermissionQuery
- func (c *PermissionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (pq *PermissionQuery) QueryRoles() *RoleQuery
- func (pq *PermissionQuery) Select(fields ...string) *PermissionSelect
- func (pq *PermissionQuery) Unique(unique bool) *PermissionQuery
- func (pq *PermissionQuery) Where(ps ...predicate.Permission) *PermissionQuery
- func (pq *PermissionQuery) WithRoles(opts ...func(*RoleQuery)) *PermissionQuery
- type PermissionSelect
- func (ps *PermissionSelect) Aggregate(fns ...AggregateFunc) *PermissionSelect
- func (s *PermissionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *PermissionSelect) BoolX(ctx context.Context) bool
- func (s *PermissionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *PermissionSelect) BoolsX(ctx context.Context) []bool
- func (c PermissionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (s *PermissionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *PermissionSelect) Float64X(ctx context.Context) float64
- func (s *PermissionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *PermissionSelect) Float64sX(ctx context.Context) []float64
- func (s *PermissionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *PermissionSelect) IntX(ctx context.Context) int
- func (s *PermissionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *PermissionSelect) IntsX(ctx context.Context) []int
- func (ps *PermissionSelect) Modify(modifiers ...func(s *sql.Selector)) *PermissionSelect
- func (c PermissionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ps *PermissionSelect) Scan(ctx context.Context, v any) error
- func (s *PermissionSelect) ScanX(ctx context.Context, v any)
- func (s *PermissionSelect) String(ctx context.Context) (_ string, err error)
- func (s *PermissionSelect) StringX(ctx context.Context) string
- func (s *PermissionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *PermissionSelect) StringsX(ctx context.Context) []string
- type PermissionUpdate
- func (pu *PermissionUpdate) AddOrder(i int) *PermissionUpdate
- func (pu *PermissionUpdate) AddRoleIDs(ids ...int) *PermissionUpdate
- func (pu *PermissionUpdate) AddRoles(r ...*Role) *PermissionUpdate
- func (pu *PermissionUpdate) ClearRoles() *PermissionUpdate
- func (pu *PermissionUpdate) Exec(ctx context.Context) error
- func (c *PermissionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (pu *PermissionUpdate) ExecX(ctx context.Context)
- func (pu *PermissionUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PermissionUpdate
- func (pu *PermissionUpdate) Mutation() *PermissionMutation
- func (c *PermissionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (pu *PermissionUpdate) RemoveRoleIDs(ids ...int) *PermissionUpdate
- func (pu *PermissionUpdate) RemoveRoles(r ...*Role) *PermissionUpdate
- func (pu *PermissionUpdate) Save(ctx context.Context) (int, error)
- func (pu *PermissionUpdate) SaveX(ctx context.Context) int
- func (pu *PermissionUpdate) SetCreatedAt(t time.Time) *PermissionUpdate
- func (pu *PermissionUpdate) SetGroup(s string) *PermissionUpdate
- func (pu *PermissionUpdate) SetKey(s string) *PermissionUpdate
- func (pu *PermissionUpdate) SetName(s string) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableCreatedAt(t *time.Time) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableGroup(s *string) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableKey(s *string) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableName(s *string) *PermissionUpdate
- func (pu *PermissionUpdate) SetNillableOrder(i *int) *PermissionUpdate
- func (pu *PermissionUpdate) SetOrder(i int) *PermissionUpdate
- func (pu *PermissionUpdate) SetUpdatedAt(t time.Time) *PermissionUpdate
- func (pu *PermissionUpdate) Where(ps ...predicate.Permission) *PermissionUpdate
- type PermissionUpdateOne
- func (puo *PermissionUpdateOne) AddOrder(i int) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) AddRoleIDs(ids ...int) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) AddRoles(r ...*Role) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) ClearRoles() *PermissionUpdateOne
- func (puo *PermissionUpdateOne) Exec(ctx context.Context) error
- func (c *PermissionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (puo *PermissionUpdateOne) ExecX(ctx context.Context)
- func (puo *PermissionUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) Mutation() *PermissionMutation
- func (c *PermissionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (puo *PermissionUpdateOne) RemoveRoleIDs(ids ...int) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) RemoveRoles(r ...*Role) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) Save(ctx context.Context) (*Permission, error)
- func (puo *PermissionUpdateOne) SaveX(ctx context.Context) *Permission
- func (puo *PermissionUpdateOne) Select(field string, fields ...string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetCreatedAt(t time.Time) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetGroup(s string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetKey(s string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetName(s string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableCreatedAt(t *time.Time) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableGroup(s *string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableKey(s *string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableName(s *string) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetNillableOrder(i *int) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetOrder(i int) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) SetUpdatedAt(t time.Time) *PermissionUpdateOne
- func (puo *PermissionUpdateOne) Where(ps ...predicate.Permission) *PermissionUpdateOne
- type Permissions
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type Role
- func (c *Role) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (r *Role) QueryAdmins() *AdminQuery
- func (c *Role) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (r *Role) QueryPermissions() *PermissionQuery
- func (r *Role) QueryRoutes() *RouteQuery
- func (r *Role) String() string
- func (r *Role) Unwrap() *Role
- func (r *Role) Update() *RoleUpdateOne
- func (r *Role) Value(name string) (ent.Value, error)
- 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 int) *RoleDeleteOne
- func (c *RoleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *RoleClient) Get(ctx context.Context, id int) (*Role, error)
- func (c *RoleClient) GetX(ctx context.Context, id int) *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) QueryAdmins(r *Role) *AdminQuery
- func (c *RoleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *RoleClient) QueryPermissions(r *Role) *PermissionQuery
- func (c *RoleClient) QueryRoutes(r *Role) *RouteQuery
- func (c *RoleClient) Update() *RoleUpdate
- func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
- func (c *RoleClient) UpdateOneID(id int) *RoleUpdateOne
- func (c *RoleClient) Use(hooks ...Hook)
- type RoleCreate
- func (rc *RoleCreate) AddAdminIDs(ids ...int) *RoleCreate
- func (rc *RoleCreate) AddAdmins(a ...*Admin) *RoleCreate
- func (rc *RoleCreate) AddPermissionIDs(ids ...int) *RoleCreate
- func (rc *RoleCreate) AddPermissions(p ...*Permission) *RoleCreate
- func (rc *RoleCreate) AddRouteIDs(ids ...int) *RoleCreate
- func (rc *RoleCreate) AddRoutes(r ...*Route) *RoleCreate
- func (rc *RoleCreate) Exec(ctx context.Context) error
- func (c *RoleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rc *RoleCreate) ExecX(ctx context.Context)
- func (rc *RoleCreate) Mutation() *RoleMutation
- func (c *RoleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
- func (rc *RoleCreate) SaveX(ctx context.Context) *Role
- func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate
- func (rc *RoleCreate) SetDeletedAt(i int) *RoleCreate
- func (rc *RoleCreate) SetDescription(s string) *RoleCreate
- func (rc *RoleCreate) SetIsChangeable(b bool) *RoleCreate
- func (rc *RoleCreate) SetIsEnable(b bool) *RoleCreate
- func (rc *RoleCreate) SetName(s string) *RoleCreate
- func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate
- func (rc *RoleCreate) SetNillableDeletedAt(i *int) *RoleCreate
- func (rc *RoleCreate) SetNillableIsEnable(b *bool) *RoleCreate
- func (rc *RoleCreate) SetNillableUpdatedAt(t *time.Time) *RoleCreate
- func (rc *RoleCreate) SetOrder(i int) *RoleCreate
- func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate
- type RoleCreateBulk
- func (rcb *RoleCreateBulk) Exec(ctx context.Context) error
- func (c *RoleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rcb *RoleCreateBulk) ExecX(ctx context.Context)
- func (c *RoleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)
- func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role
- type RoleDelete
- func (rd *RoleDelete) Exec(ctx context.Context) (int, error)
- func (c *RoleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rd *RoleDelete) ExecX(ctx context.Context) int
- func (c *RoleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete
- type RoleDeleteOne
- type RoleEdges
- 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) AddAdminIDs(ids ...int)
- func (m *RoleMutation) AddDeletedAt(i int)
- func (m *RoleMutation) AddField(name string, value ent.Value) error
- func (m *RoleMutation) AddOrder(i int)
- func (m *RoleMutation) AddPermissionIDs(ids ...int)
- func (m *RoleMutation) AddRouteIDs(ids ...int)
- func (m *RoleMutation) AddedDeletedAt() (r int, 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) AddedOrder() (r int, exists bool)
- func (m *RoleMutation) AdminsCleared() bool
- func (m *RoleMutation) AdminsIDs() (ids []int)
- func (m *RoleMutation) ClearAdmins()
- func (m *RoleMutation) ClearEdge(name string) error
- func (m *RoleMutation) ClearField(name string) error
- func (m *RoleMutation) ClearPermissions()
- func (m *RoleMutation) ClearRoutes()
- func (m *RoleMutation) ClearedEdges() []string
- func (m *RoleMutation) ClearedFields() []string
- func (m RoleMutation) Client() *Client
- func (m *RoleMutation) CreatedAt() (r time.Time, exists bool)
- func (m *RoleMutation) DeletedAt() (r int, exists bool)
- func (m *RoleMutation) Description() (r string, exists bool)
- func (m *RoleMutation) EdgeCleared(name string) bool
- func (c *RoleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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 int, exists bool)
- func (m *RoleMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RoleMutation) IsChangeable() (r bool, exists bool)
- func (m *RoleMutation) IsEnable() (r bool, exists bool)
- func (m *RoleMutation) Name() (r string, exists bool)
- func (m *RoleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RoleMutation) OldDeletedAt(ctx context.Context) (v int, err error)
- func (m *RoleMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RoleMutation) OldIsChangeable(ctx context.Context) (v bool, err error)
- func (m *RoleMutation) OldIsEnable(ctx context.Context) (v bool, err error)
- func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldOrder(ctx context.Context) (v int, err error)
- func (m *RoleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RoleMutation) Op() Op
- func (m *RoleMutation) Order() (r int, exists bool)
- func (m *RoleMutation) PermissionsCleared() bool
- func (m *RoleMutation) PermissionsIDs() (ids []int)
- func (c *RoleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *RoleMutation) RemoveAdminIDs(ids ...int)
- func (m *RoleMutation) RemovePermissionIDs(ids ...int)
- func (m *RoleMutation) RemoveRouteIDs(ids ...int)
- func (m *RoleMutation) RemovedAdminsIDs() (ids []int)
- func (m *RoleMutation) RemovedEdges() []string
- func (m *RoleMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleMutation) RemovedPermissionsIDs() (ids []int)
- func (m *RoleMutation) RemovedRoutesIDs() (ids []int)
- func (m *RoleMutation) ResetAdmins()
- func (m *RoleMutation) ResetCreatedAt()
- func (m *RoleMutation) ResetDeletedAt()
- func (m *RoleMutation) ResetDescription()
- func (m *RoleMutation) ResetEdge(name string) error
- func (m *RoleMutation) ResetField(name string) error
- func (m *RoleMutation) ResetIsChangeable()
- func (m *RoleMutation) ResetIsEnable()
- func (m *RoleMutation) ResetName()
- func (m *RoleMutation) ResetOrder()
- func (m *RoleMutation) ResetPermissions()
- func (m *RoleMutation) ResetRoutes()
- func (m *RoleMutation) ResetUpdatedAt()
- func (m *RoleMutation) RoutesCleared() bool
- func (m *RoleMutation) RoutesIDs() (ids []int)
- func (m *RoleMutation) SetCreatedAt(t time.Time)
- func (m *RoleMutation) SetDeletedAt(i int)
- func (m *RoleMutation) SetDescription(s string)
- func (m *RoleMutation) SetField(name string, value ent.Value) error
- func (m *RoleMutation) SetIsChangeable(b bool)
- func (m *RoleMutation) SetIsEnable(b bool)
- func (m *RoleMutation) SetName(s string)
- func (m *RoleMutation) SetOp(op Op)
- func (m *RoleMutation) SetOrder(i int)
- func (m *RoleMutation) SetUpdatedAt(t time.Time)
- func (m RoleMutation) Tx() (*Tx, error)
- func (m *RoleMutation) Type() string
- func (m *RoleMutation) UpdatedAt() (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 (c *RoleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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 int, err error)
- func (rq *RoleQuery) FirstIDX(ctx context.Context) int
- 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 []int, err error)
- func (rq *RoleQuery) IDsX(ctx context.Context) []int
- func (rq *RoleQuery) Limit(limit int) *RoleQuery
- func (rq *RoleQuery) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect
- func (rq *RoleQuery) Offset(offset int) *RoleQuery
- func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *RoleQuery) OnlyIDX(ctx context.Context) int
- func (rq *RoleQuery) OnlyX(ctx context.Context) *Role
- func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery
- func (rq *RoleQuery) QueryAdmins() *AdminQuery
- func (c *RoleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rq *RoleQuery) QueryPermissions() *PermissionQuery
- func (rq *RoleQuery) QueryRoutes() *RouteQuery
- func (rq *RoleQuery) Select(fields ...string) *RoleSelect
- func (rq *RoleQuery) Unique(unique bool) *RoleQuery
- func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery
- func (rq *RoleQuery) WithAdmins(opts ...func(*AdminQuery)) *RoleQuery
- func (rq *RoleQuery) WithPermissions(opts ...func(*PermissionQuery)) *RoleQuery
- func (rq *RoleQuery) WithRoutes(opts ...func(*RouteQuery)) *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 (c RoleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- 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) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect
- func (c RoleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- 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) AddAdminIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) AddAdmins(a ...*Admin) *RoleUpdate
- func (ru *RoleUpdate) AddDeletedAt(i int) *RoleUpdate
- func (ru *RoleUpdate) AddOrder(i int) *RoleUpdate
- func (ru *RoleUpdate) AddPermissionIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) AddPermissions(p ...*Permission) *RoleUpdate
- func (ru *RoleUpdate) AddRouteIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) AddRoutes(r ...*Route) *RoleUpdate
- func (ru *RoleUpdate) ClearAdmins() *RoleUpdate
- func (ru *RoleUpdate) ClearPermissions() *RoleUpdate
- func (ru *RoleUpdate) ClearRoutes() *RoleUpdate
- func (ru *RoleUpdate) Exec(ctx context.Context) error
- func (c *RoleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ru *RoleUpdate) ExecX(ctx context.Context)
- func (ru *RoleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdate
- func (ru *RoleUpdate) Mutation() *RoleMutation
- func (c *RoleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ru *RoleUpdate) RemoveAdminIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) RemoveAdmins(a ...*Admin) *RoleUpdate
- func (ru *RoleUpdate) RemovePermissionIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) RemovePermissions(p ...*Permission) *RoleUpdate
- func (ru *RoleUpdate) RemoveRouteIDs(ids ...int) *RoleUpdate
- func (ru *RoleUpdate) RemoveRoutes(r ...*Route) *RoleUpdate
- func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
- func (ru *RoleUpdate) SaveX(ctx context.Context) int
- func (ru *RoleUpdate) SetCreatedAt(t time.Time) *RoleUpdate
- func (ru *RoleUpdate) SetDeletedAt(i int) *RoleUpdate
- func (ru *RoleUpdate) SetDescription(s string) *RoleUpdate
- func (ru *RoleUpdate) SetIsChangeable(b bool) *RoleUpdate
- func (ru *RoleUpdate) SetIsEnable(b bool) *RoleUpdate
- func (ru *RoleUpdate) SetName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableCreatedAt(t *time.Time) *RoleUpdate
- func (ru *RoleUpdate) SetNillableDeletedAt(i *int) *RoleUpdate
- func (ru *RoleUpdate) SetNillableDescription(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableIsChangeable(b *bool) *RoleUpdate
- func (ru *RoleUpdate) SetNillableIsEnable(b *bool) *RoleUpdate
- func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableOrder(i *int) *RoleUpdate
- func (ru *RoleUpdate) SetOrder(i int) *RoleUpdate
- func (ru *RoleUpdate) SetUpdatedAt(t time.Time) *RoleUpdate
- func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
- type RoleUpdateOne
- func (ruo *RoleUpdateOne) AddAdminIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddAdmins(a ...*Admin) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddDeletedAt(i int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddOrder(i int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddPermissionIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddPermissions(p ...*Permission) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddRouteIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddRoutes(r ...*Route) *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearAdmins() *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearPermissions() *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearRoutes() *RoleUpdateOne
- func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
- func (c *RoleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
- func (ruo *RoleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdateOne
- func (ruo *RoleUpdateOne) Mutation() *RoleMutation
- func (c *RoleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ruo *RoleUpdateOne) RemoveAdminIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveAdmins(a ...*Admin) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemovePermissionIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemovePermissions(p ...*Permission) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveRouteIDs(ids ...int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveRoutes(r ...*Route) *RoleUpdateOne
- 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) SetCreatedAt(t time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetDeletedAt(i int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetDescription(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetIsChangeable(b bool) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetIsEnable(b bool) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableCreatedAt(t *time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableDeletedAt(i *int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableDescription(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableIsChangeable(b *bool) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableIsEnable(b *bool) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableOrder(i *int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetOrder(i int) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUpdatedAt(t time.Time) *RoleUpdateOne
- func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne
- type Roles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Route
- func (c *Route) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (r *Route) QueryChildren() *RouteQuery
- func (c *Route) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (r *Route) QueryParent() *RouteQuery
- func (r *Route) QueryRoles() *RoleQuery
- func (r *Route) String() string
- func (r *Route) Unwrap() *Route
- func (r *Route) Update() *RouteUpdateOne
- func (r *Route) Value(name string) (ent.Value, error)
- type RouteClient
- func (c *RouteClient) Create() *RouteCreate
- func (c *RouteClient) CreateBulk(builders ...*RouteCreate) *RouteCreateBulk
- func (c *RouteClient) Delete() *RouteDelete
- func (c *RouteClient) DeleteOne(r *Route) *RouteDeleteOne
- func (c *RouteClient) DeleteOneID(id int) *RouteDeleteOne
- func (c *RouteClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (c *RouteClient) Get(ctx context.Context, id int) (*Route, error)
- func (c *RouteClient) GetX(ctx context.Context, id int) *Route
- func (c *RouteClient) Hooks() []Hook
- func (c *RouteClient) Intercept(interceptors ...Interceptor)
- func (c *RouteClient) Interceptors() []Interceptor
- func (c *RouteClient) MapCreateBulk(slice any, setFunc func(*RouteCreate, int)) *RouteCreateBulk
- func (c *RouteClient) Query() *RouteQuery
- func (c *RouteClient) QueryChildren(r *Route) *RouteQuery
- func (c *RouteClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (c *RouteClient) QueryParent(r *Route) *RouteQuery
- func (c *RouteClient) QueryRoles(r *Route) *RoleQuery
- func (c *RouteClient) Update() *RouteUpdate
- func (c *RouteClient) UpdateOne(r *Route) *RouteUpdateOne
- func (c *RouteClient) UpdateOneID(id int) *RouteUpdateOne
- func (c *RouteClient) Use(hooks ...Hook)
- type RouteCreate
- func (rc *RouteCreate) AddChildIDs(ids ...int) *RouteCreate
- func (rc *RouteCreate) AddChildren(r ...*Route) *RouteCreate
- func (rc *RouteCreate) AddRoleIDs(ids ...int) *RouteCreate
- func (rc *RouteCreate) AddRoles(r ...*Role) *RouteCreate
- func (rc *RouteCreate) Exec(ctx context.Context) error
- func (c *RouteCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rc *RouteCreate) ExecX(ctx context.Context)
- func (rc *RouteCreate) Mutation() *RouteMutation
- func (c *RouteCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rc *RouteCreate) Save(ctx context.Context) (*Route, error)
- func (rc *RouteCreate) SaveX(ctx context.Context) *Route
- func (rc *RouteCreate) SetComponent(s string) *RouteCreate
- func (rc *RouteCreate) SetCreatedAt(t time.Time) *RouteCreate
- func (rc *RouteCreate) SetDeletedAt(i int) *RouteCreate
- func (rc *RouteCreate) SetID(i int) *RouteCreate
- func (rc *RouteCreate) SetIsEnable(b bool) *RouteCreate
- func (rc *RouteCreate) SetMeta(tm types.RouteMeta) *RouteCreate
- func (rc *RouteCreate) SetName(s string) *RouteCreate
- func (rc *RouteCreate) SetNillableCreatedAt(t *time.Time) *RouteCreate
- func (rc *RouteCreate) SetNillableDeletedAt(i *int) *RouteCreate
- func (rc *RouteCreate) SetNillableIsEnable(b *bool) *RouteCreate
- func (rc *RouteCreate) SetNillableParentID(i *int) *RouteCreate
- func (rc *RouteCreate) SetNillableRedirect(s *string) *RouteCreate
- func (rc *RouteCreate) SetNillableType(r *route.Type) *RouteCreate
- func (rc *RouteCreate) SetNillableUpdatedAt(t *time.Time) *RouteCreate
- func (rc *RouteCreate) SetParent(r *Route) *RouteCreate
- func (rc *RouteCreate) SetParentID(i int) *RouteCreate
- func (rc *RouteCreate) SetPath(s string) *RouteCreate
- func (rc *RouteCreate) SetRedirect(s string) *RouteCreate
- func (rc *RouteCreate) SetType(r route.Type) *RouteCreate
- func (rc *RouteCreate) SetUpdatedAt(t time.Time) *RouteCreate
- type RouteCreateBulk
- func (rcb *RouteCreateBulk) Exec(ctx context.Context) error
- func (c *RouteCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rcb *RouteCreateBulk) ExecX(ctx context.Context)
- func (c *RouteCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rcb *RouteCreateBulk) Save(ctx context.Context) ([]*Route, error)
- func (rcb *RouteCreateBulk) SaveX(ctx context.Context) []*Route
- type RouteDelete
- func (rd *RouteDelete) Exec(ctx context.Context) (int, error)
- func (c *RouteDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rd *RouteDelete) ExecX(ctx context.Context) int
- func (c *RouteDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rd *RouteDelete) Where(ps ...predicate.Route) *RouteDelete
- type RouteDeleteOne
- type RouteEdges
- type RouteGroupBy
- func (rgb *RouteGroupBy) Aggregate(fns ...AggregateFunc) *RouteGroupBy
- func (s *RouteGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RouteGroupBy) BoolX(ctx context.Context) bool
- func (s *RouteGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RouteGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RouteGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RouteGroupBy) Float64X(ctx context.Context) float64
- func (s *RouteGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RouteGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RouteGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RouteGroupBy) IntX(ctx context.Context) int
- func (s *RouteGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RouteGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RouteGroupBy) Scan(ctx context.Context, v any) error
- func (s *RouteGroupBy) ScanX(ctx context.Context, v any)
- func (s *RouteGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RouteGroupBy) StringX(ctx context.Context) string
- func (s *RouteGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RouteGroupBy) StringsX(ctx context.Context) []string
- type RouteMutation
- func (m *RouteMutation) AddChildIDs(ids ...int)
- func (m *RouteMutation) AddDeletedAt(i int)
- func (m *RouteMutation) AddField(name string, value ent.Value) error
- func (m *RouteMutation) AddRoleIDs(ids ...int)
- func (m *RouteMutation) AddedDeletedAt() (r int, exists bool)
- func (m *RouteMutation) AddedEdges() []string
- func (m *RouteMutation) AddedField(name string) (ent.Value, bool)
- func (m *RouteMutation) AddedFields() []string
- func (m *RouteMutation) AddedIDs(name string) []ent.Value
- func (m *RouteMutation) ChildrenCleared() bool
- func (m *RouteMutation) ChildrenIDs() (ids []int)
- func (m *RouteMutation) ClearChildren()
- func (m *RouteMutation) ClearEdge(name string) error
- func (m *RouteMutation) ClearField(name string) error
- func (m *RouteMutation) ClearParent()
- func (m *RouteMutation) ClearParentID()
- func (m *RouteMutation) ClearRedirect()
- func (m *RouteMutation) ClearRoles()
- func (m *RouteMutation) ClearedEdges() []string
- func (m *RouteMutation) ClearedFields() []string
- func (m RouteMutation) Client() *Client
- func (m *RouteMutation) Component() (r string, exists bool)
- func (m *RouteMutation) CreatedAt() (r time.Time, exists bool)
- func (m *RouteMutation) DeletedAt() (r int, exists bool)
- func (m *RouteMutation) EdgeCleared(name string) bool
- func (c *RouteMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (m *RouteMutation) Field(name string) (ent.Value, bool)
- func (m *RouteMutation) FieldCleared(name string) bool
- func (m *RouteMutation) Fields() []string
- func (m *RouteMutation) GetType() (r route.Type, exists bool)
- func (m *RouteMutation) ID() (id int, exists bool)
- func (m *RouteMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RouteMutation) IsEnable() (r bool, exists bool)
- func (m *RouteMutation) Meta() (r types.RouteMeta, exists bool)
- func (m *RouteMutation) Name() (r string, exists bool)
- func (m *RouteMutation) OldComponent(ctx context.Context) (v string, err error)
- func (m *RouteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RouteMutation) OldDeletedAt(ctx context.Context) (v int, err error)
- func (m *RouteMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RouteMutation) OldIsEnable(ctx context.Context) (v bool, err error)
- func (m *RouteMutation) OldMeta(ctx context.Context) (v types.RouteMeta, err error)
- func (m *RouteMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RouteMutation) OldParentID(ctx context.Context) (v *int, err error)
- func (m *RouteMutation) OldPath(ctx context.Context) (v string, err error)
- func (m *RouteMutation) OldRedirect(ctx context.Context) (v *string, err error)
- func (m *RouteMutation) OldType(ctx context.Context) (v route.Type, err error)
- func (m *RouteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RouteMutation) Op() Op
- func (m *RouteMutation) ParentCleared() bool
- func (m *RouteMutation) ParentID() (r int, exists bool)
- func (m *RouteMutation) ParentIDCleared() bool
- func (m *RouteMutation) ParentIDs() (ids []int)
- func (m *RouteMutation) Path() (r string, exists bool)
- func (c *RouteMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (m *RouteMutation) Redirect() (r string, exists bool)
- func (m *RouteMutation) RedirectCleared() bool
- func (m *RouteMutation) RemoveChildIDs(ids ...int)
- func (m *RouteMutation) RemoveRoleIDs(ids ...int)
- func (m *RouteMutation) RemovedChildrenIDs() (ids []int)
- func (m *RouteMutation) RemovedEdges() []string
- func (m *RouteMutation) RemovedIDs(name string) []ent.Value
- func (m *RouteMutation) RemovedRolesIDs() (ids []int)
- func (m *RouteMutation) ResetChildren()
- func (m *RouteMutation) ResetComponent()
- func (m *RouteMutation) ResetCreatedAt()
- func (m *RouteMutation) ResetDeletedAt()
- func (m *RouteMutation) ResetEdge(name string) error
- func (m *RouteMutation) ResetField(name string) error
- func (m *RouteMutation) ResetIsEnable()
- func (m *RouteMutation) ResetMeta()
- func (m *RouteMutation) ResetName()
- func (m *RouteMutation) ResetParent()
- func (m *RouteMutation) ResetParentID()
- func (m *RouteMutation) ResetPath()
- func (m *RouteMutation) ResetRedirect()
- func (m *RouteMutation) ResetRoles()
- func (m *RouteMutation) ResetType()
- func (m *RouteMutation) ResetUpdatedAt()
- func (m *RouteMutation) RolesCleared() bool
- func (m *RouteMutation) RolesIDs() (ids []int)
- func (m *RouteMutation) SetComponent(s string)
- func (m *RouteMutation) SetCreatedAt(t time.Time)
- func (m *RouteMutation) SetDeletedAt(i int)
- func (m *RouteMutation) SetField(name string, value ent.Value) error
- func (m *RouteMutation) SetID(id int)
- func (m *RouteMutation) SetIsEnable(b bool)
- func (m *RouteMutation) SetMeta(tm types.RouteMeta)
- func (m *RouteMutation) SetName(s string)
- func (m *RouteMutation) SetOp(op Op)
- func (m *RouteMutation) SetParentID(i int)
- func (m *RouteMutation) SetPath(s string)
- func (m *RouteMutation) SetRedirect(s string)
- func (m *RouteMutation) SetType(r route.Type)
- func (m *RouteMutation) SetUpdatedAt(t time.Time)
- func (m RouteMutation) Tx() (*Tx, error)
- func (m *RouteMutation) Type() string
- func (m *RouteMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *RouteMutation) Where(ps ...predicate.Route)
- func (m *RouteMutation) WhereP(ps ...func(*sql.Selector))
- type RouteQuery
- func (rq *RouteQuery) Aggregate(fns ...AggregateFunc) *RouteSelect
- func (rq *RouteQuery) All(ctx context.Context) ([]*Route, error)
- func (rq *RouteQuery) AllX(ctx context.Context) []*Route
- func (rq *RouteQuery) Clone() *RouteQuery
- func (rq *RouteQuery) Count(ctx context.Context) (int, error)
- func (rq *RouteQuery) CountX(ctx context.Context) int
- func (c *RouteQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (rq *RouteQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RouteQuery) ExistX(ctx context.Context) bool
- func (rq *RouteQuery) First(ctx context.Context) (*Route, error)
- func (rq *RouteQuery) FirstID(ctx context.Context) (id int, err error)
- func (rq *RouteQuery) FirstIDX(ctx context.Context) int
- func (rq *RouteQuery) FirstX(ctx context.Context) *Route
- func (rq *RouteQuery) GroupBy(field string, fields ...string) *RouteGroupBy
- func (rq *RouteQuery) IDs(ctx context.Context) (ids []int, err error)
- func (rq *RouteQuery) IDsX(ctx context.Context) []int
- func (rq *RouteQuery) Limit(limit int) *RouteQuery
- func (rq *RouteQuery) Modify(modifiers ...func(s *sql.Selector)) *RouteSelect
- func (rq *RouteQuery) Offset(offset int) *RouteQuery
- func (rq *RouteQuery) Only(ctx context.Context) (*Route, error)
- func (rq *RouteQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *RouteQuery) OnlyIDX(ctx context.Context) int
- func (rq *RouteQuery) OnlyX(ctx context.Context) *Route
- func (rq *RouteQuery) Order(o ...route.OrderOption) *RouteQuery
- func (rq *RouteQuery) QueryChildren() *RouteQuery
- func (c *RouteQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rq *RouteQuery) QueryParent() *RouteQuery
- func (rq *RouteQuery) QueryRoles() *RoleQuery
- func (rq *RouteQuery) Select(fields ...string) *RouteSelect
- func (rq *RouteQuery) Unique(unique bool) *RouteQuery
- func (rq *RouteQuery) Where(ps ...predicate.Route) *RouteQuery
- func (rq *RouteQuery) WithChildren(opts ...func(*RouteQuery)) *RouteQuery
- func (rq *RouteQuery) WithParent(opts ...func(*RouteQuery)) *RouteQuery
- func (rq *RouteQuery) WithRoles(opts ...func(*RoleQuery)) *RouteQuery
- type RouteSelect
- func (rs *RouteSelect) Aggregate(fns ...AggregateFunc) *RouteSelect
- func (s *RouteSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RouteSelect) BoolX(ctx context.Context) bool
- func (s *RouteSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RouteSelect) BoolsX(ctx context.Context) []bool
- func (c RouteSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (s *RouteSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RouteSelect) Float64X(ctx context.Context) float64
- func (s *RouteSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RouteSelect) Float64sX(ctx context.Context) []float64
- func (s *RouteSelect) Int(ctx context.Context) (_ int, err error)
- func (s *RouteSelect) IntX(ctx context.Context) int
- func (s *RouteSelect) Ints(ctx context.Context) ([]int, error)
- func (s *RouteSelect) IntsX(ctx context.Context) []int
- func (rs *RouteSelect) Modify(modifiers ...func(s *sql.Selector)) *RouteSelect
- func (c RouteSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (rs *RouteSelect) Scan(ctx context.Context, v any) error
- func (s *RouteSelect) ScanX(ctx context.Context, v any)
- func (s *RouteSelect) String(ctx context.Context) (_ string, err error)
- func (s *RouteSelect) StringX(ctx context.Context) string
- func (s *RouteSelect) Strings(ctx context.Context) ([]string, error)
- func (s *RouteSelect) StringsX(ctx context.Context) []string
- type RouteUpdate
- func (ru *RouteUpdate) AddChildIDs(ids ...int) *RouteUpdate
- func (ru *RouteUpdate) AddChildren(r ...*Route) *RouteUpdate
- func (ru *RouteUpdate) AddDeletedAt(i int) *RouteUpdate
- func (ru *RouteUpdate) AddRoleIDs(ids ...int) *RouteUpdate
- func (ru *RouteUpdate) AddRoles(r ...*Role) *RouteUpdate
- func (ru *RouteUpdate) ClearChildren() *RouteUpdate
- func (ru *RouteUpdate) ClearParent() *RouteUpdate
- func (ru *RouteUpdate) ClearParentID() *RouteUpdate
- func (ru *RouteUpdate) ClearRedirect() *RouteUpdate
- func (ru *RouteUpdate) ClearRoles() *RouteUpdate
- func (ru *RouteUpdate) Exec(ctx context.Context) error
- func (c *RouteUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ru *RouteUpdate) ExecX(ctx context.Context)
- func (ru *RouteUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RouteUpdate
- func (ru *RouteUpdate) Mutation() *RouteMutation
- func (c *RouteUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ru *RouteUpdate) RemoveChildIDs(ids ...int) *RouteUpdate
- func (ru *RouteUpdate) RemoveChildren(r ...*Route) *RouteUpdate
- func (ru *RouteUpdate) RemoveRoleIDs(ids ...int) *RouteUpdate
- func (ru *RouteUpdate) RemoveRoles(r ...*Role) *RouteUpdate
- func (ru *RouteUpdate) Save(ctx context.Context) (int, error)
- func (ru *RouteUpdate) SaveX(ctx context.Context) int
- func (ru *RouteUpdate) SetComponent(s string) *RouteUpdate
- func (ru *RouteUpdate) SetCreatedAt(t time.Time) *RouteUpdate
- func (ru *RouteUpdate) SetDeletedAt(i int) *RouteUpdate
- func (ru *RouteUpdate) SetIsEnable(b bool) *RouteUpdate
- func (ru *RouteUpdate) SetMeta(tm types.RouteMeta) *RouteUpdate
- func (ru *RouteUpdate) SetName(s string) *RouteUpdate
- func (ru *RouteUpdate) SetNillableComponent(s *string) *RouteUpdate
- func (ru *RouteUpdate) SetNillableCreatedAt(t *time.Time) *RouteUpdate
- func (ru *RouteUpdate) SetNillableDeletedAt(i *int) *RouteUpdate
- func (ru *RouteUpdate) SetNillableIsEnable(b *bool) *RouteUpdate
- func (ru *RouteUpdate) SetNillableMeta(tm *types.RouteMeta) *RouteUpdate
- func (ru *RouteUpdate) SetNillableName(s *string) *RouteUpdate
- func (ru *RouteUpdate) SetNillableParentID(i *int) *RouteUpdate
- func (ru *RouteUpdate) SetNillablePath(s *string) *RouteUpdate
- func (ru *RouteUpdate) SetNillableRedirect(s *string) *RouteUpdate
- func (ru *RouteUpdate) SetNillableType(r *route.Type) *RouteUpdate
- func (ru *RouteUpdate) SetParent(r *Route) *RouteUpdate
- func (ru *RouteUpdate) SetParentID(i int) *RouteUpdate
- func (ru *RouteUpdate) SetPath(s string) *RouteUpdate
- func (ru *RouteUpdate) SetRedirect(s string) *RouteUpdate
- func (ru *RouteUpdate) SetType(r route.Type) *RouteUpdate
- func (ru *RouteUpdate) SetUpdatedAt(t time.Time) *RouteUpdate
- func (ru *RouteUpdate) Where(ps ...predicate.Route) *RouteUpdate
- type RouteUpdateOne
- func (ruo *RouteUpdateOne) AddChildIDs(ids ...int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddChildren(r ...*Route) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddDeletedAt(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddRoleIDs(ids ...int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) AddRoles(r ...*Role) *RouteUpdateOne
- func (ruo *RouteUpdateOne) ClearChildren() *RouteUpdateOne
- func (ruo *RouteUpdateOne) ClearParent() *RouteUpdateOne
- func (ruo *RouteUpdateOne) ClearParentID() *RouteUpdateOne
- func (ruo *RouteUpdateOne) ClearRedirect() *RouteUpdateOne
- func (ruo *RouteUpdateOne) ClearRoles() *RouteUpdateOne
- func (ruo *RouteUpdateOne) Exec(ctx context.Context) error
- func (c *RouteUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (ruo *RouteUpdateOne) ExecX(ctx context.Context)
- func (ruo *RouteUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RouteUpdateOne
- func (ruo *RouteUpdateOne) Mutation() *RouteMutation
- func (c *RouteUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (ruo *RouteUpdateOne) RemoveChildIDs(ids ...int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) RemoveChildren(r ...*Route) *RouteUpdateOne
- func (ruo *RouteUpdateOne) RemoveRoleIDs(ids ...int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) RemoveRoles(r ...*Role) *RouteUpdateOne
- func (ruo *RouteUpdateOne) Save(ctx context.Context) (*Route, error)
- func (ruo *RouteUpdateOne) SaveX(ctx context.Context) *Route
- func (ruo *RouteUpdateOne) Select(field string, fields ...string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetComponent(s string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetCreatedAt(t time.Time) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetDeletedAt(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetIsEnable(b bool) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetMeta(tm types.RouteMeta) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetName(s string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableComponent(s *string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableCreatedAt(t *time.Time) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableDeletedAt(i *int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableIsEnable(b *bool) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableMeta(tm *types.RouteMeta) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableName(s *string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableParentID(i *int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillablePath(s *string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableRedirect(s *string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetNillableType(r *route.Type) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetParent(r *Route) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetParentID(i int) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetPath(s string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetRedirect(s string) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetType(r route.Type) *RouteUpdateOne
- func (ruo *RouteUpdateOne) SetUpdatedAt(t time.Time) *RouteUpdateOne
- func (ruo *RouteUpdateOne) Where(ps ...predicate.Route) *RouteUpdateOne
- type Routes
- type TraverseFunc
- type Traverser
- type Tx
- func (tx *Tx) Client() *Client
- func (tx *Tx) Commit() error
- func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
- func (tx *Tx) OnCommit(f CommitHook)
- func (tx *Tx) OnRollback(f RollbackHook)
- func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
- func (tx *Tx) Rollback() error
- 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. TypeAdmin = "Admin" TypePermission = "Permission" TypeRole = "Role" TypeRoute = "Route" )
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 Admin ¶
type Admin struct { // ID of the ent. ID int `json:"id" rql:"filter,sort"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updatedAt,omitempty"` // IsEnable holds the value of the "is_enable" field. IsEnable bool `json:"isEnable" rql:"filter,sort"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt int `json:"-"` // Username holds the value of the "username" field. Username string `json:"username" rql:"column=username,filter,sort"` // Password holds the value of the "password" field. Password string `json:"-" rql:"-"` // WhitelistIps holds the value of the "whitelist_ips" field. WhitelistIps []string `json:"whitelistIps"` // DisplayName holds the value of the "display_name" field. DisplayName string `json:"displayName,omitempty" rql:"filter,sort"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the AdminQuery when eager-loading is set. Edges AdminEdges `json:"edges" rql:"-"` // contains filtered or unexported fields }
Admin is the model entity for the Admin schema.
func (*Admin) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Admin) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Admin) QueryRoles ¶
QueryRoles queries the "roles" edge of the Admin entity.
func (*Admin) Unwrap ¶
Unwrap unwraps the Admin 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 (*Admin) Update ¶
func (a *Admin) Update() *AdminUpdateOne
Update returns a builder for updating this Admin. Note that you need to call Admin.Unwrap() before calling this method if this Admin was returned from a transaction, and the transaction was committed or rolled back.
type AdminClient ¶
type AdminClient struct {
// contains filtered or unexported fields
}
AdminClient is a client for the Admin schema.
func NewAdminClient ¶
func NewAdminClient(c config) *AdminClient
NewAdminClient returns a client for the Admin from the given config.
func (*AdminClient) Create ¶
func (c *AdminClient) Create() *AdminCreate
Create returns a builder for creating a Admin entity.
func (*AdminClient) CreateBulk ¶
func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk
CreateBulk returns a builder for creating a bulk of Admin entities.
func (*AdminClient) Delete ¶
func (c *AdminClient) Delete() *AdminDelete
Delete returns a delete builder for Admin.
func (*AdminClient) DeleteOne ¶
func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*AdminClient) DeleteOneID ¶
func (c *AdminClient) DeleteOneID(id int) *AdminDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*AdminClient) ExecContext ¶
func (c *AdminClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminClient) GetX ¶
func (c *AdminClient) GetX(ctx context.Context, id int) *Admin
GetX is like Get, but panics if an error occurs.
func (*AdminClient) Intercept ¶
func (c *AdminClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `admin.Intercept(f(g(h())))`.
func (*AdminClient) Interceptors ¶
func (c *AdminClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*AdminClient) MapCreateBulk ¶
func (c *AdminClient) MapCreateBulk(slice any, setFunc func(*AdminCreate, int)) *AdminCreateBulk
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 (*AdminClient) Query ¶
func (c *AdminClient) Query() *AdminQuery
Query returns a query builder for Admin.
func (*AdminClient) QueryContext ¶
func (c *AdminClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminClient) QueryRoles ¶
func (c *AdminClient) QueryRoles(a *Admin) *RoleQuery
QueryRoles queries the roles edge of a Admin.
func (*AdminClient) Update ¶
func (c *AdminClient) Update() *AdminUpdate
Update returns an update builder for Admin.
func (*AdminClient) UpdateOne ¶
func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne
UpdateOne returns an update builder for the given entity.
func (*AdminClient) UpdateOneID ¶
func (c *AdminClient) UpdateOneID(id int) *AdminUpdateOne
UpdateOneID returns an update builder for the given id.
func (*AdminClient) Use ¶
func (c *AdminClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `admin.Hooks(f(g(h())))`.
type AdminCreate ¶
type AdminCreate struct {
// contains filtered or unexported fields
}
AdminCreate is the builder for creating a Admin entity.
func (*AdminCreate) AddRoleIDs ¶
func (ac *AdminCreate) AddRoleIDs(ids ...int) *AdminCreate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*AdminCreate) AddRoles ¶
func (ac *AdminCreate) AddRoles(r ...*Role) *AdminCreate
AddRoles adds the "roles" edges to the Role entity.
func (*AdminCreate) Exec ¶
func (ac *AdminCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*AdminCreate) ExecContext ¶
func (c *AdminCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminCreate) ExecX ¶
func (ac *AdminCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminCreate) Mutation ¶
func (ac *AdminCreate) Mutation() *AdminMutation
Mutation returns the AdminMutation object of the builder.
func (*AdminCreate) QueryContext ¶
func (c *AdminCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminCreate) Save ¶
func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)
Save creates the Admin in the database.
func (*AdminCreate) SaveX ¶
func (ac *AdminCreate) SaveX(ctx context.Context) *Admin
SaveX calls Save and panics if Save returns an error.
func (*AdminCreate) SetCreatedAt ¶
func (ac *AdminCreate) SetCreatedAt(t time.Time) *AdminCreate
SetCreatedAt sets the "created_at" field.
func (*AdminCreate) SetDeletedAt ¶
func (ac *AdminCreate) SetDeletedAt(i int) *AdminCreate
SetDeletedAt sets the "deleted_at" field.
func (*AdminCreate) SetDisplayName ¶
func (ac *AdminCreate) SetDisplayName(s string) *AdminCreate
SetDisplayName sets the "display_name" field.
func (*AdminCreate) SetIsEnable ¶
func (ac *AdminCreate) SetIsEnable(b bool) *AdminCreate
SetIsEnable sets the "is_enable" field.
func (*AdminCreate) SetNillableCreatedAt ¶
func (ac *AdminCreate) SetNillableCreatedAt(t *time.Time) *AdminCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AdminCreate) SetNillableDeletedAt ¶
func (ac *AdminCreate) SetNillableDeletedAt(i *int) *AdminCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*AdminCreate) SetNillableDisplayName ¶
func (ac *AdminCreate) SetNillableDisplayName(s *string) *AdminCreate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*AdminCreate) SetNillableIsEnable ¶
func (ac *AdminCreate) SetNillableIsEnable(b *bool) *AdminCreate
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*AdminCreate) SetNillableUpdatedAt ¶
func (ac *AdminCreate) SetNillableUpdatedAt(t *time.Time) *AdminCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*AdminCreate) SetPassword ¶
func (ac *AdminCreate) SetPassword(s string) *AdminCreate
SetPassword sets the "password" field.
func (*AdminCreate) SetUpdatedAt ¶
func (ac *AdminCreate) SetUpdatedAt(t time.Time) *AdminCreate
SetUpdatedAt sets the "updated_at" field.
func (*AdminCreate) SetUsername ¶
func (ac *AdminCreate) SetUsername(s string) *AdminCreate
SetUsername sets the "username" field.
func (*AdminCreate) SetWhitelistIps ¶
func (ac *AdminCreate) SetWhitelistIps(s []string) *AdminCreate
SetWhitelistIps sets the "whitelist_ips" field.
type AdminCreateBulk ¶
type AdminCreateBulk struct {
// contains filtered or unexported fields
}
AdminCreateBulk is the builder for creating many Admin entities in bulk.
func (*AdminCreateBulk) Exec ¶
func (acb *AdminCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*AdminCreateBulk) ExecContext ¶
func (c *AdminCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminCreateBulk) ExecX ¶
func (acb *AdminCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminCreateBulk) QueryContext ¶
func (c *AdminCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type AdminDelete ¶
type AdminDelete struct {
// contains filtered or unexported fields
}
AdminDelete is the builder for deleting a Admin entity.
func (*AdminDelete) Exec ¶
func (ad *AdminDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*AdminDelete) ExecContext ¶
func (c *AdminDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminDelete) ExecX ¶
func (ad *AdminDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*AdminDelete) QueryContext ¶
func (c *AdminDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminDelete) Where ¶
func (ad *AdminDelete) Where(ps ...predicate.Admin) *AdminDelete
Where appends a list predicates to the AdminDelete builder.
type AdminDeleteOne ¶
type AdminDeleteOne struct {
// contains filtered or unexported fields
}
AdminDeleteOne is the builder for deleting a single Admin entity.
func (*AdminDeleteOne) Exec ¶
func (ado *AdminDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*AdminDeleteOne) ExecX ¶
func (ado *AdminDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminDeleteOne) Where ¶
func (ado *AdminDeleteOne) Where(ps ...predicate.Admin) *AdminDeleteOne
Where appends a list predicates to the AdminDelete builder.
type AdminEdges ¶
type AdminEdges struct { // Roles holds the value of the roles edge. Roles []*Role `json:"roles,omitempty"` // contains filtered or unexported fields }
AdminEdges holds the relations/edges for other nodes in the graph.
func (AdminEdges) RolesOrErr ¶
func (e AdminEdges) RolesOrErr() ([]*Role, error)
RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.
type AdminGroupBy ¶
type AdminGroupBy struct {
// contains filtered or unexported fields
}
AdminGroupBy is the group-by builder for Admin entities.
func (*AdminGroupBy) Aggregate ¶
func (agb *AdminGroupBy) Aggregate(fns ...AggregateFunc) *AdminGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*AdminGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AdminGroupBy) Scan ¶
func (agb *AdminGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AdminGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AdminMutation ¶
type AdminMutation struct {
// contains filtered or unexported fields
}
AdminMutation represents an operation that mutates the Admin nodes in the graph.
func (*AdminMutation) AddDeletedAt ¶
func (m *AdminMutation) AddDeletedAt(i int)
AddDeletedAt adds i to the "deleted_at" field.
func (*AdminMutation) AddField ¶
func (m *AdminMutation) 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 (*AdminMutation) AddRoleIDs ¶
func (m *AdminMutation) AddRoleIDs(ids ...int)
AddRoleIDs adds the "roles" edge to the Role entity by ids.
func (*AdminMutation) AddedDeletedAt ¶
func (m *AdminMutation) AddedDeletedAt() (r int, exists bool)
AddedDeletedAt returns the value that was added to the "deleted_at" field in this mutation.
func (*AdminMutation) AddedEdges ¶
func (m *AdminMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*AdminMutation) AddedField ¶
func (m *AdminMutation) 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 (*AdminMutation) AddedFields ¶
func (m *AdminMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*AdminMutation) AddedIDs ¶
func (m *AdminMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*AdminMutation) AppendWhitelistIps ¶
func (m *AdminMutation) AppendWhitelistIps(s []string)
AppendWhitelistIps adds s to the "whitelist_ips" field.
func (*AdminMutation) AppendedWhitelistIps ¶
func (m *AdminMutation) AppendedWhitelistIps() ([]string, bool)
AppendedWhitelistIps returns the list of values that were appended to the "whitelist_ips" field in this mutation.
func (*AdminMutation) ClearDisplayName ¶
func (m *AdminMutation) ClearDisplayName()
ClearDisplayName clears the value of the "display_name" field.
func (*AdminMutation) ClearEdge ¶
func (m *AdminMutation) 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 (*AdminMutation) ClearField ¶
func (m *AdminMutation) 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 (*AdminMutation) ClearRoles ¶
func (m *AdminMutation) ClearRoles()
ClearRoles clears the "roles" edge to the Role entity.
func (*AdminMutation) ClearedEdges ¶
func (m *AdminMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*AdminMutation) ClearedFields ¶
func (m *AdminMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (AdminMutation) Client ¶
func (m AdminMutation) 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 (*AdminMutation) CreatedAt ¶
func (m *AdminMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*AdminMutation) DeletedAt ¶
func (m *AdminMutation) DeletedAt() (r int, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*AdminMutation) DisplayName ¶
func (m *AdminMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "display_name" field in the mutation.
func (*AdminMutation) DisplayNameCleared ¶
func (m *AdminMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "display_name" field was cleared in this mutation.
func (*AdminMutation) EdgeCleared ¶
func (m *AdminMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*AdminMutation) ExecContext ¶
func (c *AdminMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminMutation) Field ¶
func (m *AdminMutation) 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 (*AdminMutation) FieldCleared ¶
func (m *AdminMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*AdminMutation) Fields ¶
func (m *AdminMutation) 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 (*AdminMutation) ID ¶
func (m *AdminMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*AdminMutation) IDs ¶
func (m *AdminMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*AdminMutation) IsEnable ¶
func (m *AdminMutation) IsEnable() (r bool, exists bool)
IsEnable returns the value of the "is_enable" field in the mutation.
func (*AdminMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldDeletedAt ¶
func (m *AdminMutation) OldDeletedAt(ctx context.Context) (v int, err error)
OldDeletedAt returns the old "deleted_at" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldDisplayName ¶
func (m *AdminMutation) OldDisplayName(ctx context.Context) (v string, err error)
OldDisplayName returns the old "display_name" field's value of the Admin entity. If the Admin 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 (*AdminMutation) 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 (*AdminMutation) OldIsEnable ¶
func (m *AdminMutation) OldIsEnable(ctx context.Context) (v bool, err error)
OldIsEnable returns the old "is_enable" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldPassword ¶
func (m *AdminMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldUsername ¶
func (m *AdminMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldWhitelistIps ¶
func (m *AdminMutation) OldWhitelistIps(ctx context.Context) (v []string, err error)
OldWhitelistIps returns the old "whitelist_ips" field's value of the Admin entity. If the Admin 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 (*AdminMutation) Password ¶
func (m *AdminMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*AdminMutation) QueryContext ¶
func (c *AdminMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminMutation) RemoveRoleIDs ¶
func (m *AdminMutation) RemoveRoleIDs(ids ...int)
RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.
func (*AdminMutation) RemovedEdges ¶
func (m *AdminMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*AdminMutation) RemovedIDs ¶
func (m *AdminMutation) 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 (*AdminMutation) RemovedRolesIDs ¶
func (m *AdminMutation) RemovedRolesIDs() (ids []int)
RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.
func (*AdminMutation) ResetCreatedAt ¶
func (m *AdminMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*AdminMutation) ResetDeletedAt ¶
func (m *AdminMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*AdminMutation) ResetDisplayName ¶
func (m *AdminMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "display_name" field.
func (*AdminMutation) ResetEdge ¶
func (m *AdminMutation) 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 (*AdminMutation) ResetField ¶
func (m *AdminMutation) 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 (*AdminMutation) ResetIsEnable ¶
func (m *AdminMutation) ResetIsEnable()
ResetIsEnable resets all changes to the "is_enable" field.
func (*AdminMutation) ResetPassword ¶
func (m *AdminMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*AdminMutation) ResetRoles ¶
func (m *AdminMutation) ResetRoles()
ResetRoles resets all changes to the "roles" edge.
func (*AdminMutation) ResetUpdatedAt ¶
func (m *AdminMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*AdminMutation) ResetUsername ¶
func (m *AdminMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*AdminMutation) ResetWhitelistIps ¶
func (m *AdminMutation) ResetWhitelistIps()
ResetWhitelistIps resets all changes to the "whitelist_ips" field.
func (*AdminMutation) RolesCleared ¶
func (m *AdminMutation) RolesCleared() bool
RolesCleared reports if the "roles" edge to the Role entity was cleared.
func (*AdminMutation) RolesIDs ¶
func (m *AdminMutation) RolesIDs() (ids []int)
RolesIDs returns the "roles" edge IDs in the mutation.
func (*AdminMutation) SetCreatedAt ¶
func (m *AdminMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*AdminMutation) SetDeletedAt ¶
func (m *AdminMutation) SetDeletedAt(i int)
SetDeletedAt sets the "deleted_at" field.
func (*AdminMutation) SetDisplayName ¶
func (m *AdminMutation) SetDisplayName(s string)
SetDisplayName sets the "display_name" field.
func (*AdminMutation) SetField ¶
func (m *AdminMutation) 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 (*AdminMutation) SetIsEnable ¶
func (m *AdminMutation) SetIsEnable(b bool)
SetIsEnable sets the "is_enable" field.
func (*AdminMutation) SetOp ¶
func (m *AdminMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*AdminMutation) SetPassword ¶
func (m *AdminMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*AdminMutation) SetUpdatedAt ¶
func (m *AdminMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*AdminMutation) SetUsername ¶
func (m *AdminMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (*AdminMutation) SetWhitelistIps ¶
func (m *AdminMutation) SetWhitelistIps(s []string)
SetWhitelistIps sets the "whitelist_ips" field.
func (AdminMutation) Tx ¶
func (m AdminMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*AdminMutation) Type ¶
func (m *AdminMutation) Type() string
Type returns the node type of this mutation (Admin).
func (*AdminMutation) UpdatedAt ¶
func (m *AdminMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*AdminMutation) Username ¶
func (m *AdminMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*AdminMutation) Where ¶
func (m *AdminMutation) Where(ps ...predicate.Admin)
Where appends a list predicates to the AdminMutation builder.
func (*AdminMutation) WhereP ¶
func (m *AdminMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the AdminMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
func (*AdminMutation) WhitelistIps ¶
func (m *AdminMutation) WhitelistIps() (r []string, exists bool)
WhitelistIps returns the value of the "whitelist_ips" field in the mutation.
type AdminQuery ¶
type AdminQuery struct {
// contains filtered or unexported fields
}
AdminQuery is the builder for querying Admin entities.
func (*AdminQuery) Aggregate ¶
func (aq *AdminQuery) Aggregate(fns ...AggregateFunc) *AdminSelect
Aggregate returns a AdminSelect configured with the given aggregations.
func (*AdminQuery) All ¶
func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)
All executes the query and returns a list of Admins.
func (*AdminQuery) AllX ¶
func (aq *AdminQuery) AllX(ctx context.Context) []*Admin
AllX is like All, but panics if an error occurs.
func (*AdminQuery) Clone ¶
func (aq *AdminQuery) Clone() *AdminQuery
Clone returns a duplicate of the AdminQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*AdminQuery) Count ¶
func (aq *AdminQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*AdminQuery) CountX ¶
func (aq *AdminQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*AdminQuery) ExecContext ¶
func (c *AdminQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminQuery) Exist ¶
func (aq *AdminQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*AdminQuery) ExistX ¶
func (aq *AdminQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*AdminQuery) First ¶
func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)
First returns the first Admin entity from the query. Returns a *NotFoundError when no Admin was found.
func (*AdminQuery) FirstID ¶
func (aq *AdminQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Admin ID from the query. Returns a *NotFoundError when no Admin ID was found.
func (*AdminQuery) FirstIDX ¶
func (aq *AdminQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*AdminQuery) FirstX ¶
func (aq *AdminQuery) FirstX(ctx context.Context) *Admin
FirstX is like First, but panics if an error occurs.
func (*AdminQuery) GroupBy ¶
func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` Count int `json:"count,omitempty"` } client.Admin.Query(). GroupBy(admin.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*AdminQuery) IDs ¶
func (aq *AdminQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Admin IDs.
func (*AdminQuery) IDsX ¶
func (aq *AdminQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*AdminQuery) Limit ¶
func (aq *AdminQuery) Limit(limit int) *AdminQuery
Limit the number of records to be returned by this query.
func (*AdminQuery) Modify ¶
func (aq *AdminQuery) Modify(modifiers ...func(s *sql.Selector)) *AdminSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*AdminQuery) Offset ¶
func (aq *AdminQuery) Offset(offset int) *AdminQuery
Offset to start from.
func (*AdminQuery) Only ¶
func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)
Only returns a single Admin entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Admin entity is found. Returns a *NotFoundError when no Admin entities are found.
func (*AdminQuery) OnlyID ¶
func (aq *AdminQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Admin ID in the query. Returns a *NotSingularError when more than one Admin ID is found. Returns a *NotFoundError when no entities are found.
func (*AdminQuery) OnlyIDX ¶
func (aq *AdminQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*AdminQuery) OnlyX ¶
func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin
OnlyX is like Only, but panics if an error occurs.
func (*AdminQuery) Order ¶
func (aq *AdminQuery) Order(o ...admin.OrderOption) *AdminQuery
Order specifies how the records should be ordered.
func (*AdminQuery) QueryContext ¶
func (c *AdminQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminQuery) QueryRoles ¶
func (aq *AdminQuery) QueryRoles() *RoleQuery
QueryRoles chains the current query on the "roles" edge.
func (*AdminQuery) Select ¶
func (aq *AdminQuery) Select(fields ...string) *AdminSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` } client.Admin.Query(). Select(admin.FieldCreatedAt). Scan(ctx, &v)
func (*AdminQuery) Unique ¶
func (aq *AdminQuery) Unique(unique bool) *AdminQuery
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 (*AdminQuery) Where ¶
func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery
Where adds a new predicate for the AdminQuery builder.
func (*AdminQuery) WithRoles ¶
func (aq *AdminQuery) WithRoles(opts ...func(*RoleQuery)) *AdminQuery
WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.
type AdminSelect ¶
type AdminSelect struct { *AdminQuery // contains filtered or unexported fields }
AdminSelect is the builder for selecting fields of Admin entities.
func (*AdminSelect) Aggregate ¶
func (as *AdminSelect) Aggregate(fns ...AggregateFunc) *AdminSelect
Aggregate adds the given aggregation functions to the selector query.
func (*AdminSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (AdminSelect) ExecContext ¶
func (c AdminSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*AdminSelect) Modify ¶
func (as *AdminSelect) Modify(modifiers ...func(s *sql.Selector)) *AdminSelect
Modify adds a query modifier for attaching custom logic to queries.
func (AdminSelect) QueryContext ¶
func (c AdminSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminSelect) Scan ¶
func (as *AdminSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*AdminSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type AdminUpdate ¶
type AdminUpdate struct {
// contains filtered or unexported fields
}
AdminUpdate is the builder for updating Admin entities.
func (*AdminUpdate) AddDeletedAt ¶
func (au *AdminUpdate) AddDeletedAt(i int) *AdminUpdate
AddDeletedAt adds i to the "deleted_at" field.
func (*AdminUpdate) AddRoleIDs ¶
func (au *AdminUpdate) AddRoleIDs(ids ...int) *AdminUpdate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*AdminUpdate) AddRoles ¶
func (au *AdminUpdate) AddRoles(r ...*Role) *AdminUpdate
AddRoles adds the "roles" edges to the Role entity.
func (*AdminUpdate) AppendWhitelistIps ¶
func (au *AdminUpdate) AppendWhitelistIps(s []string) *AdminUpdate
AppendWhitelistIps appends s to the "whitelist_ips" field.
func (*AdminUpdate) ClearDisplayName ¶
func (au *AdminUpdate) ClearDisplayName() *AdminUpdate
ClearDisplayName clears the value of the "display_name" field.
func (*AdminUpdate) ClearRoles ¶
func (au *AdminUpdate) ClearRoles() *AdminUpdate
ClearRoles clears all "roles" edges to the Role entity.
func (*AdminUpdate) Exec ¶
func (au *AdminUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*AdminUpdate) ExecContext ¶
func (c *AdminUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminUpdate) ExecX ¶
func (au *AdminUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminUpdate) Modify ¶
func (au *AdminUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AdminUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*AdminUpdate) Mutation ¶
func (au *AdminUpdate) Mutation() *AdminMutation
Mutation returns the AdminMutation object of the builder.
func (*AdminUpdate) QueryContext ¶
func (c *AdminUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminUpdate) RemoveRoleIDs ¶
func (au *AdminUpdate) RemoveRoleIDs(ids ...int) *AdminUpdate
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*AdminUpdate) RemoveRoles ¶
func (au *AdminUpdate) RemoveRoles(r ...*Role) *AdminUpdate
RemoveRoles removes "roles" edges to Role entities.
func (*AdminUpdate) Save ¶
func (au *AdminUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*AdminUpdate) SaveX ¶
func (au *AdminUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*AdminUpdate) SetCreatedAt ¶
func (au *AdminUpdate) SetCreatedAt(t time.Time) *AdminUpdate
SetCreatedAt sets the "created_at" field.
func (*AdminUpdate) SetDeletedAt ¶
func (au *AdminUpdate) SetDeletedAt(i int) *AdminUpdate
SetDeletedAt sets the "deleted_at" field.
func (*AdminUpdate) SetDisplayName ¶
func (au *AdminUpdate) SetDisplayName(s string) *AdminUpdate
SetDisplayName sets the "display_name" field.
func (*AdminUpdate) SetIsEnable ¶
func (au *AdminUpdate) SetIsEnable(b bool) *AdminUpdate
SetIsEnable sets the "is_enable" field.
func (*AdminUpdate) SetNillableCreatedAt ¶
func (au *AdminUpdate) SetNillableCreatedAt(t *time.Time) *AdminUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AdminUpdate) SetNillableDeletedAt ¶
func (au *AdminUpdate) SetNillableDeletedAt(i *int) *AdminUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*AdminUpdate) SetNillableDisplayName ¶
func (au *AdminUpdate) SetNillableDisplayName(s *string) *AdminUpdate
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*AdminUpdate) SetNillableIsEnable ¶
func (au *AdminUpdate) SetNillableIsEnable(b *bool) *AdminUpdate
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*AdminUpdate) SetNillablePassword ¶
func (au *AdminUpdate) SetNillablePassword(s *string) *AdminUpdate
SetNillablePassword sets the "password" field if the given value is not nil.
func (*AdminUpdate) SetNillableUsername ¶
func (au *AdminUpdate) SetNillableUsername(s *string) *AdminUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*AdminUpdate) SetPassword ¶
func (au *AdminUpdate) SetPassword(s string) *AdminUpdate
SetPassword sets the "password" field.
func (*AdminUpdate) SetUpdatedAt ¶
func (au *AdminUpdate) SetUpdatedAt(t time.Time) *AdminUpdate
SetUpdatedAt sets the "updated_at" field.
func (*AdminUpdate) SetUsername ¶
func (au *AdminUpdate) SetUsername(s string) *AdminUpdate
SetUsername sets the "username" field.
func (*AdminUpdate) SetWhitelistIps ¶
func (au *AdminUpdate) SetWhitelistIps(s []string) *AdminUpdate
SetWhitelistIps sets the "whitelist_ips" field.
func (*AdminUpdate) Where ¶
func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate
Where appends a list predicates to the AdminUpdate builder.
type AdminUpdateOne ¶
type AdminUpdateOne struct {
// contains filtered or unexported fields
}
AdminUpdateOne is the builder for updating a single Admin entity.
func (*AdminUpdateOne) AddDeletedAt ¶
func (auo *AdminUpdateOne) AddDeletedAt(i int) *AdminUpdateOne
AddDeletedAt adds i to the "deleted_at" field.
func (*AdminUpdateOne) AddRoleIDs ¶
func (auo *AdminUpdateOne) AddRoleIDs(ids ...int) *AdminUpdateOne
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*AdminUpdateOne) AddRoles ¶
func (auo *AdminUpdateOne) AddRoles(r ...*Role) *AdminUpdateOne
AddRoles adds the "roles" edges to the Role entity.
func (*AdminUpdateOne) AppendWhitelistIps ¶
func (auo *AdminUpdateOne) AppendWhitelistIps(s []string) *AdminUpdateOne
AppendWhitelistIps appends s to the "whitelist_ips" field.
func (*AdminUpdateOne) ClearDisplayName ¶
func (auo *AdminUpdateOne) ClearDisplayName() *AdminUpdateOne
ClearDisplayName clears the value of the "display_name" field.
func (*AdminUpdateOne) ClearRoles ¶
func (auo *AdminUpdateOne) ClearRoles() *AdminUpdateOne
ClearRoles clears all "roles" edges to the Role entity.
func (*AdminUpdateOne) Exec ¶
func (auo *AdminUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*AdminUpdateOne) ExecContext ¶
func (c *AdminUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*AdminUpdateOne) ExecX ¶
func (auo *AdminUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*AdminUpdateOne) Modify ¶
func (auo *AdminUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AdminUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*AdminUpdateOne) Mutation ¶
func (auo *AdminUpdateOne) Mutation() *AdminMutation
Mutation returns the AdminMutation object of the builder.
func (*AdminUpdateOne) QueryContext ¶
func (c *AdminUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*AdminUpdateOne) RemoveRoleIDs ¶
func (auo *AdminUpdateOne) RemoveRoleIDs(ids ...int) *AdminUpdateOne
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*AdminUpdateOne) RemoveRoles ¶
func (auo *AdminUpdateOne) RemoveRoles(r ...*Role) *AdminUpdateOne
RemoveRoles removes "roles" edges to Role entities.
func (*AdminUpdateOne) Save ¶
func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)
Save executes the query and returns the updated Admin entity.
func (*AdminUpdateOne) SaveX ¶
func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin
SaveX is like Save, but panics if an error occurs.
func (*AdminUpdateOne) Select ¶
func (auo *AdminUpdateOne) Select(field string, fields ...string) *AdminUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*AdminUpdateOne) SetCreatedAt ¶
func (auo *AdminUpdateOne) SetCreatedAt(t time.Time) *AdminUpdateOne
SetCreatedAt sets the "created_at" field.
func (*AdminUpdateOne) SetDeletedAt ¶
func (auo *AdminUpdateOne) SetDeletedAt(i int) *AdminUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*AdminUpdateOne) SetDisplayName ¶
func (auo *AdminUpdateOne) SetDisplayName(s string) *AdminUpdateOne
SetDisplayName sets the "display_name" field.
func (*AdminUpdateOne) SetIsEnable ¶
func (auo *AdminUpdateOne) SetIsEnable(b bool) *AdminUpdateOne
SetIsEnable sets the "is_enable" field.
func (*AdminUpdateOne) SetNillableCreatedAt ¶
func (auo *AdminUpdateOne) SetNillableCreatedAt(t *time.Time) *AdminUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*AdminUpdateOne) SetNillableDeletedAt ¶
func (auo *AdminUpdateOne) SetNillableDeletedAt(i *int) *AdminUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*AdminUpdateOne) SetNillableDisplayName ¶
func (auo *AdminUpdateOne) SetNillableDisplayName(s *string) *AdminUpdateOne
SetNillableDisplayName sets the "display_name" field if the given value is not nil.
func (*AdminUpdateOne) SetNillableIsEnable ¶
func (auo *AdminUpdateOne) SetNillableIsEnable(b *bool) *AdminUpdateOne
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*AdminUpdateOne) SetNillablePassword ¶
func (auo *AdminUpdateOne) SetNillablePassword(s *string) *AdminUpdateOne
SetNillablePassword sets the "password" field if the given value is not nil.
func (*AdminUpdateOne) SetNillableUsername ¶
func (auo *AdminUpdateOne) SetNillableUsername(s *string) *AdminUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*AdminUpdateOne) SetPassword ¶
func (auo *AdminUpdateOne) SetPassword(s string) *AdminUpdateOne
SetPassword sets the "password" field.
func (*AdminUpdateOne) SetUpdatedAt ¶
func (auo *AdminUpdateOne) SetUpdatedAt(t time.Time) *AdminUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*AdminUpdateOne) SetUsername ¶
func (auo *AdminUpdateOne) SetUsername(s string) *AdminUpdateOne
SetUsername sets the "username" field.
func (*AdminUpdateOne) SetWhitelistIps ¶
func (auo *AdminUpdateOne) SetWhitelistIps(s []string) *AdminUpdateOne
SetWhitelistIps sets the "whitelist_ips" field.
func (*AdminUpdateOne) Where ¶
func (auo *AdminUpdateOne) Where(ps ...predicate.Admin) *AdminUpdateOne
Where appends a list predicates to the AdminUpdate builder.
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 // Admin is the client for interacting with the Admin builders. Admin *AdminClient // Permission is the client for interacting with the Permission builders. Permission *PermissionClient // Role is the client for interacting with the Role builders. Role *RoleClient // Route is the client for interacting with the Route builders. Route *RouteClient // 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(). Admin. Query(). Count(ctx)
func (*Client) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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(...)`.
func (*Client) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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 Permission ¶
type Permission struct { // ID of the ent. ID int `json:"id" rql:"filter,sort"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updatedAt,omitempty"` // Group holds the value of the "group" field. Group string `json:"group,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Key holds the value of the "key" field. Key string `json:"key,omitempty"` // Order holds the value of the "order" field. Order int `json:"order,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the PermissionQuery when eager-loading is set. Edges PermissionEdges `json:"edges" rql:"-"` // contains filtered or unexported fields }
Permission is the model entity for the Permission schema.
func (*Permission) ExecContext ¶
func (c *Permission) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Permission) QueryContext ¶
func (c *Permission) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Permission) QueryRoles ¶
func (pe *Permission) QueryRoles() *RoleQuery
QueryRoles queries the "roles" edge of the Permission entity.
func (*Permission) String ¶
func (pe *Permission) String() string
String implements the fmt.Stringer.
func (*Permission) Unwrap ¶
func (pe *Permission) Unwrap() *Permission
Unwrap unwraps the Permission 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 (*Permission) Update ¶
func (pe *Permission) Update() *PermissionUpdateOne
Update returns a builder for updating this Permission. Note that you need to call Permission.Unwrap() before calling this method if this Permission was returned from a transaction, and the transaction was committed or rolled back.
type PermissionClient ¶
type PermissionClient struct {
// contains filtered or unexported fields
}
PermissionClient is a client for the Permission schema.
func NewPermissionClient ¶
func NewPermissionClient(c config) *PermissionClient
NewPermissionClient returns a client for the Permission from the given config.
func (*PermissionClient) Create ¶
func (c *PermissionClient) Create() *PermissionCreate
Create returns a builder for creating a Permission entity.
func (*PermissionClient) CreateBulk ¶
func (c *PermissionClient) CreateBulk(builders ...*PermissionCreate) *PermissionCreateBulk
CreateBulk returns a builder for creating a bulk of Permission entities.
func (*PermissionClient) Delete ¶
func (c *PermissionClient) Delete() *PermissionDelete
Delete returns a delete builder for Permission.
func (*PermissionClient) DeleteOne ¶
func (c *PermissionClient) DeleteOne(pe *Permission) *PermissionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*PermissionClient) DeleteOneID ¶
func (c *PermissionClient) DeleteOneID(id int) *PermissionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*PermissionClient) ExecContext ¶
func (c *PermissionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionClient) Get ¶
func (c *PermissionClient) Get(ctx context.Context, id int) (*Permission, error)
Get returns a Permission entity by its id.
func (*PermissionClient) GetX ¶
func (c *PermissionClient) GetX(ctx context.Context, id int) *Permission
GetX is like Get, but panics if an error occurs.
func (*PermissionClient) Hooks ¶
func (c *PermissionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*PermissionClient) Intercept ¶
func (c *PermissionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `permission.Intercept(f(g(h())))`.
func (*PermissionClient) Interceptors ¶
func (c *PermissionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*PermissionClient) MapCreateBulk ¶
func (c *PermissionClient) MapCreateBulk(slice any, setFunc func(*PermissionCreate, int)) *PermissionCreateBulk
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 (*PermissionClient) Query ¶
func (c *PermissionClient) Query() *PermissionQuery
Query returns a query builder for Permission.
func (*PermissionClient) QueryContext ¶
func (c *PermissionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionClient) QueryRoles ¶
func (c *PermissionClient) QueryRoles(pe *Permission) *RoleQuery
QueryRoles queries the roles edge of a Permission.
func (*PermissionClient) Update ¶
func (c *PermissionClient) Update() *PermissionUpdate
Update returns an update builder for Permission.
func (*PermissionClient) UpdateOne ¶
func (c *PermissionClient) UpdateOne(pe *Permission) *PermissionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*PermissionClient) UpdateOneID ¶
func (c *PermissionClient) UpdateOneID(id int) *PermissionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*PermissionClient) Use ¶
func (c *PermissionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `permission.Hooks(f(g(h())))`.
type PermissionCreate ¶
type PermissionCreate struct {
// contains filtered or unexported fields
}
PermissionCreate is the builder for creating a Permission entity.
func (*PermissionCreate) AddRoleIDs ¶
func (pc *PermissionCreate) AddRoleIDs(ids ...int) *PermissionCreate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*PermissionCreate) AddRoles ¶
func (pc *PermissionCreate) AddRoles(r ...*Role) *PermissionCreate
AddRoles adds the "roles" edges to the Role entity.
func (*PermissionCreate) Exec ¶
func (pc *PermissionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*PermissionCreate) ExecContext ¶
func (c *PermissionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionCreate) ExecX ¶
func (pc *PermissionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionCreate) Mutation ¶
func (pc *PermissionCreate) Mutation() *PermissionMutation
Mutation returns the PermissionMutation object of the builder.
func (*PermissionCreate) QueryContext ¶
func (c *PermissionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionCreate) Save ¶
func (pc *PermissionCreate) Save(ctx context.Context) (*Permission, error)
Save creates the Permission in the database.
func (*PermissionCreate) SaveX ¶
func (pc *PermissionCreate) SaveX(ctx context.Context) *Permission
SaveX calls Save and panics if Save returns an error.
func (*PermissionCreate) SetCreatedAt ¶
func (pc *PermissionCreate) SetCreatedAt(t time.Time) *PermissionCreate
SetCreatedAt sets the "created_at" field.
func (*PermissionCreate) SetGroup ¶
func (pc *PermissionCreate) SetGroup(s string) *PermissionCreate
SetGroup sets the "group" field.
func (*PermissionCreate) SetKey ¶
func (pc *PermissionCreate) SetKey(s string) *PermissionCreate
SetKey sets the "key" field.
func (*PermissionCreate) SetName ¶
func (pc *PermissionCreate) SetName(s string) *PermissionCreate
SetName sets the "name" field.
func (*PermissionCreate) SetNillableCreatedAt ¶
func (pc *PermissionCreate) SetNillableCreatedAt(t *time.Time) *PermissionCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PermissionCreate) SetNillableUpdatedAt ¶
func (pc *PermissionCreate) SetNillableUpdatedAt(t *time.Time) *PermissionCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*PermissionCreate) SetOrder ¶
func (pc *PermissionCreate) SetOrder(i int) *PermissionCreate
SetOrder sets the "order" field.
func (*PermissionCreate) SetUpdatedAt ¶
func (pc *PermissionCreate) SetUpdatedAt(t time.Time) *PermissionCreate
SetUpdatedAt sets the "updated_at" field.
type PermissionCreateBulk ¶
type PermissionCreateBulk struct {
// contains filtered or unexported fields
}
PermissionCreateBulk is the builder for creating many Permission entities in bulk.
func (*PermissionCreateBulk) Exec ¶
func (pcb *PermissionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*PermissionCreateBulk) ExecContext ¶
func (c *PermissionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionCreateBulk) ExecX ¶
func (pcb *PermissionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionCreateBulk) QueryContext ¶
func (c *PermissionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionCreateBulk) Save ¶
func (pcb *PermissionCreateBulk) Save(ctx context.Context) ([]*Permission, error)
Save creates the Permission entities in the database.
func (*PermissionCreateBulk) SaveX ¶
func (pcb *PermissionCreateBulk) SaveX(ctx context.Context) []*Permission
SaveX is like Save, but panics if an error occurs.
type PermissionDelete ¶
type PermissionDelete struct {
// contains filtered or unexported fields
}
PermissionDelete is the builder for deleting a Permission entity.
func (*PermissionDelete) Exec ¶
func (pd *PermissionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*PermissionDelete) ExecContext ¶
func (c *PermissionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionDelete) ExecX ¶
func (pd *PermissionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*PermissionDelete) QueryContext ¶
func (c *PermissionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionDelete) Where ¶
func (pd *PermissionDelete) Where(ps ...predicate.Permission) *PermissionDelete
Where appends a list predicates to the PermissionDelete builder.
type PermissionDeleteOne ¶
type PermissionDeleteOne struct {
// contains filtered or unexported fields
}
PermissionDeleteOne is the builder for deleting a single Permission entity.
func (*PermissionDeleteOne) Exec ¶
func (pdo *PermissionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*PermissionDeleteOne) ExecX ¶
func (pdo *PermissionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionDeleteOne) Where ¶
func (pdo *PermissionDeleteOne) Where(ps ...predicate.Permission) *PermissionDeleteOne
Where appends a list predicates to the PermissionDelete builder.
type PermissionEdges ¶
type PermissionEdges struct { // Roles holds the value of the roles edge. Roles []*Role `json:"roles,omitempty"` // contains filtered or unexported fields }
PermissionEdges holds the relations/edges for other nodes in the graph.
func (PermissionEdges) RolesOrErr ¶
func (e PermissionEdges) RolesOrErr() ([]*Role, error)
RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.
type PermissionGroupBy ¶
type PermissionGroupBy struct {
// contains filtered or unexported fields
}
PermissionGroupBy is the group-by builder for Permission entities.
func (*PermissionGroupBy) Aggregate ¶
func (pgb *PermissionGroupBy) Aggregate(fns ...AggregateFunc) *PermissionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*PermissionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PermissionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*PermissionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PermissionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PermissionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PermissionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PermissionGroupBy) Scan ¶
func (pgb *PermissionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PermissionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PermissionMutation ¶
type PermissionMutation struct {
// contains filtered or unexported fields
}
PermissionMutation represents an operation that mutates the Permission nodes in the graph.
func (*PermissionMutation) AddField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) AddOrder ¶
func (m *PermissionMutation) AddOrder(i int)
AddOrder adds i to the "order" field.
func (*PermissionMutation) AddRoleIDs ¶
func (m *PermissionMutation) AddRoleIDs(ids ...int)
AddRoleIDs adds the "roles" edge to the Role entity by ids.
func (*PermissionMutation) AddedEdges ¶
func (m *PermissionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*PermissionMutation) AddedField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) AddedFields ¶
func (m *PermissionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*PermissionMutation) AddedIDs ¶
func (m *PermissionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*PermissionMutation) AddedOrder ¶
func (m *PermissionMutation) AddedOrder() (r int, exists bool)
AddedOrder returns the value that was added to the "order" field in this mutation.
func (*PermissionMutation) ClearEdge ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ClearField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ClearRoles ¶
func (m *PermissionMutation) ClearRoles()
ClearRoles clears the "roles" edge to the Role entity.
func (*PermissionMutation) ClearedEdges ¶
func (m *PermissionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*PermissionMutation) ClearedFields ¶
func (m *PermissionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (PermissionMutation) Client ¶
func (m PermissionMutation) 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 (*PermissionMutation) CreatedAt ¶
func (m *PermissionMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*PermissionMutation) EdgeCleared ¶
func (m *PermissionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*PermissionMutation) ExecContext ¶
func (c *PermissionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionMutation) Field ¶
func (m *PermissionMutation) 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 (*PermissionMutation) FieldCleared ¶
func (m *PermissionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*PermissionMutation) Fields ¶
func (m *PermissionMutation) 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 (*PermissionMutation) Group ¶
func (m *PermissionMutation) Group() (r string, exists bool)
Group returns the value of the "group" field in the mutation.
func (*PermissionMutation) ID ¶
func (m *PermissionMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*PermissionMutation) IDs ¶
func (m *PermissionMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*PermissionMutation) Key ¶
func (m *PermissionMutation) Key() (r string, exists bool)
Key returns the value of the "key" field in the mutation.
func (*PermissionMutation) Name ¶
func (m *PermissionMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*PermissionMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) 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 (*PermissionMutation) OldGroup ¶
func (m *PermissionMutation) OldGroup(ctx context.Context) (v string, err error)
OldGroup returns the old "group" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) OldKey ¶
func (m *PermissionMutation) OldKey(ctx context.Context) (v string, err error)
OldKey returns the old "key" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) OldName ¶
func (m *PermissionMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) OldOrder ¶
func (m *PermissionMutation) OldOrder(ctx context.Context) (v int, err error)
OldOrder returns the old "order" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Permission entity. If the Permission 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 (*PermissionMutation) Order ¶
func (m *PermissionMutation) Order() (r int, exists bool)
Order returns the value of the "order" field in the mutation.
func (*PermissionMutation) QueryContext ¶
func (c *PermissionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionMutation) RemoveRoleIDs ¶
func (m *PermissionMutation) RemoveRoleIDs(ids ...int)
RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.
func (*PermissionMutation) RemovedEdges ¶
func (m *PermissionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*PermissionMutation) RemovedIDs ¶
func (m *PermissionMutation) 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 (*PermissionMutation) RemovedRolesIDs ¶
func (m *PermissionMutation) RemovedRolesIDs() (ids []int)
RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.
func (*PermissionMutation) ResetCreatedAt ¶
func (m *PermissionMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*PermissionMutation) ResetEdge ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ResetField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) ResetGroup ¶
func (m *PermissionMutation) ResetGroup()
ResetGroup resets all changes to the "group" field.
func (*PermissionMutation) ResetKey ¶
func (m *PermissionMutation) ResetKey()
ResetKey resets all changes to the "key" field.
func (*PermissionMutation) ResetName ¶
func (m *PermissionMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*PermissionMutation) ResetOrder ¶
func (m *PermissionMutation) ResetOrder()
ResetOrder resets all changes to the "order" field.
func (*PermissionMutation) ResetRoles ¶
func (m *PermissionMutation) ResetRoles()
ResetRoles resets all changes to the "roles" edge.
func (*PermissionMutation) ResetUpdatedAt ¶
func (m *PermissionMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*PermissionMutation) RolesCleared ¶
func (m *PermissionMutation) RolesCleared() bool
RolesCleared reports if the "roles" edge to the Role entity was cleared.
func (*PermissionMutation) RolesIDs ¶
func (m *PermissionMutation) RolesIDs() (ids []int)
RolesIDs returns the "roles" edge IDs in the mutation.
func (*PermissionMutation) SetCreatedAt ¶
func (m *PermissionMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*PermissionMutation) SetField ¶
func (m *PermissionMutation) 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 (*PermissionMutation) SetGroup ¶
func (m *PermissionMutation) SetGroup(s string)
SetGroup sets the "group" field.
func (*PermissionMutation) SetKey ¶
func (m *PermissionMutation) SetKey(s string)
SetKey sets the "key" field.
func (*PermissionMutation) SetName ¶
func (m *PermissionMutation) SetName(s string)
SetName sets the "name" field.
func (*PermissionMutation) SetOp ¶
func (m *PermissionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*PermissionMutation) SetOrder ¶
func (m *PermissionMutation) SetOrder(i int)
SetOrder sets the "order" field.
func (*PermissionMutation) SetUpdatedAt ¶
func (m *PermissionMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (PermissionMutation) Tx ¶
func (m PermissionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*PermissionMutation) Type ¶
func (m *PermissionMutation) Type() string
Type returns the node type of this mutation (Permission).
func (*PermissionMutation) UpdatedAt ¶
func (m *PermissionMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*PermissionMutation) Where ¶
func (m *PermissionMutation) Where(ps ...predicate.Permission)
Where appends a list predicates to the PermissionMutation builder.
func (*PermissionMutation) WhereP ¶
func (m *PermissionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the PermissionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type PermissionQuery ¶
type PermissionQuery struct {
// contains filtered or unexported fields
}
PermissionQuery is the builder for querying Permission entities.
func (*PermissionQuery) Aggregate ¶
func (pq *PermissionQuery) Aggregate(fns ...AggregateFunc) *PermissionSelect
Aggregate returns a PermissionSelect configured with the given aggregations.
func (*PermissionQuery) All ¶
func (pq *PermissionQuery) All(ctx context.Context) ([]*Permission, error)
All executes the query and returns a list of Permissions.
func (*PermissionQuery) AllX ¶
func (pq *PermissionQuery) AllX(ctx context.Context) []*Permission
AllX is like All, but panics if an error occurs.
func (*PermissionQuery) Clone ¶
func (pq *PermissionQuery) Clone() *PermissionQuery
Clone returns a duplicate of the PermissionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*PermissionQuery) Count ¶
func (pq *PermissionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*PermissionQuery) CountX ¶
func (pq *PermissionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*PermissionQuery) ExecContext ¶
func (c *PermissionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionQuery) Exist ¶
func (pq *PermissionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*PermissionQuery) ExistX ¶
func (pq *PermissionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*PermissionQuery) First ¶
func (pq *PermissionQuery) First(ctx context.Context) (*Permission, error)
First returns the first Permission entity from the query. Returns a *NotFoundError when no Permission was found.
func (*PermissionQuery) FirstID ¶
func (pq *PermissionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Permission ID from the query. Returns a *NotFoundError when no Permission ID was found.
func (*PermissionQuery) FirstIDX ¶
func (pq *PermissionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*PermissionQuery) FirstX ¶
func (pq *PermissionQuery) FirstX(ctx context.Context) *Permission
FirstX is like First, but panics if an error occurs.
func (*PermissionQuery) GroupBy ¶
func (pq *PermissionQuery) GroupBy(field string, fields ...string) *PermissionGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` Count int `json:"count,omitempty"` } client.Permission.Query(). GroupBy(permission.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*PermissionQuery) IDs ¶
func (pq *PermissionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Permission IDs.
func (*PermissionQuery) IDsX ¶
func (pq *PermissionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*PermissionQuery) Limit ¶
func (pq *PermissionQuery) Limit(limit int) *PermissionQuery
Limit the number of records to be returned by this query.
func (*PermissionQuery) Modify ¶
func (pq *PermissionQuery) Modify(modifiers ...func(s *sql.Selector)) *PermissionSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*PermissionQuery) Offset ¶
func (pq *PermissionQuery) Offset(offset int) *PermissionQuery
Offset to start from.
func (*PermissionQuery) Only ¶
func (pq *PermissionQuery) Only(ctx context.Context) (*Permission, error)
Only returns a single Permission entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Permission entity is found. Returns a *NotFoundError when no Permission entities are found.
func (*PermissionQuery) OnlyID ¶
func (pq *PermissionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Permission ID in the query. Returns a *NotSingularError when more than one Permission ID is found. Returns a *NotFoundError when no entities are found.
func (*PermissionQuery) OnlyIDX ¶
func (pq *PermissionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*PermissionQuery) OnlyX ¶
func (pq *PermissionQuery) OnlyX(ctx context.Context) *Permission
OnlyX is like Only, but panics if an error occurs.
func (*PermissionQuery) Order ¶
func (pq *PermissionQuery) Order(o ...permission.OrderOption) *PermissionQuery
Order specifies how the records should be ordered.
func (*PermissionQuery) QueryContext ¶
func (c *PermissionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionQuery) QueryRoles ¶
func (pq *PermissionQuery) QueryRoles() *RoleQuery
QueryRoles chains the current query on the "roles" edge.
func (*PermissionQuery) Select ¶
func (pq *PermissionQuery) Select(fields ...string) *PermissionSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` } client.Permission.Query(). Select(permission.FieldCreatedAt). Scan(ctx, &v)
func (*PermissionQuery) Unique ¶
func (pq *PermissionQuery) Unique(unique bool) *PermissionQuery
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 (*PermissionQuery) Where ¶
func (pq *PermissionQuery) Where(ps ...predicate.Permission) *PermissionQuery
Where adds a new predicate for the PermissionQuery builder.
func (*PermissionQuery) WithRoles ¶
func (pq *PermissionQuery) WithRoles(opts ...func(*RoleQuery)) *PermissionQuery
WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.
type PermissionSelect ¶
type PermissionSelect struct { *PermissionQuery // contains filtered or unexported fields }
PermissionSelect is the builder for selecting fields of Permission entities.
func (*PermissionSelect) Aggregate ¶
func (ps *PermissionSelect) Aggregate(fns ...AggregateFunc) *PermissionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*PermissionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (PermissionSelect) ExecContext ¶
func (c PermissionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*PermissionSelect) Modify ¶
func (ps *PermissionSelect) Modify(modifiers ...func(s *sql.Selector)) *PermissionSelect
Modify adds a query modifier for attaching custom logic to queries.
func (PermissionSelect) QueryContext ¶
func (c PermissionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionSelect) Scan ¶
func (ps *PermissionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*PermissionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type PermissionUpdate ¶
type PermissionUpdate struct {
// contains filtered or unexported fields
}
PermissionUpdate is the builder for updating Permission entities.
func (*PermissionUpdate) AddOrder ¶
func (pu *PermissionUpdate) AddOrder(i int) *PermissionUpdate
AddOrder adds i to the "order" field.
func (*PermissionUpdate) AddRoleIDs ¶
func (pu *PermissionUpdate) AddRoleIDs(ids ...int) *PermissionUpdate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*PermissionUpdate) AddRoles ¶
func (pu *PermissionUpdate) AddRoles(r ...*Role) *PermissionUpdate
AddRoles adds the "roles" edges to the Role entity.
func (*PermissionUpdate) ClearRoles ¶
func (pu *PermissionUpdate) ClearRoles() *PermissionUpdate
ClearRoles clears all "roles" edges to the Role entity.
func (*PermissionUpdate) Exec ¶
func (pu *PermissionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*PermissionUpdate) ExecContext ¶
func (c *PermissionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionUpdate) ExecX ¶
func (pu *PermissionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionUpdate) Modify ¶
func (pu *PermissionUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PermissionUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*PermissionUpdate) Mutation ¶
func (pu *PermissionUpdate) Mutation() *PermissionMutation
Mutation returns the PermissionMutation object of the builder.
func (*PermissionUpdate) QueryContext ¶
func (c *PermissionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionUpdate) RemoveRoleIDs ¶
func (pu *PermissionUpdate) RemoveRoleIDs(ids ...int) *PermissionUpdate
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*PermissionUpdate) RemoveRoles ¶
func (pu *PermissionUpdate) RemoveRoles(r ...*Role) *PermissionUpdate
RemoveRoles removes "roles" edges to Role entities.
func (*PermissionUpdate) Save ¶
func (pu *PermissionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*PermissionUpdate) SaveX ¶
func (pu *PermissionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*PermissionUpdate) SetCreatedAt ¶
func (pu *PermissionUpdate) SetCreatedAt(t time.Time) *PermissionUpdate
SetCreatedAt sets the "created_at" field.
func (*PermissionUpdate) SetGroup ¶
func (pu *PermissionUpdate) SetGroup(s string) *PermissionUpdate
SetGroup sets the "group" field.
func (*PermissionUpdate) SetKey ¶
func (pu *PermissionUpdate) SetKey(s string) *PermissionUpdate
SetKey sets the "key" field.
func (*PermissionUpdate) SetName ¶
func (pu *PermissionUpdate) SetName(s string) *PermissionUpdate
SetName sets the "name" field.
func (*PermissionUpdate) SetNillableCreatedAt ¶
func (pu *PermissionUpdate) SetNillableCreatedAt(t *time.Time) *PermissionUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PermissionUpdate) SetNillableGroup ¶
func (pu *PermissionUpdate) SetNillableGroup(s *string) *PermissionUpdate
SetNillableGroup sets the "group" field if the given value is not nil.
func (*PermissionUpdate) SetNillableKey ¶
func (pu *PermissionUpdate) SetNillableKey(s *string) *PermissionUpdate
SetNillableKey sets the "key" field if the given value is not nil.
func (*PermissionUpdate) SetNillableName ¶
func (pu *PermissionUpdate) SetNillableName(s *string) *PermissionUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*PermissionUpdate) SetNillableOrder ¶
func (pu *PermissionUpdate) SetNillableOrder(i *int) *PermissionUpdate
SetNillableOrder sets the "order" field if the given value is not nil.
func (*PermissionUpdate) SetOrder ¶
func (pu *PermissionUpdate) SetOrder(i int) *PermissionUpdate
SetOrder sets the "order" field.
func (*PermissionUpdate) SetUpdatedAt ¶
func (pu *PermissionUpdate) SetUpdatedAt(t time.Time) *PermissionUpdate
SetUpdatedAt sets the "updated_at" field.
func (*PermissionUpdate) Where ¶
func (pu *PermissionUpdate) Where(ps ...predicate.Permission) *PermissionUpdate
Where appends a list predicates to the PermissionUpdate builder.
type PermissionUpdateOne ¶
type PermissionUpdateOne struct {
// contains filtered or unexported fields
}
PermissionUpdateOne is the builder for updating a single Permission entity.
func (*PermissionUpdateOne) AddOrder ¶
func (puo *PermissionUpdateOne) AddOrder(i int) *PermissionUpdateOne
AddOrder adds i to the "order" field.
func (*PermissionUpdateOne) AddRoleIDs ¶
func (puo *PermissionUpdateOne) AddRoleIDs(ids ...int) *PermissionUpdateOne
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*PermissionUpdateOne) AddRoles ¶
func (puo *PermissionUpdateOne) AddRoles(r ...*Role) *PermissionUpdateOne
AddRoles adds the "roles" edges to the Role entity.
func (*PermissionUpdateOne) ClearRoles ¶
func (puo *PermissionUpdateOne) ClearRoles() *PermissionUpdateOne
ClearRoles clears all "roles" edges to the Role entity.
func (*PermissionUpdateOne) Exec ¶
func (puo *PermissionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*PermissionUpdateOne) ExecContext ¶
func (c *PermissionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*PermissionUpdateOne) ExecX ¶
func (puo *PermissionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*PermissionUpdateOne) Modify ¶
func (puo *PermissionUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PermissionUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*PermissionUpdateOne) Mutation ¶
func (puo *PermissionUpdateOne) Mutation() *PermissionMutation
Mutation returns the PermissionMutation object of the builder.
func (*PermissionUpdateOne) QueryContext ¶
func (c *PermissionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*PermissionUpdateOne) RemoveRoleIDs ¶
func (puo *PermissionUpdateOne) RemoveRoleIDs(ids ...int) *PermissionUpdateOne
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*PermissionUpdateOne) RemoveRoles ¶
func (puo *PermissionUpdateOne) RemoveRoles(r ...*Role) *PermissionUpdateOne
RemoveRoles removes "roles" edges to Role entities.
func (*PermissionUpdateOne) Save ¶
func (puo *PermissionUpdateOne) Save(ctx context.Context) (*Permission, error)
Save executes the query and returns the updated Permission entity.
func (*PermissionUpdateOne) SaveX ¶
func (puo *PermissionUpdateOne) SaveX(ctx context.Context) *Permission
SaveX is like Save, but panics if an error occurs.
func (*PermissionUpdateOne) Select ¶
func (puo *PermissionUpdateOne) Select(field string, fields ...string) *PermissionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*PermissionUpdateOne) SetCreatedAt ¶
func (puo *PermissionUpdateOne) SetCreatedAt(t time.Time) *PermissionUpdateOne
SetCreatedAt sets the "created_at" field.
func (*PermissionUpdateOne) SetGroup ¶
func (puo *PermissionUpdateOne) SetGroup(s string) *PermissionUpdateOne
SetGroup sets the "group" field.
func (*PermissionUpdateOne) SetKey ¶
func (puo *PermissionUpdateOne) SetKey(s string) *PermissionUpdateOne
SetKey sets the "key" field.
func (*PermissionUpdateOne) SetName ¶
func (puo *PermissionUpdateOne) SetName(s string) *PermissionUpdateOne
SetName sets the "name" field.
func (*PermissionUpdateOne) SetNillableCreatedAt ¶
func (puo *PermissionUpdateOne) SetNillableCreatedAt(t *time.Time) *PermissionUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*PermissionUpdateOne) SetNillableGroup ¶
func (puo *PermissionUpdateOne) SetNillableGroup(s *string) *PermissionUpdateOne
SetNillableGroup sets the "group" field if the given value is not nil.
func (*PermissionUpdateOne) SetNillableKey ¶
func (puo *PermissionUpdateOne) SetNillableKey(s *string) *PermissionUpdateOne
SetNillableKey sets the "key" field if the given value is not nil.
func (*PermissionUpdateOne) SetNillableName ¶
func (puo *PermissionUpdateOne) SetNillableName(s *string) *PermissionUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*PermissionUpdateOne) SetNillableOrder ¶
func (puo *PermissionUpdateOne) SetNillableOrder(i *int) *PermissionUpdateOne
SetNillableOrder sets the "order" field if the given value is not nil.
func (*PermissionUpdateOne) SetOrder ¶
func (puo *PermissionUpdateOne) SetOrder(i int) *PermissionUpdateOne
SetOrder sets the "order" field.
func (*PermissionUpdateOne) SetUpdatedAt ¶
func (puo *PermissionUpdateOne) SetUpdatedAt(t time.Time) *PermissionUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*PermissionUpdateOne) Where ¶
func (puo *PermissionUpdateOne) Where(ps ...predicate.Permission) *PermissionUpdateOne
Where appends a list predicates to the PermissionUpdate 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 int `json:"id" rql:"filter,sort"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updatedAt,omitempty"` // IsEnable holds the value of the "is_enable" field. IsEnable bool `json:"isEnable" rql:"filter,sort"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt int `json:"-"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Description holds the value of the "description" field. Description string `json:"description,omitempty"` // Order holds the value of the "order" field. Order int `json:"order,omitempty"` // IsChangeable holds the value of the "is_changeable" field. IsChangeable bool `json:"isChangeable,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the RoleQuery when eager-loading is set. Edges RoleEdges `json:"edges" rql:"-"` // contains filtered or unexported fields }
Role is the model entity for the Role schema.
func (*Role) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Role) QueryAdmins ¶
func (r *Role) QueryAdmins() *AdminQuery
QueryAdmins queries the "admins" edge of the Role entity.
func (*Role) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Role) QueryPermissions ¶
func (r *Role) QueryPermissions() *PermissionQuery
QueryPermissions queries the "permissions" edge of the Role entity.
func (*Role) QueryRoutes ¶
func (r *Role) QueryRoutes() *RouteQuery
QueryRoutes queries the "routes" edge of the Role entity.
func (*Role) Unwrap ¶
Unwrap unwraps the Role entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Role) Update ¶
func (r *Role) Update() *RoleUpdateOne
Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.
type RoleClient ¶
type RoleClient struct {
// contains filtered or unexported fields
}
RoleClient is a client for the Role schema.
func NewRoleClient ¶
func NewRoleClient(c config) *RoleClient
NewRoleClient returns a client for the Role from the given config.
func (*RoleClient) Create ¶
func (c *RoleClient) Create() *RoleCreate
Create returns a builder for creating a Role entity.
func (*RoleClient) CreateBulk ¶
func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk
CreateBulk returns a builder for creating a bulk of Role entities.
func (*RoleClient) Delete ¶
func (c *RoleClient) Delete() *RoleDelete
Delete returns a delete builder for Role.
func (*RoleClient) DeleteOne ¶
func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RoleClient) DeleteOneID ¶
func (c *RoleClient) DeleteOneID(id int) *RoleDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RoleClient) ExecContext ¶
func (c *RoleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RoleClient) GetX ¶
func (c *RoleClient) GetX(ctx context.Context, id int) *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) QueryAdmins ¶
func (c *RoleClient) QueryAdmins(r *Role) *AdminQuery
QueryAdmins queries the admins edge of a Role.
func (*RoleClient) QueryContext ¶
func (c *RoleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RoleClient) QueryPermissions ¶
func (c *RoleClient) QueryPermissions(r *Role) *PermissionQuery
QueryPermissions queries the permissions edge of a Role.
func (*RoleClient) QueryRoutes ¶
func (c *RoleClient) QueryRoutes(r *Role) *RouteQuery
QueryRoutes queries the routes edge of a 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 int) *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) AddAdminIDs ¶
func (rc *RoleCreate) AddAdminIDs(ids ...int) *RoleCreate
AddAdminIDs adds the "admins" edge to the Admin entity by IDs.
func (*RoleCreate) AddAdmins ¶
func (rc *RoleCreate) AddAdmins(a ...*Admin) *RoleCreate
AddAdmins adds the "admins" edges to the Admin entity.
func (*RoleCreate) AddPermissionIDs ¶
func (rc *RoleCreate) AddPermissionIDs(ids ...int) *RoleCreate
AddPermissionIDs adds the "permissions" edge to the Permission entity by IDs.
func (*RoleCreate) AddPermissions ¶
func (rc *RoleCreate) AddPermissions(p ...*Permission) *RoleCreate
AddPermissions adds the "permissions" edges to the Permission entity.
func (*RoleCreate) AddRouteIDs ¶
func (rc *RoleCreate) AddRouteIDs(ids ...int) *RoleCreate
AddRouteIDs adds the "routes" edge to the Route entity by IDs.
func (*RoleCreate) AddRoutes ¶
func (rc *RoleCreate) AddRoutes(r ...*Route) *RoleCreate
AddRoutes adds the "routes" edges to the Route entity.
func (*RoleCreate) Exec ¶
func (rc *RoleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreate) ExecContext ¶
func (c *RoleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) QueryContext ¶
func (c *RoleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) SetCreatedAt ¶
func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate
SetCreatedAt sets the "created_at" field.
func (*RoleCreate) SetDeletedAt ¶
func (rc *RoleCreate) SetDeletedAt(i int) *RoleCreate
SetDeletedAt sets the "deleted_at" field.
func (*RoleCreate) SetDescription ¶
func (rc *RoleCreate) SetDescription(s string) *RoleCreate
SetDescription sets the "description" field.
func (*RoleCreate) SetIsChangeable ¶
func (rc *RoleCreate) SetIsChangeable(b bool) *RoleCreate
SetIsChangeable sets the "is_changeable" field.
func (*RoleCreate) SetIsEnable ¶
func (rc *RoleCreate) SetIsEnable(b bool) *RoleCreate
SetIsEnable sets the "is_enable" field.
func (*RoleCreate) SetName ¶
func (rc *RoleCreate) SetName(s string) *RoleCreate
SetName sets the "name" field.
func (*RoleCreate) SetNillableCreatedAt ¶
func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RoleCreate) SetNillableDeletedAt ¶
func (rc *RoleCreate) SetNillableDeletedAt(i *int) *RoleCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*RoleCreate) SetNillableIsEnable ¶
func (rc *RoleCreate) SetNillableIsEnable(b *bool) *RoleCreate
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*RoleCreate) SetNillableUpdatedAt ¶
func (rc *RoleCreate) SetNillableUpdatedAt(t *time.Time) *RoleCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*RoleCreate) SetOrder ¶
func (rc *RoleCreate) SetOrder(i int) *RoleCreate
SetOrder sets the "order" field.
func (*RoleCreate) SetUpdatedAt ¶
func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate
SetUpdatedAt sets the "updated_at" 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) ExecContext ¶
func (c *RoleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RoleCreateBulk) ExecX ¶
func (rcb *RoleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleCreateBulk) QueryContext ¶
func (c *RoleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) ExecContext ¶
func (c *RoleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RoleDelete) ExecX ¶
func (rd *RoleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RoleDelete) QueryContext ¶
func (c *RoleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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 RoleEdges ¶
type RoleEdges struct { // Admins holds the value of the admins edge. Admins []*Admin `json:"admins,omitempty"` // Permissions holds the value of the permissions edge. Permissions []*Permission `json:"permissions,omitempty"` // Routes holds the value of the routes edge. Routes []*Route `json:"routes,omitempty"` // contains filtered or unexported fields }
RoleEdges holds the relations/edges for other nodes in the graph.
func (RoleEdges) AdminsOrErr ¶
AdminsOrErr returns the Admins value or an error if the edge was not loaded in eager-loading.
func (RoleEdges) PermissionsOrErr ¶
func (e RoleEdges) PermissionsOrErr() ([]*Permission, error)
PermissionsOrErr returns the Permissions value or an error if the edge was not loaded in eager-loading.
func (RoleEdges) RoutesOrErr ¶
RoutesOrErr returns the Routes value or an error if the edge was not loaded in eager-loading.
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) AddAdminIDs ¶
func (m *RoleMutation) AddAdminIDs(ids ...int)
AddAdminIDs adds the "admins" edge to the Admin entity by ids.
func (*RoleMutation) AddDeletedAt ¶
func (m *RoleMutation) AddDeletedAt(i int)
AddDeletedAt adds i to the "deleted_at" 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) AddOrder ¶
func (m *RoleMutation) AddOrder(i int)
AddOrder adds i to the "order" field.
func (*RoleMutation) AddPermissionIDs ¶
func (m *RoleMutation) AddPermissionIDs(ids ...int)
AddPermissionIDs adds the "permissions" edge to the Permission entity by ids.
func (*RoleMutation) AddRouteIDs ¶
func (m *RoleMutation) AddRouteIDs(ids ...int)
AddRouteIDs adds the "routes" edge to the Route entity by ids.
func (*RoleMutation) AddedDeletedAt ¶
func (m *RoleMutation) AddedDeletedAt() (r int, exists bool)
AddedDeletedAt returns the value that was added to the "deleted_at" 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) AddedOrder ¶
func (m *RoleMutation) AddedOrder() (r int, exists bool)
AddedOrder returns the value that was added to the "order" field in this mutation.
func (*RoleMutation) AdminsCleared ¶
func (m *RoleMutation) AdminsCleared() bool
AdminsCleared reports if the "admins" edge to the Admin entity was cleared.
func (*RoleMutation) AdminsIDs ¶
func (m *RoleMutation) AdminsIDs() (ids []int)
AdminsIDs returns the "admins" edge IDs in the mutation.
func (*RoleMutation) ClearAdmins ¶
func (m *RoleMutation) ClearAdmins()
ClearAdmins clears the "admins" edge to the Admin entity.
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) ClearPermissions ¶
func (m *RoleMutation) ClearPermissions()
ClearPermissions clears the "permissions" edge to the Permission entity.
func (*RoleMutation) ClearRoutes ¶
func (m *RoleMutation) ClearRoutes()
ClearRoutes clears the "routes" edge to the Route entity.
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) CreatedAt ¶
func (m *RoleMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*RoleMutation) DeletedAt ¶
func (m *RoleMutation) DeletedAt() (r int, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*RoleMutation) Description ¶
func (m *RoleMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the 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) ExecContext ¶
func (c *RoleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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 int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*RoleMutation) IDs ¶
func (m *RoleMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*RoleMutation) IsChangeable ¶
func (m *RoleMutation) IsChangeable() (r bool, exists bool)
IsChangeable returns the value of the "is_changeable" field in the mutation.
func (*RoleMutation) IsEnable ¶
func (m *RoleMutation) IsEnable() (r bool, exists bool)
IsEnable returns the value of the "is_enable" field in 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) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" 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) OldDeletedAt ¶
func (m *RoleMutation) OldDeletedAt(ctx context.Context) (v int, err error)
OldDeletedAt returns the old "deleted_at" 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) OldDescription ¶
func (m *RoleMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" 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) OldIsChangeable ¶
func (m *RoleMutation) OldIsChangeable(ctx context.Context) (v bool, err error)
OldIsChangeable returns the old "is_changeable" 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) OldIsEnable ¶
func (m *RoleMutation) OldIsEnable(ctx context.Context) (v bool, err error)
OldIsEnable returns the old "is_enable" 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) 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) OldOrder ¶
func (m *RoleMutation) OldOrder(ctx context.Context) (v int, err error)
OldOrder returns the old "order" 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) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" 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) Order ¶
func (m *RoleMutation) Order() (r int, exists bool)
Order returns the value of the "order" field in the mutation.
func (*RoleMutation) PermissionsCleared ¶
func (m *RoleMutation) PermissionsCleared() bool
PermissionsCleared reports if the "permissions" edge to the Permission entity was cleared.
func (*RoleMutation) PermissionsIDs ¶
func (m *RoleMutation) PermissionsIDs() (ids []int)
PermissionsIDs returns the "permissions" edge IDs in the mutation.
func (*RoleMutation) QueryContext ¶
func (c *RoleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RoleMutation) RemoveAdminIDs ¶
func (m *RoleMutation) RemoveAdminIDs(ids ...int)
RemoveAdminIDs removes the "admins" edge to the Admin entity by IDs.
func (*RoleMutation) RemovePermissionIDs ¶
func (m *RoleMutation) RemovePermissionIDs(ids ...int)
RemovePermissionIDs removes the "permissions" edge to the Permission entity by IDs.
func (*RoleMutation) RemoveRouteIDs ¶
func (m *RoleMutation) RemoveRouteIDs(ids ...int)
RemoveRouteIDs removes the "routes" edge to the Route entity by IDs.
func (*RoleMutation) RemovedAdminsIDs ¶
func (m *RoleMutation) RemovedAdminsIDs() (ids []int)
RemovedAdmins returns the removed IDs of the "admins" edge to the Admin entity.
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) RemovedPermissionsIDs ¶
func (m *RoleMutation) RemovedPermissionsIDs() (ids []int)
RemovedPermissions returns the removed IDs of the "permissions" edge to the Permission entity.
func (*RoleMutation) RemovedRoutesIDs ¶
func (m *RoleMutation) RemovedRoutesIDs() (ids []int)
RemovedRoutes returns the removed IDs of the "routes" edge to the Route entity.
func (*RoleMutation) ResetAdmins ¶
func (m *RoleMutation) ResetAdmins()
ResetAdmins resets all changes to the "admins" edge.
func (*RoleMutation) ResetCreatedAt ¶
func (m *RoleMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*RoleMutation) ResetDeletedAt ¶
func (m *RoleMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*RoleMutation) ResetDescription ¶
func (m *RoleMutation) ResetDescription()
ResetDescription resets all changes to the "description" 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) ResetIsChangeable ¶
func (m *RoleMutation) ResetIsChangeable()
ResetIsChangeable resets all changes to the "is_changeable" field.
func (*RoleMutation) ResetIsEnable ¶
func (m *RoleMutation) ResetIsEnable()
ResetIsEnable resets all changes to the "is_enable" field.
func (*RoleMutation) ResetName ¶
func (m *RoleMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RoleMutation) ResetOrder ¶
func (m *RoleMutation) ResetOrder()
ResetOrder resets all changes to the "order" field.
func (*RoleMutation) ResetPermissions ¶
func (m *RoleMutation) ResetPermissions()
ResetPermissions resets all changes to the "permissions" edge.
func (*RoleMutation) ResetRoutes ¶
func (m *RoleMutation) ResetRoutes()
ResetRoutes resets all changes to the "routes" edge.
func (*RoleMutation) ResetUpdatedAt ¶
func (m *RoleMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*RoleMutation) RoutesCleared ¶
func (m *RoleMutation) RoutesCleared() bool
RoutesCleared reports if the "routes" edge to the Route entity was cleared.
func (*RoleMutation) RoutesIDs ¶
func (m *RoleMutation) RoutesIDs() (ids []int)
RoutesIDs returns the "routes" edge IDs in the mutation.
func (*RoleMutation) SetCreatedAt ¶
func (m *RoleMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*RoleMutation) SetDeletedAt ¶
func (m *RoleMutation) SetDeletedAt(i int)
SetDeletedAt sets the "deleted_at" field.
func (*RoleMutation) SetDescription ¶
func (m *RoleMutation) SetDescription(s string)
SetDescription sets the "description" 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) SetIsChangeable ¶
func (m *RoleMutation) SetIsChangeable(b bool)
SetIsChangeable sets the "is_changeable" field.
func (*RoleMutation) SetIsEnable ¶
func (m *RoleMutation) SetIsEnable(b bool)
SetIsEnable sets the "is_enable" field.
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) SetOrder ¶
func (m *RoleMutation) SetOrder(i int)
SetOrder sets the "order" field.
func (*RoleMutation) SetUpdatedAt ¶
func (m *RoleMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" 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) UpdatedAt ¶
func (m *RoleMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" 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) ExecContext ¶
func (c *RoleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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 { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` Count int `json:"count,omitempty"` } client.Role.Query(). GroupBy(role.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RoleQuery) Modify ¶
func (rq *RoleQuery) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect
Modify adds a query modifier for attaching custom logic to queries.
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) QueryAdmins ¶
func (rq *RoleQuery) QueryAdmins() *AdminQuery
QueryAdmins chains the current query on the "admins" edge.
func (*RoleQuery) QueryContext ¶
func (c *RoleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RoleQuery) QueryPermissions ¶
func (rq *RoleQuery) QueryPermissions() *PermissionQuery
QueryPermissions chains the current query on the "permissions" edge.
func (*RoleQuery) QueryRoutes ¶
func (rq *RoleQuery) QueryRoutes() *RouteQuery
QueryRoutes chains the current query on the "routes" edge.
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 { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` } client.Role.Query(). Select(role.FieldCreatedAt). Scan(ctx, &v)
func (*RoleQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*RoleQuery) WithAdmins ¶
func (rq *RoleQuery) WithAdmins(opts ...func(*AdminQuery)) *RoleQuery
WithAdmins tells the query-builder to eager-load the nodes that are connected to the "admins" edge. The optional arguments are used to configure the query builder of the edge.
func (*RoleQuery) WithPermissions ¶
func (rq *RoleQuery) WithPermissions(opts ...func(*PermissionQuery)) *RoleQuery
WithPermissions tells the query-builder to eager-load the nodes that are connected to the "permissions" edge. The optional arguments are used to configure the query builder of the edge.
func (*RoleQuery) WithRoutes ¶
func (rq *RoleQuery) WithRoutes(opts ...func(*RouteQuery)) *RoleQuery
WithRoutes tells the query-builder to eager-load the nodes that are connected to the "routes" edge. The optional arguments are used to configure the query builder of the edge.
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) ExecContext ¶
func (c RoleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
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) Modify ¶
func (rs *RoleSelect) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect
Modify adds a query modifier for attaching custom logic to queries.
func (RoleSelect) QueryContext ¶
func (c RoleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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) AddAdminIDs ¶
func (ru *RoleUpdate) AddAdminIDs(ids ...int) *RoleUpdate
AddAdminIDs adds the "admins" edge to the Admin entity by IDs.
func (*RoleUpdate) AddAdmins ¶
func (ru *RoleUpdate) AddAdmins(a ...*Admin) *RoleUpdate
AddAdmins adds the "admins" edges to the Admin entity.
func (*RoleUpdate) AddDeletedAt ¶
func (ru *RoleUpdate) AddDeletedAt(i int) *RoleUpdate
AddDeletedAt adds i to the "deleted_at" field.
func (*RoleUpdate) AddOrder ¶
func (ru *RoleUpdate) AddOrder(i int) *RoleUpdate
AddOrder adds i to the "order" field.
func (*RoleUpdate) AddPermissionIDs ¶
func (ru *RoleUpdate) AddPermissionIDs(ids ...int) *RoleUpdate
AddPermissionIDs adds the "permissions" edge to the Permission entity by IDs.
func (*RoleUpdate) AddPermissions ¶
func (ru *RoleUpdate) AddPermissions(p ...*Permission) *RoleUpdate
AddPermissions adds the "permissions" edges to the Permission entity.
func (*RoleUpdate) AddRouteIDs ¶
func (ru *RoleUpdate) AddRouteIDs(ids ...int) *RoleUpdate
AddRouteIDs adds the "routes" edge to the Route entity by IDs.
func (*RoleUpdate) AddRoutes ¶
func (ru *RoleUpdate) AddRoutes(r ...*Route) *RoleUpdate
AddRoutes adds the "routes" edges to the Route entity.
func (*RoleUpdate) ClearAdmins ¶
func (ru *RoleUpdate) ClearAdmins() *RoleUpdate
ClearAdmins clears all "admins" edges to the Admin entity.
func (*RoleUpdate) ClearPermissions ¶
func (ru *RoleUpdate) ClearPermissions() *RoleUpdate
ClearPermissions clears all "permissions" edges to the Permission entity.
func (*RoleUpdate) ClearRoutes ¶
func (ru *RoleUpdate) ClearRoutes() *RoleUpdate
ClearRoutes clears all "routes" edges to the Route entity.
func (*RoleUpdate) Exec ¶
func (ru *RoleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleUpdate) ExecContext ¶
func (c *RoleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RoleUpdate) ExecX ¶
func (ru *RoleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdate) Modify ¶
func (ru *RoleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*RoleUpdate) Mutation ¶
func (ru *RoleUpdate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdate) QueryContext ¶
func (c *RoleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RoleUpdate) RemoveAdminIDs ¶
func (ru *RoleUpdate) RemoveAdminIDs(ids ...int) *RoleUpdate
RemoveAdminIDs removes the "admins" edge to Admin entities by IDs.
func (*RoleUpdate) RemoveAdmins ¶
func (ru *RoleUpdate) RemoveAdmins(a ...*Admin) *RoleUpdate
RemoveAdmins removes "admins" edges to Admin entities.
func (*RoleUpdate) RemovePermissionIDs ¶
func (ru *RoleUpdate) RemovePermissionIDs(ids ...int) *RoleUpdate
RemovePermissionIDs removes the "permissions" edge to Permission entities by IDs.
func (*RoleUpdate) RemovePermissions ¶
func (ru *RoleUpdate) RemovePermissions(p ...*Permission) *RoleUpdate
RemovePermissions removes "permissions" edges to Permission entities.
func (*RoleUpdate) RemoveRouteIDs ¶
func (ru *RoleUpdate) RemoveRouteIDs(ids ...int) *RoleUpdate
RemoveRouteIDs removes the "routes" edge to Route entities by IDs.
func (*RoleUpdate) RemoveRoutes ¶
func (ru *RoleUpdate) RemoveRoutes(r ...*Route) *RoleUpdate
RemoveRoutes removes "routes" edges to Route entities.
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) SetCreatedAt ¶
func (ru *RoleUpdate) SetCreatedAt(t time.Time) *RoleUpdate
SetCreatedAt sets the "created_at" field.
func (*RoleUpdate) SetDeletedAt ¶
func (ru *RoleUpdate) SetDeletedAt(i int) *RoleUpdate
SetDeletedAt sets the "deleted_at" field.
func (*RoleUpdate) SetDescription ¶
func (ru *RoleUpdate) SetDescription(s string) *RoleUpdate
SetDescription sets the "description" field.
func (*RoleUpdate) SetIsChangeable ¶
func (ru *RoleUpdate) SetIsChangeable(b bool) *RoleUpdate
SetIsChangeable sets the "is_changeable" field.
func (*RoleUpdate) SetIsEnable ¶
func (ru *RoleUpdate) SetIsEnable(b bool) *RoleUpdate
SetIsEnable sets the "is_enable" field.
func (*RoleUpdate) SetName ¶
func (ru *RoleUpdate) SetName(s string) *RoleUpdate
SetName sets the "name" field.
func (*RoleUpdate) SetNillableCreatedAt ¶
func (ru *RoleUpdate) SetNillableCreatedAt(t *time.Time) *RoleUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RoleUpdate) SetNillableDeletedAt ¶
func (ru *RoleUpdate) SetNillableDeletedAt(i *int) *RoleUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*RoleUpdate) SetNillableDescription ¶
func (ru *RoleUpdate) SetNillableDescription(s *string) *RoleUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RoleUpdate) SetNillableIsChangeable ¶
func (ru *RoleUpdate) SetNillableIsChangeable(b *bool) *RoleUpdate
SetNillableIsChangeable sets the "is_changeable" field if the given value is not nil.
func (*RoleUpdate) SetNillableIsEnable ¶
func (ru *RoleUpdate) SetNillableIsEnable(b *bool) *RoleUpdate
SetNillableIsEnable sets the "is_enable" 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) SetNillableOrder ¶
func (ru *RoleUpdate) SetNillableOrder(i *int) *RoleUpdate
SetNillableOrder sets the "order" field if the given value is not nil.
func (*RoleUpdate) SetOrder ¶
func (ru *RoleUpdate) SetOrder(i int) *RoleUpdate
SetOrder sets the "order" field.
func (*RoleUpdate) SetUpdatedAt ¶
func (ru *RoleUpdate) SetUpdatedAt(t time.Time) *RoleUpdate
SetUpdatedAt sets the "updated_at" 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) AddAdminIDs ¶
func (ruo *RoleUpdateOne) AddAdminIDs(ids ...int) *RoleUpdateOne
AddAdminIDs adds the "admins" edge to the Admin entity by IDs.
func (*RoleUpdateOne) AddAdmins ¶
func (ruo *RoleUpdateOne) AddAdmins(a ...*Admin) *RoleUpdateOne
AddAdmins adds the "admins" edges to the Admin entity.
func (*RoleUpdateOne) AddDeletedAt ¶
func (ruo *RoleUpdateOne) AddDeletedAt(i int) *RoleUpdateOne
AddDeletedAt adds i to the "deleted_at" field.
func (*RoleUpdateOne) AddOrder ¶
func (ruo *RoleUpdateOne) AddOrder(i int) *RoleUpdateOne
AddOrder adds i to the "order" field.
func (*RoleUpdateOne) AddPermissionIDs ¶
func (ruo *RoleUpdateOne) AddPermissionIDs(ids ...int) *RoleUpdateOne
AddPermissionIDs adds the "permissions" edge to the Permission entity by IDs.
func (*RoleUpdateOne) AddPermissions ¶
func (ruo *RoleUpdateOne) AddPermissions(p ...*Permission) *RoleUpdateOne
AddPermissions adds the "permissions" edges to the Permission entity.
func (*RoleUpdateOne) AddRouteIDs ¶
func (ruo *RoleUpdateOne) AddRouteIDs(ids ...int) *RoleUpdateOne
AddRouteIDs adds the "routes" edge to the Route entity by IDs.
func (*RoleUpdateOne) AddRoutes ¶
func (ruo *RoleUpdateOne) AddRoutes(r ...*Route) *RoleUpdateOne
AddRoutes adds the "routes" edges to the Route entity.
func (*RoleUpdateOne) ClearAdmins ¶
func (ruo *RoleUpdateOne) ClearAdmins() *RoleUpdateOne
ClearAdmins clears all "admins" edges to the Admin entity.
func (*RoleUpdateOne) ClearPermissions ¶
func (ruo *RoleUpdateOne) ClearPermissions() *RoleUpdateOne
ClearPermissions clears all "permissions" edges to the Permission entity.
func (*RoleUpdateOne) ClearRoutes ¶
func (ruo *RoleUpdateOne) ClearRoutes() *RoleUpdateOne
ClearRoutes clears all "routes" edges to the Route entity.
func (*RoleUpdateOne) Exec ¶
func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RoleUpdateOne) ExecContext ¶
func (c *RoleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RoleUpdateOne) ExecX ¶
func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdateOne) Modify ¶
func (ruo *RoleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*RoleUpdateOne) Mutation ¶
func (ruo *RoleUpdateOne) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdateOne) QueryContext ¶
func (c *RoleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RoleUpdateOne) RemoveAdminIDs ¶
func (ruo *RoleUpdateOne) RemoveAdminIDs(ids ...int) *RoleUpdateOne
RemoveAdminIDs removes the "admins" edge to Admin entities by IDs.
func (*RoleUpdateOne) RemoveAdmins ¶
func (ruo *RoleUpdateOne) RemoveAdmins(a ...*Admin) *RoleUpdateOne
RemoveAdmins removes "admins" edges to Admin entities.
func (*RoleUpdateOne) RemovePermissionIDs ¶
func (ruo *RoleUpdateOne) RemovePermissionIDs(ids ...int) *RoleUpdateOne
RemovePermissionIDs removes the "permissions" edge to Permission entities by IDs.
func (*RoleUpdateOne) RemovePermissions ¶
func (ruo *RoleUpdateOne) RemovePermissions(p ...*Permission) *RoleUpdateOne
RemovePermissions removes "permissions" edges to Permission entities.
func (*RoleUpdateOne) RemoveRouteIDs ¶
func (ruo *RoleUpdateOne) RemoveRouteIDs(ids ...int) *RoleUpdateOne
RemoveRouteIDs removes the "routes" edge to Route entities by IDs.
func (*RoleUpdateOne) RemoveRoutes ¶
func (ruo *RoleUpdateOne) RemoveRoutes(r ...*Route) *RoleUpdateOne
RemoveRoutes removes "routes" edges to Route entities.
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) SetCreatedAt ¶
func (ruo *RoleUpdateOne) SetCreatedAt(t time.Time) *RoleUpdateOne
SetCreatedAt sets the "created_at" field.
func (*RoleUpdateOne) SetDeletedAt ¶
func (ruo *RoleUpdateOne) SetDeletedAt(i int) *RoleUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*RoleUpdateOne) SetDescription ¶
func (ruo *RoleUpdateOne) SetDescription(s string) *RoleUpdateOne
SetDescription sets the "description" field.
func (*RoleUpdateOne) SetIsChangeable ¶
func (ruo *RoleUpdateOne) SetIsChangeable(b bool) *RoleUpdateOne
SetIsChangeable sets the "is_changeable" field.
func (*RoleUpdateOne) SetIsEnable ¶
func (ruo *RoleUpdateOne) SetIsEnable(b bool) *RoleUpdateOne
SetIsEnable sets the "is_enable" field.
func (*RoleUpdateOne) SetName ¶
func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
SetName sets the "name" field.
func (*RoleUpdateOne) SetNillableCreatedAt ¶
func (ruo *RoleUpdateOne) SetNillableCreatedAt(t *time.Time) *RoleUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableDeletedAt ¶
func (ruo *RoleUpdateOne) SetNillableDeletedAt(i *int) *RoleUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableDescription ¶
func (ruo *RoleUpdateOne) SetNillableDescription(s *string) *RoleUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableIsChangeable ¶
func (ruo *RoleUpdateOne) SetNillableIsChangeable(b *bool) *RoleUpdateOne
SetNillableIsChangeable sets the "is_changeable" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableIsEnable ¶
func (ruo *RoleUpdateOne) SetNillableIsEnable(b *bool) *RoleUpdateOne
SetNillableIsEnable sets the "is_enable" 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) SetNillableOrder ¶
func (ruo *RoleUpdateOne) SetNillableOrder(i *int) *RoleUpdateOne
SetNillableOrder sets the "order" field if the given value is not nil.
func (*RoleUpdateOne) SetOrder ¶
func (ruo *RoleUpdateOne) SetOrder(i int) *RoleUpdateOne
SetOrder sets the "order" field.
func (*RoleUpdateOne) SetUpdatedAt ¶
func (ruo *RoleUpdateOne) SetUpdatedAt(t time.Time) *RoleUpdateOne
SetUpdatedAt sets the "updated_at" 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 Route ¶
type Route struct { // ID of the ent. ID int `json:"id" rql:"filter,sort"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updatedAt,omitempty"` // IsEnable holds the value of the "is_enable" field. IsEnable bool `json:"isEnable" rql:"filter,sort"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt int `json:"-"` // ParentID holds the value of the "parent_id" field. ParentID *int `json:"parentId,omitempty" rql:"filter,sort"` // Path holds the value of the "path" field. Path string `json:"path,omitempty" rql:"filter,sort"` // Component holds the value of the "component" field. Component string `json:"component,omitempty" rql:"filter,sort"` // Redirect holds the value of the "redirect" field. Redirect *string `json:"redirect,omitempty" rql:"filter,sort"` // Name holds the value of the "name" field. Name string `json:"name,omitempty" rql:"filter,sort"` // Type holds the value of the "type" field. Type route.Type `json:"type,omitempty" rql:"filter,sort"` // Meta holds the value of the "meta" field. Meta types.RouteMeta `json:"meta,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the RouteQuery when eager-loading is set. Edges RouteEdges `json:"edges" rql:"-"` // contains filtered or unexported fields }
Route is the model entity for the Route schema.
func (*Route) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Route) QueryChildren ¶
func (r *Route) QueryChildren() *RouteQuery
QueryChildren queries the "children" edge of the Route entity.
func (*Route) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*Route) QueryParent ¶
func (r *Route) QueryParent() *RouteQuery
QueryParent queries the "parent" edge of the Route entity.
func (*Route) QueryRoles ¶
QueryRoles queries the "roles" edge of the Route entity.
func (*Route) Unwrap ¶
Unwrap unwraps the Route 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 (*Route) Update ¶
func (r *Route) Update() *RouteUpdateOne
Update returns a builder for updating this Route. Note that you need to call Route.Unwrap() before calling this method if this Route was returned from a transaction, and the transaction was committed or rolled back.
type RouteClient ¶
type RouteClient struct {
// contains filtered or unexported fields
}
RouteClient is a client for the Route schema.
func NewRouteClient ¶
func NewRouteClient(c config) *RouteClient
NewRouteClient returns a client for the Route from the given config.
func (*RouteClient) Create ¶
func (c *RouteClient) Create() *RouteCreate
Create returns a builder for creating a Route entity.
func (*RouteClient) CreateBulk ¶
func (c *RouteClient) CreateBulk(builders ...*RouteCreate) *RouteCreateBulk
CreateBulk returns a builder for creating a bulk of Route entities.
func (*RouteClient) Delete ¶
func (c *RouteClient) Delete() *RouteDelete
Delete returns a delete builder for Route.
func (*RouteClient) DeleteOne ¶
func (c *RouteClient) DeleteOne(r *Route) *RouteDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RouteClient) DeleteOneID ¶
func (c *RouteClient) DeleteOneID(id int) *RouteDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RouteClient) ExecContext ¶
func (c *RouteClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteClient) GetX ¶
func (c *RouteClient) GetX(ctx context.Context, id int) *Route
GetX is like Get, but panics if an error occurs.
func (*RouteClient) Intercept ¶
func (c *RouteClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `route.Intercept(f(g(h())))`.
func (*RouteClient) Interceptors ¶
func (c *RouteClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RouteClient) MapCreateBulk ¶
func (c *RouteClient) MapCreateBulk(slice any, setFunc func(*RouteCreate, int)) *RouteCreateBulk
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 (*RouteClient) Query ¶
func (c *RouteClient) Query() *RouteQuery
Query returns a query builder for Route.
func (*RouteClient) QueryChildren ¶
func (c *RouteClient) QueryChildren(r *Route) *RouteQuery
QueryChildren queries the children edge of a Route.
func (*RouteClient) QueryContext ¶
func (c *RouteClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteClient) QueryParent ¶
func (c *RouteClient) QueryParent(r *Route) *RouteQuery
QueryParent queries the parent edge of a Route.
func (*RouteClient) QueryRoles ¶
func (c *RouteClient) QueryRoles(r *Route) *RoleQuery
QueryRoles queries the roles edge of a Route.
func (*RouteClient) Update ¶
func (c *RouteClient) Update() *RouteUpdate
Update returns an update builder for Route.
func (*RouteClient) UpdateOne ¶
func (c *RouteClient) UpdateOne(r *Route) *RouteUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RouteClient) UpdateOneID ¶
func (c *RouteClient) UpdateOneID(id int) *RouteUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RouteClient) Use ¶
func (c *RouteClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `route.Hooks(f(g(h())))`.
type RouteCreate ¶
type RouteCreate struct {
// contains filtered or unexported fields
}
RouteCreate is the builder for creating a Route entity.
func (*RouteCreate) AddChildIDs ¶
func (rc *RouteCreate) AddChildIDs(ids ...int) *RouteCreate
AddChildIDs adds the "children" edge to the Route entity by IDs.
func (*RouteCreate) AddChildren ¶
func (rc *RouteCreate) AddChildren(r ...*Route) *RouteCreate
AddChildren adds the "children" edges to the Route entity.
func (*RouteCreate) AddRoleIDs ¶
func (rc *RouteCreate) AddRoleIDs(ids ...int) *RouteCreate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*RouteCreate) AddRoles ¶
func (rc *RouteCreate) AddRoles(r ...*Role) *RouteCreate
AddRoles adds the "roles" edges to the Role entity.
func (*RouteCreate) Exec ¶
func (rc *RouteCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RouteCreate) ExecContext ¶
func (c *RouteCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteCreate) ExecX ¶
func (rc *RouteCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteCreate) Mutation ¶
func (rc *RouteCreate) Mutation() *RouteMutation
Mutation returns the RouteMutation object of the builder.
func (*RouteCreate) QueryContext ¶
func (c *RouteCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteCreate) Save ¶
func (rc *RouteCreate) Save(ctx context.Context) (*Route, error)
Save creates the Route in the database.
func (*RouteCreate) SaveX ¶
func (rc *RouteCreate) SaveX(ctx context.Context) *Route
SaveX calls Save and panics if Save returns an error.
func (*RouteCreate) SetComponent ¶
func (rc *RouteCreate) SetComponent(s string) *RouteCreate
SetComponent sets the "component" field.
func (*RouteCreate) SetCreatedAt ¶
func (rc *RouteCreate) SetCreatedAt(t time.Time) *RouteCreate
SetCreatedAt sets the "created_at" field.
func (*RouteCreate) SetDeletedAt ¶
func (rc *RouteCreate) SetDeletedAt(i int) *RouteCreate
SetDeletedAt sets the "deleted_at" field.
func (*RouteCreate) SetID ¶
func (rc *RouteCreate) SetID(i int) *RouteCreate
SetID sets the "id" field.
func (*RouteCreate) SetIsEnable ¶
func (rc *RouteCreate) SetIsEnable(b bool) *RouteCreate
SetIsEnable sets the "is_enable" field.
func (*RouteCreate) SetMeta ¶
func (rc *RouteCreate) SetMeta(tm types.RouteMeta) *RouteCreate
SetMeta sets the "meta" field.
func (*RouteCreate) SetName ¶
func (rc *RouteCreate) SetName(s string) *RouteCreate
SetName sets the "name" field.
func (*RouteCreate) SetNillableCreatedAt ¶
func (rc *RouteCreate) SetNillableCreatedAt(t *time.Time) *RouteCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RouteCreate) SetNillableDeletedAt ¶
func (rc *RouteCreate) SetNillableDeletedAt(i *int) *RouteCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*RouteCreate) SetNillableIsEnable ¶
func (rc *RouteCreate) SetNillableIsEnable(b *bool) *RouteCreate
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*RouteCreate) SetNillableParentID ¶
func (rc *RouteCreate) SetNillableParentID(i *int) *RouteCreate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*RouteCreate) SetNillableRedirect ¶
func (rc *RouteCreate) SetNillableRedirect(s *string) *RouteCreate
SetNillableRedirect sets the "redirect" field if the given value is not nil.
func (*RouteCreate) SetNillableType ¶
func (rc *RouteCreate) SetNillableType(r *route.Type) *RouteCreate
SetNillableType sets the "type" field if the given value is not nil.
func (*RouteCreate) SetNillableUpdatedAt ¶
func (rc *RouteCreate) SetNillableUpdatedAt(t *time.Time) *RouteCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*RouteCreate) SetParent ¶
func (rc *RouteCreate) SetParent(r *Route) *RouteCreate
SetParent sets the "parent" edge to the Route entity.
func (*RouteCreate) SetParentID ¶
func (rc *RouteCreate) SetParentID(i int) *RouteCreate
SetParentID sets the "parent_id" field.
func (*RouteCreate) SetPath ¶
func (rc *RouteCreate) SetPath(s string) *RouteCreate
SetPath sets the "path" field.
func (*RouteCreate) SetRedirect ¶
func (rc *RouteCreate) SetRedirect(s string) *RouteCreate
SetRedirect sets the "redirect" field.
func (*RouteCreate) SetType ¶
func (rc *RouteCreate) SetType(r route.Type) *RouteCreate
SetType sets the "type" field.
func (*RouteCreate) SetUpdatedAt ¶
func (rc *RouteCreate) SetUpdatedAt(t time.Time) *RouteCreate
SetUpdatedAt sets the "updated_at" field.
type RouteCreateBulk ¶
type RouteCreateBulk struct {
// contains filtered or unexported fields
}
RouteCreateBulk is the builder for creating many Route entities in bulk.
func (*RouteCreateBulk) Exec ¶
func (rcb *RouteCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RouteCreateBulk) ExecContext ¶
func (c *RouteCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteCreateBulk) ExecX ¶
func (rcb *RouteCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteCreateBulk) QueryContext ¶
func (c *RouteCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
type RouteDelete ¶
type RouteDelete struct {
// contains filtered or unexported fields
}
RouteDelete is the builder for deleting a Route entity.
func (*RouteDelete) Exec ¶
func (rd *RouteDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RouteDelete) ExecContext ¶
func (c *RouteDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteDelete) ExecX ¶
func (rd *RouteDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RouteDelete) QueryContext ¶
func (c *RouteDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteDelete) Where ¶
func (rd *RouteDelete) Where(ps ...predicate.Route) *RouteDelete
Where appends a list predicates to the RouteDelete builder.
type RouteDeleteOne ¶
type RouteDeleteOne struct {
// contains filtered or unexported fields
}
RouteDeleteOne is the builder for deleting a single Route entity.
func (*RouteDeleteOne) Exec ¶
func (rdo *RouteDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RouteDeleteOne) ExecX ¶
func (rdo *RouteDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteDeleteOne) Where ¶
func (rdo *RouteDeleteOne) Where(ps ...predicate.Route) *RouteDeleteOne
Where appends a list predicates to the RouteDelete builder.
type RouteEdges ¶
type RouteEdges struct { // Parent holds the value of the parent edge. Parent *Route `json:"parent,omitempty"` // Children holds the value of the children edge. Children []*Route `json:"children,omitempty"` // Roles holds the value of the roles edge. Roles []*Role `json:"roles,omitempty"` // contains filtered or unexported fields }
RouteEdges holds the relations/edges for other nodes in the graph.
func (RouteEdges) ChildrenOrErr ¶
func (e RouteEdges) ChildrenOrErr() ([]*Route, error)
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (RouteEdges) ParentOrErr ¶
func (e RouteEdges) ParentOrErr() (*Route, error)
ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (RouteEdges) RolesOrErr ¶
func (e RouteEdges) RolesOrErr() ([]*Role, error)
RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.
type RouteGroupBy ¶
type RouteGroupBy struct {
// contains filtered or unexported fields
}
RouteGroupBy is the group-by builder for Route entities.
func (*RouteGroupBy) Aggregate ¶
func (rgb *RouteGroupBy) Aggregate(fns ...AggregateFunc) *RouteGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RouteGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RouteGroupBy) Scan ¶
func (rgb *RouteGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RouteGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RouteMutation ¶
type RouteMutation struct {
// contains filtered or unexported fields
}
RouteMutation represents an operation that mutates the Route nodes in the graph.
func (*RouteMutation) AddChildIDs ¶
func (m *RouteMutation) AddChildIDs(ids ...int)
AddChildIDs adds the "children" edge to the Route entity by ids.
func (*RouteMutation) AddDeletedAt ¶
func (m *RouteMutation) AddDeletedAt(i int)
AddDeletedAt adds i to the "deleted_at" field.
func (*RouteMutation) AddField ¶
func (m *RouteMutation) 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 (*RouteMutation) AddRoleIDs ¶
func (m *RouteMutation) AddRoleIDs(ids ...int)
AddRoleIDs adds the "roles" edge to the Role entity by ids.
func (*RouteMutation) AddedDeletedAt ¶
func (m *RouteMutation) AddedDeletedAt() (r int, exists bool)
AddedDeletedAt returns the value that was added to the "deleted_at" field in this mutation.
func (*RouteMutation) AddedEdges ¶
func (m *RouteMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RouteMutation) AddedField ¶
func (m *RouteMutation) 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 (*RouteMutation) AddedFields ¶
func (m *RouteMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RouteMutation) AddedIDs ¶
func (m *RouteMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RouteMutation) ChildrenCleared ¶
func (m *RouteMutation) ChildrenCleared() bool
ChildrenCleared reports if the "children" edge to the Route entity was cleared.
func (*RouteMutation) ChildrenIDs ¶
func (m *RouteMutation) ChildrenIDs() (ids []int)
ChildrenIDs returns the "children" edge IDs in the mutation.
func (*RouteMutation) ClearChildren ¶
func (m *RouteMutation) ClearChildren()
ClearChildren clears the "children" edge to the Route entity.
func (*RouteMutation) ClearEdge ¶
func (m *RouteMutation) 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 (*RouteMutation) ClearField ¶
func (m *RouteMutation) 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 (*RouteMutation) ClearParent ¶
func (m *RouteMutation) ClearParent()
ClearParent clears the "parent" edge to the Route entity.
func (*RouteMutation) ClearParentID ¶
func (m *RouteMutation) ClearParentID()
ClearParentID clears the value of the "parent_id" field.
func (*RouteMutation) ClearRedirect ¶
func (m *RouteMutation) ClearRedirect()
ClearRedirect clears the value of the "redirect" field.
func (*RouteMutation) ClearRoles ¶
func (m *RouteMutation) ClearRoles()
ClearRoles clears the "roles" edge to the Role entity.
func (*RouteMutation) ClearedEdges ¶
func (m *RouteMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RouteMutation) ClearedFields ¶
func (m *RouteMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RouteMutation) Client ¶
func (m RouteMutation) 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 (*RouteMutation) Component ¶
func (m *RouteMutation) Component() (r string, exists bool)
Component returns the value of the "component" field in the mutation.
func (*RouteMutation) CreatedAt ¶
func (m *RouteMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*RouteMutation) DeletedAt ¶
func (m *RouteMutation) DeletedAt() (r int, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*RouteMutation) EdgeCleared ¶
func (m *RouteMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RouteMutation) ExecContext ¶
func (c *RouteMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteMutation) Field ¶
func (m *RouteMutation) 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 (*RouteMutation) FieldCleared ¶
func (m *RouteMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RouteMutation) Fields ¶
func (m *RouteMutation) 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 (*RouteMutation) GetType ¶
func (m *RouteMutation) GetType() (r route.Type, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*RouteMutation) ID ¶
func (m *RouteMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*RouteMutation) IDs ¶
func (m *RouteMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*RouteMutation) IsEnable ¶
func (m *RouteMutation) IsEnable() (r bool, exists bool)
IsEnable returns the value of the "is_enable" field in the mutation.
func (*RouteMutation) Meta ¶
func (m *RouteMutation) Meta() (r types.RouteMeta, exists bool)
Meta returns the value of the "meta" field in the mutation.
func (*RouteMutation) Name ¶
func (m *RouteMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RouteMutation) OldComponent ¶
func (m *RouteMutation) OldComponent(ctx context.Context) (v string, err error)
OldComponent returns the old "component" field's value of the Route entity. If the Route 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 (*RouteMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Route entity. If the Route 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 (*RouteMutation) OldDeletedAt ¶
func (m *RouteMutation) OldDeletedAt(ctx context.Context) (v int, err error)
OldDeletedAt returns the old "deleted_at" field's value of the Route entity. If the Route 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 (*RouteMutation) 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 (*RouteMutation) OldIsEnable ¶
func (m *RouteMutation) OldIsEnable(ctx context.Context) (v bool, err error)
OldIsEnable returns the old "is_enable" field's value of the Route entity. If the Route 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 (*RouteMutation) OldMeta ¶
OldMeta returns the old "meta" field's value of the Route entity. If the Route 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 (*RouteMutation) OldName ¶
func (m *RouteMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Route entity. If the Route 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 (*RouteMutation) OldParentID ¶
func (m *RouteMutation) OldParentID(ctx context.Context) (v *int, err error)
OldParentID returns the old "parent_id" field's value of the Route entity. If the Route 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 (*RouteMutation) OldPath ¶
func (m *RouteMutation) OldPath(ctx context.Context) (v string, err error)
OldPath returns the old "path" field's value of the Route entity. If the Route 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 (*RouteMutation) OldRedirect ¶
func (m *RouteMutation) OldRedirect(ctx context.Context) (v *string, err error)
OldRedirect returns the old "redirect" field's value of the Route entity. If the Route 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 (*RouteMutation) OldType ¶
OldType returns the old "type" field's value of the Route entity. If the Route 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 (*RouteMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Route entity. If the Route 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 (*RouteMutation) ParentCleared ¶
func (m *RouteMutation) ParentCleared() bool
ParentCleared reports if the "parent" edge to the Route entity was cleared.
func (*RouteMutation) ParentID ¶
func (m *RouteMutation) ParentID() (r int, exists bool)
ParentID returns the value of the "parent_id" field in the mutation.
func (*RouteMutation) ParentIDCleared ¶
func (m *RouteMutation) ParentIDCleared() bool
ParentIDCleared returns if the "parent_id" field was cleared in this mutation.
func (*RouteMutation) ParentIDs ¶
func (m *RouteMutation) ParentIDs() (ids []int)
ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.
func (*RouteMutation) Path ¶
func (m *RouteMutation) Path() (r string, exists bool)
Path returns the value of the "path" field in the mutation.
func (*RouteMutation) QueryContext ¶
func (c *RouteMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteMutation) Redirect ¶
func (m *RouteMutation) Redirect() (r string, exists bool)
Redirect returns the value of the "redirect" field in the mutation.
func (*RouteMutation) RedirectCleared ¶
func (m *RouteMutation) RedirectCleared() bool
RedirectCleared returns if the "redirect" field was cleared in this mutation.
func (*RouteMutation) RemoveChildIDs ¶
func (m *RouteMutation) RemoveChildIDs(ids ...int)
RemoveChildIDs removes the "children" edge to the Route entity by IDs.
func (*RouteMutation) RemoveRoleIDs ¶
func (m *RouteMutation) RemoveRoleIDs(ids ...int)
RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.
func (*RouteMutation) RemovedChildrenIDs ¶
func (m *RouteMutation) RemovedChildrenIDs() (ids []int)
RemovedChildren returns the removed IDs of the "children" edge to the Route entity.
func (*RouteMutation) RemovedEdges ¶
func (m *RouteMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RouteMutation) RemovedIDs ¶
func (m *RouteMutation) 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 (*RouteMutation) RemovedRolesIDs ¶
func (m *RouteMutation) RemovedRolesIDs() (ids []int)
RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.
func (*RouteMutation) ResetChildren ¶
func (m *RouteMutation) ResetChildren()
ResetChildren resets all changes to the "children" edge.
func (*RouteMutation) ResetComponent ¶
func (m *RouteMutation) ResetComponent()
ResetComponent resets all changes to the "component" field.
func (*RouteMutation) ResetCreatedAt ¶
func (m *RouteMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*RouteMutation) ResetDeletedAt ¶
func (m *RouteMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*RouteMutation) ResetEdge ¶
func (m *RouteMutation) 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 (*RouteMutation) ResetField ¶
func (m *RouteMutation) 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 (*RouteMutation) ResetIsEnable ¶
func (m *RouteMutation) ResetIsEnable()
ResetIsEnable resets all changes to the "is_enable" field.
func (*RouteMutation) ResetMeta ¶
func (m *RouteMutation) ResetMeta()
ResetMeta resets all changes to the "meta" field.
func (*RouteMutation) ResetName ¶
func (m *RouteMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RouteMutation) ResetParent ¶
func (m *RouteMutation) ResetParent()
ResetParent resets all changes to the "parent" edge.
func (*RouteMutation) ResetParentID ¶
func (m *RouteMutation) ResetParentID()
ResetParentID resets all changes to the "parent_id" field.
func (*RouteMutation) ResetPath ¶
func (m *RouteMutation) ResetPath()
ResetPath resets all changes to the "path" field.
func (*RouteMutation) ResetRedirect ¶
func (m *RouteMutation) ResetRedirect()
ResetRedirect resets all changes to the "redirect" field.
func (*RouteMutation) ResetRoles ¶
func (m *RouteMutation) ResetRoles()
ResetRoles resets all changes to the "roles" edge.
func (*RouteMutation) ResetType ¶
func (m *RouteMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*RouteMutation) ResetUpdatedAt ¶
func (m *RouteMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*RouteMutation) RolesCleared ¶
func (m *RouteMutation) RolesCleared() bool
RolesCleared reports if the "roles" edge to the Role entity was cleared.
func (*RouteMutation) RolesIDs ¶
func (m *RouteMutation) RolesIDs() (ids []int)
RolesIDs returns the "roles" edge IDs in the mutation.
func (*RouteMutation) SetComponent ¶
func (m *RouteMutation) SetComponent(s string)
SetComponent sets the "component" field.
func (*RouteMutation) SetCreatedAt ¶
func (m *RouteMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*RouteMutation) SetDeletedAt ¶
func (m *RouteMutation) SetDeletedAt(i int)
SetDeletedAt sets the "deleted_at" field.
func (*RouteMutation) SetField ¶
func (m *RouteMutation) 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 (*RouteMutation) SetID ¶
func (m *RouteMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Route entities.
func (*RouteMutation) SetIsEnable ¶
func (m *RouteMutation) SetIsEnable(b bool)
SetIsEnable sets the "is_enable" field.
func (*RouteMutation) SetMeta ¶
func (m *RouteMutation) SetMeta(tm types.RouteMeta)
SetMeta sets the "meta" field.
func (*RouteMutation) SetName ¶
func (m *RouteMutation) SetName(s string)
SetName sets the "name" field.
func (*RouteMutation) SetOp ¶
func (m *RouteMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RouteMutation) SetParentID ¶
func (m *RouteMutation) SetParentID(i int)
SetParentID sets the "parent_id" field.
func (*RouteMutation) SetPath ¶
func (m *RouteMutation) SetPath(s string)
SetPath sets the "path" field.
func (*RouteMutation) SetRedirect ¶
func (m *RouteMutation) SetRedirect(s string)
SetRedirect sets the "redirect" field.
func (*RouteMutation) SetType ¶
func (m *RouteMutation) SetType(r route.Type)
SetType sets the "type" field.
func (*RouteMutation) SetUpdatedAt ¶
func (m *RouteMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (RouteMutation) Tx ¶
func (m RouteMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RouteMutation) Type ¶
func (m *RouteMutation) Type() string
Type returns the node type of this mutation (Route).
func (*RouteMutation) UpdatedAt ¶
func (m *RouteMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*RouteMutation) Where ¶
func (m *RouteMutation) Where(ps ...predicate.Route)
Where appends a list predicates to the RouteMutation builder.
func (*RouteMutation) WhereP ¶
func (m *RouteMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RouteMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RouteQuery ¶
type RouteQuery struct {
// contains filtered or unexported fields
}
RouteQuery is the builder for querying Route entities.
func (*RouteQuery) Aggregate ¶
func (rq *RouteQuery) Aggregate(fns ...AggregateFunc) *RouteSelect
Aggregate returns a RouteSelect configured with the given aggregations.
func (*RouteQuery) All ¶
func (rq *RouteQuery) All(ctx context.Context) ([]*Route, error)
All executes the query and returns a list of Routes.
func (*RouteQuery) AllX ¶
func (rq *RouteQuery) AllX(ctx context.Context) []*Route
AllX is like All, but panics if an error occurs.
func (*RouteQuery) Clone ¶
func (rq *RouteQuery) Clone() *RouteQuery
Clone returns a duplicate of the RouteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RouteQuery) Count ¶
func (rq *RouteQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RouteQuery) CountX ¶
func (rq *RouteQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RouteQuery) ExecContext ¶
func (c *RouteQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteQuery) Exist ¶
func (rq *RouteQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RouteQuery) ExistX ¶
func (rq *RouteQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RouteQuery) First ¶
func (rq *RouteQuery) First(ctx context.Context) (*Route, error)
First returns the first Route entity from the query. Returns a *NotFoundError when no Route was found.
func (*RouteQuery) FirstID ¶
func (rq *RouteQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Route ID from the query. Returns a *NotFoundError when no Route ID was found.
func (*RouteQuery) FirstIDX ¶
func (rq *RouteQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RouteQuery) FirstX ¶
func (rq *RouteQuery) FirstX(ctx context.Context) *Route
FirstX is like First, but panics if an error occurs.
func (*RouteQuery) GroupBy ¶
func (rq *RouteQuery) GroupBy(field string, fields ...string) *RouteGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` Count int `json:"count,omitempty"` } client.Route.Query(). GroupBy(route.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RouteQuery) IDs ¶
func (rq *RouteQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Route IDs.
func (*RouteQuery) IDsX ¶
func (rq *RouteQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RouteQuery) Limit ¶
func (rq *RouteQuery) Limit(limit int) *RouteQuery
Limit the number of records to be returned by this query.
func (*RouteQuery) Modify ¶
func (rq *RouteQuery) Modify(modifiers ...func(s *sql.Selector)) *RouteSelect
Modify adds a query modifier for attaching custom logic to queries.
func (*RouteQuery) Offset ¶
func (rq *RouteQuery) Offset(offset int) *RouteQuery
Offset to start from.
func (*RouteQuery) Only ¶
func (rq *RouteQuery) Only(ctx context.Context) (*Route, error)
Only returns a single Route entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Route entity is found. Returns a *NotFoundError when no Route entities are found.
func (*RouteQuery) OnlyID ¶
func (rq *RouteQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Route ID in the query. Returns a *NotSingularError when more than one Route ID is found. Returns a *NotFoundError when no entities are found.
func (*RouteQuery) OnlyIDX ¶
func (rq *RouteQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RouteQuery) OnlyX ¶
func (rq *RouteQuery) OnlyX(ctx context.Context) *Route
OnlyX is like Only, but panics if an error occurs.
func (*RouteQuery) Order ¶
func (rq *RouteQuery) Order(o ...route.OrderOption) *RouteQuery
Order specifies how the records should be ordered.
func (*RouteQuery) QueryChildren ¶
func (rq *RouteQuery) QueryChildren() *RouteQuery
QueryChildren chains the current query on the "children" edge.
func (*RouteQuery) QueryContext ¶
func (c *RouteQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteQuery) QueryParent ¶
func (rq *RouteQuery) QueryParent() *RouteQuery
QueryParent chains the current query on the "parent" edge.
func (*RouteQuery) QueryRoles ¶
func (rq *RouteQuery) QueryRoles() *RoleQuery
QueryRoles chains the current query on the "roles" edge.
func (*RouteQuery) Select ¶
func (rq *RouteQuery) Select(fields ...string) *RouteSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"createdAt,omitempty" rql:"filter,sort"` } client.Route.Query(). Select(route.FieldCreatedAt). Scan(ctx, &v)
func (*RouteQuery) Unique ¶
func (rq *RouteQuery) Unique(unique bool) *RouteQuery
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 (*RouteQuery) Where ¶
func (rq *RouteQuery) Where(ps ...predicate.Route) *RouteQuery
Where adds a new predicate for the RouteQuery builder.
func (*RouteQuery) WithChildren ¶
func (rq *RouteQuery) WithChildren(opts ...func(*RouteQuery)) *RouteQuery
WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.
func (*RouteQuery) WithParent ¶
func (rq *RouteQuery) WithParent(opts ...func(*RouteQuery)) *RouteQuery
WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.
func (*RouteQuery) WithRoles ¶
func (rq *RouteQuery) WithRoles(opts ...func(*RoleQuery)) *RouteQuery
WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.
type RouteSelect ¶
type RouteSelect struct { *RouteQuery // contains filtered or unexported fields }
RouteSelect is the builder for selecting fields of Route entities.
func (*RouteSelect) Aggregate ¶
func (rs *RouteSelect) Aggregate(fns ...AggregateFunc) *RouteSelect
Aggregate adds the given aggregation functions to the selector query.
func (*RouteSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (RouteSelect) ExecContext ¶
func (c RouteSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RouteSelect) Modify ¶
func (rs *RouteSelect) Modify(modifiers ...func(s *sql.Selector)) *RouteSelect
Modify adds a query modifier for attaching custom logic to queries.
func (RouteSelect) QueryContext ¶
func (c RouteSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteSelect) Scan ¶
func (rs *RouteSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RouteSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RouteUpdate ¶
type RouteUpdate struct {
// contains filtered or unexported fields
}
RouteUpdate is the builder for updating Route entities.
func (*RouteUpdate) AddChildIDs ¶
func (ru *RouteUpdate) AddChildIDs(ids ...int) *RouteUpdate
AddChildIDs adds the "children" edge to the Route entity by IDs.
func (*RouteUpdate) AddChildren ¶
func (ru *RouteUpdate) AddChildren(r ...*Route) *RouteUpdate
AddChildren adds the "children" edges to the Route entity.
func (*RouteUpdate) AddDeletedAt ¶
func (ru *RouteUpdate) AddDeletedAt(i int) *RouteUpdate
AddDeletedAt adds i to the "deleted_at" field.
func (*RouteUpdate) AddRoleIDs ¶
func (ru *RouteUpdate) AddRoleIDs(ids ...int) *RouteUpdate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*RouteUpdate) AddRoles ¶
func (ru *RouteUpdate) AddRoles(r ...*Role) *RouteUpdate
AddRoles adds the "roles" edges to the Role entity.
func (*RouteUpdate) ClearChildren ¶
func (ru *RouteUpdate) ClearChildren() *RouteUpdate
ClearChildren clears all "children" edges to the Route entity.
func (*RouteUpdate) ClearParent ¶
func (ru *RouteUpdate) ClearParent() *RouteUpdate
ClearParent clears the "parent" edge to the Route entity.
func (*RouteUpdate) ClearParentID ¶
func (ru *RouteUpdate) ClearParentID() *RouteUpdate
ClearParentID clears the value of the "parent_id" field.
func (*RouteUpdate) ClearRedirect ¶
func (ru *RouteUpdate) ClearRedirect() *RouteUpdate
ClearRedirect clears the value of the "redirect" field.
func (*RouteUpdate) ClearRoles ¶
func (ru *RouteUpdate) ClearRoles() *RouteUpdate
ClearRoles clears all "roles" edges to the Role entity.
func (*RouteUpdate) Exec ¶
func (ru *RouteUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RouteUpdate) ExecContext ¶
func (c *RouteUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteUpdate) ExecX ¶
func (ru *RouteUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteUpdate) Modify ¶
func (ru *RouteUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RouteUpdate
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*RouteUpdate) Mutation ¶
func (ru *RouteUpdate) Mutation() *RouteMutation
Mutation returns the RouteMutation object of the builder.
func (*RouteUpdate) QueryContext ¶
func (c *RouteUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteUpdate) RemoveChildIDs ¶
func (ru *RouteUpdate) RemoveChildIDs(ids ...int) *RouteUpdate
RemoveChildIDs removes the "children" edge to Route entities by IDs.
func (*RouteUpdate) RemoveChildren ¶
func (ru *RouteUpdate) RemoveChildren(r ...*Route) *RouteUpdate
RemoveChildren removes "children" edges to Route entities.
func (*RouteUpdate) RemoveRoleIDs ¶
func (ru *RouteUpdate) RemoveRoleIDs(ids ...int) *RouteUpdate
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*RouteUpdate) RemoveRoles ¶
func (ru *RouteUpdate) RemoveRoles(r ...*Role) *RouteUpdate
RemoveRoles removes "roles" edges to Role entities.
func (*RouteUpdate) Save ¶
func (ru *RouteUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RouteUpdate) SaveX ¶
func (ru *RouteUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RouteUpdate) SetComponent ¶
func (ru *RouteUpdate) SetComponent(s string) *RouteUpdate
SetComponent sets the "component" field.
func (*RouteUpdate) SetCreatedAt ¶
func (ru *RouteUpdate) SetCreatedAt(t time.Time) *RouteUpdate
SetCreatedAt sets the "created_at" field.
func (*RouteUpdate) SetDeletedAt ¶
func (ru *RouteUpdate) SetDeletedAt(i int) *RouteUpdate
SetDeletedAt sets the "deleted_at" field.
func (*RouteUpdate) SetIsEnable ¶
func (ru *RouteUpdate) SetIsEnable(b bool) *RouteUpdate
SetIsEnable sets the "is_enable" field.
func (*RouteUpdate) SetMeta ¶
func (ru *RouteUpdate) SetMeta(tm types.RouteMeta) *RouteUpdate
SetMeta sets the "meta" field.
func (*RouteUpdate) SetName ¶
func (ru *RouteUpdate) SetName(s string) *RouteUpdate
SetName sets the "name" field.
func (*RouteUpdate) SetNillableComponent ¶
func (ru *RouteUpdate) SetNillableComponent(s *string) *RouteUpdate
SetNillableComponent sets the "component" field if the given value is not nil.
func (*RouteUpdate) SetNillableCreatedAt ¶
func (ru *RouteUpdate) SetNillableCreatedAt(t *time.Time) *RouteUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RouteUpdate) SetNillableDeletedAt ¶
func (ru *RouteUpdate) SetNillableDeletedAt(i *int) *RouteUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*RouteUpdate) SetNillableIsEnable ¶
func (ru *RouteUpdate) SetNillableIsEnable(b *bool) *RouteUpdate
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*RouteUpdate) SetNillableMeta ¶
func (ru *RouteUpdate) SetNillableMeta(tm *types.RouteMeta) *RouteUpdate
SetNillableMeta sets the "meta" field if the given value is not nil.
func (*RouteUpdate) SetNillableName ¶
func (ru *RouteUpdate) SetNillableName(s *string) *RouteUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RouteUpdate) SetNillableParentID ¶
func (ru *RouteUpdate) SetNillableParentID(i *int) *RouteUpdate
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*RouteUpdate) SetNillablePath ¶
func (ru *RouteUpdate) SetNillablePath(s *string) *RouteUpdate
SetNillablePath sets the "path" field if the given value is not nil.
func (*RouteUpdate) SetNillableRedirect ¶
func (ru *RouteUpdate) SetNillableRedirect(s *string) *RouteUpdate
SetNillableRedirect sets the "redirect" field if the given value is not nil.
func (*RouteUpdate) SetNillableType ¶
func (ru *RouteUpdate) SetNillableType(r *route.Type) *RouteUpdate
SetNillableType sets the "type" field if the given value is not nil.
func (*RouteUpdate) SetParent ¶
func (ru *RouteUpdate) SetParent(r *Route) *RouteUpdate
SetParent sets the "parent" edge to the Route entity.
func (*RouteUpdate) SetParentID ¶
func (ru *RouteUpdate) SetParentID(i int) *RouteUpdate
SetParentID sets the "parent_id" field.
func (*RouteUpdate) SetPath ¶
func (ru *RouteUpdate) SetPath(s string) *RouteUpdate
SetPath sets the "path" field.
func (*RouteUpdate) SetRedirect ¶
func (ru *RouteUpdate) SetRedirect(s string) *RouteUpdate
SetRedirect sets the "redirect" field.
func (*RouteUpdate) SetType ¶
func (ru *RouteUpdate) SetType(r route.Type) *RouteUpdate
SetType sets the "type" field.
func (*RouteUpdate) SetUpdatedAt ¶
func (ru *RouteUpdate) SetUpdatedAt(t time.Time) *RouteUpdate
SetUpdatedAt sets the "updated_at" field.
func (*RouteUpdate) Where ¶
func (ru *RouteUpdate) Where(ps ...predicate.Route) *RouteUpdate
Where appends a list predicates to the RouteUpdate builder.
type RouteUpdateOne ¶
type RouteUpdateOne struct {
// contains filtered or unexported fields
}
RouteUpdateOne is the builder for updating a single Route entity.
func (*RouteUpdateOne) AddChildIDs ¶
func (ruo *RouteUpdateOne) AddChildIDs(ids ...int) *RouteUpdateOne
AddChildIDs adds the "children" edge to the Route entity by IDs.
func (*RouteUpdateOne) AddChildren ¶
func (ruo *RouteUpdateOne) AddChildren(r ...*Route) *RouteUpdateOne
AddChildren adds the "children" edges to the Route entity.
func (*RouteUpdateOne) AddDeletedAt ¶
func (ruo *RouteUpdateOne) AddDeletedAt(i int) *RouteUpdateOne
AddDeletedAt adds i to the "deleted_at" field.
func (*RouteUpdateOne) AddRoleIDs ¶
func (ruo *RouteUpdateOne) AddRoleIDs(ids ...int) *RouteUpdateOne
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*RouteUpdateOne) AddRoles ¶
func (ruo *RouteUpdateOne) AddRoles(r ...*Role) *RouteUpdateOne
AddRoles adds the "roles" edges to the Role entity.
func (*RouteUpdateOne) ClearChildren ¶
func (ruo *RouteUpdateOne) ClearChildren() *RouteUpdateOne
ClearChildren clears all "children" edges to the Route entity.
func (*RouteUpdateOne) ClearParent ¶
func (ruo *RouteUpdateOne) ClearParent() *RouteUpdateOne
ClearParent clears the "parent" edge to the Route entity.
func (*RouteUpdateOne) ClearParentID ¶
func (ruo *RouteUpdateOne) ClearParentID() *RouteUpdateOne
ClearParentID clears the value of the "parent_id" field.
func (*RouteUpdateOne) ClearRedirect ¶
func (ruo *RouteUpdateOne) ClearRedirect() *RouteUpdateOne
ClearRedirect clears the value of the "redirect" field.
func (*RouteUpdateOne) ClearRoles ¶
func (ruo *RouteUpdateOne) ClearRoles() *RouteUpdateOne
ClearRoles clears all "roles" edges to the Role entity.
func (*RouteUpdateOne) Exec ¶
func (ruo *RouteUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RouteUpdateOne) ExecContext ¶
func (c *RouteUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*RouteUpdateOne) ExecX ¶
func (ruo *RouteUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RouteUpdateOne) Modify ¶
func (ruo *RouteUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RouteUpdateOne
Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (*RouteUpdateOne) Mutation ¶
func (ruo *RouteUpdateOne) Mutation() *RouteMutation
Mutation returns the RouteMutation object of the builder.
func (*RouteUpdateOne) QueryContext ¶
func (c *RouteUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
func (*RouteUpdateOne) RemoveChildIDs ¶
func (ruo *RouteUpdateOne) RemoveChildIDs(ids ...int) *RouteUpdateOne
RemoveChildIDs removes the "children" edge to Route entities by IDs.
func (*RouteUpdateOne) RemoveChildren ¶
func (ruo *RouteUpdateOne) RemoveChildren(r ...*Route) *RouteUpdateOne
RemoveChildren removes "children" edges to Route entities.
func (*RouteUpdateOne) RemoveRoleIDs ¶
func (ruo *RouteUpdateOne) RemoveRoleIDs(ids ...int) *RouteUpdateOne
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*RouteUpdateOne) RemoveRoles ¶
func (ruo *RouteUpdateOne) RemoveRoles(r ...*Role) *RouteUpdateOne
RemoveRoles removes "roles" edges to Role entities.
func (*RouteUpdateOne) Save ¶
func (ruo *RouteUpdateOne) Save(ctx context.Context) (*Route, error)
Save executes the query and returns the updated Route entity.
func (*RouteUpdateOne) SaveX ¶
func (ruo *RouteUpdateOne) SaveX(ctx context.Context) *Route
SaveX is like Save, but panics if an error occurs.
func (*RouteUpdateOne) Select ¶
func (ruo *RouteUpdateOne) Select(field string, fields ...string) *RouteUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RouteUpdateOne) SetComponent ¶
func (ruo *RouteUpdateOne) SetComponent(s string) *RouteUpdateOne
SetComponent sets the "component" field.
func (*RouteUpdateOne) SetCreatedAt ¶
func (ruo *RouteUpdateOne) SetCreatedAt(t time.Time) *RouteUpdateOne
SetCreatedAt sets the "created_at" field.
func (*RouteUpdateOne) SetDeletedAt ¶
func (ruo *RouteUpdateOne) SetDeletedAt(i int) *RouteUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*RouteUpdateOne) SetIsEnable ¶
func (ruo *RouteUpdateOne) SetIsEnable(b bool) *RouteUpdateOne
SetIsEnable sets the "is_enable" field.
func (*RouteUpdateOne) SetMeta ¶
func (ruo *RouteUpdateOne) SetMeta(tm types.RouteMeta) *RouteUpdateOne
SetMeta sets the "meta" field.
func (*RouteUpdateOne) SetName ¶
func (ruo *RouteUpdateOne) SetName(s string) *RouteUpdateOne
SetName sets the "name" field.
func (*RouteUpdateOne) SetNillableComponent ¶
func (ruo *RouteUpdateOne) SetNillableComponent(s *string) *RouteUpdateOne
SetNillableComponent sets the "component" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableCreatedAt ¶
func (ruo *RouteUpdateOne) SetNillableCreatedAt(t *time.Time) *RouteUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableDeletedAt ¶
func (ruo *RouteUpdateOne) SetNillableDeletedAt(i *int) *RouteUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableIsEnable ¶
func (ruo *RouteUpdateOne) SetNillableIsEnable(b *bool) *RouteUpdateOne
SetNillableIsEnable sets the "is_enable" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableMeta ¶
func (ruo *RouteUpdateOne) SetNillableMeta(tm *types.RouteMeta) *RouteUpdateOne
SetNillableMeta sets the "meta" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableName ¶
func (ruo *RouteUpdateOne) SetNillableName(s *string) *RouteUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableParentID ¶
func (ruo *RouteUpdateOne) SetNillableParentID(i *int) *RouteUpdateOne
SetNillableParentID sets the "parent_id" field if the given value is not nil.
func (*RouteUpdateOne) SetNillablePath ¶
func (ruo *RouteUpdateOne) SetNillablePath(s *string) *RouteUpdateOne
SetNillablePath sets the "path" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableRedirect ¶
func (ruo *RouteUpdateOne) SetNillableRedirect(s *string) *RouteUpdateOne
SetNillableRedirect sets the "redirect" field if the given value is not nil.
func (*RouteUpdateOne) SetNillableType ¶
func (ruo *RouteUpdateOne) SetNillableType(r *route.Type) *RouteUpdateOne
SetNillableType sets the "type" field if the given value is not nil.
func (*RouteUpdateOne) SetParent ¶
func (ruo *RouteUpdateOne) SetParent(r *Route) *RouteUpdateOne
SetParent sets the "parent" edge to the Route entity.
func (*RouteUpdateOne) SetParentID ¶
func (ruo *RouteUpdateOne) SetParentID(i int) *RouteUpdateOne
SetParentID sets the "parent_id" field.
func (*RouteUpdateOne) SetPath ¶
func (ruo *RouteUpdateOne) SetPath(s string) *RouteUpdateOne
SetPath sets the "path" field.
func (*RouteUpdateOne) SetRedirect ¶
func (ruo *RouteUpdateOne) SetRedirect(s string) *RouteUpdateOne
SetRedirect sets the "redirect" field.
func (*RouteUpdateOne) SetType ¶
func (ruo *RouteUpdateOne) SetType(r route.Type) *RouteUpdateOne
SetType sets the "type" field.
func (*RouteUpdateOne) SetUpdatedAt ¶
func (ruo *RouteUpdateOne) SetUpdatedAt(t time.Time) *RouteUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*RouteUpdateOne) Where ¶
func (ruo *RouteUpdateOne) Where(ps ...predicate.Route) *RouteUpdateOne
Where appends a list predicates to the RouteUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Admin is the client for interacting with the Admin builders. Admin *AdminClient // Permission is the client for interacting with the Permission builders. Permission *PermissionClient // Role is the client for interacting with the Role builders. Role *RoleClient // Route is the client for interacting with the Route builders. Route *RouteClient // 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) ExecContext ¶
ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
func (*Tx) QueryContext ¶
QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.
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 ¶
- admin.go
- admin_create.go
- admin_delete.go
- admin_query.go
- admin_update.go
- client.go
- ent.go
- mutation.go
- permission.go
- permission_create.go
- permission_delete.go
- permission_query.go
- permission_update.go
- role.go
- role_create.go
- role_delete.go
- role_query.go
- role_update.go
- route.go
- route_create.go
- route_delete.go
- route_query.go
- route_update.go
- runtime.go
- tx.go