Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Event
- func (e *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error
- func (e *Event) QueryCategory() *EventTypeQuery
- func (e *Event) QueryUsers() *UserQuery
- func (e *Event) String() string
- func (e *Event) Unwrap() *Event
- func (e *Event) Update() *EventUpdateOne
- func (e *Event) Validate(formats strfmt.Registry) error
- type EventClient
- func (c *EventClient) Create() *EventCreate
- func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk
- func (c *EventClient) Delete() *EventDelete
- func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne
- func (c *EventClient) DeleteOneID(id uuid.UUID) *EventDeleteOne
- func (c *EventClient) Get(ctx context.Context, id uuid.UUID) (*Event, error)
- func (c *EventClient) GetX(ctx context.Context, id uuid.UUID) *Event
- func (c *EventClient) Hooks() []Hook
- func (c *EventClient) Query() *EventQuery
- func (c *EventClient) QueryCategory(e *Event) *EventTypeQuery
- func (c *EventClient) QueryUsers(e *Event) *UserQuery
- func (c *EventClient) Update() *EventUpdate
- func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne
- func (c *EventClient) UpdateOneID(id uuid.UUID) *EventUpdateOne
- func (c *EventClient) Use(hooks ...Hook)
- type EventCreate
- func (ec *EventCreate) AddUserIDs(ids ...uuid.UUID) *EventCreate
- func (ec *EventCreate) AddUsers(u ...*User) *EventCreate
- func (ec *EventCreate) Exec(ctx context.Context) error
- func (ec *EventCreate) ExecX(ctx context.Context)
- func (ec *EventCreate) Mutation() *EventMutation
- func (ec *EventCreate) Save(ctx context.Context) (*Event, error)
- func (ec *EventCreate) SaveX(ctx context.Context) *Event
- func (ec *EventCreate) SetCategory(e *EventType) *EventCreate
- func (ec *EventCreate) SetCategoryID(id uuid.UUID) *EventCreate
- func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate
- func (ec *EventCreate) SetDescription(s string) *EventCreate
- func (ec *EventCreate) SetEndAt(t time.Time) *EventCreate
- func (ec *EventCreate) SetID(u uuid.UUID) *EventCreate
- func (ec *EventCreate) SetName(s string) *EventCreate
- func (ec *EventCreate) SetNillableCategoryID(id *uuid.UUID) *EventCreate
- func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate
- func (ec *EventCreate) SetNillableDescription(s *string) *EventCreate
- func (ec *EventCreate) SetNillableID(u *uuid.UUID) *EventCreate
- func (ec *EventCreate) SetNillableTutorsRequired(i *int64) *EventCreate
- func (ec *EventCreate) SetNillableWalletsReward(i *int64) *EventCreate
- func (ec *EventCreate) SetStartAt(t time.Time) *EventCreate
- func (ec *EventCreate) SetTutorsRequired(i int64) *EventCreate
- func (ec *EventCreate) SetWalletsReward(i int64) *EventCreate
- type EventCreateBulk
- type EventDelete
- type EventDeleteOne
- type EventEdges
- type EventGroupBy
- func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy
- func (egb *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (egb *EventGroupBy) BoolX(ctx context.Context) bool
- func (egb *EventGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool
- func (egb *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (egb *EventGroupBy) Float64X(ctx context.Context) float64
- func (egb *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64
- func (egb *EventGroupBy) Int(ctx context.Context) (_ int, err error)
- func (egb *EventGroupBy) IntX(ctx context.Context) int
- func (egb *EventGroupBy) Ints(ctx context.Context) ([]int, error)
- func (egb *EventGroupBy) IntsX(ctx context.Context) []int
- func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error
- func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})
- func (egb *EventGroupBy) String(ctx context.Context) (_ string, err error)
- func (egb *EventGroupBy) StringX(ctx context.Context) string
- func (egb *EventGroupBy) Strings(ctx context.Context) ([]string, error)
- func (egb *EventGroupBy) StringsX(ctx context.Context) []string
- type EventMutation
- func (m *EventMutation) AddField(name string, value ent.Value) error
- func (m *EventMutation) AddTutorsRequired(i int64)
- func (m *EventMutation) AddUserIDs(ids ...uuid.UUID)
- func (m *EventMutation) AddWalletsReward(i int64)
- func (m *EventMutation) AddedEdges() []string
- func (m *EventMutation) AddedField(name string) (ent.Value, bool)
- func (m *EventMutation) AddedFields() []string
- func (m *EventMutation) AddedIDs(name string) []ent.Value
- func (m *EventMutation) AddedTutorsRequired() (r int64, exists bool)
- func (m *EventMutation) AddedWalletsReward() (r int64, exists bool)
- func (m *EventMutation) CategoryCleared() bool
- func (m *EventMutation) CategoryID() (id uuid.UUID, exists bool)
- func (m *EventMutation) CategoryIDs() (ids []uuid.UUID)
- func (m *EventMutation) ClearCategory()
- func (m *EventMutation) ClearDescription()
- func (m *EventMutation) ClearEdge(name string) error
- func (m *EventMutation) ClearField(name string) error
- func (m *EventMutation) ClearTutorsRequired()
- func (m *EventMutation) ClearUsers()
- func (m *EventMutation) ClearWalletsReward()
- func (m *EventMutation) ClearedEdges() []string
- func (m *EventMutation) ClearedFields() []string
- func (m EventMutation) Client() *Client
- func (m *EventMutation) CreatedAt() (r time.Time, exists bool)
- func (m *EventMutation) Description() (r string, exists bool)
- func (m *EventMutation) DescriptionCleared() bool
- func (m *EventMutation) EdgeCleared(name string) bool
- func (m *EventMutation) EndAt() (r time.Time, exists bool)
- func (m *EventMutation) Field(name string) (ent.Value, bool)
- func (m *EventMutation) FieldCleared(name string) bool
- func (m *EventMutation) Fields() []string
- func (m *EventMutation) ID() (id uuid.UUID, exists bool)
- func (m *EventMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *EventMutation) Name() (r string, exists bool)
- func (m *EventMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *EventMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *EventMutation) OldEndAt(ctx context.Context) (v time.Time, err error)
- func (m *EventMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EventMutation) OldName(ctx context.Context) (v string, err error)
- func (m *EventMutation) OldStartAt(ctx context.Context) (v time.Time, err error)
- func (m *EventMutation) OldTutorsRequired(ctx context.Context) (v *int64, err error)
- func (m *EventMutation) OldWalletsReward(ctx context.Context) (v *int64, err error)
- func (m *EventMutation) Op() Op
- func (m *EventMutation) RemoveUserIDs(ids ...uuid.UUID)
- func (m *EventMutation) RemovedEdges() []string
- func (m *EventMutation) RemovedIDs(name string) []ent.Value
- func (m *EventMutation) RemovedUsersIDs() (ids []uuid.UUID)
- func (m *EventMutation) ResetCategory()
- func (m *EventMutation) ResetCreatedAt()
- func (m *EventMutation) ResetDescription()
- func (m *EventMutation) ResetEdge(name string) error
- func (m *EventMutation) ResetEndAt()
- func (m *EventMutation) ResetField(name string) error
- func (m *EventMutation) ResetName()
- func (m *EventMutation) ResetStartAt()
- func (m *EventMutation) ResetTutorsRequired()
- func (m *EventMutation) ResetUsers()
- func (m *EventMutation) ResetWalletsReward()
- func (m *EventMutation) SetCategoryID(id uuid.UUID)
- func (m *EventMutation) SetCreatedAt(t time.Time)
- func (m *EventMutation) SetDescription(s string)
- func (m *EventMutation) SetEndAt(t time.Time)
- func (m *EventMutation) SetField(name string, value ent.Value) error
- func (m *EventMutation) SetID(id uuid.UUID)
- func (m *EventMutation) SetName(s string)
- func (m *EventMutation) SetStartAt(t time.Time)
- func (m *EventMutation) SetTutorsRequired(i int64)
- func (m *EventMutation) SetWalletsReward(i int64)
- func (m *EventMutation) StartAt() (r time.Time, exists bool)
- func (m *EventMutation) TutorsRequired() (r int64, exists bool)
- func (m *EventMutation) TutorsRequiredCleared() bool
- func (m EventMutation) Tx() (*Tx, error)
- func (m *EventMutation) Type() string
- func (m *EventMutation) UsersCleared() bool
- func (m *EventMutation) UsersIDs() (ids []uuid.UUID)
- func (m *EventMutation) WalletsReward() (r int64, exists bool)
- func (m *EventMutation) WalletsRewardCleared() bool
- func (m *EventMutation) Where(ps ...predicate.Event)
- type EventQuery
- func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)
- func (eq *EventQuery) AllX(ctx context.Context) []*Event
- func (eq *EventQuery) Clone() *EventQuery
- func (eq *EventQuery) Count(ctx context.Context) (int, error)
- func (eq *EventQuery) CountX(ctx context.Context) int
- func (eq *EventQuery) Exist(ctx context.Context) (bool, error)
- func (eq *EventQuery) ExistX(ctx context.Context) bool
- func (eq *EventQuery) First(ctx context.Context) (*Event, error)
- func (eq *EventQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (eq *EventQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (eq *EventQuery) FirstX(ctx context.Context) *Event
- func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy
- func (eq *EventQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (eq *EventQuery) IDsX(ctx context.Context) []uuid.UUID
- func (eq *EventQuery) Limit(limit int) *EventQuery
- func (eq *EventQuery) Offset(offset int) *EventQuery
- func (eq *EventQuery) Only(ctx context.Context) (*Event, error)
- func (eq *EventQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (eq *EventQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (eq *EventQuery) OnlyX(ctx context.Context) *Event
- func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery
- func (eq *EventQuery) QueryCategory() *EventTypeQuery
- func (eq *EventQuery) QueryUsers() *UserQuery
- func (eq *EventQuery) Select(fields ...string) *EventSelect
- func (eq *EventQuery) Unique(unique bool) *EventQuery
- func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery
- func (eq *EventQuery) WithCategory(opts ...func(*EventTypeQuery)) *EventQuery
- func (eq *EventQuery) WithUsers(opts ...func(*UserQuery)) *EventQuery
- type EventSelect
- func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)
- func (es *EventSelect) BoolX(ctx context.Context) bool
- func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)
- func (es *EventSelect) BoolsX(ctx context.Context) []bool
- func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)
- func (es *EventSelect) Float64X(ctx context.Context) float64
- func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)
- func (es *EventSelect) Float64sX(ctx context.Context) []float64
- func (es *EventSelect) Int(ctx context.Context) (_ int, err error)
- func (es *EventSelect) IntX(ctx context.Context) int
- func (es *EventSelect) Ints(ctx context.Context) ([]int, error)
- func (es *EventSelect) IntsX(ctx context.Context) []int
- func (es *EventSelect) Scan(ctx context.Context, v interface{}) error
- func (es *EventSelect) ScanX(ctx context.Context, v interface{})
- func (es *EventSelect) String(ctx context.Context) (_ string, err error)
- func (es *EventSelect) StringX(ctx context.Context) string
- func (es *EventSelect) Strings(ctx context.Context) ([]string, error)
- func (es *EventSelect) StringsX(ctx context.Context) []string
- type EventType
- func (et *EventType) ContextValidate(ctx context.Context, formats strfmt.Registry) error
- func (et *EventType) QueryEvents() *EventQuery
- func (et *EventType) String() string
- func (et *EventType) Unwrap() *EventType
- func (et *EventType) Update() *EventTypeUpdateOne
- func (et *EventType) Validate(formats strfmt.Registry) error
- type EventTypeClient
- func (c *EventTypeClient) Create() *EventTypeCreate
- func (c *EventTypeClient) CreateBulk(builders ...*EventTypeCreate) *EventTypeCreateBulk
- func (c *EventTypeClient) Delete() *EventTypeDelete
- func (c *EventTypeClient) DeleteOne(et *EventType) *EventTypeDeleteOne
- func (c *EventTypeClient) DeleteOneID(id uuid.UUID) *EventTypeDeleteOne
- func (c *EventTypeClient) Get(ctx context.Context, id uuid.UUID) (*EventType, error)
- func (c *EventTypeClient) GetX(ctx context.Context, id uuid.UUID) *EventType
- func (c *EventTypeClient) Hooks() []Hook
- func (c *EventTypeClient) Query() *EventTypeQuery
- func (c *EventTypeClient) QueryEvents(et *EventType) *EventQuery
- func (c *EventTypeClient) Update() *EventTypeUpdate
- func (c *EventTypeClient) UpdateOne(et *EventType) *EventTypeUpdateOne
- func (c *EventTypeClient) UpdateOneID(id uuid.UUID) *EventTypeUpdateOne
- func (c *EventTypeClient) Use(hooks ...Hook)
- type EventTypeCreate
- func (etc *EventTypeCreate) AddEventIDs(ids ...uuid.UUID) *EventTypeCreate
- func (etc *EventTypeCreate) AddEvents(e ...*Event) *EventTypeCreate
- func (etc *EventTypeCreate) Exec(ctx context.Context) error
- func (etc *EventTypeCreate) ExecX(ctx context.Context)
- func (etc *EventTypeCreate) Mutation() *EventTypeMutation
- func (etc *EventTypeCreate) Save(ctx context.Context) (*EventType, error)
- func (etc *EventTypeCreate) SaveX(ctx context.Context) *EventType
- func (etc *EventTypeCreate) SetColor(s string) *EventTypeCreate
- func (etc *EventTypeCreate) SetID(u uuid.UUID) *EventTypeCreate
- func (etc *EventTypeCreate) SetName(s string) *EventTypeCreate
- func (etc *EventTypeCreate) SetNillableID(u *uuid.UUID) *EventTypeCreate
- type EventTypeCreateBulk
- type EventTypeDelete
- type EventTypeDeleteOne
- type EventTypeEdges
- type EventTypeGroupBy
- func (etgb *EventTypeGroupBy) Aggregate(fns ...AggregateFunc) *EventTypeGroupBy
- func (etgb *EventTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (etgb *EventTypeGroupBy) BoolX(ctx context.Context) bool
- func (etgb *EventTypeGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (etgb *EventTypeGroupBy) BoolsX(ctx context.Context) []bool
- func (etgb *EventTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (etgb *EventTypeGroupBy) Float64X(ctx context.Context) float64
- func (etgb *EventTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (etgb *EventTypeGroupBy) Float64sX(ctx context.Context) []float64
- func (etgb *EventTypeGroupBy) Int(ctx context.Context) (_ int, err error)
- func (etgb *EventTypeGroupBy) IntX(ctx context.Context) int
- func (etgb *EventTypeGroupBy) Ints(ctx context.Context) ([]int, error)
- func (etgb *EventTypeGroupBy) IntsX(ctx context.Context) []int
- func (etgb *EventTypeGroupBy) Scan(ctx context.Context, v interface{}) error
- func (etgb *EventTypeGroupBy) ScanX(ctx context.Context, v interface{})
- func (etgb *EventTypeGroupBy) String(ctx context.Context) (_ string, err error)
- func (etgb *EventTypeGroupBy) StringX(ctx context.Context) string
- func (etgb *EventTypeGroupBy) Strings(ctx context.Context) ([]string, error)
- func (etgb *EventTypeGroupBy) StringsX(ctx context.Context) []string
- type EventTypeMutation
- func (m *EventTypeMutation) AddEventIDs(ids ...uuid.UUID)
- func (m *EventTypeMutation) AddField(name string, value ent.Value) error
- func (m *EventTypeMutation) AddedEdges() []string
- func (m *EventTypeMutation) AddedField(name string) (ent.Value, bool)
- func (m *EventTypeMutation) AddedFields() []string
- func (m *EventTypeMutation) AddedIDs(name string) []ent.Value
- func (m *EventTypeMutation) ClearEdge(name string) error
- func (m *EventTypeMutation) ClearEvents()
- func (m *EventTypeMutation) ClearField(name string) error
- func (m *EventTypeMutation) ClearedEdges() []string
- func (m *EventTypeMutation) ClearedFields() []string
- func (m EventTypeMutation) Client() *Client
- func (m *EventTypeMutation) Color() (r string, exists bool)
- func (m *EventTypeMutation) EdgeCleared(name string) bool
- func (m *EventTypeMutation) EventsCleared() bool
- func (m *EventTypeMutation) EventsIDs() (ids []uuid.UUID)
- func (m *EventTypeMutation) Field(name string) (ent.Value, bool)
- func (m *EventTypeMutation) FieldCleared(name string) bool
- func (m *EventTypeMutation) Fields() []string
- func (m *EventTypeMutation) ID() (id uuid.UUID, exists bool)
- func (m *EventTypeMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *EventTypeMutation) Name() (r string, exists bool)
- func (m *EventTypeMutation) OldColor(ctx context.Context) (v string, err error)
- func (m *EventTypeMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *EventTypeMutation) OldName(ctx context.Context) (v string, err error)
- func (m *EventTypeMutation) Op() Op
- func (m *EventTypeMutation) RemoveEventIDs(ids ...uuid.UUID)
- func (m *EventTypeMutation) RemovedEdges() []string
- func (m *EventTypeMutation) RemovedEventsIDs() (ids []uuid.UUID)
- func (m *EventTypeMutation) RemovedIDs(name string) []ent.Value
- func (m *EventTypeMutation) ResetColor()
- func (m *EventTypeMutation) ResetEdge(name string) error
- func (m *EventTypeMutation) ResetEvents()
- func (m *EventTypeMutation) ResetField(name string) error
- func (m *EventTypeMutation) ResetName()
- func (m *EventTypeMutation) SetColor(s string)
- func (m *EventTypeMutation) SetField(name string, value ent.Value) error
- func (m *EventTypeMutation) SetID(id uuid.UUID)
- func (m *EventTypeMutation) SetName(s string)
- func (m EventTypeMutation) Tx() (*Tx, error)
- func (m *EventTypeMutation) Type() string
- func (m *EventTypeMutation) Where(ps ...predicate.EventType)
- type EventTypeQuery
- func (etq *EventTypeQuery) All(ctx context.Context) ([]*EventType, error)
- func (etq *EventTypeQuery) AllX(ctx context.Context) []*EventType
- func (etq *EventTypeQuery) Clone() *EventTypeQuery
- func (etq *EventTypeQuery) Count(ctx context.Context) (int, error)
- func (etq *EventTypeQuery) CountX(ctx context.Context) int
- func (etq *EventTypeQuery) Exist(ctx context.Context) (bool, error)
- func (etq *EventTypeQuery) ExistX(ctx context.Context) bool
- func (etq *EventTypeQuery) First(ctx context.Context) (*EventType, error)
- func (etq *EventTypeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (etq *EventTypeQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (etq *EventTypeQuery) FirstX(ctx context.Context) *EventType
- func (etq *EventTypeQuery) GroupBy(field string, fields ...string) *EventTypeGroupBy
- func (etq *EventTypeQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (etq *EventTypeQuery) IDsX(ctx context.Context) []uuid.UUID
- func (etq *EventTypeQuery) Limit(limit int) *EventTypeQuery
- func (etq *EventTypeQuery) Offset(offset int) *EventTypeQuery
- func (etq *EventTypeQuery) Only(ctx context.Context) (*EventType, error)
- func (etq *EventTypeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (etq *EventTypeQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (etq *EventTypeQuery) OnlyX(ctx context.Context) *EventType
- func (etq *EventTypeQuery) Order(o ...OrderFunc) *EventTypeQuery
- func (etq *EventTypeQuery) QueryEvents() *EventQuery
- func (etq *EventTypeQuery) Select(fields ...string) *EventTypeSelect
- func (etq *EventTypeQuery) Unique(unique bool) *EventTypeQuery
- func (etq *EventTypeQuery) Where(ps ...predicate.EventType) *EventTypeQuery
- func (etq *EventTypeQuery) WithEvents(opts ...func(*EventQuery)) *EventTypeQuery
- type EventTypeSelect
- func (ets *EventTypeSelect) Bool(ctx context.Context) (_ bool, err error)
- func (ets *EventTypeSelect) BoolX(ctx context.Context) bool
- func (ets *EventTypeSelect) Bools(ctx context.Context) ([]bool, error)
- func (ets *EventTypeSelect) BoolsX(ctx context.Context) []bool
- func (ets *EventTypeSelect) Float64(ctx context.Context) (_ float64, err error)
- func (ets *EventTypeSelect) Float64X(ctx context.Context) float64
- func (ets *EventTypeSelect) Float64s(ctx context.Context) ([]float64, error)
- func (ets *EventTypeSelect) Float64sX(ctx context.Context) []float64
- func (ets *EventTypeSelect) Int(ctx context.Context) (_ int, err error)
- func (ets *EventTypeSelect) IntX(ctx context.Context) int
- func (ets *EventTypeSelect) Ints(ctx context.Context) ([]int, error)
- func (ets *EventTypeSelect) IntsX(ctx context.Context) []int
- func (ets *EventTypeSelect) Scan(ctx context.Context, v interface{}) error
- func (ets *EventTypeSelect) ScanX(ctx context.Context, v interface{})
- func (ets *EventTypeSelect) String(ctx context.Context) (_ string, err error)
- func (ets *EventTypeSelect) StringX(ctx context.Context) string
- func (ets *EventTypeSelect) Strings(ctx context.Context) ([]string, error)
- func (ets *EventTypeSelect) StringsX(ctx context.Context) []string
- type EventTypeUpdate
- func (etu *EventTypeUpdate) AddEventIDs(ids ...uuid.UUID) *EventTypeUpdate
- func (etu *EventTypeUpdate) AddEvents(e ...*Event) *EventTypeUpdate
- func (etu *EventTypeUpdate) ClearEvents() *EventTypeUpdate
- func (etu *EventTypeUpdate) Exec(ctx context.Context) error
- func (etu *EventTypeUpdate) ExecX(ctx context.Context)
- func (etu *EventTypeUpdate) Mutation() *EventTypeMutation
- func (etu *EventTypeUpdate) RemoveEventIDs(ids ...uuid.UUID) *EventTypeUpdate
- func (etu *EventTypeUpdate) RemoveEvents(e ...*Event) *EventTypeUpdate
- func (etu *EventTypeUpdate) Save(ctx context.Context) (int, error)
- func (etu *EventTypeUpdate) SaveX(ctx context.Context) int
- func (etu *EventTypeUpdate) SetColor(s string) *EventTypeUpdate
- func (etu *EventTypeUpdate) SetName(s string) *EventTypeUpdate
- func (etu *EventTypeUpdate) Where(ps ...predicate.EventType) *EventTypeUpdate
- type EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) AddEventIDs(ids ...uuid.UUID) *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) AddEvents(e ...*Event) *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) ClearEvents() *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) Exec(ctx context.Context) error
- func (etuo *EventTypeUpdateOne) ExecX(ctx context.Context)
- func (etuo *EventTypeUpdateOne) Mutation() *EventTypeMutation
- func (etuo *EventTypeUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) RemoveEvents(e ...*Event) *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) Save(ctx context.Context) (*EventType, error)
- func (etuo *EventTypeUpdateOne) SaveX(ctx context.Context) *EventType
- func (etuo *EventTypeUpdateOne) Select(field string, fields ...string) *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) SetColor(s string) *EventTypeUpdateOne
- func (etuo *EventTypeUpdateOne) SetName(s string) *EventTypeUpdateOne
- type EventTypes
- type EventUpdate
- func (eu *EventUpdate) AddTutorsRequired(i int64) *EventUpdate
- func (eu *EventUpdate) AddUserIDs(ids ...uuid.UUID) *EventUpdate
- func (eu *EventUpdate) AddUsers(u ...*User) *EventUpdate
- func (eu *EventUpdate) AddWalletsReward(i int64) *EventUpdate
- func (eu *EventUpdate) ClearCategory() *EventUpdate
- func (eu *EventUpdate) ClearDescription() *EventUpdate
- func (eu *EventUpdate) ClearTutorsRequired() *EventUpdate
- func (eu *EventUpdate) ClearUsers() *EventUpdate
- func (eu *EventUpdate) ClearWalletsReward() *EventUpdate
- func (eu *EventUpdate) Exec(ctx context.Context) error
- func (eu *EventUpdate) ExecX(ctx context.Context)
- func (eu *EventUpdate) Mutation() *EventMutation
- func (eu *EventUpdate) RemoveUserIDs(ids ...uuid.UUID) *EventUpdate
- func (eu *EventUpdate) RemoveUsers(u ...*User) *EventUpdate
- func (eu *EventUpdate) Save(ctx context.Context) (int, error)
- func (eu *EventUpdate) SaveX(ctx context.Context) int
- func (eu *EventUpdate) SetCategory(e *EventType) *EventUpdate
- func (eu *EventUpdate) SetCategoryID(id uuid.UUID) *EventUpdate
- func (eu *EventUpdate) SetDescription(s string) *EventUpdate
- func (eu *EventUpdate) SetEndAt(t time.Time) *EventUpdate
- func (eu *EventUpdate) SetName(s string) *EventUpdate
- func (eu *EventUpdate) SetNillableCategoryID(id *uuid.UUID) *EventUpdate
- func (eu *EventUpdate) SetNillableDescription(s *string) *EventUpdate
- func (eu *EventUpdate) SetNillableTutorsRequired(i *int64) *EventUpdate
- func (eu *EventUpdate) SetNillableWalletsReward(i *int64) *EventUpdate
- func (eu *EventUpdate) SetStartAt(t time.Time) *EventUpdate
- func (eu *EventUpdate) SetTutorsRequired(i int64) *EventUpdate
- func (eu *EventUpdate) SetWalletsReward(i int64) *EventUpdate
- func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate
- type EventUpdateOne
- func (euo *EventUpdateOne) AddTutorsRequired(i int64) *EventUpdateOne
- func (euo *EventUpdateOne) AddUserIDs(ids ...uuid.UUID) *EventUpdateOne
- func (euo *EventUpdateOne) AddUsers(u ...*User) *EventUpdateOne
- func (euo *EventUpdateOne) AddWalletsReward(i int64) *EventUpdateOne
- func (euo *EventUpdateOne) ClearCategory() *EventUpdateOne
- func (euo *EventUpdateOne) ClearDescription() *EventUpdateOne
- func (euo *EventUpdateOne) ClearTutorsRequired() *EventUpdateOne
- func (euo *EventUpdateOne) ClearUsers() *EventUpdateOne
- func (euo *EventUpdateOne) ClearWalletsReward() *EventUpdateOne
- func (euo *EventUpdateOne) Exec(ctx context.Context) error
- func (euo *EventUpdateOne) ExecX(ctx context.Context)
- func (euo *EventUpdateOne) Mutation() *EventMutation
- func (euo *EventUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *EventUpdateOne
- func (euo *EventUpdateOne) RemoveUsers(u ...*User) *EventUpdateOne
- func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)
- func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event
- func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne
- func (euo *EventUpdateOne) SetCategory(e *EventType) *EventUpdateOne
- func (euo *EventUpdateOne) SetCategoryID(id uuid.UUID) *EventUpdateOne
- func (euo *EventUpdateOne) SetDescription(s string) *EventUpdateOne
- func (euo *EventUpdateOne) SetEndAt(t time.Time) *EventUpdateOne
- func (euo *EventUpdateOne) SetName(s string) *EventUpdateOne
- func (euo *EventUpdateOne) SetNillableCategoryID(id *uuid.UUID) *EventUpdateOne
- func (euo *EventUpdateOne) SetNillableDescription(s *string) *EventUpdateOne
- func (euo *EventUpdateOne) SetNillableTutorsRequired(i *int64) *EventUpdateOne
- func (euo *EventUpdateOne) SetNillableWalletsReward(i *int64) *EventUpdateOne
- func (euo *EventUpdateOne) SetStartAt(t time.Time) *EventUpdateOne
- func (euo *EventUpdateOne) SetTutorsRequired(i int64) *EventUpdateOne
- func (euo *EventUpdateOne) SetWalletsReward(i int64) *EventUpdateOne
- type Events
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type Role
- type RoleClient
- func (c *RoleClient) Create() *RoleCreate
- func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk
- func (c *RoleClient) Delete() *RoleDelete
- func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne
- func (c *RoleClient) DeleteOneID(id uuid.UUID) *RoleDeleteOne
- func (c *RoleClient) Get(ctx context.Context, id uuid.UUID) (*Role, error)
- func (c *RoleClient) GetX(ctx context.Context, id uuid.UUID) *Role
- func (c *RoleClient) Hooks() []Hook
- func (c *RoleClient) Query() *RoleQuery
- func (c *RoleClient) QueryUsers(r *Role) *UserQuery
- func (c *RoleClient) Update() *RoleUpdate
- func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne
- func (c *RoleClient) UpdateOneID(id uuid.UUID) *RoleUpdateOne
- func (c *RoleClient) Use(hooks ...Hook)
- type RoleCreate
- func (rc *RoleCreate) AddUserIDs(ids ...uuid.UUID) *RoleCreate
- func (rc *RoleCreate) AddUsers(u ...*User) *RoleCreate
- func (rc *RoleCreate) Exec(ctx context.Context) error
- func (rc *RoleCreate) ExecX(ctx context.Context)
- func (rc *RoleCreate) Mutation() *RoleMutation
- func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
- func (rc *RoleCreate) SaveX(ctx context.Context) *Role
- func (rc *RoleCreate) SetEvent(s string) *RoleCreate
- func (rc *RoleCreate) SetEventWrite(s string) *RoleCreate
- func (rc *RoleCreate) SetID(u uuid.UUID) *RoleCreate
- func (rc *RoleCreate) SetName(s string) *RoleCreate
- func (rc *RoleCreate) SetNillableEvent(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableEventWrite(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableID(u *uuid.UUID) *RoleCreate
- func (rc *RoleCreate) SetNillableUser(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableUserSubscription(s *string) *RoleCreate
- func (rc *RoleCreate) SetNillableUserWrite(s *string) *RoleCreate
- func (rc *RoleCreate) SetUser(s string) *RoleCreate
- func (rc *RoleCreate) SetUserSubscription(s string) *RoleCreate
- func (rc *RoleCreate) SetUserWrite(s string) *RoleCreate
- type RoleCreateBulk
- type RoleDelete
- type RoleDeleteOne
- type RoleEdges
- type RoleGroupBy
- func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy
- func (rgb *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (rgb *RoleGroupBy) BoolX(ctx context.Context) bool
- func (rgb *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (rgb *RoleGroupBy) BoolsX(ctx context.Context) []bool
- func (rgb *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (rgb *RoleGroupBy) Float64X(ctx context.Context) float64
- func (rgb *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (rgb *RoleGroupBy) Float64sX(ctx context.Context) []float64
- func (rgb *RoleGroupBy) Int(ctx context.Context) (_ int, err error)
- func (rgb *RoleGroupBy) IntX(ctx context.Context) int
- func (rgb *RoleGroupBy) Ints(ctx context.Context) ([]int, error)
- func (rgb *RoleGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RoleGroupBy) Scan(ctx context.Context, v interface{}) error
- func (rgb *RoleGroupBy) ScanX(ctx context.Context, v interface{})
- func (rgb *RoleGroupBy) String(ctx context.Context) (_ string, err error)
- func (rgb *RoleGroupBy) StringX(ctx context.Context) string
- func (rgb *RoleGroupBy) Strings(ctx context.Context) ([]string, error)
- func (rgb *RoleGroupBy) StringsX(ctx context.Context) []string
- type RoleMutation
- func (m *RoleMutation) AddField(name string, value ent.Value) error
- func (m *RoleMutation) AddUserIDs(ids ...uuid.UUID)
- func (m *RoleMutation) AddedEdges() []string
- func (m *RoleMutation) AddedField(name string) (ent.Value, bool)
- func (m *RoleMutation) AddedFields() []string
- func (m *RoleMutation) AddedIDs(name string) []ent.Value
- func (m *RoleMutation) ClearEdge(name string) error
- func (m *RoleMutation) ClearField(name string) error
- func (m *RoleMutation) ClearUsers()
- func (m *RoleMutation) ClearedEdges() []string
- func (m *RoleMutation) ClearedFields() []string
- func (m RoleMutation) Client() *Client
- func (m *RoleMutation) EdgeCleared(name string) bool
- func (m *RoleMutation) Event() (r string, exists bool)
- func (m *RoleMutation) EventWrite() (r string, exists bool)
- func (m *RoleMutation) Field(name string) (ent.Value, bool)
- func (m *RoleMutation) FieldCleared(name string) bool
- func (m *RoleMutation) Fields() []string
- func (m *RoleMutation) ID() (id uuid.UUID, exists bool)
- func (m *RoleMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *RoleMutation) Name() (r string, exists bool)
- func (m *RoleMutation) OldEvent(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldEventWrite(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldUser(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldUserSubscription(ctx context.Context) (v string, err error)
- func (m *RoleMutation) OldUserWrite(ctx context.Context) (v string, err error)
- func (m *RoleMutation) Op() Op
- func (m *RoleMutation) RemoveUserIDs(ids ...uuid.UUID)
- func (m *RoleMutation) RemovedEdges() []string
- func (m *RoleMutation) RemovedIDs(name string) []ent.Value
- func (m *RoleMutation) RemovedUsersIDs() (ids []uuid.UUID)
- func (m *RoleMutation) ResetEdge(name string) error
- func (m *RoleMutation) ResetEvent()
- func (m *RoleMutation) ResetEventWrite()
- func (m *RoleMutation) ResetField(name string) error
- func (m *RoleMutation) ResetName()
- func (m *RoleMutation) ResetUser()
- func (m *RoleMutation) ResetUserSubscription()
- func (m *RoleMutation) ResetUserWrite()
- func (m *RoleMutation) ResetUsers()
- func (m *RoleMutation) SetEvent(s string)
- func (m *RoleMutation) SetEventWrite(s string)
- func (m *RoleMutation) SetField(name string, value ent.Value) error
- func (m *RoleMutation) SetID(id uuid.UUID)
- func (m *RoleMutation) SetName(s string)
- func (m *RoleMutation) SetUser(s string)
- func (m *RoleMutation) SetUserSubscription(s string)
- func (m *RoleMutation) SetUserWrite(s string)
- func (m RoleMutation) Tx() (*Tx, error)
- func (m *RoleMutation) Type() string
- func (m *RoleMutation) User() (r string, exists bool)
- func (m *RoleMutation) UserSubscription() (r string, exists bool)
- func (m *RoleMutation) UserWrite() (r string, exists bool)
- func (m *RoleMutation) UsersCleared() bool
- func (m *RoleMutation) UsersIDs() (ids []uuid.UUID)
- func (m *RoleMutation) Where(ps ...predicate.Role)
- type RoleQuery
- func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)
- func (rq *RoleQuery) AllX(ctx context.Context) []*Role
- func (rq *RoleQuery) Clone() *RoleQuery
- func (rq *RoleQuery) Count(ctx context.Context) (int, error)
- func (rq *RoleQuery) CountX(ctx context.Context) int
- func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RoleQuery) ExistX(ctx context.Context) bool
- func (rq *RoleQuery) First(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (rq *RoleQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (rq *RoleQuery) FirstX(ctx context.Context) *Role
- func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
- func (rq *RoleQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (rq *RoleQuery) IDsX(ctx context.Context) []uuid.UUID
- func (rq *RoleQuery) Limit(limit int) *RoleQuery
- func (rq *RoleQuery) Offset(offset int) *RoleQuery
- func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)
- func (rq *RoleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (rq *RoleQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (rq *RoleQuery) OnlyX(ctx context.Context) *Role
- func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery
- func (rq *RoleQuery) QueryUsers() *UserQuery
- 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) WithUsers(opts ...func(*UserQuery)) *RoleQuery
- type RoleSelect
- func (rs *RoleSelect) Bool(ctx context.Context) (_ bool, err error)
- func (rs *RoleSelect) BoolX(ctx context.Context) bool
- func (rs *RoleSelect) Bools(ctx context.Context) ([]bool, error)
- func (rs *RoleSelect) BoolsX(ctx context.Context) []bool
- func (rs *RoleSelect) Float64(ctx context.Context) (_ float64, err error)
- func (rs *RoleSelect) Float64X(ctx context.Context) float64
- func (rs *RoleSelect) Float64s(ctx context.Context) ([]float64, error)
- func (rs *RoleSelect) Float64sX(ctx context.Context) []float64
- func (rs *RoleSelect) Int(ctx context.Context) (_ int, err error)
- func (rs *RoleSelect) IntX(ctx context.Context) int
- func (rs *RoleSelect) Ints(ctx context.Context) ([]int, error)
- func (rs *RoleSelect) IntsX(ctx context.Context) []int
- func (rs *RoleSelect) Scan(ctx context.Context, v interface{}) error
- func (rs *RoleSelect) ScanX(ctx context.Context, v interface{})
- func (rs *RoleSelect) String(ctx context.Context) (_ string, err error)
- func (rs *RoleSelect) StringX(ctx context.Context) string
- func (rs *RoleSelect) Strings(ctx context.Context) ([]string, error)
- func (rs *RoleSelect) StringsX(ctx context.Context) []string
- type RoleUpdate
- func (ru *RoleUpdate) AddUserIDs(ids ...uuid.UUID) *RoleUpdate
- func (ru *RoleUpdate) AddUsers(u ...*User) *RoleUpdate
- func (ru *RoleUpdate) ClearUsers() *RoleUpdate
- func (ru *RoleUpdate) Exec(ctx context.Context) error
- func (ru *RoleUpdate) ExecX(ctx context.Context)
- func (ru *RoleUpdate) Mutation() *RoleMutation
- func (ru *RoleUpdate) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdate
- func (ru *RoleUpdate) RemoveUsers(u ...*User) *RoleUpdate
- func (ru *RoleUpdate) Save(ctx context.Context) (int, error)
- func (ru *RoleUpdate) SaveX(ctx context.Context) int
- func (ru *RoleUpdate) SetEvent(s string) *RoleUpdate
- func (ru *RoleUpdate) SetEventWrite(s string) *RoleUpdate
- func (ru *RoleUpdate) SetName(s string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableEvent(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableEventWrite(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableUser(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableUserSubscription(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetNillableUserWrite(s *string) *RoleUpdate
- func (ru *RoleUpdate) SetUser(s string) *RoleUpdate
- func (ru *RoleUpdate) SetUserSubscription(s string) *RoleUpdate
- func (ru *RoleUpdate) SetUserWrite(s string) *RoleUpdate
- func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate
- type RoleUpdateOne
- func (ruo *RoleUpdateOne) AddUserIDs(ids ...uuid.UUID) *RoleUpdateOne
- func (ruo *RoleUpdateOne) AddUsers(u ...*User) *RoleUpdateOne
- func (ruo *RoleUpdateOne) ClearUsers() *RoleUpdateOne
- func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
- func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
- func (ruo *RoleUpdateOne) Mutation() *RoleMutation
- func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdateOne
- func (ruo *RoleUpdateOne) RemoveUsers(u ...*User) *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) SetEvent(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetEventWrite(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableEvent(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableEventWrite(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableUser(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableUserSubscription(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetNillableUserWrite(s *string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUser(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUserSubscription(s string) *RoleUpdateOne
- func (ruo *RoleUpdateOne) SetUserWrite(s string) *RoleUpdateOne
- type Roles
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type User
- func (u *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error
- func (u *User) QueryEvents() *EventQuery
- func (u *User) QueryRoles() *RoleQuery
- func (u *User) String() string
- func (u *User) Unwrap() *User
- func (u *User) Update() *UserUpdateOne
- func (u *User) Validate(formats strfmt.Registry) error
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryEvents(u *User) *EventQuery
- func (c *UserClient) QueryRoles(u *User) *RoleQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddEventIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddEvents(e ...*Event) *UserCreate
- func (uc *UserCreate) AddRoleIDs(ids ...uuid.UUID) *UserCreate
- func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetDisplayName(s string) *UserCreate
- func (uc *UserCreate) SetFirstName(s string) *UserCreate
- func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
- func (uc *UserCreate) SetImagePath(s string) *UserCreate
- func (uc *UserCreate) SetLastName(s string) *UserCreate
- func (uc *UserCreate) SetLogin(s string) *UserCreate
- func (uc *UserCreate) SetNillableDisplayName(s *string) *UserCreate
- func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate
- func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
- func (uc *UserCreate) SetNillableImagePath(s *string) *UserCreate
- func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
- func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
- func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ugb *UserGroupBy) IntX(ctx context.Context) int
- func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (ugb *UserGroupBy) StringX(ctx context.Context) string
- func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ugb *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddEventIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddRoleIDs(ids ...uuid.UUID)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearDisplayName()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearEvents()
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearFirstName()
- func (m *UserMutation) ClearImagePath()
- func (m *UserMutation) ClearLastName()
- func (m *UserMutation) ClearRoles()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) DisplayName() (r string, exists bool)
- func (m *UserMutation) DisplayNameCleared() bool
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) EventsCleared() bool
- func (m *UserMutation) EventsIDs() (ids []uuid.UUID)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) FirstName() (r string, exists bool)
- func (m *UserMutation) FirstNameCleared() bool
- func (m *UserMutation) ID() (id uuid.UUID, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *UserMutation) ImagePath() (r string, exists bool)
- func (m *UserMutation) ImagePathCleared() bool
- func (m *UserMutation) LastName() (r string, exists bool)
- func (m *UserMutation) LastNameCleared() bool
- func (m *UserMutation) Login() (r string, exists bool)
- func (m *UserMutation) OldDisplayName(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldFirstName(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldImagePath(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldLastName(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldLogin(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RemoveEventIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemoveRoleIDs(ids ...uuid.UUID)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedEventsIDs() (ids []uuid.UUID)
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedRolesIDs() (ids []uuid.UUID)
- func (m *UserMutation) ResetDisplayName()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEvents()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFirstName()
- func (m *UserMutation) ResetImagePath()
- func (m *UserMutation) ResetLastName()
- func (m *UserMutation) ResetLogin()
- func (m *UserMutation) ResetRoles()
- func (m *UserMutation) RolesCleared() bool
- func (m *UserMutation) RolesIDs() (ids []uuid.UUID)
- func (m *UserMutation) SetDisplayName(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetFirstName(s string)
- func (m *UserMutation) SetID(id uuid.UUID)
- func (m *UserMutation) SetImagePath(s string)
- func (m *UserMutation) SetLastName(s string)
- func (m *UserMutation) SetLogin(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QueryEvents() *EventQuery
- func (uq *UserQuery) QueryRoles() *RoleQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithEvents(opts ...func(*EventQuery)) *UserQuery
- func (uq *UserQuery) WithRoles(opts ...func(*RoleQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (us *UserSelect) BoolX(ctx context.Context) bool
- func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (us *UserSelect) BoolsX(ctx context.Context) []bool
- func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (us *UserSelect) Float64X(ctx context.Context) float64
- func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (us *UserSelect) Float64sX(ctx context.Context) []float64
- func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (us *UserSelect) IntX(ctx context.Context) int
- func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (us *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (us *UserSelect) ScanX(ctx context.Context, v interface{})
- func (us *UserSelect) String(ctx context.Context) (_ string, err error)
- func (us *UserSelect) StringX(ctx context.Context) string
- func (us *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (us *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddEventIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddEvents(e ...*Event) *UserUpdate
- func (uu *UserUpdate) AddRoleIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate
- func (uu *UserUpdate) ClearDisplayName() *UserUpdate
- func (uu *UserUpdate) ClearEvents() *UserUpdate
- func (uu *UserUpdate) ClearFirstName() *UserUpdate
- func (uu *UserUpdate) ClearImagePath() *UserUpdate
- func (uu *UserUpdate) ClearLastName() *UserUpdate
- func (uu *UserUpdate) ClearRoles() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveEventIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveEvents(e ...*Event) *UserUpdate
- func (uu *UserUpdate) RemoveRoleIDs(ids ...uuid.UUID) *UserUpdate
- func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate
- func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
- func (uu *UserUpdate) SetImagePath(s string) *UserUpdate
- func (uu *UserUpdate) SetLastName(s string) *UserUpdate
- func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableImagePath(s *string) *UserUpdate
- func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddEventIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddEvents(e ...*Event) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRoleIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearDisplayName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearEvents() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearFirstName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearImagePath() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearLastName() *UserUpdateOne
- func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveEvents(e ...*Event) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...uuid.UUID) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetImagePath(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableImagePath(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeEvent = "Event" TypeEventType = "EventType" TypeRole = "Role" TypeUser = "User" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Event is the client for interacting with the Event builders. Event *EventClient // EventType is the client for interacting with the EventType builders. EventType *EventTypeClient // Role is the client for interacting with the Role builders. Role *RoleClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Event. Query(). Count(ctx)
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 Event ¶
type Event struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // 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"` // TutorsRequired holds the value of the "tutorsRequired" field. TutorsRequired *int64 `json:"tutorsRequired,omitempty"` // WalletsReward holds the value of the "walletsReward" field. WalletsReward *int64 `json:"walletsReward,omitempty"` // CreatedAt holds the value of the "createdAt" field. CreatedAt time.Time `json:"createdAt,omitempty"` // StartAt holds the value of the "startAt" field. StartAt time.Time `json:"startAt,omitempty"` // EndAt holds the value of the "endAt" field. EndAt time.Time `json:"endAt,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the EventQuery when eager-loading is set. Edges EventEdges `json:"edges"` // contains filtered or unexported fields }
Event is the model entity for the Event schema.
func (*Event) ContextValidate ¶
ContextValidate method is implemented to discard code editor errors.
func (*Event) QueryCategory ¶
func (e *Event) QueryCategory() *EventTypeQuery
QueryCategory queries the "category" edge of the Event entity.
func (*Event) QueryUsers ¶
QueryUsers queries the "users" edge of the Event entity.
func (*Event) Unwrap ¶
Unwrap unwraps the Event 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 (*Event) Update ¶
func (e *Event) Update() *EventUpdateOne
Update returns a builder for updating this Event. Note that you need to call Event.Unwrap() before calling this method if this Event was returned from a transaction, and the transaction was committed or rolled back.
type EventClient ¶
type EventClient struct {
// contains filtered or unexported fields
}
EventClient is a client for the Event schema.
func NewEventClient ¶
func NewEventClient(c config) *EventClient
NewEventClient returns a client for the Event from the given config.
func (*EventClient) Create ¶
func (c *EventClient) Create() *EventCreate
Create returns a create builder for Event.
func (*EventClient) CreateBulk ¶
func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk
CreateBulk returns a builder for creating a bulk of Event entities.
func (*EventClient) Delete ¶
func (c *EventClient) Delete() *EventDelete
Delete returns a delete builder for Event.
func (*EventClient) DeleteOne ¶
func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*EventClient) DeleteOneID ¶
func (c *EventClient) DeleteOneID(id uuid.UUID) *EventDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*EventClient) Query ¶
func (c *EventClient) Query() *EventQuery
Query returns a query builder for Event.
func (*EventClient) QueryCategory ¶
func (c *EventClient) QueryCategory(e *Event) *EventTypeQuery
QueryCategory queries the category edge of a Event.
func (*EventClient) QueryUsers ¶
func (c *EventClient) QueryUsers(e *Event) *UserQuery
QueryUsers queries the users edge of a Event.
func (*EventClient) Update ¶
func (c *EventClient) Update() *EventUpdate
Update returns an update builder for Event.
func (*EventClient) UpdateOne ¶
func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne
UpdateOne returns an update builder for the given entity.
func (*EventClient) UpdateOneID ¶
func (c *EventClient) UpdateOneID(id uuid.UUID) *EventUpdateOne
UpdateOneID returns an update builder for the given id.
func (*EventClient) Use ¶
func (c *EventClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `event.Hooks(f(g(h())))`.
type EventCreate ¶
type EventCreate struct {
// contains filtered or unexported fields
}
EventCreate is the builder for creating a Event entity.
func (*EventCreate) AddUserIDs ¶
func (ec *EventCreate) AddUserIDs(ids ...uuid.UUID) *EventCreate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*EventCreate) AddUsers ¶
func (ec *EventCreate) AddUsers(u ...*User) *EventCreate
AddUsers adds the "users" edges to the User entity.
func (*EventCreate) Exec ¶
func (ec *EventCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*EventCreate) ExecX ¶
func (ec *EventCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventCreate) Mutation ¶
func (ec *EventCreate) Mutation() *EventMutation
Mutation returns the EventMutation object of the builder.
func (*EventCreate) Save ¶
func (ec *EventCreate) Save(ctx context.Context) (*Event, error)
Save creates the Event in the database.
func (*EventCreate) SaveX ¶
func (ec *EventCreate) SaveX(ctx context.Context) *Event
SaveX calls Save and panics if Save returns an error.
func (*EventCreate) SetCategory ¶
func (ec *EventCreate) SetCategory(e *EventType) *EventCreate
SetCategory sets the "category" edge to the EventType entity.
func (*EventCreate) SetCategoryID ¶
func (ec *EventCreate) SetCategoryID(id uuid.UUID) *EventCreate
SetCategoryID sets the "category" edge to the EventType entity by ID.
func (*EventCreate) SetCreatedAt ¶
func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate
SetCreatedAt sets the "createdAt" field.
func (*EventCreate) SetDescription ¶
func (ec *EventCreate) SetDescription(s string) *EventCreate
SetDescription sets the "description" field.
func (*EventCreate) SetEndAt ¶
func (ec *EventCreate) SetEndAt(t time.Time) *EventCreate
SetEndAt sets the "endAt" field.
func (*EventCreate) SetID ¶
func (ec *EventCreate) SetID(u uuid.UUID) *EventCreate
SetID sets the "id" field.
func (*EventCreate) SetName ¶
func (ec *EventCreate) SetName(s string) *EventCreate
SetName sets the "name" field.
func (*EventCreate) SetNillableCategoryID ¶
func (ec *EventCreate) SetNillableCategoryID(id *uuid.UUID) *EventCreate
SetNillableCategoryID sets the "category" edge to the EventType entity by ID if the given value is not nil.
func (*EventCreate) SetNillableCreatedAt ¶
func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate
SetNillableCreatedAt sets the "createdAt" field if the given value is not nil.
func (*EventCreate) SetNillableDescription ¶
func (ec *EventCreate) SetNillableDescription(s *string) *EventCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*EventCreate) SetNillableID ¶
func (ec *EventCreate) SetNillableID(u *uuid.UUID) *EventCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*EventCreate) SetNillableTutorsRequired ¶
func (ec *EventCreate) SetNillableTutorsRequired(i *int64) *EventCreate
SetNillableTutorsRequired sets the "tutorsRequired" field if the given value is not nil.
func (*EventCreate) SetNillableWalletsReward ¶
func (ec *EventCreate) SetNillableWalletsReward(i *int64) *EventCreate
SetNillableWalletsReward sets the "walletsReward" field if the given value is not nil.
func (*EventCreate) SetStartAt ¶
func (ec *EventCreate) SetStartAt(t time.Time) *EventCreate
SetStartAt sets the "startAt" field.
func (*EventCreate) SetTutorsRequired ¶
func (ec *EventCreate) SetTutorsRequired(i int64) *EventCreate
SetTutorsRequired sets the "tutorsRequired" field.
func (*EventCreate) SetWalletsReward ¶
func (ec *EventCreate) SetWalletsReward(i int64) *EventCreate
SetWalletsReward sets the "walletsReward" field.
type EventCreateBulk ¶
type EventCreateBulk struct {
// contains filtered or unexported fields
}
EventCreateBulk is the builder for creating many Event entities in bulk.
func (*EventCreateBulk) Exec ¶
func (ecb *EventCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*EventCreateBulk) ExecX ¶
func (ecb *EventCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type EventDelete ¶
type EventDelete struct {
// contains filtered or unexported fields
}
EventDelete is the builder for deleting a Event entity.
func (*EventDelete) Exec ¶
func (ed *EventDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*EventDelete) ExecX ¶
func (ed *EventDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*EventDelete) Where ¶
func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete
Where appends a list predicates to the EventDelete builder.
type EventDeleteOne ¶
type EventDeleteOne struct {
// contains filtered or unexported fields
}
EventDeleteOne is the builder for deleting a single Event entity.
func (*EventDeleteOne) Exec ¶
func (edo *EventDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*EventDeleteOne) ExecX ¶
func (edo *EventDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type EventEdges ¶
type EventEdges struct { // Users holds the value of the users edge. Users []*User `json:"users,omitempty"` // Category holds the value of the category edge. Category *EventType `json:"category,omitempty"` // contains filtered or unexported fields }
EventEdges holds the relations/edges for other nodes in the graph.
func (EventEdges) CategoryOrErr ¶
func (e EventEdges) CategoryOrErr() (*EventType, error)
CategoryOrErr returns the Category value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (EventEdges) UsersOrErr ¶
func (e EventEdges) UsersOrErr() ([]*User, error)
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.
type EventGroupBy ¶
type EventGroupBy struct {
// contains filtered or unexported fields
}
EventGroupBy is the group-by builder for Event entities.
func (*EventGroupBy) Aggregate ¶
func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*EventGroupBy) Bool ¶
func (egb *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) BoolX ¶
func (egb *EventGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*EventGroupBy) Bools ¶
func (egb *EventGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) BoolsX ¶
func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*EventGroupBy) Float64 ¶
func (egb *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) Float64X ¶
func (egb *EventGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*EventGroupBy) Float64s ¶
func (egb *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) Float64sX ¶
func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*EventGroupBy) Int ¶
func (egb *EventGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) IntX ¶
func (egb *EventGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*EventGroupBy) Ints ¶
func (egb *EventGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) IntsX ¶
func (egb *EventGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*EventGroupBy) Scan ¶
func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*EventGroupBy) ScanX ¶
func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*EventGroupBy) String ¶
func (egb *EventGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventGroupBy) StringX ¶
func (egb *EventGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type EventMutation ¶
type EventMutation struct {
// contains filtered or unexported fields
}
EventMutation represents an operation that mutates the Event nodes in the graph.
func (*EventMutation) AddField ¶
func (m *EventMutation) 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 (*EventMutation) AddTutorsRequired ¶
func (m *EventMutation) AddTutorsRequired(i int64)
AddTutorsRequired adds i to the "tutorsRequired" field.
func (*EventMutation) AddUserIDs ¶
func (m *EventMutation) AddUserIDs(ids ...uuid.UUID)
AddUserIDs adds the "users" edge to the User entity by ids.
func (*EventMutation) AddWalletsReward ¶
func (m *EventMutation) AddWalletsReward(i int64)
AddWalletsReward adds i to the "walletsReward" field.
func (*EventMutation) AddedEdges ¶
func (m *EventMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*EventMutation) AddedField ¶
func (m *EventMutation) 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 (*EventMutation) AddedFields ¶
func (m *EventMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*EventMutation) AddedIDs ¶
func (m *EventMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*EventMutation) AddedTutorsRequired ¶
func (m *EventMutation) AddedTutorsRequired() (r int64, exists bool)
AddedTutorsRequired returns the value that was added to the "tutorsRequired" field in this mutation.
func (*EventMutation) AddedWalletsReward ¶
func (m *EventMutation) AddedWalletsReward() (r int64, exists bool)
AddedWalletsReward returns the value that was added to the "walletsReward" field in this mutation.
func (*EventMutation) CategoryCleared ¶
func (m *EventMutation) CategoryCleared() bool
CategoryCleared reports if the "category" edge to the EventType entity was cleared.
func (*EventMutation) CategoryID ¶
func (m *EventMutation) CategoryID() (id uuid.UUID, exists bool)
CategoryID returns the "category" edge ID in the mutation.
func (*EventMutation) CategoryIDs ¶
func (m *EventMutation) CategoryIDs() (ids []uuid.UUID)
CategoryIDs returns the "category" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CategoryID instead. It exists only for internal usage by the builders.
func (*EventMutation) ClearCategory ¶
func (m *EventMutation) ClearCategory()
ClearCategory clears the "category" edge to the EventType entity.
func (*EventMutation) ClearDescription ¶
func (m *EventMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*EventMutation) ClearEdge ¶
func (m *EventMutation) 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 (*EventMutation) ClearField ¶
func (m *EventMutation) 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 (*EventMutation) ClearTutorsRequired ¶
func (m *EventMutation) ClearTutorsRequired()
ClearTutorsRequired clears the value of the "tutorsRequired" field.
func (*EventMutation) ClearUsers ¶
func (m *EventMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*EventMutation) ClearWalletsReward ¶
func (m *EventMutation) ClearWalletsReward()
ClearWalletsReward clears the value of the "walletsReward" field.
func (*EventMutation) ClearedEdges ¶
func (m *EventMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*EventMutation) ClearedFields ¶
func (m *EventMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (EventMutation) Client ¶
func (m EventMutation) 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 (*EventMutation) CreatedAt ¶
func (m *EventMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "createdAt" field in the mutation.
func (*EventMutation) Description ¶
func (m *EventMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*EventMutation) DescriptionCleared ¶
func (m *EventMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*EventMutation) EdgeCleared ¶
func (m *EventMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*EventMutation) EndAt ¶
func (m *EventMutation) EndAt() (r time.Time, exists bool)
EndAt returns the value of the "endAt" field in the mutation.
func (*EventMutation) Field ¶
func (m *EventMutation) 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 (*EventMutation) FieldCleared ¶
func (m *EventMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*EventMutation) Fields ¶
func (m *EventMutation) 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 (*EventMutation) ID ¶
func (m *EventMutation) ID() (id uuid.UUID, 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 (*EventMutation) IDs ¶
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 (*EventMutation) Name ¶
func (m *EventMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*EventMutation) OldCreatedAt ¶
OldCreatedAt returns the old "createdAt" field's value of the Event entity. If the Event 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 (*EventMutation) OldDescription ¶
func (m *EventMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Event entity. If the Event 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 (*EventMutation) OldEndAt ¶
OldEndAt returns the old "endAt" field's value of the Event entity. If the Event 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 (*EventMutation) 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 (*EventMutation) OldName ¶
func (m *EventMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Event entity. If the Event 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 (*EventMutation) OldStartAt ¶
OldStartAt returns the old "startAt" field's value of the Event entity. If the Event 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 (*EventMutation) OldTutorsRequired ¶
func (m *EventMutation) OldTutorsRequired(ctx context.Context) (v *int64, err error)
OldTutorsRequired returns the old "tutorsRequired" field's value of the Event entity. If the Event 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 (*EventMutation) OldWalletsReward ¶
func (m *EventMutation) OldWalletsReward(ctx context.Context) (v *int64, err error)
OldWalletsReward returns the old "walletsReward" field's value of the Event entity. If the Event 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 (*EventMutation) RemoveUserIDs ¶
func (m *EventMutation) RemoveUserIDs(ids ...uuid.UUID)
RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (*EventMutation) RemovedEdges ¶
func (m *EventMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*EventMutation) RemovedIDs ¶
func (m *EventMutation) 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 (*EventMutation) RemovedUsersIDs ¶
func (m *EventMutation) RemovedUsersIDs() (ids []uuid.UUID)
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (*EventMutation) ResetCategory ¶
func (m *EventMutation) ResetCategory()
ResetCategory resets all changes to the "category" edge.
func (*EventMutation) ResetCreatedAt ¶
func (m *EventMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "createdAt" field.
func (*EventMutation) ResetDescription ¶
func (m *EventMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*EventMutation) ResetEdge ¶
func (m *EventMutation) 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 (*EventMutation) ResetEndAt ¶
func (m *EventMutation) ResetEndAt()
ResetEndAt resets all changes to the "endAt" field.
func (*EventMutation) ResetField ¶
func (m *EventMutation) 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 (*EventMutation) ResetName ¶
func (m *EventMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*EventMutation) ResetStartAt ¶
func (m *EventMutation) ResetStartAt()
ResetStartAt resets all changes to the "startAt" field.
func (*EventMutation) ResetTutorsRequired ¶
func (m *EventMutation) ResetTutorsRequired()
ResetTutorsRequired resets all changes to the "tutorsRequired" field.
func (*EventMutation) ResetUsers ¶
func (m *EventMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*EventMutation) ResetWalletsReward ¶
func (m *EventMutation) ResetWalletsReward()
ResetWalletsReward resets all changes to the "walletsReward" field.
func (*EventMutation) SetCategoryID ¶
func (m *EventMutation) SetCategoryID(id uuid.UUID)
SetCategoryID sets the "category" edge to the EventType entity by id.
func (*EventMutation) SetCreatedAt ¶
func (m *EventMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "createdAt" field.
func (*EventMutation) SetDescription ¶
func (m *EventMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*EventMutation) SetEndAt ¶
func (m *EventMutation) SetEndAt(t time.Time)
SetEndAt sets the "endAt" field.
func (*EventMutation) SetField ¶
func (m *EventMutation) 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 (*EventMutation) SetID ¶
func (m *EventMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Event entities.
func (*EventMutation) SetName ¶
func (m *EventMutation) SetName(s string)
SetName sets the "name" field.
func (*EventMutation) SetStartAt ¶
func (m *EventMutation) SetStartAt(t time.Time)
SetStartAt sets the "startAt" field.
func (*EventMutation) SetTutorsRequired ¶
func (m *EventMutation) SetTutorsRequired(i int64)
SetTutorsRequired sets the "tutorsRequired" field.
func (*EventMutation) SetWalletsReward ¶
func (m *EventMutation) SetWalletsReward(i int64)
SetWalletsReward sets the "walletsReward" field.
func (*EventMutation) StartAt ¶
func (m *EventMutation) StartAt() (r time.Time, exists bool)
StartAt returns the value of the "startAt" field in the mutation.
func (*EventMutation) TutorsRequired ¶
func (m *EventMutation) TutorsRequired() (r int64, exists bool)
TutorsRequired returns the value of the "tutorsRequired" field in the mutation.
func (*EventMutation) TutorsRequiredCleared ¶
func (m *EventMutation) TutorsRequiredCleared() bool
TutorsRequiredCleared returns if the "tutorsRequired" field was cleared in this mutation.
func (EventMutation) Tx ¶
func (m EventMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*EventMutation) Type ¶
func (m *EventMutation) Type() string
Type returns the node type of this mutation (Event).
func (*EventMutation) UsersCleared ¶
func (m *EventMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*EventMutation) UsersIDs ¶
func (m *EventMutation) UsersIDs() (ids []uuid.UUID)
UsersIDs returns the "users" edge IDs in the mutation.
func (*EventMutation) WalletsReward ¶
func (m *EventMutation) WalletsReward() (r int64, exists bool)
WalletsReward returns the value of the "walletsReward" field in the mutation.
func (*EventMutation) WalletsRewardCleared ¶
func (m *EventMutation) WalletsRewardCleared() bool
WalletsRewardCleared returns if the "walletsReward" field was cleared in this mutation.
func (*EventMutation) Where ¶
func (m *EventMutation) Where(ps ...predicate.Event)
Where appends a list predicates to the EventMutation builder.
type EventQuery ¶
type EventQuery struct {
// contains filtered or unexported fields
}
EventQuery is the builder for querying Event entities.
func (*EventQuery) All ¶
func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)
All executes the query and returns a list of Events.
func (*EventQuery) AllX ¶
func (eq *EventQuery) AllX(ctx context.Context) []*Event
AllX is like All, but panics if an error occurs.
func (*EventQuery) Clone ¶
func (eq *EventQuery) Clone() *EventQuery
Clone returns a duplicate of the EventQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*EventQuery) Count ¶
func (eq *EventQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*EventQuery) CountX ¶
func (eq *EventQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*EventQuery) Exist ¶
func (eq *EventQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*EventQuery) ExistX ¶
func (eq *EventQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*EventQuery) First ¶
func (eq *EventQuery) First(ctx context.Context) (*Event, error)
First returns the first Event entity from the query. Returns a *NotFoundError when no Event was found.
func (*EventQuery) FirstID ¶
FirstID returns the first Event ID from the query. Returns a *NotFoundError when no Event ID was found.
func (*EventQuery) FirstIDX ¶
func (eq *EventQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*EventQuery) FirstX ¶
func (eq *EventQuery) FirstX(ctx context.Context) *Event
FirstX is like First, but panics if an error occurs.
func (*EventQuery) GroupBy ¶
func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Event.Query(). GroupBy(event.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*EventQuery) IDsX ¶
func (eq *EventQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*EventQuery) Limit ¶
func (eq *EventQuery) Limit(limit int) *EventQuery
Limit adds a limit step to the query.
func (*EventQuery) Offset ¶
func (eq *EventQuery) Offset(offset int) *EventQuery
Offset adds an offset step to the query.
func (*EventQuery) Only ¶
func (eq *EventQuery) Only(ctx context.Context) (*Event, error)
Only returns a single Event entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Event entity is found. Returns a *NotFoundError when no Event entities are found.
func (*EventQuery) OnlyID ¶
OnlyID is like Only, but returns the only Event ID in the query. Returns a *NotSingularError when more than one Event ID is found. Returns a *NotFoundError when no entities are found.
func (*EventQuery) OnlyIDX ¶
func (eq *EventQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*EventQuery) OnlyX ¶
func (eq *EventQuery) OnlyX(ctx context.Context) *Event
OnlyX is like Only, but panics if an error occurs.
func (*EventQuery) Order ¶
func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery
Order adds an order step to the query.
func (*EventQuery) QueryCategory ¶
func (eq *EventQuery) QueryCategory() *EventTypeQuery
QueryCategory chains the current query on the "category" edge.
func (*EventQuery) QueryUsers ¶
func (eq *EventQuery) QueryUsers() *UserQuery
QueryUsers chains the current query on the "users" edge.
func (*EventQuery) Select ¶
func (eq *EventQuery) Select(fields ...string) *EventSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.Event.Query(). Select(event.FieldName). Scan(ctx, &v)
func (*EventQuery) Unique ¶
func (eq *EventQuery) Unique(unique bool) *EventQuery
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 (*EventQuery) Where ¶
func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery
Where adds a new predicate for the EventQuery builder.
func (*EventQuery) WithCategory ¶
func (eq *EventQuery) WithCategory(opts ...func(*EventTypeQuery)) *EventQuery
WithCategory tells the query-builder to eager-load the nodes that are connected to the "category" edge. The optional arguments are used to configure the query builder of the edge.
func (*EventQuery) WithUsers ¶
func (eq *EventQuery) WithUsers(opts ...func(*UserQuery)) *EventQuery
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
type EventSelect ¶
type EventSelect struct { *EventQuery // contains filtered or unexported fields }
EventSelect is the builder for selecting fields of Event entities.
func (*EventSelect) Bool ¶
func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EventSelect) BoolX ¶
func (es *EventSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*EventSelect) Bools ¶
func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EventSelect) BoolsX ¶
func (es *EventSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*EventSelect) Float64 ¶
func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EventSelect) Float64X ¶
func (es *EventSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*EventSelect) Float64s ¶
func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EventSelect) Float64sX ¶
func (es *EventSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*EventSelect) Int ¶
func (es *EventSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EventSelect) IntX ¶
func (es *EventSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*EventSelect) Ints ¶
func (es *EventSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EventSelect) IntsX ¶
func (es *EventSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*EventSelect) Scan ¶
func (es *EventSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*EventSelect) ScanX ¶
func (es *EventSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*EventSelect) String ¶
func (es *EventSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*EventSelect) StringX ¶
func (es *EventSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type EventType ¶
type EventType struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Color holds the value of the "color" field. Color string `json:"color,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the EventTypeQuery when eager-loading is set. Edges EventTypeEdges `json:"edges"` // contains filtered or unexported fields }
EventType is the model entity for the EventType schema.
func (*EventType) ContextValidate ¶
ContextValidate method is implemented to discard code editor errors.
func (*EventType) QueryEvents ¶
func (et *EventType) QueryEvents() *EventQuery
QueryEvents queries the "events" edge of the EventType entity.
func (*EventType) Unwrap ¶
Unwrap unwraps the EventType 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 (*EventType) Update ¶
func (et *EventType) Update() *EventTypeUpdateOne
Update returns a builder for updating this EventType. Note that you need to call EventType.Unwrap() before calling this method if this EventType was returned from a transaction, and the transaction was committed or rolled back.
type EventTypeClient ¶
type EventTypeClient struct {
// contains filtered or unexported fields
}
EventTypeClient is a client for the EventType schema.
func NewEventTypeClient ¶
func NewEventTypeClient(c config) *EventTypeClient
NewEventTypeClient returns a client for the EventType from the given config.
func (*EventTypeClient) Create ¶
func (c *EventTypeClient) Create() *EventTypeCreate
Create returns a create builder for EventType.
func (*EventTypeClient) CreateBulk ¶
func (c *EventTypeClient) CreateBulk(builders ...*EventTypeCreate) *EventTypeCreateBulk
CreateBulk returns a builder for creating a bulk of EventType entities.
func (*EventTypeClient) Delete ¶
func (c *EventTypeClient) Delete() *EventTypeDelete
Delete returns a delete builder for EventType.
func (*EventTypeClient) DeleteOne ¶
func (c *EventTypeClient) DeleteOne(et *EventType) *EventTypeDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*EventTypeClient) DeleteOneID ¶
func (c *EventTypeClient) DeleteOneID(id uuid.UUID) *EventTypeDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*EventTypeClient) Hooks ¶
func (c *EventTypeClient) Hooks() []Hook
Hooks returns the client hooks.
func (*EventTypeClient) Query ¶
func (c *EventTypeClient) Query() *EventTypeQuery
Query returns a query builder for EventType.
func (*EventTypeClient) QueryEvents ¶
func (c *EventTypeClient) QueryEvents(et *EventType) *EventQuery
QueryEvents queries the events edge of a EventType.
func (*EventTypeClient) Update ¶
func (c *EventTypeClient) Update() *EventTypeUpdate
Update returns an update builder for EventType.
func (*EventTypeClient) UpdateOne ¶
func (c *EventTypeClient) UpdateOne(et *EventType) *EventTypeUpdateOne
UpdateOne returns an update builder for the given entity.
func (*EventTypeClient) UpdateOneID ¶
func (c *EventTypeClient) UpdateOneID(id uuid.UUID) *EventTypeUpdateOne
UpdateOneID returns an update builder for the given id.
func (*EventTypeClient) Use ¶
func (c *EventTypeClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `eventtype.Hooks(f(g(h())))`.
type EventTypeCreate ¶
type EventTypeCreate struct {
// contains filtered or unexported fields
}
EventTypeCreate is the builder for creating a EventType entity.
func (*EventTypeCreate) AddEventIDs ¶
func (etc *EventTypeCreate) AddEventIDs(ids ...uuid.UUID) *EventTypeCreate
AddEventIDs adds the "events" edge to the Event entity by IDs.
func (*EventTypeCreate) AddEvents ¶
func (etc *EventTypeCreate) AddEvents(e ...*Event) *EventTypeCreate
AddEvents adds the "events" edges to the Event entity.
func (*EventTypeCreate) Exec ¶
func (etc *EventTypeCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*EventTypeCreate) ExecX ¶
func (etc *EventTypeCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventTypeCreate) Mutation ¶
func (etc *EventTypeCreate) Mutation() *EventTypeMutation
Mutation returns the EventTypeMutation object of the builder.
func (*EventTypeCreate) Save ¶
func (etc *EventTypeCreate) Save(ctx context.Context) (*EventType, error)
Save creates the EventType in the database.
func (*EventTypeCreate) SaveX ¶
func (etc *EventTypeCreate) SaveX(ctx context.Context) *EventType
SaveX calls Save and panics if Save returns an error.
func (*EventTypeCreate) SetColor ¶
func (etc *EventTypeCreate) SetColor(s string) *EventTypeCreate
SetColor sets the "color" field.
func (*EventTypeCreate) SetID ¶
func (etc *EventTypeCreate) SetID(u uuid.UUID) *EventTypeCreate
SetID sets the "id" field.
func (*EventTypeCreate) SetName ¶
func (etc *EventTypeCreate) SetName(s string) *EventTypeCreate
SetName sets the "name" field.
func (*EventTypeCreate) SetNillableID ¶
func (etc *EventTypeCreate) SetNillableID(u *uuid.UUID) *EventTypeCreate
SetNillableID sets the "id" field if the given value is not nil.
type EventTypeCreateBulk ¶
type EventTypeCreateBulk struct {
// contains filtered or unexported fields
}
EventTypeCreateBulk is the builder for creating many EventType entities in bulk.
func (*EventTypeCreateBulk) Exec ¶
func (etcb *EventTypeCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*EventTypeCreateBulk) ExecX ¶
func (etcb *EventTypeCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type EventTypeDelete ¶
type EventTypeDelete struct {
// contains filtered or unexported fields
}
EventTypeDelete is the builder for deleting a EventType entity.
func (*EventTypeDelete) Exec ¶
func (etd *EventTypeDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*EventTypeDelete) ExecX ¶
func (etd *EventTypeDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*EventTypeDelete) Where ¶
func (etd *EventTypeDelete) Where(ps ...predicate.EventType) *EventTypeDelete
Where appends a list predicates to the EventTypeDelete builder.
type EventTypeDeleteOne ¶
type EventTypeDeleteOne struct {
// contains filtered or unexported fields
}
EventTypeDeleteOne is the builder for deleting a single EventType entity.
func (*EventTypeDeleteOne) Exec ¶
func (etdo *EventTypeDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*EventTypeDeleteOne) ExecX ¶
func (etdo *EventTypeDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type EventTypeEdges ¶
type EventTypeEdges struct { // Events holds the value of the events edge. Events []*Event `json:"events,omitempty"` // contains filtered or unexported fields }
EventTypeEdges holds the relations/edges for other nodes in the graph.
func (EventTypeEdges) EventsOrErr ¶
func (e EventTypeEdges) EventsOrErr() ([]*Event, error)
EventsOrErr returns the Events value or an error if the edge was not loaded in eager-loading.
type EventTypeGroupBy ¶
type EventTypeGroupBy struct {
// contains filtered or unexported fields
}
EventTypeGroupBy is the group-by builder for EventType entities.
func (*EventTypeGroupBy) Aggregate ¶
func (etgb *EventTypeGroupBy) Aggregate(fns ...AggregateFunc) *EventTypeGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*EventTypeGroupBy) Bool ¶
func (etgb *EventTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) BoolX ¶
func (etgb *EventTypeGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*EventTypeGroupBy) Bools ¶
func (etgb *EventTypeGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) BoolsX ¶
func (etgb *EventTypeGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*EventTypeGroupBy) Float64 ¶
func (etgb *EventTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) Float64X ¶
func (etgb *EventTypeGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*EventTypeGroupBy) Float64s ¶
func (etgb *EventTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) Float64sX ¶
func (etgb *EventTypeGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*EventTypeGroupBy) Int ¶
func (etgb *EventTypeGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) IntX ¶
func (etgb *EventTypeGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*EventTypeGroupBy) Ints ¶
func (etgb *EventTypeGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) IntsX ¶
func (etgb *EventTypeGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*EventTypeGroupBy) Scan ¶
func (etgb *EventTypeGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*EventTypeGroupBy) ScanX ¶
func (etgb *EventTypeGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*EventTypeGroupBy) String ¶
func (etgb *EventTypeGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*EventTypeGroupBy) StringX ¶
func (etgb *EventTypeGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type EventTypeMutation ¶
type EventTypeMutation struct {
// contains filtered or unexported fields
}
EventTypeMutation represents an operation that mutates the EventType nodes in the graph.
func (*EventTypeMutation) AddEventIDs ¶
func (m *EventTypeMutation) AddEventIDs(ids ...uuid.UUID)
AddEventIDs adds the "events" edge to the Event entity by ids.
func (*EventTypeMutation) AddField ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) AddedEdges ¶
func (m *EventTypeMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*EventTypeMutation) AddedField ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) AddedFields ¶
func (m *EventTypeMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*EventTypeMutation) AddedIDs ¶
func (m *EventTypeMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*EventTypeMutation) ClearEdge ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) ClearEvents ¶
func (m *EventTypeMutation) ClearEvents()
ClearEvents clears the "events" edge to the Event entity.
func (*EventTypeMutation) ClearField ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) ClearedEdges ¶
func (m *EventTypeMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*EventTypeMutation) ClearedFields ¶
func (m *EventTypeMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (EventTypeMutation) Client ¶
func (m EventTypeMutation) 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 (*EventTypeMutation) Color ¶
func (m *EventTypeMutation) Color() (r string, exists bool)
Color returns the value of the "color" field in the mutation.
func (*EventTypeMutation) EdgeCleared ¶
func (m *EventTypeMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*EventTypeMutation) EventsCleared ¶
func (m *EventTypeMutation) EventsCleared() bool
EventsCleared reports if the "events" edge to the Event entity was cleared.
func (*EventTypeMutation) EventsIDs ¶
func (m *EventTypeMutation) EventsIDs() (ids []uuid.UUID)
EventsIDs returns the "events" edge IDs in the mutation.
func (*EventTypeMutation) Field ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) FieldCleared ¶
func (m *EventTypeMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*EventTypeMutation) Fields ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) ID ¶
func (m *EventTypeMutation) ID() (id uuid.UUID, 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 (*EventTypeMutation) IDs ¶
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 (*EventTypeMutation) Name ¶
func (m *EventTypeMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*EventTypeMutation) OldColor ¶
func (m *EventTypeMutation) OldColor(ctx context.Context) (v string, err error)
OldColor returns the old "color" field's value of the EventType entity. If the EventType 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 (*EventTypeMutation) 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 (*EventTypeMutation) OldName ¶
func (m *EventTypeMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the EventType entity. If the EventType 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 (*EventTypeMutation) RemoveEventIDs ¶
func (m *EventTypeMutation) RemoveEventIDs(ids ...uuid.UUID)
RemoveEventIDs removes the "events" edge to the Event entity by IDs.
func (*EventTypeMutation) RemovedEdges ¶
func (m *EventTypeMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*EventTypeMutation) RemovedEventsIDs ¶
func (m *EventTypeMutation) RemovedEventsIDs() (ids []uuid.UUID)
RemovedEvents returns the removed IDs of the "events" edge to the Event entity.
func (*EventTypeMutation) RemovedIDs ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) ResetColor ¶
func (m *EventTypeMutation) ResetColor()
ResetColor resets all changes to the "color" field.
func (*EventTypeMutation) ResetEdge ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) ResetEvents ¶
func (m *EventTypeMutation) ResetEvents()
ResetEvents resets all changes to the "events" edge.
func (*EventTypeMutation) ResetField ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) ResetName ¶
func (m *EventTypeMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*EventTypeMutation) SetColor ¶
func (m *EventTypeMutation) SetColor(s string)
SetColor sets the "color" field.
func (*EventTypeMutation) SetField ¶
func (m *EventTypeMutation) 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 (*EventTypeMutation) SetID ¶
func (m *EventTypeMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of EventType entities.
func (*EventTypeMutation) SetName ¶
func (m *EventTypeMutation) SetName(s string)
SetName sets the "name" field.
func (EventTypeMutation) Tx ¶
func (m EventTypeMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*EventTypeMutation) Type ¶
func (m *EventTypeMutation) Type() string
Type returns the node type of this mutation (EventType).
func (*EventTypeMutation) Where ¶
func (m *EventTypeMutation) Where(ps ...predicate.EventType)
Where appends a list predicates to the EventTypeMutation builder.
type EventTypeQuery ¶
type EventTypeQuery struct {
// contains filtered or unexported fields
}
EventTypeQuery is the builder for querying EventType entities.
func (*EventTypeQuery) All ¶
func (etq *EventTypeQuery) All(ctx context.Context) ([]*EventType, error)
All executes the query and returns a list of EventTypes.
func (*EventTypeQuery) AllX ¶
func (etq *EventTypeQuery) AllX(ctx context.Context) []*EventType
AllX is like All, but panics if an error occurs.
func (*EventTypeQuery) Clone ¶
func (etq *EventTypeQuery) Clone() *EventTypeQuery
Clone returns a duplicate of the EventTypeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*EventTypeQuery) Count ¶
func (etq *EventTypeQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*EventTypeQuery) CountX ¶
func (etq *EventTypeQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*EventTypeQuery) Exist ¶
func (etq *EventTypeQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*EventTypeQuery) ExistX ¶
func (etq *EventTypeQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*EventTypeQuery) First ¶
func (etq *EventTypeQuery) First(ctx context.Context) (*EventType, error)
First returns the first EventType entity from the query. Returns a *NotFoundError when no EventType was found.
func (*EventTypeQuery) FirstID ¶
FirstID returns the first EventType ID from the query. Returns a *NotFoundError when no EventType ID was found.
func (*EventTypeQuery) FirstIDX ¶
func (etq *EventTypeQuery) FirstIDX(ctx context.Context) uuid.UUID
FirstIDX is like FirstID, but panics if an error occurs.
func (*EventTypeQuery) FirstX ¶
func (etq *EventTypeQuery) FirstX(ctx context.Context) *EventType
FirstX is like First, but panics if an error occurs.
func (*EventTypeQuery) GroupBy ¶
func (etq *EventTypeQuery) GroupBy(field string, fields ...string) *EventTypeGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.EventType.Query(). GroupBy(eventtype.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*EventTypeQuery) IDsX ¶
func (etq *EventTypeQuery) IDsX(ctx context.Context) []uuid.UUID
IDsX is like IDs, but panics if an error occurs.
func (*EventTypeQuery) Limit ¶
func (etq *EventTypeQuery) Limit(limit int) *EventTypeQuery
Limit adds a limit step to the query.
func (*EventTypeQuery) Offset ¶
func (etq *EventTypeQuery) Offset(offset int) *EventTypeQuery
Offset adds an offset step to the query.
func (*EventTypeQuery) Only ¶
func (etq *EventTypeQuery) Only(ctx context.Context) (*EventType, error)
Only returns a single EventType entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one EventType entity is found. Returns a *NotFoundError when no EventType entities are found.
func (*EventTypeQuery) OnlyID ¶
OnlyID is like Only, but returns the only EventType ID in the query. Returns a *NotSingularError when more than one EventType ID is found. Returns a *NotFoundError when no entities are found.
func (*EventTypeQuery) OnlyIDX ¶
func (etq *EventTypeQuery) OnlyIDX(ctx context.Context) uuid.UUID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*EventTypeQuery) OnlyX ¶
func (etq *EventTypeQuery) OnlyX(ctx context.Context) *EventType
OnlyX is like Only, but panics if an error occurs.
func (*EventTypeQuery) Order ¶
func (etq *EventTypeQuery) Order(o ...OrderFunc) *EventTypeQuery
Order adds an order step to the query.
func (*EventTypeQuery) QueryEvents ¶
func (etq *EventTypeQuery) QueryEvents() *EventQuery
QueryEvents chains the current query on the "events" edge.
func (*EventTypeQuery) Select ¶
func (etq *EventTypeQuery) Select(fields ...string) *EventTypeSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Name string `json:"name,omitempty"` } client.EventType.Query(). Select(eventtype.FieldName). Scan(ctx, &v)
func (*EventTypeQuery) Unique ¶
func (etq *EventTypeQuery) Unique(unique bool) *EventTypeQuery
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 (*EventTypeQuery) Where ¶
func (etq *EventTypeQuery) Where(ps ...predicate.EventType) *EventTypeQuery
Where adds a new predicate for the EventTypeQuery builder.
func (*EventTypeQuery) WithEvents ¶
func (etq *EventTypeQuery) WithEvents(opts ...func(*EventQuery)) *EventTypeQuery
WithEvents tells the query-builder to eager-load the nodes that are connected to the "events" edge. The optional arguments are used to configure the query builder of the edge.
type EventTypeSelect ¶
type EventTypeSelect struct { *EventTypeQuery // contains filtered or unexported fields }
EventTypeSelect is the builder for selecting fields of EventType entities.
func (*EventTypeSelect) Bool ¶
func (ets *EventTypeSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) BoolX ¶
func (ets *EventTypeSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*EventTypeSelect) Bools ¶
func (ets *EventTypeSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) BoolsX ¶
func (ets *EventTypeSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*EventTypeSelect) Float64 ¶
func (ets *EventTypeSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) Float64X ¶
func (ets *EventTypeSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*EventTypeSelect) Float64s ¶
func (ets *EventTypeSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) Float64sX ¶
func (ets *EventTypeSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*EventTypeSelect) Int ¶
func (ets *EventTypeSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) IntX ¶
func (ets *EventTypeSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*EventTypeSelect) Ints ¶
func (ets *EventTypeSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) IntsX ¶
func (ets *EventTypeSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*EventTypeSelect) Scan ¶
func (ets *EventTypeSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*EventTypeSelect) ScanX ¶
func (ets *EventTypeSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*EventTypeSelect) String ¶
func (ets *EventTypeSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*EventTypeSelect) StringX ¶
func (ets *EventTypeSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type EventTypeUpdate ¶
type EventTypeUpdate struct {
// contains filtered or unexported fields
}
EventTypeUpdate is the builder for updating EventType entities.
func (*EventTypeUpdate) AddEventIDs ¶
func (etu *EventTypeUpdate) AddEventIDs(ids ...uuid.UUID) *EventTypeUpdate
AddEventIDs adds the "events" edge to the Event entity by IDs.
func (*EventTypeUpdate) AddEvents ¶
func (etu *EventTypeUpdate) AddEvents(e ...*Event) *EventTypeUpdate
AddEvents adds the "events" edges to the Event entity.
func (*EventTypeUpdate) ClearEvents ¶
func (etu *EventTypeUpdate) ClearEvents() *EventTypeUpdate
ClearEvents clears all "events" edges to the Event entity.
func (*EventTypeUpdate) Exec ¶
func (etu *EventTypeUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*EventTypeUpdate) ExecX ¶
func (etu *EventTypeUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventTypeUpdate) Mutation ¶
func (etu *EventTypeUpdate) Mutation() *EventTypeMutation
Mutation returns the EventTypeMutation object of the builder.
func (*EventTypeUpdate) RemoveEventIDs ¶
func (etu *EventTypeUpdate) RemoveEventIDs(ids ...uuid.UUID) *EventTypeUpdate
RemoveEventIDs removes the "events" edge to Event entities by IDs.
func (*EventTypeUpdate) RemoveEvents ¶
func (etu *EventTypeUpdate) RemoveEvents(e ...*Event) *EventTypeUpdate
RemoveEvents removes "events" edges to Event entities.
func (*EventTypeUpdate) Save ¶
func (etu *EventTypeUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*EventTypeUpdate) SaveX ¶
func (etu *EventTypeUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*EventTypeUpdate) SetColor ¶
func (etu *EventTypeUpdate) SetColor(s string) *EventTypeUpdate
SetColor sets the "color" field.
func (*EventTypeUpdate) SetName ¶
func (etu *EventTypeUpdate) SetName(s string) *EventTypeUpdate
SetName sets the "name" field.
func (*EventTypeUpdate) Where ¶
func (etu *EventTypeUpdate) Where(ps ...predicate.EventType) *EventTypeUpdate
Where appends a list predicates to the EventTypeUpdate builder.
type EventTypeUpdateOne ¶
type EventTypeUpdateOne struct {
// contains filtered or unexported fields
}
EventTypeUpdateOne is the builder for updating a single EventType entity.
func (*EventTypeUpdateOne) AddEventIDs ¶
func (etuo *EventTypeUpdateOne) AddEventIDs(ids ...uuid.UUID) *EventTypeUpdateOne
AddEventIDs adds the "events" edge to the Event entity by IDs.
func (*EventTypeUpdateOne) AddEvents ¶
func (etuo *EventTypeUpdateOne) AddEvents(e ...*Event) *EventTypeUpdateOne
AddEvents adds the "events" edges to the Event entity.
func (*EventTypeUpdateOne) ClearEvents ¶
func (etuo *EventTypeUpdateOne) ClearEvents() *EventTypeUpdateOne
ClearEvents clears all "events" edges to the Event entity.
func (*EventTypeUpdateOne) Exec ¶
func (etuo *EventTypeUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*EventTypeUpdateOne) ExecX ¶
func (etuo *EventTypeUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventTypeUpdateOne) Mutation ¶
func (etuo *EventTypeUpdateOne) Mutation() *EventTypeMutation
Mutation returns the EventTypeMutation object of the builder.
func (*EventTypeUpdateOne) RemoveEventIDs ¶
func (etuo *EventTypeUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *EventTypeUpdateOne
RemoveEventIDs removes the "events" edge to Event entities by IDs.
func (*EventTypeUpdateOne) RemoveEvents ¶
func (etuo *EventTypeUpdateOne) RemoveEvents(e ...*Event) *EventTypeUpdateOne
RemoveEvents removes "events" edges to Event entities.
func (*EventTypeUpdateOne) Save ¶
func (etuo *EventTypeUpdateOne) Save(ctx context.Context) (*EventType, error)
Save executes the query and returns the updated EventType entity.
func (*EventTypeUpdateOne) SaveX ¶
func (etuo *EventTypeUpdateOne) SaveX(ctx context.Context) *EventType
SaveX is like Save, but panics if an error occurs.
func (*EventTypeUpdateOne) Select ¶
func (etuo *EventTypeUpdateOne) Select(field string, fields ...string) *EventTypeUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*EventTypeUpdateOne) SetColor ¶
func (etuo *EventTypeUpdateOne) SetColor(s string) *EventTypeUpdateOne
SetColor sets the "color" field.
func (*EventTypeUpdateOne) SetName ¶
func (etuo *EventTypeUpdateOne) SetName(s string) *EventTypeUpdateOne
SetName sets the "name" field.
type EventUpdate ¶
type EventUpdate struct {
// contains filtered or unexported fields
}
EventUpdate is the builder for updating Event entities.
func (*EventUpdate) AddTutorsRequired ¶
func (eu *EventUpdate) AddTutorsRequired(i int64) *EventUpdate
AddTutorsRequired adds i to the "tutorsRequired" field.
func (*EventUpdate) AddUserIDs ¶
func (eu *EventUpdate) AddUserIDs(ids ...uuid.UUID) *EventUpdate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*EventUpdate) AddUsers ¶
func (eu *EventUpdate) AddUsers(u ...*User) *EventUpdate
AddUsers adds the "users" edges to the User entity.
func (*EventUpdate) AddWalletsReward ¶
func (eu *EventUpdate) AddWalletsReward(i int64) *EventUpdate
AddWalletsReward adds i to the "walletsReward" field.
func (*EventUpdate) ClearCategory ¶
func (eu *EventUpdate) ClearCategory() *EventUpdate
ClearCategory clears the "category" edge to the EventType entity.
func (*EventUpdate) ClearDescription ¶
func (eu *EventUpdate) ClearDescription() *EventUpdate
ClearDescription clears the value of the "description" field.
func (*EventUpdate) ClearTutorsRequired ¶
func (eu *EventUpdate) ClearTutorsRequired() *EventUpdate
ClearTutorsRequired clears the value of the "tutorsRequired" field.
func (*EventUpdate) ClearUsers ¶
func (eu *EventUpdate) ClearUsers() *EventUpdate
ClearUsers clears all "users" edges to the User entity.
func (*EventUpdate) ClearWalletsReward ¶
func (eu *EventUpdate) ClearWalletsReward() *EventUpdate
ClearWalletsReward clears the value of the "walletsReward" field.
func (*EventUpdate) Exec ¶
func (eu *EventUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*EventUpdate) ExecX ¶
func (eu *EventUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventUpdate) Mutation ¶
func (eu *EventUpdate) Mutation() *EventMutation
Mutation returns the EventMutation object of the builder.
func (*EventUpdate) RemoveUserIDs ¶
func (eu *EventUpdate) RemoveUserIDs(ids ...uuid.UUID) *EventUpdate
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*EventUpdate) RemoveUsers ¶
func (eu *EventUpdate) RemoveUsers(u ...*User) *EventUpdate
RemoveUsers removes "users" edges to User entities.
func (*EventUpdate) Save ¶
func (eu *EventUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*EventUpdate) SaveX ¶
func (eu *EventUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*EventUpdate) SetCategory ¶
func (eu *EventUpdate) SetCategory(e *EventType) *EventUpdate
SetCategory sets the "category" edge to the EventType entity.
func (*EventUpdate) SetCategoryID ¶
func (eu *EventUpdate) SetCategoryID(id uuid.UUID) *EventUpdate
SetCategoryID sets the "category" edge to the EventType entity by ID.
func (*EventUpdate) SetDescription ¶
func (eu *EventUpdate) SetDescription(s string) *EventUpdate
SetDescription sets the "description" field.
func (*EventUpdate) SetEndAt ¶
func (eu *EventUpdate) SetEndAt(t time.Time) *EventUpdate
SetEndAt sets the "endAt" field.
func (*EventUpdate) SetName ¶
func (eu *EventUpdate) SetName(s string) *EventUpdate
SetName sets the "name" field.
func (*EventUpdate) SetNillableCategoryID ¶
func (eu *EventUpdate) SetNillableCategoryID(id *uuid.UUID) *EventUpdate
SetNillableCategoryID sets the "category" edge to the EventType entity by ID if the given value is not nil.
func (*EventUpdate) SetNillableDescription ¶
func (eu *EventUpdate) SetNillableDescription(s *string) *EventUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*EventUpdate) SetNillableTutorsRequired ¶
func (eu *EventUpdate) SetNillableTutorsRequired(i *int64) *EventUpdate
SetNillableTutorsRequired sets the "tutorsRequired" field if the given value is not nil.
func (*EventUpdate) SetNillableWalletsReward ¶
func (eu *EventUpdate) SetNillableWalletsReward(i *int64) *EventUpdate
SetNillableWalletsReward sets the "walletsReward" field if the given value is not nil.
func (*EventUpdate) SetStartAt ¶
func (eu *EventUpdate) SetStartAt(t time.Time) *EventUpdate
SetStartAt sets the "startAt" field.
func (*EventUpdate) SetTutorsRequired ¶
func (eu *EventUpdate) SetTutorsRequired(i int64) *EventUpdate
SetTutorsRequired sets the "tutorsRequired" field.
func (*EventUpdate) SetWalletsReward ¶
func (eu *EventUpdate) SetWalletsReward(i int64) *EventUpdate
SetWalletsReward sets the "walletsReward" field.
func (*EventUpdate) Where ¶
func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate
Where appends a list predicates to the EventUpdate builder.
type EventUpdateOne ¶
type EventUpdateOne struct {
// contains filtered or unexported fields
}
EventUpdateOne is the builder for updating a single Event entity.
func (*EventUpdateOne) AddTutorsRequired ¶
func (euo *EventUpdateOne) AddTutorsRequired(i int64) *EventUpdateOne
AddTutorsRequired adds i to the "tutorsRequired" field.
func (*EventUpdateOne) AddUserIDs ¶
func (euo *EventUpdateOne) AddUserIDs(ids ...uuid.UUID) *EventUpdateOne
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*EventUpdateOne) AddUsers ¶
func (euo *EventUpdateOne) AddUsers(u ...*User) *EventUpdateOne
AddUsers adds the "users" edges to the User entity.
func (*EventUpdateOne) AddWalletsReward ¶
func (euo *EventUpdateOne) AddWalletsReward(i int64) *EventUpdateOne
AddWalletsReward adds i to the "walletsReward" field.
func (*EventUpdateOne) ClearCategory ¶
func (euo *EventUpdateOne) ClearCategory() *EventUpdateOne
ClearCategory clears the "category" edge to the EventType entity.
func (*EventUpdateOne) ClearDescription ¶
func (euo *EventUpdateOne) ClearDescription() *EventUpdateOne
ClearDescription clears the value of the "description" field.
func (*EventUpdateOne) ClearTutorsRequired ¶
func (euo *EventUpdateOne) ClearTutorsRequired() *EventUpdateOne
ClearTutorsRequired clears the value of the "tutorsRequired" field.
func (*EventUpdateOne) ClearUsers ¶
func (euo *EventUpdateOne) ClearUsers() *EventUpdateOne
ClearUsers clears all "users" edges to the User entity.
func (*EventUpdateOne) ClearWalletsReward ¶
func (euo *EventUpdateOne) ClearWalletsReward() *EventUpdateOne
ClearWalletsReward clears the value of the "walletsReward" field.
func (*EventUpdateOne) Exec ¶
func (euo *EventUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*EventUpdateOne) ExecX ¶
func (euo *EventUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*EventUpdateOne) Mutation ¶
func (euo *EventUpdateOne) Mutation() *EventMutation
Mutation returns the EventMutation object of the builder.
func (*EventUpdateOne) RemoveUserIDs ¶
func (euo *EventUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *EventUpdateOne
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*EventUpdateOne) RemoveUsers ¶
func (euo *EventUpdateOne) RemoveUsers(u ...*User) *EventUpdateOne
RemoveUsers removes "users" edges to User entities.
func (*EventUpdateOne) Save ¶
func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)
Save executes the query and returns the updated Event entity.
func (*EventUpdateOne) SaveX ¶
func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event
SaveX is like Save, but panics if an error occurs.
func (*EventUpdateOne) Select ¶
func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*EventUpdateOne) SetCategory ¶
func (euo *EventUpdateOne) SetCategory(e *EventType) *EventUpdateOne
SetCategory sets the "category" edge to the EventType entity.
func (*EventUpdateOne) SetCategoryID ¶
func (euo *EventUpdateOne) SetCategoryID(id uuid.UUID) *EventUpdateOne
SetCategoryID sets the "category" edge to the EventType entity by ID.
func (*EventUpdateOne) SetDescription ¶
func (euo *EventUpdateOne) SetDescription(s string) *EventUpdateOne
SetDescription sets the "description" field.
func (*EventUpdateOne) SetEndAt ¶
func (euo *EventUpdateOne) SetEndAt(t time.Time) *EventUpdateOne
SetEndAt sets the "endAt" field.
func (*EventUpdateOne) SetName ¶
func (euo *EventUpdateOne) SetName(s string) *EventUpdateOne
SetName sets the "name" field.
func (*EventUpdateOne) SetNillableCategoryID ¶
func (euo *EventUpdateOne) SetNillableCategoryID(id *uuid.UUID) *EventUpdateOne
SetNillableCategoryID sets the "category" edge to the EventType entity by ID if the given value is not nil.
func (*EventUpdateOne) SetNillableDescription ¶
func (euo *EventUpdateOne) SetNillableDescription(s *string) *EventUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*EventUpdateOne) SetNillableTutorsRequired ¶
func (euo *EventUpdateOne) SetNillableTutorsRequired(i *int64) *EventUpdateOne
SetNillableTutorsRequired sets the "tutorsRequired" field if the given value is not nil.
func (*EventUpdateOne) SetNillableWalletsReward ¶
func (euo *EventUpdateOne) SetNillableWalletsReward(i *int64) *EventUpdateOne
SetNillableWalletsReward sets the "walletsReward" field if the given value is not nil.
func (*EventUpdateOne) SetStartAt ¶
func (euo *EventUpdateOne) SetStartAt(t time.Time) *EventUpdateOne
SetStartAt sets the "startAt" field.
func (*EventUpdateOne) SetTutorsRequired ¶
func (euo *EventUpdateOne) SetTutorsRequired(i int64) *EventUpdateOne
SetTutorsRequired sets the "tutorsRequired" field.
func (*EventUpdateOne) SetWalletsReward ¶
func (euo *EventUpdateOne) SetWalletsReward(i int64) *EventUpdateOne
SetWalletsReward sets the "walletsReward" field.
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 Role ¶
type Role struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Event holds the value of the "event" field. Event string `json:"-"` // EventWrite holds the value of the "event_write" field. EventWrite string `json:"-"` // User holds the value of the "user" field. User string `json:"-"` // UserSubscription holds the value of the "user_subscription" field. UserSubscription string `json:"-"` // UserWrite holds the value of the "user_write" field. UserWrite string `json:"-"` // 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"` // contains filtered or unexported fields }
Role is the model entity for the Role schema.
func (*Role) ContextValidate ¶
ContextValidate method is implemented to discard code editor errors.
func (*Role) QueryUsers ¶
QueryUsers queries the "users" 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 create builder for Role.
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 delete builder for the given entity.
func (*RoleClient) DeleteOneID ¶
func (c *RoleClient) DeleteOneID(id uuid.UUID) *RoleDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*RoleClient) Query ¶
func (c *RoleClient) Query() *RoleQuery
Query returns a query builder for Role.
func (*RoleClient) QueryUsers ¶
func (c *RoleClient) QueryUsers(r *Role) *UserQuery
QueryUsers queries the users 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 uuid.UUID) *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) AddUserIDs ¶
func (rc *RoleCreate) AddUserIDs(ids ...uuid.UUID) *RoleCreate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*RoleCreate) AddUsers ¶
func (rc *RoleCreate) AddUsers(u ...*User) *RoleCreate
AddUsers adds the "users" edges to the User entity.
func (*RoleCreate) Exec ¶
func (rc *RoleCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreate) ExecX ¶
func (rc *RoleCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleCreate) Mutation ¶
func (rc *RoleCreate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleCreate) Save ¶
func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)
Save creates the Role in the database.
func (*RoleCreate) SaveX ¶
func (rc *RoleCreate) SaveX(ctx context.Context) *Role
SaveX calls Save and panics if Save returns an error.
func (*RoleCreate) SetEvent ¶
func (rc *RoleCreate) SetEvent(s string) *RoleCreate
SetEvent sets the "event" field.
func (*RoleCreate) SetEventWrite ¶
func (rc *RoleCreate) SetEventWrite(s string) *RoleCreate
SetEventWrite sets the "event_write" field.
func (*RoleCreate) SetID ¶
func (rc *RoleCreate) SetID(u uuid.UUID) *RoleCreate
SetID sets the "id" field.
func (*RoleCreate) SetName ¶
func (rc *RoleCreate) SetName(s string) *RoleCreate
SetName sets the "name" field.
func (*RoleCreate) SetNillableEvent ¶
func (rc *RoleCreate) SetNillableEvent(s *string) *RoleCreate
SetNillableEvent sets the "event" field if the given value is not nil.
func (*RoleCreate) SetNillableEventWrite ¶
func (rc *RoleCreate) SetNillableEventWrite(s *string) *RoleCreate
SetNillableEventWrite sets the "event_write" field if the given value is not nil.
func (*RoleCreate) SetNillableID ¶
func (rc *RoleCreate) SetNillableID(u *uuid.UUID) *RoleCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*RoleCreate) SetNillableUser ¶
func (rc *RoleCreate) SetNillableUser(s *string) *RoleCreate
SetNillableUser sets the "user" field if the given value is not nil.
func (*RoleCreate) SetNillableUserSubscription ¶
func (rc *RoleCreate) SetNillableUserSubscription(s *string) *RoleCreate
SetNillableUserSubscription sets the "user_subscription" field if the given value is not nil.
func (*RoleCreate) SetNillableUserWrite ¶
func (rc *RoleCreate) SetNillableUserWrite(s *string) *RoleCreate
SetNillableUserWrite sets the "user_write" field if the given value is not nil.
func (*RoleCreate) SetUser ¶
func (rc *RoleCreate) SetUser(s string) *RoleCreate
SetUser sets the "user" field.
func (*RoleCreate) SetUserSubscription ¶
func (rc *RoleCreate) SetUserSubscription(s string) *RoleCreate
SetUserSubscription sets the "user_subscription" field.
func (*RoleCreate) SetUserWrite ¶
func (rc *RoleCreate) SetUserWrite(s string) *RoleCreate
SetUserWrite sets the "user_write" field.
type RoleCreateBulk ¶
type RoleCreateBulk struct {
// contains filtered or unexported fields
}
RoleCreateBulk is the builder for creating many Role entities in bulk.
func (*RoleCreateBulk) Exec ¶
func (rcb *RoleCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleCreateBulk) ExecX ¶
func (rcb *RoleCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RoleDelete ¶
type RoleDelete struct {
// contains filtered or unexported fields
}
RoleDelete is the builder for deleting a Role entity.
func (*RoleDelete) Exec ¶
func (rd *RoleDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RoleDelete) ExecX ¶
func (rd *RoleDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RoleDelete) Where ¶
func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete
Where appends a list predicates to the RoleDelete builder.
type RoleDeleteOne ¶
type RoleDeleteOne struct {
// contains filtered or unexported fields
}
RoleDeleteOne is the builder for deleting a single Role entity.
func (*RoleDeleteOne) Exec ¶
func (rdo *RoleDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RoleDeleteOne) ExecX ¶
func (rdo *RoleDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RoleEdges ¶
type RoleEdges struct { // Users holds the value of the users edge. Users []*User `json:"users,omitempty"` // contains filtered or unexported fields }
RoleEdges holds the relations/edges for other nodes in the graph.
func (RoleEdges) UsersOrErr ¶
UsersOrErr returns the Users 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 ¶
func (rgb *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) BoolX ¶
func (rgb *RoleGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RoleGroupBy) Bools ¶
func (rgb *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) BoolsX ¶
func (rgb *RoleGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RoleGroupBy) Float64 ¶
func (rgb *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) Float64X ¶
func (rgb *RoleGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RoleGroupBy) Float64s ¶
func (rgb *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) Float64sX ¶
func (rgb *RoleGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RoleGroupBy) Int ¶
func (rgb *RoleGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) IntX ¶
func (rgb *RoleGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RoleGroupBy) Ints ¶
func (rgb *RoleGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) IntsX ¶
func (rgb *RoleGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RoleGroupBy) Scan ¶
func (rgb *RoleGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*RoleGroupBy) ScanX ¶
func (rgb *RoleGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RoleGroupBy) String ¶
func (rgb *RoleGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*RoleGroupBy) StringX ¶
func (rgb *RoleGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RoleMutation ¶
type RoleMutation struct {
// contains filtered or unexported fields
}
RoleMutation represents an operation that mutates the Role nodes in the graph.
func (*RoleMutation) AddField ¶
func (m *RoleMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*RoleMutation) AddUserIDs ¶
func (m *RoleMutation) AddUserIDs(ids ...uuid.UUID)
AddUserIDs adds the "users" edge to the User entity by ids.
func (*RoleMutation) AddedEdges ¶
func (m *RoleMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RoleMutation) AddedField ¶
func (m *RoleMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*RoleMutation) AddedFields ¶
func (m *RoleMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RoleMutation) AddedIDs ¶
func (m *RoleMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RoleMutation) ClearEdge ¶
func (m *RoleMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*RoleMutation) ClearField ¶
func (m *RoleMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*RoleMutation) ClearUsers ¶
func (m *RoleMutation) ClearUsers()
ClearUsers clears the "users" edge to the User 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) 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) Event ¶
func (m *RoleMutation) Event() (r string, exists bool)
Event returns the value of the "event" field in the mutation.
func (*RoleMutation) EventWrite ¶
func (m *RoleMutation) EventWrite() (r string, exists bool)
EventWrite returns the value of the "event_write" field in the mutation.
func (*RoleMutation) Field ¶
func (m *RoleMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*RoleMutation) FieldCleared ¶
func (m *RoleMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RoleMutation) Fields ¶
func (m *RoleMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*RoleMutation) ID ¶
func (m *RoleMutation) ID() (id uuid.UUID, 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 ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*RoleMutation) Name ¶
func (m *RoleMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RoleMutation) OldEvent ¶
func (m *RoleMutation) OldEvent(ctx context.Context) (v string, err error)
OldEvent returns the old "event" 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) OldEventWrite ¶
func (m *RoleMutation) OldEventWrite(ctx context.Context) (v string, err error)
OldEventWrite returns the old "event_write" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*RoleMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*RoleMutation) OldName ¶
func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*RoleMutation) OldUser ¶
func (m *RoleMutation) OldUser(ctx context.Context) (v string, err error)
OldUser returns the old "user" 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) OldUserSubscription ¶
func (m *RoleMutation) OldUserSubscription(ctx context.Context) (v string, err error)
OldUserSubscription returns the old "user_subscription" 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) OldUserWrite ¶
func (m *RoleMutation) OldUserWrite(ctx context.Context) (v string, err error)
OldUserWrite returns the old "user_write" 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) RemoveUserIDs ¶
func (m *RoleMutation) RemoveUserIDs(ids ...uuid.UUID)
RemoveUserIDs removes the "users" edge to the User entity by IDs.
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) RemovedUsersIDs ¶
func (m *RoleMutation) RemovedUsersIDs() (ids []uuid.UUID)
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
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) ResetEvent ¶
func (m *RoleMutation) ResetEvent()
ResetEvent resets all changes to the "event" field.
func (*RoleMutation) ResetEventWrite ¶
func (m *RoleMutation) ResetEventWrite()
ResetEventWrite resets all changes to the "event_write" field.
func (*RoleMutation) ResetField ¶
func (m *RoleMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*RoleMutation) ResetName ¶
func (m *RoleMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RoleMutation) ResetUser ¶
func (m *RoleMutation) ResetUser()
ResetUser resets all changes to the "user" field.
func (*RoleMutation) ResetUserSubscription ¶
func (m *RoleMutation) ResetUserSubscription()
ResetUserSubscription resets all changes to the "user_subscription" field.
func (*RoleMutation) ResetUserWrite ¶
func (m *RoleMutation) ResetUserWrite()
ResetUserWrite resets all changes to the "user_write" field.
func (*RoleMutation) ResetUsers ¶
func (m *RoleMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*RoleMutation) SetEvent ¶
func (m *RoleMutation) SetEvent(s string)
SetEvent sets the "event" field.
func (*RoleMutation) SetEventWrite ¶
func (m *RoleMutation) SetEventWrite(s string)
SetEventWrite sets the "event_write" field.
func (*RoleMutation) SetField ¶
func (m *RoleMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*RoleMutation) SetID ¶
func (m *RoleMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Role entities.
func (*RoleMutation) SetName ¶
func (m *RoleMutation) SetName(s string)
SetName sets the "name" field.
func (*RoleMutation) SetUser ¶
func (m *RoleMutation) SetUser(s string)
SetUser sets the "user" field.
func (*RoleMutation) SetUserSubscription ¶
func (m *RoleMutation) SetUserSubscription(s string)
SetUserSubscription sets the "user_subscription" field.
func (*RoleMutation) SetUserWrite ¶
func (m *RoleMutation) SetUserWrite(s string)
SetUserWrite sets the "user_write" 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) User ¶
func (m *RoleMutation) User() (r string, exists bool)
User returns the value of the "user" field in the mutation.
func (*RoleMutation) UserSubscription ¶
func (m *RoleMutation) UserSubscription() (r string, exists bool)
UserSubscription returns the value of the "user_subscription" field in the mutation.
func (*RoleMutation) UserWrite ¶
func (m *RoleMutation) UserWrite() (r string, exists bool)
UserWrite returns the value of the "user_write" field in the mutation.
func (*RoleMutation) UsersCleared ¶
func (m *RoleMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*RoleMutation) UsersIDs ¶
func (m *RoleMutation) UsersIDs() (ids []uuid.UUID)
UsersIDs returns the "users" edge IDs in the mutation.
func (*RoleMutation) Where ¶
func (m *RoleMutation) Where(ps ...predicate.Role)
Where appends a list predicates to the RoleMutation builder.
type RoleQuery ¶
type RoleQuery struct {
// contains filtered or unexported fields
}
RoleQuery is the builder for querying Role entities.
func (*RoleQuery) Clone ¶
Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RoleQuery) First ¶
First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.
func (*RoleQuery) FirstID ¶
FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.
func (*RoleQuery) GroupBy ¶
func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Role.Query(). GroupBy(role.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RoleQuery) Only ¶
Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.
func (*RoleQuery) OnlyID ¶
OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.
func (*RoleQuery) QueryUsers ¶
QueryUsers chains the current query on the "users" 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 { Name string `json:"name,omitempty"` } client.Role.Query(). Select(role.FieldName). 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.
type RoleSelect ¶
type RoleSelect struct { *RoleQuery // contains filtered or unexported fields }
RoleSelect is the builder for selecting fields of Role entities.
func (*RoleSelect) Bool ¶
func (rs *RoleSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RoleSelect) BoolX ¶
func (rs *RoleSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*RoleSelect) Bools ¶
func (rs *RoleSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RoleSelect) BoolsX ¶
func (rs *RoleSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RoleSelect) Float64 ¶
func (rs *RoleSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64X ¶
func (rs *RoleSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*RoleSelect) Float64s ¶
func (rs *RoleSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RoleSelect) Float64sX ¶
func (rs *RoleSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RoleSelect) Int ¶
func (rs *RoleSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RoleSelect) IntX ¶
func (rs *RoleSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*RoleSelect) Ints ¶
func (rs *RoleSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RoleSelect) IntsX ¶
func (rs *RoleSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RoleSelect) Scan ¶
func (rs *RoleSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*RoleSelect) ScanX ¶
func (rs *RoleSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*RoleSelect) String ¶
func (rs *RoleSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*RoleSelect) StringX ¶
func (rs *RoleSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type RoleUpdate ¶
type RoleUpdate struct {
// contains filtered or unexported fields
}
RoleUpdate is the builder for updating Role entities.
func (*RoleUpdate) AddUserIDs ¶
func (ru *RoleUpdate) AddUserIDs(ids ...uuid.UUID) *RoleUpdate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*RoleUpdate) AddUsers ¶
func (ru *RoleUpdate) AddUsers(u ...*User) *RoleUpdate
AddUsers adds the "users" edges to the User entity.
func (*RoleUpdate) ClearUsers ¶
func (ru *RoleUpdate) ClearUsers() *RoleUpdate
ClearUsers clears all "users" edges to the User entity.
func (*RoleUpdate) Exec ¶
func (ru *RoleUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RoleUpdate) ExecX ¶
func (ru *RoleUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdate) Mutation ¶
func (ru *RoleUpdate) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdate) RemoveUserIDs ¶
func (ru *RoleUpdate) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdate
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*RoleUpdate) RemoveUsers ¶
func (ru *RoleUpdate) RemoveUsers(u ...*User) *RoleUpdate
RemoveUsers removes "users" edges to User 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) SetEvent ¶
func (ru *RoleUpdate) SetEvent(s string) *RoleUpdate
SetEvent sets the "event" field.
func (*RoleUpdate) SetEventWrite ¶
func (ru *RoleUpdate) SetEventWrite(s string) *RoleUpdate
SetEventWrite sets the "event_write" field.
func (*RoleUpdate) SetName ¶
func (ru *RoleUpdate) SetName(s string) *RoleUpdate
SetName sets the "name" field.
func (*RoleUpdate) SetNillableEvent ¶
func (ru *RoleUpdate) SetNillableEvent(s *string) *RoleUpdate
SetNillableEvent sets the "event" field if the given value is not nil.
func (*RoleUpdate) SetNillableEventWrite ¶
func (ru *RoleUpdate) SetNillableEventWrite(s *string) *RoleUpdate
SetNillableEventWrite sets the "event_write" field if the given value is not nil.
func (*RoleUpdate) SetNillableUser ¶
func (ru *RoleUpdate) SetNillableUser(s *string) *RoleUpdate
SetNillableUser sets the "user" field if the given value is not nil.
func (*RoleUpdate) SetNillableUserSubscription ¶
func (ru *RoleUpdate) SetNillableUserSubscription(s *string) *RoleUpdate
SetNillableUserSubscription sets the "user_subscription" field if the given value is not nil.
func (*RoleUpdate) SetNillableUserWrite ¶
func (ru *RoleUpdate) SetNillableUserWrite(s *string) *RoleUpdate
SetNillableUserWrite sets the "user_write" field if the given value is not nil.
func (*RoleUpdate) SetUser ¶
func (ru *RoleUpdate) SetUser(s string) *RoleUpdate
SetUser sets the "user" field.
func (*RoleUpdate) SetUserSubscription ¶
func (ru *RoleUpdate) SetUserSubscription(s string) *RoleUpdate
SetUserSubscription sets the "user_subscription" field.
func (*RoleUpdate) SetUserWrite ¶
func (ru *RoleUpdate) SetUserWrite(s string) *RoleUpdate
SetUserWrite sets the "user_write" 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) AddUserIDs ¶
func (ruo *RoleUpdateOne) AddUserIDs(ids ...uuid.UUID) *RoleUpdateOne
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*RoleUpdateOne) AddUsers ¶
func (ruo *RoleUpdateOne) AddUsers(u ...*User) *RoleUpdateOne
AddUsers adds the "users" edges to the User entity.
func (*RoleUpdateOne) ClearUsers ¶
func (ruo *RoleUpdateOne) ClearUsers() *RoleUpdateOne
ClearUsers clears all "users" edges to the User entity.
func (*RoleUpdateOne) Exec ¶
func (ruo *RoleUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RoleUpdateOne) ExecX ¶
func (ruo *RoleUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RoleUpdateOne) Mutation ¶
func (ruo *RoleUpdateOne) Mutation() *RoleMutation
Mutation returns the RoleMutation object of the builder.
func (*RoleUpdateOne) RemoveUserIDs ¶
func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdateOne
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*RoleUpdateOne) RemoveUsers ¶
func (ruo *RoleUpdateOne) RemoveUsers(u ...*User) *RoleUpdateOne
RemoveUsers removes "users" edges to User 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) SetEvent ¶
func (ruo *RoleUpdateOne) SetEvent(s string) *RoleUpdateOne
SetEvent sets the "event" field.
func (*RoleUpdateOne) SetEventWrite ¶
func (ruo *RoleUpdateOne) SetEventWrite(s string) *RoleUpdateOne
SetEventWrite sets the "event_write" field.
func (*RoleUpdateOne) SetName ¶
func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne
SetName sets the "name" field.
func (*RoleUpdateOne) SetNillableEvent ¶
func (ruo *RoleUpdateOne) SetNillableEvent(s *string) *RoleUpdateOne
SetNillableEvent sets the "event" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableEventWrite ¶
func (ruo *RoleUpdateOne) SetNillableEventWrite(s *string) *RoleUpdateOne
SetNillableEventWrite sets the "event_write" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableUser ¶
func (ruo *RoleUpdateOne) SetNillableUser(s *string) *RoleUpdateOne
SetNillableUser sets the "user" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableUserSubscription ¶
func (ruo *RoleUpdateOne) SetNillableUserSubscription(s *string) *RoleUpdateOne
SetNillableUserSubscription sets the "user_subscription" field if the given value is not nil.
func (*RoleUpdateOne) SetNillableUserWrite ¶
func (ruo *RoleUpdateOne) SetNillableUserWrite(s *string) *RoleUpdateOne
SetNillableUserWrite sets the "user_write" field if the given value is not nil.
func (*RoleUpdateOne) SetUser ¶
func (ruo *RoleUpdateOne) SetUser(s string) *RoleUpdateOne
SetUser sets the "user" field.
func (*RoleUpdateOne) SetUserSubscription ¶
func (ruo *RoleUpdateOne) SetUserSubscription(s string) *RoleUpdateOne
SetUserSubscription sets the "user_subscription" field.
func (*RoleUpdateOne) SetUserWrite ¶
func (ruo *RoleUpdateOne) SetUserWrite(s string) *RoleUpdateOne
SetUserWrite sets the "user_write" field.
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 Tx ¶
type Tx struct { // Event is the client for interacting with the Event builders. Event *EventClient // EventType is the client for interacting with the EventType builders. EventType *EventTypeClient // Role is the client for interacting with the Role builders. Role *RoleClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID uuid.UUID `json:"id,omitempty"` // Login holds the value of the "login" field. Login string `json:"login,omitempty"` // FirstName holds the value of the "firstName" field. FirstName *string `json:"firstName,omitempty"` // LastName holds the value of the "lastName" field. LastName *string `json:"lastName,omitempty"` // DisplayName holds the value of the "displayName" field. DisplayName *string `json:"displayName,omitempty"` // ImagePath holds the value of the "imagePath" field. ImagePath *string `json:"imagePath,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) ContextValidate ¶
ContextValidate method is implemented to discard code editor errors.
func (*User) QueryEvents ¶
func (u *User) QueryEvents() *EventQuery
QueryEvents queries the "events" edge of the User entity.
func (*User) QueryRoles ¶
QueryRoles queries the "roles" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryEvents ¶
func (c *UserClient) QueryEvents(u *User) *EventQuery
QueryEvents queries the events edge of a User.
func (*UserClient) QueryRoles ¶
func (c *UserClient) QueryRoles(u *User) *RoleQuery
QueryRoles queries the roles edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddEventIDs ¶
func (uc *UserCreate) AddEventIDs(ids ...uuid.UUID) *UserCreate
AddEventIDs adds the "events" edge to the Event entity by IDs.
func (*UserCreate) AddEvents ¶
func (uc *UserCreate) AddEvents(e ...*Event) *UserCreate
AddEvents adds the "events" edges to the Event entity.
func (*UserCreate) AddRoleIDs ¶
func (uc *UserCreate) AddRoleIDs(ids ...uuid.UUID) *UserCreate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*UserCreate) AddRoles ¶
func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate
AddRoles adds the "roles" edges to the Role entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetDisplayName ¶
func (uc *UserCreate) SetDisplayName(s string) *UserCreate
SetDisplayName sets the "displayName" field.
func (*UserCreate) SetFirstName ¶
func (uc *UserCreate) SetFirstName(s string) *UserCreate
SetFirstName sets the "firstName" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetImagePath ¶
func (uc *UserCreate) SetImagePath(s string) *UserCreate
SetImagePath sets the "imagePath" field.
func (*UserCreate) SetLastName ¶
func (uc *UserCreate) SetLastName(s string) *UserCreate
SetLastName sets the "lastName" field.
func (*UserCreate) SetLogin ¶
func (uc *UserCreate) SetLogin(s string) *UserCreate
SetLogin sets the "login" field.
func (*UserCreate) SetNillableDisplayName ¶
func (uc *UserCreate) SetNillableDisplayName(s *string) *UserCreate
SetNillableDisplayName sets the "displayName" field if the given value is not nil.
func (*UserCreate) SetNillableFirstName ¶
func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate
SetNillableFirstName sets the "firstName" field if the given value is not nil.
func (*UserCreate) SetNillableID ¶
func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate
SetNillableID sets the "id" field if the given value is not nil.
func (*UserCreate) SetNillableImagePath ¶
func (uc *UserCreate) SetNillableImagePath(s *string) *UserCreate
SetNillableImagePath sets the "imagePath" field if the given value is not nil.
func (*UserCreate) SetNillableLastName ¶
func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate
SetNillableLastName sets the "lastName" field if the given value is not nil.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserEdges ¶
type UserEdges struct { // Roles holds the value of the roles edge. Roles []*Role `json:"roles,omitempty"` // Events holds the value of the events edge. Events []*Event `json:"events,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) EventsOrErr ¶
EventsOrErr returns the Events value or an error if the edge was not loaded in eager-loading.
func (UserEdges) RolesOrErr ¶
RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolX ¶
func (ugb *UserGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserGroupBy) Bools ¶
func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) BoolsX ¶
func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserGroupBy) Float64 ¶
func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64X ¶
func (ugb *UserGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserGroupBy) Float64s ¶
func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) Float64sX ¶
func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserGroupBy) Int ¶
func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntX ¶
func (ugb *UserGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserGroupBy) Ints ¶
func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) IntsX ¶
func (ugb *UserGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) ScanX ¶
func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserGroupBy) String ¶
func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*UserGroupBy) StringX ¶
func (ugb *UserGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddEventIDs ¶
func (m *UserMutation) AddEventIDs(ids ...uuid.UUID)
AddEventIDs adds the "events" edge to the Event entity by ids.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddRoleIDs ¶
func (m *UserMutation) AddRoleIDs(ids ...uuid.UUID)
AddRoleIDs adds the "roles" edge to the Role entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearDisplayName ¶
func (m *UserMutation) ClearDisplayName()
ClearDisplayName clears the value of the "displayName" field.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearEvents ¶
func (m *UserMutation) ClearEvents()
ClearEvents clears the "events" edge to the Event entity.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearFirstName ¶
func (m *UserMutation) ClearFirstName()
ClearFirstName clears the value of the "firstName" field.
func (*UserMutation) ClearImagePath ¶
func (m *UserMutation) ClearImagePath()
ClearImagePath clears the value of the "imagePath" field.
func (*UserMutation) ClearLastName ¶
func (m *UserMutation) ClearLastName()
ClearLastName clears the value of the "lastName" field.
func (*UserMutation) ClearRoles ¶
func (m *UserMutation) ClearRoles()
ClearRoles clears the "roles" edge to the Role entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) DisplayName ¶
func (m *UserMutation) DisplayName() (r string, exists bool)
DisplayName returns the value of the "displayName" field in the mutation.
func (*UserMutation) DisplayNameCleared ¶
func (m *UserMutation) DisplayNameCleared() bool
DisplayNameCleared returns if the "displayName" field was cleared in this mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) EventsCleared ¶
func (m *UserMutation) EventsCleared() bool
EventsCleared reports if the "events" edge to the Event entity was cleared.
func (*UserMutation) EventsIDs ¶
func (m *UserMutation) EventsIDs() (ids []uuid.UUID)
EventsIDs returns the "events" edge IDs in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) FirstName ¶
func (m *UserMutation) FirstName() (r string, exists bool)
FirstName returns the value of the "firstName" field in the mutation.
func (*UserMutation) FirstNameCleared ¶
func (m *UserMutation) FirstNameCleared() bool
FirstNameCleared returns if the "firstName" field was cleared in this mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id uuid.UUID, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) ImagePath ¶
func (m *UserMutation) ImagePath() (r string, exists bool)
ImagePath returns the value of the "imagePath" field in the mutation.
func (*UserMutation) ImagePathCleared ¶
func (m *UserMutation) ImagePathCleared() bool
ImagePathCleared returns if the "imagePath" field was cleared in this mutation.
func (*UserMutation) LastName ¶
func (m *UserMutation) LastName() (r string, exists bool)
LastName returns the value of the "lastName" field in the mutation.
func (*UserMutation) LastNameCleared ¶
func (m *UserMutation) LastNameCleared() bool
LastNameCleared returns if the "lastName" field was cleared in this mutation.
func (*UserMutation) Login ¶
func (m *UserMutation) Login() (r string, exists bool)
Login returns the value of the "login" field in the mutation.
func (*UserMutation) OldDisplayName ¶
func (m *UserMutation) OldDisplayName(ctx context.Context) (v *string, err error)
OldDisplayName returns the old "displayName" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldFirstName ¶
func (m *UserMutation) OldFirstName(ctx context.Context) (v *string, err error)
OldFirstName returns the old "firstName" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldImagePath ¶
func (m *UserMutation) OldImagePath(ctx context.Context) (v *string, err error)
OldImagePath returns the old "imagePath" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldLastName ¶
func (m *UserMutation) OldLastName(ctx context.Context) (v *string, err error)
OldLastName returns the old "lastName" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldLogin ¶
func (m *UserMutation) OldLogin(ctx context.Context) (v string, err error)
OldLogin returns the old "login" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) RemoveEventIDs ¶
func (m *UserMutation) RemoveEventIDs(ids ...uuid.UUID)
RemoveEventIDs removes the "events" edge to the Event entity by IDs.
func (*UserMutation) RemoveRoleIDs ¶
func (m *UserMutation) RemoveRoleIDs(ids ...uuid.UUID)
RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedEventsIDs ¶
func (m *UserMutation) RemovedEventsIDs() (ids []uuid.UUID)
RemovedEvents returns the removed IDs of the "events" edge to the Event entity.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedRolesIDs ¶
func (m *UserMutation) RemovedRolesIDs() (ids []uuid.UUID)
RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.
func (*UserMutation) ResetDisplayName ¶
func (m *UserMutation) ResetDisplayName()
ResetDisplayName resets all changes to the "displayName" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEvents ¶
func (m *UserMutation) ResetEvents()
ResetEvents resets all changes to the "events" edge.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetFirstName ¶
func (m *UserMutation) ResetFirstName()
ResetFirstName resets all changes to the "firstName" field.
func (*UserMutation) ResetImagePath ¶
func (m *UserMutation) ResetImagePath()
ResetImagePath resets all changes to the "imagePath" field.
func (*UserMutation) ResetLastName ¶
func (m *UserMutation) ResetLastName()
ResetLastName resets all changes to the "lastName" field.
func (*UserMutation) ResetLogin ¶
func (m *UserMutation) ResetLogin()
ResetLogin resets all changes to the "login" field.
func (*UserMutation) ResetRoles ¶
func (m *UserMutation) ResetRoles()
ResetRoles resets all changes to the "roles" edge.
func (*UserMutation) RolesCleared ¶
func (m *UserMutation) RolesCleared() bool
RolesCleared reports if the "roles" edge to the Role entity was cleared.
func (*UserMutation) RolesIDs ¶
func (m *UserMutation) RolesIDs() (ids []uuid.UUID)
RolesIDs returns the "roles" edge IDs in the mutation.
func (*UserMutation) SetDisplayName ¶
func (m *UserMutation) SetDisplayName(s string)
SetDisplayName sets the "displayName" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetFirstName ¶
func (m *UserMutation) SetFirstName(s string)
SetFirstName sets the "firstName" field.
func (*UserMutation) SetID ¶
func (m *UserMutation) SetID(id uuid.UUID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetImagePath ¶
func (m *UserMutation) SetImagePath(s string)
SetImagePath sets the "imagePath" field.
func (*UserMutation) SetLastName ¶
func (m *UserMutation) SetLastName(s string)
SetLastName sets the "lastName" field.
func (*UserMutation) SetLogin ¶
func (m *UserMutation) SetLogin(s string)
SetLogin sets the "login" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Login string `json:"login,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldLogin). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QueryEvents ¶
func (uq *UserQuery) QueryEvents() *EventQuery
QueryEvents chains the current query on the "events" edge.
func (*UserQuery) QueryRoles ¶
QueryRoles chains the current query on the "roles" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Login string `json:"login,omitempty"` } client.User.Query(). Select(user.FieldLogin). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*UserQuery) WithEvents ¶
func (uq *UserQuery) WithEvents(opts ...func(*EventQuery)) *UserQuery
WithEvents tells the query-builder to eager-load the nodes that are connected to the "events" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Bool ¶
func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolX ¶
func (us *UserSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*UserSelect) Bools ¶
func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) BoolsX ¶
func (us *UserSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*UserSelect) Float64 ¶
func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64X ¶
func (us *UserSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*UserSelect) Float64s ¶
func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64sX ¶
func (us *UserSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*UserSelect) Int ¶
func (us *UserSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntX ¶
func (us *UserSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*UserSelect) Ints ¶
func (us *UserSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) IntsX ¶
func (us *UserSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) ScanX ¶
func (us *UserSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*UserSelect) String ¶
func (us *UserSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*UserSelect) StringX ¶
func (us *UserSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddEventIDs ¶
func (uu *UserUpdate) AddEventIDs(ids ...uuid.UUID) *UserUpdate
AddEventIDs adds the "events" edge to the Event entity by IDs.
func (*UserUpdate) AddEvents ¶
func (uu *UserUpdate) AddEvents(e ...*Event) *UserUpdate
AddEvents adds the "events" edges to the Event entity.
func (*UserUpdate) AddRoleIDs ¶
func (uu *UserUpdate) AddRoleIDs(ids ...uuid.UUID) *UserUpdate
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*UserUpdate) AddRoles ¶
func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate
AddRoles adds the "roles" edges to the Role entity.
func (*UserUpdate) ClearDisplayName ¶
func (uu *UserUpdate) ClearDisplayName() *UserUpdate
ClearDisplayName clears the value of the "displayName" field.
func (*UserUpdate) ClearEvents ¶
func (uu *UserUpdate) ClearEvents() *UserUpdate
ClearEvents clears all "events" edges to the Event entity.
func (*UserUpdate) ClearFirstName ¶
func (uu *UserUpdate) ClearFirstName() *UserUpdate
ClearFirstName clears the value of the "firstName" field.
func (*UserUpdate) ClearImagePath ¶
func (uu *UserUpdate) ClearImagePath() *UserUpdate
ClearImagePath clears the value of the "imagePath" field.
func (*UserUpdate) ClearLastName ¶
func (uu *UserUpdate) ClearLastName() *UserUpdate
ClearLastName clears the value of the "lastName" field.
func (*UserUpdate) ClearRoles ¶
func (uu *UserUpdate) ClearRoles() *UserUpdate
ClearRoles clears all "roles" edges to the Role entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveEventIDs ¶
func (uu *UserUpdate) RemoveEventIDs(ids ...uuid.UUID) *UserUpdate
RemoveEventIDs removes the "events" edge to Event entities by IDs.
func (*UserUpdate) RemoveEvents ¶
func (uu *UserUpdate) RemoveEvents(e ...*Event) *UserUpdate
RemoveEvents removes "events" edges to Event entities.
func (*UserUpdate) RemoveRoleIDs ¶
func (uu *UserUpdate) RemoveRoleIDs(ids ...uuid.UUID) *UserUpdate
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*UserUpdate) RemoveRoles ¶
func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate
RemoveRoles removes "roles" edges to Role entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetDisplayName ¶
func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate
SetDisplayName sets the "displayName" field.
func (*UserUpdate) SetFirstName ¶
func (uu *UserUpdate) SetFirstName(s string) *UserUpdate
SetFirstName sets the "firstName" field.
func (*UserUpdate) SetImagePath ¶
func (uu *UserUpdate) SetImagePath(s string) *UserUpdate
SetImagePath sets the "imagePath" field.
func (*UserUpdate) SetLastName ¶
func (uu *UserUpdate) SetLastName(s string) *UserUpdate
SetLastName sets the "lastName" field.
func (*UserUpdate) SetNillableDisplayName ¶
func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate
SetNillableDisplayName sets the "displayName" field if the given value is not nil.
func (*UserUpdate) SetNillableFirstName ¶
func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate
SetNillableFirstName sets the "firstName" field if the given value is not nil.
func (*UserUpdate) SetNillableImagePath ¶
func (uu *UserUpdate) SetNillableImagePath(s *string) *UserUpdate
SetNillableImagePath sets the "imagePath" field if the given value is not nil.
func (*UserUpdate) SetNillableLastName ¶
func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate
SetNillableLastName sets the "lastName" field if the given value is not nil.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddEventIDs ¶
func (uuo *UserUpdateOne) AddEventIDs(ids ...uuid.UUID) *UserUpdateOne
AddEventIDs adds the "events" edge to the Event entity by IDs.
func (*UserUpdateOne) AddEvents ¶
func (uuo *UserUpdateOne) AddEvents(e ...*Event) *UserUpdateOne
AddEvents adds the "events" edges to the Event entity.
func (*UserUpdateOne) AddRoleIDs ¶
func (uuo *UserUpdateOne) AddRoleIDs(ids ...uuid.UUID) *UserUpdateOne
AddRoleIDs adds the "roles" edge to the Role entity by IDs.
func (*UserUpdateOne) AddRoles ¶
func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne
AddRoles adds the "roles" edges to the Role entity.
func (*UserUpdateOne) ClearDisplayName ¶
func (uuo *UserUpdateOne) ClearDisplayName() *UserUpdateOne
ClearDisplayName clears the value of the "displayName" field.
func (*UserUpdateOne) ClearEvents ¶
func (uuo *UserUpdateOne) ClearEvents() *UserUpdateOne
ClearEvents clears all "events" edges to the Event entity.
func (*UserUpdateOne) ClearFirstName ¶
func (uuo *UserUpdateOne) ClearFirstName() *UserUpdateOne
ClearFirstName clears the value of the "firstName" field.
func (*UserUpdateOne) ClearImagePath ¶
func (uuo *UserUpdateOne) ClearImagePath() *UserUpdateOne
ClearImagePath clears the value of the "imagePath" field.
func (*UserUpdateOne) ClearLastName ¶
func (uuo *UserUpdateOne) ClearLastName() *UserUpdateOne
ClearLastName clears the value of the "lastName" field.
func (*UserUpdateOne) ClearRoles ¶
func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne
ClearRoles clears all "roles" edges to the Role entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveEventIDs ¶
func (uuo *UserUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveEventIDs removes the "events" edge to Event entities by IDs.
func (*UserUpdateOne) RemoveEvents ¶
func (uuo *UserUpdateOne) RemoveEvents(e ...*Event) *UserUpdateOne
RemoveEvents removes "events" edges to Event entities.
func (*UserUpdateOne) RemoveRoleIDs ¶
func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...uuid.UUID) *UserUpdateOne
RemoveRoleIDs removes the "roles" edge to Role entities by IDs.
func (*UserUpdateOne) RemoveRoles ¶
func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne
RemoveRoles removes "roles" edges to Role entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetDisplayName ¶
func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne
SetDisplayName sets the "displayName" field.
func (*UserUpdateOne) SetFirstName ¶
func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne
SetFirstName sets the "firstName" field.
func (*UserUpdateOne) SetImagePath ¶
func (uuo *UserUpdateOne) SetImagePath(s string) *UserUpdateOne
SetImagePath sets the "imagePath" field.
func (*UserUpdateOne) SetLastName ¶
func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne
SetLastName sets the "lastName" field.
func (*UserUpdateOne) SetNillableDisplayName ¶
func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne
SetNillableDisplayName sets the "displayName" field if the given value is not nil.
func (*UserUpdateOne) SetNillableFirstName ¶
func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne
SetNillableFirstName sets the "firstName" field if the given value is not nil.
func (*UserUpdateOne) SetNillableImagePath ¶
func (uuo *UserUpdateOne) SetNillableImagePath(s *string) *UserUpdateOne
SetNillableImagePath sets the "imagePath" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastName ¶
func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne
SetNillableLastName sets the "lastName" field if the given value is not nil.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files ¶
- client.go
- config.go
- context.go
- ent.go
- event.go
- event_create.go
- event_delete.go
- event_query.go
- event_update.go
- eventtype.go
- eventtype_create.go
- eventtype_delete.go
- eventtype_query.go
- eventtype_update.go
- generate.go
- mutation.go
- role.go
- role_create.go
- role_delete.go
- role_query.go
- role_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go