Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Campaign
- type CampaignClient
- func (c *CampaignClient) Create() *CampaignCreate
- func (c *CampaignClient) CreateBulk(builders ...*CampaignCreate) *CampaignCreateBulk
- func (c *CampaignClient) Delete() *CampaignDelete
- func (c *CampaignClient) DeleteOne(ca *Campaign) *CampaignDeleteOne
- func (c *CampaignClient) DeleteOneID(id int) *CampaignDeleteOne
- func (c *CampaignClient) Get(ctx context.Context, id int) (*Campaign, error)
- func (c *CampaignClient) GetX(ctx context.Context, id int) *Campaign
- func (c *CampaignClient) Hooks() []Hook
- func (c *CampaignClient) Intercept(interceptors ...Interceptor)
- func (c *CampaignClient) Interceptors() []Interceptor
- func (c *CampaignClient) MapCreateBulk(slice any, setFunc func(*CampaignCreate, int)) *CampaignCreateBulk
- func (c *CampaignClient) Query() *CampaignQuery
- func (c *CampaignClient) Update() *CampaignUpdate
- func (c *CampaignClient) UpdateOne(ca *Campaign) *CampaignUpdateOne
- func (c *CampaignClient) UpdateOneID(id int) *CampaignUpdateOne
- func (c *CampaignClient) Use(hooks ...Hook)
- type CampaignCreate
- func (cc *CampaignCreate) Exec(ctx context.Context) error
- func (cc *CampaignCreate) ExecX(ctx context.Context)
- func (cc *CampaignCreate) Mutation() *CampaignMutation
- func (cc *CampaignCreate) Save(ctx context.Context) (*Campaign, error)
- func (cc *CampaignCreate) SaveX(ctx context.Context) *Campaign
- func (cc *CampaignCreate) SetCreatedAt(t time.Time) *CampaignCreate
- func (cc *CampaignCreate) SetCurrentSlot(i int64) *CampaignCreate
- func (cc *CampaignCreate) SetEndDay(t time.Time) *CampaignCreate
- func (cc *CampaignCreate) SetIsFull(b bool) *CampaignCreate
- func (cc *CampaignCreate) SetName(s string) *CampaignCreate
- func (cc *CampaignCreate) SetNillableCreatedAt(t *time.Time) *CampaignCreate
- func (cc *CampaignCreate) SetNillableUpdatedAt(t *time.Time) *CampaignCreate
- func (cc *CampaignCreate) SetStartDay(t time.Time) *CampaignCreate
- func (cc *CampaignCreate) SetTotalSlot(i int64) *CampaignCreate
- func (cc *CampaignCreate) SetUpdatedAt(t time.Time) *CampaignCreate
- type CampaignCreateBulk
- type CampaignDelete
- type CampaignDeleteOne
- type CampaignGroupBy
- func (cgb *CampaignGroupBy) Aggregate(fns ...AggregateFunc) *CampaignGroupBy
- func (s *CampaignGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CampaignGroupBy) BoolX(ctx context.Context) bool
- func (s *CampaignGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CampaignGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CampaignGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CampaignGroupBy) Float64X(ctx context.Context) float64
- func (s *CampaignGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CampaignGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CampaignGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CampaignGroupBy) IntX(ctx context.Context) int
- func (s *CampaignGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CampaignGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CampaignGroupBy) Scan(ctx context.Context, v any) error
- func (s *CampaignGroupBy) ScanX(ctx context.Context, v any)
- func (s *CampaignGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CampaignGroupBy) StringX(ctx context.Context) string
- func (s *CampaignGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CampaignGroupBy) StringsX(ctx context.Context) []string
- type CampaignMutation
- func (m *CampaignMutation) AddCurrentSlot(i int64)
- func (m *CampaignMutation) AddField(name string, value ent.Value) error
- func (m *CampaignMutation) AddTotalSlot(i int64)
- func (m *CampaignMutation) AddedCurrentSlot() (r int64, exists bool)
- func (m *CampaignMutation) AddedEdges() []string
- func (m *CampaignMutation) AddedField(name string) (ent.Value, bool)
- func (m *CampaignMutation) AddedFields() []string
- func (m *CampaignMutation) AddedIDs(name string) []ent.Value
- func (m *CampaignMutation) AddedTotalSlot() (r int64, exists bool)
- func (m *CampaignMutation) ClearEdge(name string) error
- func (m *CampaignMutation) ClearField(name string) error
- func (m *CampaignMutation) ClearedEdges() []string
- func (m *CampaignMutation) ClearedFields() []string
- func (m CampaignMutation) Client() *Client
- func (m *CampaignMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CampaignMutation) CurrentSlot() (r int64, exists bool)
- func (m *CampaignMutation) EdgeCleared(name string) bool
- func (m *CampaignMutation) EndDay() (r time.Time, exists bool)
- func (m *CampaignMutation) Field(name string) (ent.Value, bool)
- func (m *CampaignMutation) FieldCleared(name string) bool
- func (m *CampaignMutation) Fields() []string
- func (m *CampaignMutation) ID() (id int, exists bool)
- func (m *CampaignMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CampaignMutation) IsFull() (r bool, exists bool)
- func (m *CampaignMutation) Name() (r string, exists bool)
- func (m *CampaignMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CampaignMutation) OldCurrentSlot(ctx context.Context) (v int64, err error)
- func (m *CampaignMutation) OldEndDay(ctx context.Context) (v time.Time, err error)
- func (m *CampaignMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CampaignMutation) OldIsFull(ctx context.Context) (v bool, err error)
- func (m *CampaignMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CampaignMutation) OldStartDay(ctx context.Context) (v time.Time, err error)
- func (m *CampaignMutation) OldTotalSlot(ctx context.Context) (v int64, err error)
- func (m *CampaignMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CampaignMutation) Op() Op
- func (m *CampaignMutation) RemovedEdges() []string
- func (m *CampaignMutation) RemovedIDs(name string) []ent.Value
- func (m *CampaignMutation) ResetCreatedAt()
- func (m *CampaignMutation) ResetCurrentSlot()
- func (m *CampaignMutation) ResetEdge(name string) error
- func (m *CampaignMutation) ResetEndDay()
- func (m *CampaignMutation) ResetField(name string) error
- func (m *CampaignMutation) ResetIsFull()
- func (m *CampaignMutation) ResetName()
- func (m *CampaignMutation) ResetStartDay()
- func (m *CampaignMutation) ResetTotalSlot()
- func (m *CampaignMutation) ResetUpdatedAt()
- func (m *CampaignMutation) SetCreatedAt(t time.Time)
- func (m *CampaignMutation) SetCurrentSlot(i int64)
- func (m *CampaignMutation) SetEndDay(t time.Time)
- func (m *CampaignMutation) SetField(name string, value ent.Value) error
- func (m *CampaignMutation) SetIsFull(b bool)
- func (m *CampaignMutation) SetName(s string)
- func (m *CampaignMutation) SetOp(op Op)
- func (m *CampaignMutation) SetStartDay(t time.Time)
- func (m *CampaignMutation) SetTotalSlot(i int64)
- func (m *CampaignMutation) SetUpdatedAt(t time.Time)
- func (m *CampaignMutation) StartDay() (r time.Time, exists bool)
- func (m *CampaignMutation) TotalSlot() (r int64, exists bool)
- func (m CampaignMutation) Tx() (*Tx, error)
- func (m *CampaignMutation) Type() string
- func (m *CampaignMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CampaignMutation) Where(ps ...predicate.Campaign)
- func (m *CampaignMutation) WhereP(ps ...func(*sql.Selector))
- type CampaignQuery
- func (cq *CampaignQuery) Aggregate(fns ...AggregateFunc) *CampaignSelect
- func (cq *CampaignQuery) All(ctx context.Context) ([]*Campaign, error)
- func (cq *CampaignQuery) AllX(ctx context.Context) []*Campaign
- func (cq *CampaignQuery) Clone() *CampaignQuery
- func (cq *CampaignQuery) Count(ctx context.Context) (int, error)
- func (cq *CampaignQuery) CountX(ctx context.Context) int
- func (cq *CampaignQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CampaignQuery) ExistX(ctx context.Context) bool
- func (cq *CampaignQuery) First(ctx context.Context) (*Campaign, error)
- func (cq *CampaignQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CampaignQuery) FirstIDX(ctx context.Context) int
- func (cq *CampaignQuery) FirstX(ctx context.Context) *Campaign
- func (cq *CampaignQuery) GroupBy(field string, fields ...string) *CampaignGroupBy
- func (cq *CampaignQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CampaignQuery) IDsX(ctx context.Context) []int
- func (cq *CampaignQuery) Limit(limit int) *CampaignQuery
- func (cq *CampaignQuery) Offset(offset int) *CampaignQuery
- func (cq *CampaignQuery) Only(ctx context.Context) (*Campaign, error)
- func (cq *CampaignQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CampaignQuery) OnlyIDX(ctx context.Context) int
- func (cq *CampaignQuery) OnlyX(ctx context.Context) *Campaign
- func (cq *CampaignQuery) Order(o ...campaign.OrderOption) *CampaignQuery
- func (cq *CampaignQuery) Select(fields ...string) *CampaignSelect
- func (cq *CampaignQuery) Unique(unique bool) *CampaignQuery
- func (cq *CampaignQuery) Where(ps ...predicate.Campaign) *CampaignQuery
- type CampaignSelect
- func (cs *CampaignSelect) Aggregate(fns ...AggregateFunc) *CampaignSelect
- func (s *CampaignSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CampaignSelect) BoolX(ctx context.Context) bool
- func (s *CampaignSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CampaignSelect) BoolsX(ctx context.Context) []bool
- func (s *CampaignSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CampaignSelect) Float64X(ctx context.Context) float64
- func (s *CampaignSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CampaignSelect) Float64sX(ctx context.Context) []float64
- func (s *CampaignSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CampaignSelect) IntX(ctx context.Context) int
- func (s *CampaignSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CampaignSelect) IntsX(ctx context.Context) []int
- func (cs *CampaignSelect) Scan(ctx context.Context, v any) error
- func (s *CampaignSelect) ScanX(ctx context.Context, v any)
- func (s *CampaignSelect) String(ctx context.Context) (_ string, err error)
- func (s *CampaignSelect) StringX(ctx context.Context) string
- func (s *CampaignSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CampaignSelect) StringsX(ctx context.Context) []string
- type CampaignUpdate
- func (cu *CampaignUpdate) AddCurrentSlot(i int64) *CampaignUpdate
- func (cu *CampaignUpdate) AddTotalSlot(i int64) *CampaignUpdate
- func (cu *CampaignUpdate) Exec(ctx context.Context) error
- func (cu *CampaignUpdate) ExecX(ctx context.Context)
- func (cu *CampaignUpdate) Mutation() *CampaignMutation
- func (cu *CampaignUpdate) Save(ctx context.Context) (int, error)
- func (cu *CampaignUpdate) SaveX(ctx context.Context) int
- func (cu *CampaignUpdate) SetCurrentSlot(i int64) *CampaignUpdate
- func (cu *CampaignUpdate) SetEndDay(t time.Time) *CampaignUpdate
- func (cu *CampaignUpdate) SetIsFull(b bool) *CampaignUpdate
- func (cu *CampaignUpdate) SetName(s string) *CampaignUpdate
- func (cu *CampaignUpdate) SetStartDay(t time.Time) *CampaignUpdate
- func (cu *CampaignUpdate) SetTotalSlot(i int64) *CampaignUpdate
- func (cu *CampaignUpdate) SetUpdatedAt(t time.Time) *CampaignUpdate
- func (cu *CampaignUpdate) Where(ps ...predicate.Campaign) *CampaignUpdate
- type CampaignUpdateOne
- func (cuo *CampaignUpdateOne) AddCurrentSlot(i int64) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) AddTotalSlot(i int64) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) Exec(ctx context.Context) error
- func (cuo *CampaignUpdateOne) ExecX(ctx context.Context)
- func (cuo *CampaignUpdateOne) Mutation() *CampaignMutation
- func (cuo *CampaignUpdateOne) Save(ctx context.Context) (*Campaign, error)
- func (cuo *CampaignUpdateOne) SaveX(ctx context.Context) *Campaign
- func (cuo *CampaignUpdateOne) Select(field string, fields ...string) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetCurrentSlot(i int64) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetEndDay(t time.Time) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetIsFull(b bool) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetName(s string) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetStartDay(t time.Time) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetTotalSlot(i int64) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) SetUpdatedAt(t time.Time) *CampaignUpdateOne
- func (cuo *CampaignUpdateOne) Where(ps ...predicate.Campaign) *CampaignUpdateOne
- type Campaigns
- type Card
- type CardClient
- func (c *CardClient) Create() *CardCreate
- func (c *CardClient) CreateBulk(builders ...*CardCreate) *CardCreateBulk
- func (c *CardClient) Delete() *CardDelete
- func (c *CardClient) DeleteOne(ca *Card) *CardDeleteOne
- func (c *CardClient) DeleteOneID(id int) *CardDeleteOne
- func (c *CardClient) Get(ctx context.Context, id int) (*Card, error)
- func (c *CardClient) GetX(ctx context.Context, id int) *Card
- func (c *CardClient) Hooks() []Hook
- func (c *CardClient) Intercept(interceptors ...Interceptor)
- func (c *CardClient) Interceptors() []Interceptor
- func (c *CardClient) MapCreateBulk(slice any, setFunc func(*CardCreate, int)) *CardCreateBulk
- func (c *CardClient) Query() *CardQuery
- func (c *CardClient) Update() *CardUpdate
- func (c *CardClient) UpdateOne(ca *Card) *CardUpdateOne
- func (c *CardClient) UpdateOneID(id int) *CardUpdateOne
- func (c *CardClient) Use(hooks ...Hook)
- type CardCreate
- func (cc *CardCreate) Exec(ctx context.Context) error
- func (cc *CardCreate) ExecX(ctx context.Context)
- func (cc *CardCreate) Mutation() *CardMutation
- func (cc *CardCreate) Save(ctx context.Context) (*Card, error)
- func (cc *CardCreate) SaveX(ctx context.Context) *Card
- func (cc *CardCreate) SetCreatedAt(t time.Time) *CardCreate
- func (cc *CardCreate) SetName(s string) *CardCreate
- func (cc *CardCreate) SetNillableCreatedAt(t *time.Time) *CardCreate
- func (cc *CardCreate) SetNillableUpdatedAt(t *time.Time) *CardCreate
- func (cc *CardCreate) SetType(s string) *CardCreate
- func (cc *CardCreate) SetUpdatedAt(t time.Time) *CardCreate
- func (cc *CardCreate) SetValue(f float64) *CardCreate
- type CardCreateBulk
- type CardDelete
- type CardDeleteOne
- type CardGroupBy
- func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy
- func (s *CardGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CardGroupBy) BoolX(ctx context.Context) bool
- func (s *CardGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CardGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CardGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CardGroupBy) Float64X(ctx context.Context) float64
- func (s *CardGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CardGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CardGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CardGroupBy) IntX(ctx context.Context) int
- func (s *CardGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CardGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CardGroupBy) Scan(ctx context.Context, v any) error
- func (s *CardGroupBy) ScanX(ctx context.Context, v any)
- func (s *CardGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CardGroupBy) StringX(ctx context.Context) string
- func (s *CardGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CardGroupBy) StringsX(ctx context.Context) []string
- type CardMutation
- func (m *CardMutation) AddField(name string, value ent.Value) error
- func (m *CardMutation) AddValue(f float64)
- func (m *CardMutation) AddedEdges() []string
- func (m *CardMutation) AddedField(name string) (ent.Value, bool)
- func (m *CardMutation) AddedFields() []string
- func (m *CardMutation) AddedIDs(name string) []ent.Value
- func (m *CardMutation) AddedValue() (r float64, exists bool)
- func (m *CardMutation) ClearEdge(name string) error
- func (m *CardMutation) ClearField(name string) error
- func (m *CardMutation) ClearedEdges() []string
- func (m *CardMutation) ClearedFields() []string
- func (m CardMutation) Client() *Client
- func (m *CardMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CardMutation) EdgeCleared(name string) bool
- func (m *CardMutation) Field(name string) (ent.Value, bool)
- func (m *CardMutation) FieldCleared(name string) bool
- func (m *CardMutation) Fields() []string
- func (m *CardMutation) GetType() (r string, exists bool)
- func (m *CardMutation) ID() (id int, exists bool)
- func (m *CardMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CardMutation) Name() (r string, exists bool)
- func (m *CardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CardMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CardMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CardMutation) OldType(ctx context.Context) (v string, err error)
- func (m *CardMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CardMutation) OldValue(ctx context.Context) (v float64, err error)
- func (m *CardMutation) Op() Op
- func (m *CardMutation) RemovedEdges() []string
- func (m *CardMutation) RemovedIDs(name string) []ent.Value
- func (m *CardMutation) ResetCreatedAt()
- func (m *CardMutation) ResetEdge(name string) error
- func (m *CardMutation) ResetField(name string) error
- func (m *CardMutation) ResetName()
- func (m *CardMutation) ResetType()
- func (m *CardMutation) ResetUpdatedAt()
- func (m *CardMutation) ResetValue()
- func (m *CardMutation) SetCreatedAt(t time.Time)
- func (m *CardMutation) SetField(name string, value ent.Value) error
- func (m *CardMutation) SetName(s string)
- func (m *CardMutation) SetOp(op Op)
- func (m *CardMutation) SetType(s string)
- func (m *CardMutation) SetUpdatedAt(t time.Time)
- func (m *CardMutation) SetValue(f float64)
- func (m CardMutation) Tx() (*Tx, error)
- func (m *CardMutation) Type() string
- func (m *CardMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CardMutation) Value() (r float64, exists bool)
- func (m *CardMutation) Where(ps ...predicate.Card)
- func (m *CardMutation) WhereP(ps ...func(*sql.Selector))
- type CardQuery
- func (cq *CardQuery) Aggregate(fns ...AggregateFunc) *CardSelect
- func (cq *CardQuery) All(ctx context.Context) ([]*Card, error)
- func (cq *CardQuery) AllX(ctx context.Context) []*Card
- func (cq *CardQuery) Clone() *CardQuery
- func (cq *CardQuery) Count(ctx context.Context) (int, error)
- func (cq *CardQuery) CountX(ctx context.Context) int
- func (cq *CardQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CardQuery) ExistX(ctx context.Context) bool
- func (cq *CardQuery) First(ctx context.Context) (*Card, error)
- func (cq *CardQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CardQuery) FirstIDX(ctx context.Context) int
- func (cq *CardQuery) FirstX(ctx context.Context) *Card
- func (cq *CardQuery) GroupBy(field string, fields ...string) *CardGroupBy
- func (cq *CardQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CardQuery) IDsX(ctx context.Context) []int
- func (cq *CardQuery) Limit(limit int) *CardQuery
- func (cq *CardQuery) Offset(offset int) *CardQuery
- func (cq *CardQuery) Only(ctx context.Context) (*Card, error)
- func (cq *CardQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CardQuery) OnlyIDX(ctx context.Context) int
- func (cq *CardQuery) OnlyX(ctx context.Context) *Card
- func (cq *CardQuery) Order(o ...card.OrderOption) *CardQuery
- func (cq *CardQuery) Select(fields ...string) *CardSelect
- func (cq *CardQuery) Unique(unique bool) *CardQuery
- func (cq *CardQuery) Where(ps ...predicate.Card) *CardQuery
- type CardSelect
- func (cs *CardSelect) Aggregate(fns ...AggregateFunc) *CardSelect
- func (s *CardSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CardSelect) BoolX(ctx context.Context) bool
- func (s *CardSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CardSelect) BoolsX(ctx context.Context) []bool
- func (s *CardSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CardSelect) Float64X(ctx context.Context) float64
- func (s *CardSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CardSelect) Float64sX(ctx context.Context) []float64
- func (s *CardSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CardSelect) IntX(ctx context.Context) int
- func (s *CardSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CardSelect) IntsX(ctx context.Context) []int
- func (cs *CardSelect) Scan(ctx context.Context, v any) error
- func (s *CardSelect) ScanX(ctx context.Context, v any)
- func (s *CardSelect) String(ctx context.Context) (_ string, err error)
- func (s *CardSelect) StringX(ctx context.Context) string
- func (s *CardSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CardSelect) StringsX(ctx context.Context) []string
- type CardUpdate
- func (cu *CardUpdate) AddValue(f float64) *CardUpdate
- func (cu *CardUpdate) Exec(ctx context.Context) error
- func (cu *CardUpdate) ExecX(ctx context.Context)
- func (cu *CardUpdate) Mutation() *CardMutation
- func (cu *CardUpdate) Save(ctx context.Context) (int, error)
- func (cu *CardUpdate) SaveX(ctx context.Context) int
- func (cu *CardUpdate) SetName(s string) *CardUpdate
- func (cu *CardUpdate) SetType(s string) *CardUpdate
- func (cu *CardUpdate) SetUpdatedAt(t time.Time) *CardUpdate
- func (cu *CardUpdate) SetValue(f float64) *CardUpdate
- func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate
- type CardUpdateOne
- func (cuo *CardUpdateOne) AddValue(f float64) *CardUpdateOne
- func (cuo *CardUpdateOne) Exec(ctx context.Context) error
- func (cuo *CardUpdateOne) ExecX(ctx context.Context)
- func (cuo *CardUpdateOne) Mutation() *CardMutation
- func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)
- func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card
- func (cuo *CardUpdateOne) Select(field string, fields ...string) *CardUpdateOne
- func (cuo *CardUpdateOne) SetName(s string) *CardUpdateOne
- func (cuo *CardUpdateOne) SetType(s string) *CardUpdateOne
- func (cuo *CardUpdateOne) SetUpdatedAt(t time.Time) *CardUpdateOne
- func (cuo *CardUpdateOne) SetValue(f float64) *CardUpdateOne
- func (cuo *CardUpdateOne) Where(ps ...predicate.Card) *CardUpdateOne
- type Cards
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type User
- type UserBalance
- type UserBalanceClient
- func (c *UserBalanceClient) Create() *UserBalanceCreate
- func (c *UserBalanceClient) CreateBulk(builders ...*UserBalanceCreate) *UserBalanceCreateBulk
- func (c *UserBalanceClient) Delete() *UserBalanceDelete
- func (c *UserBalanceClient) DeleteOne(ub *UserBalance) *UserBalanceDeleteOne
- func (c *UserBalanceClient) DeleteOneID(id int) *UserBalanceDeleteOne
- func (c *UserBalanceClient) Get(ctx context.Context, id int) (*UserBalance, error)
- func (c *UserBalanceClient) GetX(ctx context.Context, id int) *UserBalance
- func (c *UserBalanceClient) Hooks() []Hook
- func (c *UserBalanceClient) Intercept(interceptors ...Interceptor)
- func (c *UserBalanceClient) Interceptors() []Interceptor
- func (c *UserBalanceClient) MapCreateBulk(slice any, setFunc func(*UserBalanceCreate, int)) *UserBalanceCreateBulk
- func (c *UserBalanceClient) Query() *UserBalanceQuery
- func (c *UserBalanceClient) Update() *UserBalanceUpdate
- func (c *UserBalanceClient) UpdateOne(ub *UserBalance) *UserBalanceUpdateOne
- func (c *UserBalanceClient) UpdateOneID(id int) *UserBalanceUpdateOne
- func (c *UserBalanceClient) Use(hooks ...Hook)
- type UserBalanceCreate
- func (ubc *UserBalanceCreate) Exec(ctx context.Context) error
- func (ubc *UserBalanceCreate) ExecX(ctx context.Context)
- func (ubc *UserBalanceCreate) Mutation() *UserBalanceMutation
- func (ubc *UserBalanceCreate) Save(ctx context.Context) (*UserBalance, error)
- func (ubc *UserBalanceCreate) SaveX(ctx context.Context) *UserBalance
- func (ubc *UserBalanceCreate) SetBalance(f float64) *UserBalanceCreate
- func (ubc *UserBalanceCreate) SetCreatedAt(t time.Time) *UserBalanceCreate
- func (ubc *UserBalanceCreate) SetNillableCreatedAt(t *time.Time) *UserBalanceCreate
- func (ubc *UserBalanceCreate) SetNillableUpdatedAt(t *time.Time) *UserBalanceCreate
- func (ubc *UserBalanceCreate) SetUpdatedAt(t time.Time) *UserBalanceCreate
- func (ubc *UserBalanceCreate) SetUserID(s string) *UserBalanceCreate
- type UserBalanceCreateBulk
- type UserBalanceDelete
- type UserBalanceDeleteOne
- type UserBalanceGroupBy
- func (ubgb *UserBalanceGroupBy) Aggregate(fns ...AggregateFunc) *UserBalanceGroupBy
- func (s *UserBalanceGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserBalanceGroupBy) BoolX(ctx context.Context) bool
- func (s *UserBalanceGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserBalanceGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserBalanceGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserBalanceGroupBy) Float64X(ctx context.Context) float64
- func (s *UserBalanceGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserBalanceGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserBalanceGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserBalanceGroupBy) IntX(ctx context.Context) int
- func (s *UserBalanceGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserBalanceGroupBy) IntsX(ctx context.Context) []int
- func (ubgb *UserBalanceGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserBalanceGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserBalanceGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserBalanceGroupBy) StringX(ctx context.Context) string
- func (s *UserBalanceGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserBalanceGroupBy) StringsX(ctx context.Context) []string
- type UserBalanceMutation
- func (m *UserBalanceMutation) AddBalance(f float64)
- func (m *UserBalanceMutation) AddField(name string, value ent.Value) error
- func (m *UserBalanceMutation) AddedBalance() (r float64, exists bool)
- func (m *UserBalanceMutation) AddedEdges() []string
- func (m *UserBalanceMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserBalanceMutation) AddedFields() []string
- func (m *UserBalanceMutation) AddedIDs(name string) []ent.Value
- func (m *UserBalanceMutation) Balance() (r float64, exists bool)
- func (m *UserBalanceMutation) ClearEdge(name string) error
- func (m *UserBalanceMutation) ClearField(name string) error
- func (m *UserBalanceMutation) ClearedEdges() []string
- func (m *UserBalanceMutation) ClearedFields() []string
- func (m UserBalanceMutation) Client() *Client
- func (m *UserBalanceMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserBalanceMutation) EdgeCleared(name string) bool
- func (m *UserBalanceMutation) Field(name string) (ent.Value, bool)
- func (m *UserBalanceMutation) FieldCleared(name string) bool
- func (m *UserBalanceMutation) Fields() []string
- func (m *UserBalanceMutation) ID() (id int, exists bool)
- func (m *UserBalanceMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserBalanceMutation) OldBalance(ctx context.Context) (v float64, err error)
- func (m *UserBalanceMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserBalanceMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserBalanceMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserBalanceMutation) OldUserID(ctx context.Context) (v string, err error)
- func (m *UserBalanceMutation) Op() Op
- func (m *UserBalanceMutation) RemovedEdges() []string
- func (m *UserBalanceMutation) RemovedIDs(name string) []ent.Value
- func (m *UserBalanceMutation) ResetBalance()
- func (m *UserBalanceMutation) ResetCreatedAt()
- func (m *UserBalanceMutation) ResetEdge(name string) error
- func (m *UserBalanceMutation) ResetField(name string) error
- func (m *UserBalanceMutation) ResetUpdatedAt()
- func (m *UserBalanceMutation) ResetUserID()
- func (m *UserBalanceMutation) SetBalance(f float64)
- func (m *UserBalanceMutation) SetCreatedAt(t time.Time)
- func (m *UserBalanceMutation) SetField(name string, value ent.Value) error
- func (m *UserBalanceMutation) SetOp(op Op)
- func (m *UserBalanceMutation) SetUpdatedAt(t time.Time)
- func (m *UserBalanceMutation) SetUserID(s string)
- func (m UserBalanceMutation) Tx() (*Tx, error)
- func (m *UserBalanceMutation) Type() string
- func (m *UserBalanceMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserBalanceMutation) UserID() (r string, exists bool)
- func (m *UserBalanceMutation) Where(ps ...predicate.UserBalance)
- func (m *UserBalanceMutation) WhereP(ps ...func(*sql.Selector))
- type UserBalanceQuery
- func (ubq *UserBalanceQuery) Aggregate(fns ...AggregateFunc) *UserBalanceSelect
- func (ubq *UserBalanceQuery) All(ctx context.Context) ([]*UserBalance, error)
- func (ubq *UserBalanceQuery) AllX(ctx context.Context) []*UserBalance
- func (ubq *UserBalanceQuery) Clone() *UserBalanceQuery
- func (ubq *UserBalanceQuery) Count(ctx context.Context) (int, error)
- func (ubq *UserBalanceQuery) CountX(ctx context.Context) int
- func (ubq *UserBalanceQuery) Exist(ctx context.Context) (bool, error)
- func (ubq *UserBalanceQuery) ExistX(ctx context.Context) bool
- func (ubq *UserBalanceQuery) First(ctx context.Context) (*UserBalance, error)
- func (ubq *UserBalanceQuery) FirstID(ctx context.Context) (id int, err error)
- func (ubq *UserBalanceQuery) FirstIDX(ctx context.Context) int
- func (ubq *UserBalanceQuery) FirstX(ctx context.Context) *UserBalance
- func (ubq *UserBalanceQuery) GroupBy(field string, fields ...string) *UserBalanceGroupBy
- func (ubq *UserBalanceQuery) IDs(ctx context.Context) (ids []int, err error)
- func (ubq *UserBalanceQuery) IDsX(ctx context.Context) []int
- func (ubq *UserBalanceQuery) Limit(limit int) *UserBalanceQuery
- func (ubq *UserBalanceQuery) Offset(offset int) *UserBalanceQuery
- func (ubq *UserBalanceQuery) Only(ctx context.Context) (*UserBalance, error)
- func (ubq *UserBalanceQuery) OnlyID(ctx context.Context) (id int, err error)
- func (ubq *UserBalanceQuery) OnlyIDX(ctx context.Context) int
- func (ubq *UserBalanceQuery) OnlyX(ctx context.Context) *UserBalance
- func (ubq *UserBalanceQuery) Order(o ...userbalance.OrderOption) *UserBalanceQuery
- func (ubq *UserBalanceQuery) Select(fields ...string) *UserBalanceSelect
- func (ubq *UserBalanceQuery) Unique(unique bool) *UserBalanceQuery
- func (ubq *UserBalanceQuery) Where(ps ...predicate.UserBalance) *UserBalanceQuery
- type UserBalanceSelect
- func (ubs *UserBalanceSelect) Aggregate(fns ...AggregateFunc) *UserBalanceSelect
- func (s *UserBalanceSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserBalanceSelect) BoolX(ctx context.Context) bool
- func (s *UserBalanceSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserBalanceSelect) BoolsX(ctx context.Context) []bool
- func (s *UserBalanceSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserBalanceSelect) Float64X(ctx context.Context) float64
- func (s *UserBalanceSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserBalanceSelect) Float64sX(ctx context.Context) []float64
- func (s *UserBalanceSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserBalanceSelect) IntX(ctx context.Context) int
- func (s *UserBalanceSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserBalanceSelect) IntsX(ctx context.Context) []int
- func (ubs *UserBalanceSelect) Scan(ctx context.Context, v any) error
- func (s *UserBalanceSelect) ScanX(ctx context.Context, v any)
- func (s *UserBalanceSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserBalanceSelect) StringX(ctx context.Context) string
- func (s *UserBalanceSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserBalanceSelect) StringsX(ctx context.Context) []string
- type UserBalanceUpdate
- func (ubu *UserBalanceUpdate) AddBalance(f float64) *UserBalanceUpdate
- func (ubu *UserBalanceUpdate) Exec(ctx context.Context) error
- func (ubu *UserBalanceUpdate) ExecX(ctx context.Context)
- func (ubu *UserBalanceUpdate) Mutation() *UserBalanceMutation
- func (ubu *UserBalanceUpdate) Save(ctx context.Context) (int, error)
- func (ubu *UserBalanceUpdate) SaveX(ctx context.Context) int
- func (ubu *UserBalanceUpdate) SetBalance(f float64) *UserBalanceUpdate
- func (ubu *UserBalanceUpdate) SetUpdatedAt(t time.Time) *UserBalanceUpdate
- func (ubu *UserBalanceUpdate) SetUserID(s string) *UserBalanceUpdate
- func (ubu *UserBalanceUpdate) Where(ps ...predicate.UserBalance) *UserBalanceUpdate
- type UserBalanceUpdateOne
- func (ubuo *UserBalanceUpdateOne) AddBalance(f float64) *UserBalanceUpdateOne
- func (ubuo *UserBalanceUpdateOne) Exec(ctx context.Context) error
- func (ubuo *UserBalanceUpdateOne) ExecX(ctx context.Context)
- func (ubuo *UserBalanceUpdateOne) Mutation() *UserBalanceMutation
- func (ubuo *UserBalanceUpdateOne) Save(ctx context.Context) (*UserBalance, error)
- func (ubuo *UserBalanceUpdateOne) SaveX(ctx context.Context) *UserBalance
- func (ubuo *UserBalanceUpdateOne) Select(field string, fields ...string) *UserBalanceUpdateOne
- func (ubuo *UserBalanceUpdateOne) SetBalance(f float64) *UserBalanceUpdateOne
- func (ubuo *UserBalanceUpdateOne) SetUpdatedAt(t time.Time) *UserBalanceUpdateOne
- func (ubuo *UserBalanceUpdateOne) SetUserID(s string) *UserBalanceUpdateOne
- func (ubuo *UserBalanceUpdateOne) Where(ps ...predicate.UserBalance) *UserBalanceUpdateOne
- type UserBalances
- 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 int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAccount(s string) *UserCreate
- func (uc *UserCreate) SetBirthday(t time.Time) *UserCreate
- func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetFullName(s string) *UserCreate
- func (uc *UserCreate) SetLatestLogin(t time.Time) *UserCreate
- func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
- func (uc *UserCreate) SetPassword(s string) *UserCreate
- func (uc *UserCreate) SetPhoneNumer(s string) *UserCreate
- func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
- func (uc *UserCreate) SetUserID(s string) *UserCreate
- func (uc *UserCreate) SetUserName(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) Account() (r string, exists bool)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- 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) Birthday() (r time.Time, exists bool)
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) FullName() (r string, exists bool)
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) LatestLogin() (r time.Time, exists bool)
- func (m *UserMutation) OldAccount(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldBirthday(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldFullName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldLatestLogin(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPhoneNumer(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldUserID(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldUserName(ctx context.Context) (v *string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Password() (r string, exists bool)
- func (m *UserMutation) PhoneNumer() (r string, exists bool)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetAccount()
- func (m *UserMutation) ResetBirthday()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetFullName()
- func (m *UserMutation) ResetLatestLogin()
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetPhoneNumer()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetUserID()
- func (m *UserMutation) ResetUserName()
- func (m *UserMutation) SetAccount(s string)
- func (m *UserMutation) SetBirthday(t time.Time)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetFullName(s string)
- func (m *UserMutation) SetLatestLogin(t time.Time)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetPassword(s string)
- func (m *UserMutation) SetPhoneNumer(s string)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m *UserMutation) SetUserID(s string)
- func (m *UserMutation) SetUserName(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) UserID() (r string, exists bool)
- func (m *UserMutation) UserName() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- 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 int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAccount(s string) *UserUpdate
- func (uu *UserUpdate) SetBirthday(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetFullName(s string) *UserUpdate
- func (uu *UserUpdate) SetLatestLogin(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetPassword(s string) *UserUpdate
- func (uu *UserUpdate) SetPhoneNumer(s string) *UserUpdate
- func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
- func (uu *UserUpdate) SetUserID(s string) *UserUpdate
- func (uu *UserUpdate) SetUserName(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAccount(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetBirthday(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetFullName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetLatestLogin(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPhoneNumer(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUserID(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type UserVoucher
- type UserVoucherClient
- func (c *UserVoucherClient) Create() *UserVoucherCreate
- func (c *UserVoucherClient) CreateBulk(builders ...*UserVoucherCreate) *UserVoucherCreateBulk
- func (c *UserVoucherClient) Delete() *UserVoucherDelete
- func (c *UserVoucherClient) DeleteOne(uv *UserVoucher) *UserVoucherDeleteOne
- func (c *UserVoucherClient) DeleteOneID(id int) *UserVoucherDeleteOne
- func (c *UserVoucherClient) Get(ctx context.Context, id int) (*UserVoucher, error)
- func (c *UserVoucherClient) GetX(ctx context.Context, id int) *UserVoucher
- func (c *UserVoucherClient) Hooks() []Hook
- func (c *UserVoucherClient) Intercept(interceptors ...Interceptor)
- func (c *UserVoucherClient) Interceptors() []Interceptor
- func (c *UserVoucherClient) MapCreateBulk(slice any, setFunc func(*UserVoucherCreate, int)) *UserVoucherCreateBulk
- func (c *UserVoucherClient) Query() *UserVoucherQuery
- func (c *UserVoucherClient) Update() *UserVoucherUpdate
- func (c *UserVoucherClient) UpdateOne(uv *UserVoucher) *UserVoucherUpdateOne
- func (c *UserVoucherClient) UpdateOneID(id int) *UserVoucherUpdateOne
- func (c *UserVoucherClient) Use(hooks ...Hook)
- type UserVoucherCreate
- func (uvc *UserVoucherCreate) Exec(ctx context.Context) error
- func (uvc *UserVoucherCreate) ExecX(ctx context.Context)
- func (uvc *UserVoucherCreate) Mutation() *UserVoucherMutation
- func (uvc *UserVoucherCreate) Save(ctx context.Context) (*UserVoucher, error)
- func (uvc *UserVoucherCreate) SaveX(ctx context.Context) *UserVoucher
- func (uvc *UserVoucherCreate) SetCreatedAt(t time.Time) *UserVoucherCreate
- func (uvc *UserVoucherCreate) SetNillableCreatedAt(t *time.Time) *UserVoucherCreate
- func (uvc *UserVoucherCreate) SetNillableUpdatedAt(t *time.Time) *UserVoucherCreate
- func (uvc *UserVoucherCreate) SetUpdatedAt(t time.Time) *UserVoucherCreate
- func (uvc *UserVoucherCreate) SetUserID(s string) *UserVoucherCreate
- func (uvc *UserVoucherCreate) SetVoucherCampaignID(i int64) *UserVoucherCreate
- type UserVoucherCreateBulk
- type UserVoucherDelete
- type UserVoucherDeleteOne
- type UserVoucherGroupBy
- func (uvgb *UserVoucherGroupBy) Aggregate(fns ...AggregateFunc) *UserVoucherGroupBy
- func (s *UserVoucherGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserVoucherGroupBy) BoolX(ctx context.Context) bool
- func (s *UserVoucherGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserVoucherGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserVoucherGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserVoucherGroupBy) Float64X(ctx context.Context) float64
- func (s *UserVoucherGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserVoucherGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserVoucherGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserVoucherGroupBy) IntX(ctx context.Context) int
- func (s *UserVoucherGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserVoucherGroupBy) IntsX(ctx context.Context) []int
- func (uvgb *UserVoucherGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserVoucherGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserVoucherGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserVoucherGroupBy) StringX(ctx context.Context) string
- func (s *UserVoucherGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserVoucherGroupBy) StringsX(ctx context.Context) []string
- type UserVoucherMutation
- func (m *UserVoucherMutation) AddField(name string, value ent.Value) error
- func (m *UserVoucherMutation) AddVoucherCampaignID(i int64)
- func (m *UserVoucherMutation) AddedEdges() []string
- func (m *UserVoucherMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserVoucherMutation) AddedFields() []string
- func (m *UserVoucherMutation) AddedIDs(name string) []ent.Value
- func (m *UserVoucherMutation) AddedVoucherCampaignID() (r int64, exists bool)
- func (m *UserVoucherMutation) ClearEdge(name string) error
- func (m *UserVoucherMutation) ClearField(name string) error
- func (m *UserVoucherMutation) ClearedEdges() []string
- func (m *UserVoucherMutation) ClearedFields() []string
- func (m UserVoucherMutation) Client() *Client
- func (m *UserVoucherMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserVoucherMutation) EdgeCleared(name string) bool
- func (m *UserVoucherMutation) Field(name string) (ent.Value, bool)
- func (m *UserVoucherMutation) FieldCleared(name string) bool
- func (m *UserVoucherMutation) Fields() []string
- func (m *UserVoucherMutation) ID() (id int, exists bool)
- func (m *UserVoucherMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserVoucherMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserVoucherMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserVoucherMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserVoucherMutation) OldUserID(ctx context.Context) (v string, err error)
- func (m *UserVoucherMutation) OldVoucherCampaignID(ctx context.Context) (v int64, err error)
- func (m *UserVoucherMutation) Op() Op
- func (m *UserVoucherMutation) RemovedEdges() []string
- func (m *UserVoucherMutation) RemovedIDs(name string) []ent.Value
- func (m *UserVoucherMutation) ResetCreatedAt()
- func (m *UserVoucherMutation) ResetEdge(name string) error
- func (m *UserVoucherMutation) ResetField(name string) error
- func (m *UserVoucherMutation) ResetUpdatedAt()
- func (m *UserVoucherMutation) ResetUserID()
- func (m *UserVoucherMutation) ResetVoucherCampaignID()
- func (m *UserVoucherMutation) SetCreatedAt(t time.Time)
- func (m *UserVoucherMutation) SetField(name string, value ent.Value) error
- func (m *UserVoucherMutation) SetOp(op Op)
- func (m *UserVoucherMutation) SetUpdatedAt(t time.Time)
- func (m *UserVoucherMutation) SetUserID(s string)
- func (m *UserVoucherMutation) SetVoucherCampaignID(i int64)
- func (m UserVoucherMutation) Tx() (*Tx, error)
- func (m *UserVoucherMutation) Type() string
- func (m *UserVoucherMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserVoucherMutation) UserID() (r string, exists bool)
- func (m *UserVoucherMutation) VoucherCampaignID() (r int64, exists bool)
- func (m *UserVoucherMutation) Where(ps ...predicate.UserVoucher)
- func (m *UserVoucherMutation) WhereP(ps ...func(*sql.Selector))
- type UserVoucherQuery
- func (uvq *UserVoucherQuery) Aggregate(fns ...AggregateFunc) *UserVoucherSelect
- func (uvq *UserVoucherQuery) All(ctx context.Context) ([]*UserVoucher, error)
- func (uvq *UserVoucherQuery) AllX(ctx context.Context) []*UserVoucher
- func (uvq *UserVoucherQuery) Clone() *UserVoucherQuery
- func (uvq *UserVoucherQuery) Count(ctx context.Context) (int, error)
- func (uvq *UserVoucherQuery) CountX(ctx context.Context) int
- func (uvq *UserVoucherQuery) Exist(ctx context.Context) (bool, error)
- func (uvq *UserVoucherQuery) ExistX(ctx context.Context) bool
- func (uvq *UserVoucherQuery) First(ctx context.Context) (*UserVoucher, error)
- func (uvq *UserVoucherQuery) FirstID(ctx context.Context) (id int, err error)
- func (uvq *UserVoucherQuery) FirstIDX(ctx context.Context) int
- func (uvq *UserVoucherQuery) FirstX(ctx context.Context) *UserVoucher
- func (uvq *UserVoucherQuery) GroupBy(field string, fields ...string) *UserVoucherGroupBy
- func (uvq *UserVoucherQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uvq *UserVoucherQuery) IDsX(ctx context.Context) []int
- func (uvq *UserVoucherQuery) Limit(limit int) *UserVoucherQuery
- func (uvq *UserVoucherQuery) Offset(offset int) *UserVoucherQuery
- func (uvq *UserVoucherQuery) Only(ctx context.Context) (*UserVoucher, error)
- func (uvq *UserVoucherQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uvq *UserVoucherQuery) OnlyIDX(ctx context.Context) int
- func (uvq *UserVoucherQuery) OnlyX(ctx context.Context) *UserVoucher
- func (uvq *UserVoucherQuery) Order(o ...uservoucher.OrderOption) *UserVoucherQuery
- func (uvq *UserVoucherQuery) Select(fields ...string) *UserVoucherSelect
- func (uvq *UserVoucherQuery) Unique(unique bool) *UserVoucherQuery
- func (uvq *UserVoucherQuery) Where(ps ...predicate.UserVoucher) *UserVoucherQuery
- type UserVoucherSelect
- func (uvs *UserVoucherSelect) Aggregate(fns ...AggregateFunc) *UserVoucherSelect
- func (s *UserVoucherSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserVoucherSelect) BoolX(ctx context.Context) bool
- func (s *UserVoucherSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserVoucherSelect) BoolsX(ctx context.Context) []bool
- func (s *UserVoucherSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserVoucherSelect) Float64X(ctx context.Context) float64
- func (s *UserVoucherSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserVoucherSelect) Float64sX(ctx context.Context) []float64
- func (s *UserVoucherSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserVoucherSelect) IntX(ctx context.Context) int
- func (s *UserVoucherSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserVoucherSelect) IntsX(ctx context.Context) []int
- func (uvs *UserVoucherSelect) Scan(ctx context.Context, v any) error
- func (s *UserVoucherSelect) ScanX(ctx context.Context, v any)
- func (s *UserVoucherSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserVoucherSelect) StringX(ctx context.Context) string
- func (s *UserVoucherSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserVoucherSelect) StringsX(ctx context.Context) []string
- type UserVoucherUpdate
- func (uvu *UserVoucherUpdate) AddVoucherCampaignID(i int64) *UserVoucherUpdate
- func (uvu *UserVoucherUpdate) Exec(ctx context.Context) error
- func (uvu *UserVoucherUpdate) ExecX(ctx context.Context)
- func (uvu *UserVoucherUpdate) Mutation() *UserVoucherMutation
- func (uvu *UserVoucherUpdate) Save(ctx context.Context) (int, error)
- func (uvu *UserVoucherUpdate) SaveX(ctx context.Context) int
- func (uvu *UserVoucherUpdate) SetUpdatedAt(t time.Time) *UserVoucherUpdate
- func (uvu *UserVoucherUpdate) SetUserID(s string) *UserVoucherUpdate
- func (uvu *UserVoucherUpdate) SetVoucherCampaignID(i int64) *UserVoucherUpdate
- func (uvu *UserVoucherUpdate) Where(ps ...predicate.UserVoucher) *UserVoucherUpdate
- type UserVoucherUpdateOne
- func (uvuo *UserVoucherUpdateOne) AddVoucherCampaignID(i int64) *UserVoucherUpdateOne
- func (uvuo *UserVoucherUpdateOne) Exec(ctx context.Context) error
- func (uvuo *UserVoucherUpdateOne) ExecX(ctx context.Context)
- func (uvuo *UserVoucherUpdateOne) Mutation() *UserVoucherMutation
- func (uvuo *UserVoucherUpdateOne) Save(ctx context.Context) (*UserVoucher, error)
- func (uvuo *UserVoucherUpdateOne) SaveX(ctx context.Context) *UserVoucher
- func (uvuo *UserVoucherUpdateOne) Select(field string, fields ...string) *UserVoucherUpdateOne
- func (uvuo *UserVoucherUpdateOne) SetUpdatedAt(t time.Time) *UserVoucherUpdateOne
- func (uvuo *UserVoucherUpdateOne) SetUserID(s string) *UserVoucherUpdateOne
- func (uvuo *UserVoucherUpdateOne) SetVoucherCampaignID(i int64) *UserVoucherUpdateOne
- func (uvuo *UserVoucherUpdateOne) Where(ps ...predicate.UserVoucher) *UserVoucherUpdateOne
- type UserVouchers
- type Users
- type ValidationError
- type Value
- type Voucher
- type VoucherCampaign
- type VoucherCampaignClient
- func (c *VoucherCampaignClient) Create() *VoucherCampaignCreate
- func (c *VoucherCampaignClient) CreateBulk(builders ...*VoucherCampaignCreate) *VoucherCampaignCreateBulk
- func (c *VoucherCampaignClient) Delete() *VoucherCampaignDelete
- func (c *VoucherCampaignClient) DeleteOne(vc *VoucherCampaign) *VoucherCampaignDeleteOne
- func (c *VoucherCampaignClient) DeleteOneID(id int) *VoucherCampaignDeleteOne
- func (c *VoucherCampaignClient) Get(ctx context.Context, id int) (*VoucherCampaign, error)
- func (c *VoucherCampaignClient) GetX(ctx context.Context, id int) *VoucherCampaign
- func (c *VoucherCampaignClient) Hooks() []Hook
- func (c *VoucherCampaignClient) Intercept(interceptors ...Interceptor)
- func (c *VoucherCampaignClient) Interceptors() []Interceptor
- func (c *VoucherCampaignClient) MapCreateBulk(slice any, setFunc func(*VoucherCampaignCreate, int)) *VoucherCampaignCreateBulk
- func (c *VoucherCampaignClient) Query() *VoucherCampaignQuery
- func (c *VoucherCampaignClient) Update() *VoucherCampaignUpdate
- func (c *VoucherCampaignClient) UpdateOne(vc *VoucherCampaign) *VoucherCampaignUpdateOne
- func (c *VoucherCampaignClient) UpdateOneID(id int) *VoucherCampaignUpdateOne
- func (c *VoucherCampaignClient) Use(hooks ...Hook)
- type VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) Exec(ctx context.Context) error
- func (vcc *VoucherCampaignCreate) ExecX(ctx context.Context)
- func (vcc *VoucherCampaignCreate) Mutation() *VoucherCampaignMutation
- func (vcc *VoucherCampaignCreate) Save(ctx context.Context) (*VoucherCampaign, error)
- func (vcc *VoucherCampaignCreate) SaveX(ctx context.Context) *VoucherCampaign
- func (vcc *VoucherCampaignCreate) SetCampaignID(i int64) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetCreatedAt(t time.Time) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetNillableCreatedAt(t *time.Time) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetNillableUpdatedAt(t *time.Time) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetStartDay(t time.Time) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetUpdatedAt(t time.Time) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetValidTo(t time.Time) *VoucherCampaignCreate
- func (vcc *VoucherCampaignCreate) SetVoucherID(i int64) *VoucherCampaignCreate
- type VoucherCampaignCreateBulk
- func (vccb *VoucherCampaignCreateBulk) Exec(ctx context.Context) error
- func (vccb *VoucherCampaignCreateBulk) ExecX(ctx context.Context)
- func (vccb *VoucherCampaignCreateBulk) Save(ctx context.Context) ([]*VoucherCampaign, error)
- func (vccb *VoucherCampaignCreateBulk) SaveX(ctx context.Context) []*VoucherCampaign
- type VoucherCampaignDelete
- type VoucherCampaignDeleteOne
- type VoucherCampaignGroupBy
- func (vcgb *VoucherCampaignGroupBy) Aggregate(fns ...AggregateFunc) *VoucherCampaignGroupBy
- func (s *VoucherCampaignGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoucherCampaignGroupBy) BoolX(ctx context.Context) bool
- func (s *VoucherCampaignGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VoucherCampaignGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VoucherCampaignGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoucherCampaignGroupBy) Float64X(ctx context.Context) float64
- func (s *VoucherCampaignGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoucherCampaignGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VoucherCampaignGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VoucherCampaignGroupBy) IntX(ctx context.Context) int
- func (s *VoucherCampaignGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VoucherCampaignGroupBy) IntsX(ctx context.Context) []int
- func (vcgb *VoucherCampaignGroupBy) Scan(ctx context.Context, v any) error
- func (s *VoucherCampaignGroupBy) ScanX(ctx context.Context, v any)
- func (s *VoucherCampaignGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VoucherCampaignGroupBy) StringX(ctx context.Context) string
- func (s *VoucherCampaignGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VoucherCampaignGroupBy) StringsX(ctx context.Context) []string
- type VoucherCampaignMutation
- func (m *VoucherCampaignMutation) AddCampaignID(i int64)
- func (m *VoucherCampaignMutation) AddField(name string, value ent.Value) error
- func (m *VoucherCampaignMutation) AddVoucherID(i int64)
- func (m *VoucherCampaignMutation) AddedCampaignID() (r int64, exists bool)
- func (m *VoucherCampaignMutation) AddedEdges() []string
- func (m *VoucherCampaignMutation) AddedField(name string) (ent.Value, bool)
- func (m *VoucherCampaignMutation) AddedFields() []string
- func (m *VoucherCampaignMutation) AddedIDs(name string) []ent.Value
- func (m *VoucherCampaignMutation) AddedVoucherID() (r int64, exists bool)
- func (m *VoucherCampaignMutation) CampaignID() (r int64, exists bool)
- func (m *VoucherCampaignMutation) ClearEdge(name string) error
- func (m *VoucherCampaignMutation) ClearField(name string) error
- func (m *VoucherCampaignMutation) ClearedEdges() []string
- func (m *VoucherCampaignMutation) ClearedFields() []string
- func (m VoucherCampaignMutation) Client() *Client
- func (m *VoucherCampaignMutation) CreatedAt() (r time.Time, exists bool)
- func (m *VoucherCampaignMutation) EdgeCleared(name string) bool
- func (m *VoucherCampaignMutation) Field(name string) (ent.Value, bool)
- func (m *VoucherCampaignMutation) FieldCleared(name string) bool
- func (m *VoucherCampaignMutation) Fields() []string
- func (m *VoucherCampaignMutation) ID() (id int, exists bool)
- func (m *VoucherCampaignMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VoucherCampaignMutation) OldCampaignID(ctx context.Context) (v int64, err error)
- func (m *VoucherCampaignMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VoucherCampaignMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VoucherCampaignMutation) OldStartDay(ctx context.Context) (v time.Time, err error)
- func (m *VoucherCampaignMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VoucherCampaignMutation) OldValidTo(ctx context.Context) (v time.Time, err error)
- func (m *VoucherCampaignMutation) OldVoucherID(ctx context.Context) (v int64, err error)
- func (m *VoucherCampaignMutation) Op() Op
- func (m *VoucherCampaignMutation) RemovedEdges() []string
- func (m *VoucherCampaignMutation) RemovedIDs(name string) []ent.Value
- func (m *VoucherCampaignMutation) ResetCampaignID()
- func (m *VoucherCampaignMutation) ResetCreatedAt()
- func (m *VoucherCampaignMutation) ResetEdge(name string) error
- func (m *VoucherCampaignMutation) ResetField(name string) error
- func (m *VoucherCampaignMutation) ResetStartDay()
- func (m *VoucherCampaignMutation) ResetUpdatedAt()
- func (m *VoucherCampaignMutation) ResetValidTo()
- func (m *VoucherCampaignMutation) ResetVoucherID()
- func (m *VoucherCampaignMutation) SetCampaignID(i int64)
- func (m *VoucherCampaignMutation) SetCreatedAt(t time.Time)
- func (m *VoucherCampaignMutation) SetField(name string, value ent.Value) error
- func (m *VoucherCampaignMutation) SetOp(op Op)
- func (m *VoucherCampaignMutation) SetStartDay(t time.Time)
- func (m *VoucherCampaignMutation) SetUpdatedAt(t time.Time)
- func (m *VoucherCampaignMutation) SetValidTo(t time.Time)
- func (m *VoucherCampaignMutation) SetVoucherID(i int64)
- func (m *VoucherCampaignMutation) StartDay() (r time.Time, exists bool)
- func (m VoucherCampaignMutation) Tx() (*Tx, error)
- func (m *VoucherCampaignMutation) Type() string
- func (m *VoucherCampaignMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *VoucherCampaignMutation) ValidTo() (r time.Time, exists bool)
- func (m *VoucherCampaignMutation) VoucherID() (r int64, exists bool)
- func (m *VoucherCampaignMutation) Where(ps ...predicate.VoucherCampaign)
- func (m *VoucherCampaignMutation) WhereP(ps ...func(*sql.Selector))
- type VoucherCampaignQuery
- func (vcq *VoucherCampaignQuery) Aggregate(fns ...AggregateFunc) *VoucherCampaignSelect
- func (vcq *VoucherCampaignQuery) All(ctx context.Context) ([]*VoucherCampaign, error)
- func (vcq *VoucherCampaignQuery) AllX(ctx context.Context) []*VoucherCampaign
- func (vcq *VoucherCampaignQuery) Clone() *VoucherCampaignQuery
- func (vcq *VoucherCampaignQuery) Count(ctx context.Context) (int, error)
- func (vcq *VoucherCampaignQuery) CountX(ctx context.Context) int
- func (vcq *VoucherCampaignQuery) Exist(ctx context.Context) (bool, error)
- func (vcq *VoucherCampaignQuery) ExistX(ctx context.Context) bool
- func (vcq *VoucherCampaignQuery) First(ctx context.Context) (*VoucherCampaign, error)
- func (vcq *VoucherCampaignQuery) FirstID(ctx context.Context) (id int, err error)
- func (vcq *VoucherCampaignQuery) FirstIDX(ctx context.Context) int
- func (vcq *VoucherCampaignQuery) FirstX(ctx context.Context) *VoucherCampaign
- func (vcq *VoucherCampaignQuery) GroupBy(field string, fields ...string) *VoucherCampaignGroupBy
- func (vcq *VoucherCampaignQuery) IDs(ctx context.Context) (ids []int, err error)
- func (vcq *VoucherCampaignQuery) IDsX(ctx context.Context) []int
- func (vcq *VoucherCampaignQuery) Limit(limit int) *VoucherCampaignQuery
- func (vcq *VoucherCampaignQuery) Offset(offset int) *VoucherCampaignQuery
- func (vcq *VoucherCampaignQuery) Only(ctx context.Context) (*VoucherCampaign, error)
- func (vcq *VoucherCampaignQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vcq *VoucherCampaignQuery) OnlyIDX(ctx context.Context) int
- func (vcq *VoucherCampaignQuery) OnlyX(ctx context.Context) *VoucherCampaign
- func (vcq *VoucherCampaignQuery) Order(o ...vouchercampaign.OrderOption) *VoucherCampaignQuery
- func (vcq *VoucherCampaignQuery) Select(fields ...string) *VoucherCampaignSelect
- func (vcq *VoucherCampaignQuery) Unique(unique bool) *VoucherCampaignQuery
- func (vcq *VoucherCampaignQuery) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignQuery
- type VoucherCampaignSelect
- func (vcs *VoucherCampaignSelect) Aggregate(fns ...AggregateFunc) *VoucherCampaignSelect
- func (s *VoucherCampaignSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoucherCampaignSelect) BoolX(ctx context.Context) bool
- func (s *VoucherCampaignSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VoucherCampaignSelect) BoolsX(ctx context.Context) []bool
- func (s *VoucherCampaignSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoucherCampaignSelect) Float64X(ctx context.Context) float64
- func (s *VoucherCampaignSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoucherCampaignSelect) Float64sX(ctx context.Context) []float64
- func (s *VoucherCampaignSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VoucherCampaignSelect) IntX(ctx context.Context) int
- func (s *VoucherCampaignSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VoucherCampaignSelect) IntsX(ctx context.Context) []int
- func (vcs *VoucherCampaignSelect) Scan(ctx context.Context, v any) error
- func (s *VoucherCampaignSelect) ScanX(ctx context.Context, v any)
- func (s *VoucherCampaignSelect) String(ctx context.Context) (_ string, err error)
- func (s *VoucherCampaignSelect) StringX(ctx context.Context) string
- func (s *VoucherCampaignSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VoucherCampaignSelect) StringsX(ctx context.Context) []string
- type VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) AddCampaignID(i int64) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) AddVoucherID(i int64) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) Exec(ctx context.Context) error
- func (vcu *VoucherCampaignUpdate) ExecX(ctx context.Context)
- func (vcu *VoucherCampaignUpdate) Mutation() *VoucherCampaignMutation
- func (vcu *VoucherCampaignUpdate) Save(ctx context.Context) (int, error)
- func (vcu *VoucherCampaignUpdate) SaveX(ctx context.Context) int
- func (vcu *VoucherCampaignUpdate) SetCampaignID(i int64) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) SetStartDay(t time.Time) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) SetUpdatedAt(t time.Time) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) SetValidTo(t time.Time) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) SetVoucherID(i int64) *VoucherCampaignUpdate
- func (vcu *VoucherCampaignUpdate) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignUpdate
- type VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) AddCampaignID(i int64) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) AddVoucherID(i int64) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) Exec(ctx context.Context) error
- func (vcuo *VoucherCampaignUpdateOne) ExecX(ctx context.Context)
- func (vcuo *VoucherCampaignUpdateOne) Mutation() *VoucherCampaignMutation
- func (vcuo *VoucherCampaignUpdateOne) Save(ctx context.Context) (*VoucherCampaign, error)
- func (vcuo *VoucherCampaignUpdateOne) SaveX(ctx context.Context) *VoucherCampaign
- func (vcuo *VoucherCampaignUpdateOne) Select(field string, fields ...string) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) SetCampaignID(i int64) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) SetStartDay(t time.Time) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) SetUpdatedAt(t time.Time) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) SetValidTo(t time.Time) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) SetVoucherID(i int64) *VoucherCampaignUpdateOne
- func (vcuo *VoucherCampaignUpdateOne) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignUpdateOne
- type VoucherCampaigns
- type VoucherClient
- func (c *VoucherClient) Create() *VoucherCreate
- func (c *VoucherClient) CreateBulk(builders ...*VoucherCreate) *VoucherCreateBulk
- func (c *VoucherClient) Delete() *VoucherDelete
- func (c *VoucherClient) DeleteOne(v *Voucher) *VoucherDeleteOne
- func (c *VoucherClient) DeleteOneID(id int) *VoucherDeleteOne
- func (c *VoucherClient) Get(ctx context.Context, id int) (*Voucher, error)
- func (c *VoucherClient) GetX(ctx context.Context, id int) *Voucher
- func (c *VoucherClient) Hooks() []Hook
- func (c *VoucherClient) Intercept(interceptors ...Interceptor)
- func (c *VoucherClient) Interceptors() []Interceptor
- func (c *VoucherClient) MapCreateBulk(slice any, setFunc func(*VoucherCreate, int)) *VoucherCreateBulk
- func (c *VoucherClient) Query() *VoucherQuery
- func (c *VoucherClient) Update() *VoucherUpdate
- func (c *VoucherClient) UpdateOne(v *Voucher) *VoucherUpdateOne
- func (c *VoucherClient) UpdateOneID(id int) *VoucherUpdateOne
- func (c *VoucherClient) Use(hooks ...Hook)
- type VoucherCreate
- func (vc *VoucherCreate) Exec(ctx context.Context) error
- func (vc *VoucherCreate) ExecX(ctx context.Context)
- func (vc *VoucherCreate) Mutation() *VoucherMutation
- func (vc *VoucherCreate) Save(ctx context.Context) (*Voucher, error)
- func (vc *VoucherCreate) SaveX(ctx context.Context) *Voucher
- func (vc *VoucherCreate) SetCreatedAt(t time.Time) *VoucherCreate
- func (vc *VoucherCreate) SetName(s string) *VoucherCreate
- func (vc *VoucherCreate) SetNillableCreatedAt(t *time.Time) *VoucherCreate
- func (vc *VoucherCreate) SetNillableUpdatedAt(t *time.Time) *VoucherCreate
- func (vc *VoucherCreate) SetType(s string) *VoucherCreate
- func (vc *VoucherCreate) SetUpdatedAt(t time.Time) *VoucherCreate
- func (vc *VoucherCreate) SetValue(f float64) *VoucherCreate
- type VoucherCreateBulk
- type VoucherDelete
- type VoucherDeleteOne
- type VoucherGroupBy
- func (vgb *VoucherGroupBy) Aggregate(fns ...AggregateFunc) *VoucherGroupBy
- func (s *VoucherGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoucherGroupBy) BoolX(ctx context.Context) bool
- func (s *VoucherGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VoucherGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VoucherGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoucherGroupBy) Float64X(ctx context.Context) float64
- func (s *VoucherGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoucherGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VoucherGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VoucherGroupBy) IntX(ctx context.Context) int
- func (s *VoucherGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VoucherGroupBy) IntsX(ctx context.Context) []int
- func (vgb *VoucherGroupBy) Scan(ctx context.Context, v any) error
- func (s *VoucherGroupBy) ScanX(ctx context.Context, v any)
- func (s *VoucherGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VoucherGroupBy) StringX(ctx context.Context) string
- func (s *VoucherGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VoucherGroupBy) StringsX(ctx context.Context) []string
- type VoucherMutation
- func (m *VoucherMutation) AddField(name string, value ent.Value) error
- func (m *VoucherMutation) AddValue(f float64)
- func (m *VoucherMutation) AddedEdges() []string
- func (m *VoucherMutation) AddedField(name string) (ent.Value, bool)
- func (m *VoucherMutation) AddedFields() []string
- func (m *VoucherMutation) AddedIDs(name string) []ent.Value
- func (m *VoucherMutation) AddedValue() (r float64, exists bool)
- func (m *VoucherMutation) ClearEdge(name string) error
- func (m *VoucherMutation) ClearField(name string) error
- func (m *VoucherMutation) ClearedEdges() []string
- func (m *VoucherMutation) ClearedFields() []string
- func (m VoucherMutation) Client() *Client
- func (m *VoucherMutation) CreatedAt() (r time.Time, exists bool)
- func (m *VoucherMutation) EdgeCleared(name string) bool
- func (m *VoucherMutation) Field(name string) (ent.Value, bool)
- func (m *VoucherMutation) FieldCleared(name string) bool
- func (m *VoucherMutation) Fields() []string
- func (m *VoucherMutation) GetType() (r string, exists bool)
- func (m *VoucherMutation) ID() (id int, exists bool)
- func (m *VoucherMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VoucherMutation) Name() (r string, exists bool)
- func (m *VoucherMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VoucherMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VoucherMutation) OldName(ctx context.Context) (v string, err error)
- func (m *VoucherMutation) OldType(ctx context.Context) (v string, err error)
- func (m *VoucherMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VoucherMutation) OldValue(ctx context.Context) (v float64, err error)
- func (m *VoucherMutation) Op() Op
- func (m *VoucherMutation) RemovedEdges() []string
- func (m *VoucherMutation) RemovedIDs(name string) []ent.Value
- func (m *VoucherMutation) ResetCreatedAt()
- func (m *VoucherMutation) ResetEdge(name string) error
- func (m *VoucherMutation) ResetField(name string) error
- func (m *VoucherMutation) ResetName()
- func (m *VoucherMutation) ResetType()
- func (m *VoucherMutation) ResetUpdatedAt()
- func (m *VoucherMutation) ResetValue()
- func (m *VoucherMutation) SetCreatedAt(t time.Time)
- func (m *VoucherMutation) SetField(name string, value ent.Value) error
- func (m *VoucherMutation) SetName(s string)
- func (m *VoucherMutation) SetOp(op Op)
- func (m *VoucherMutation) SetType(s string)
- func (m *VoucherMutation) SetUpdatedAt(t time.Time)
- func (m *VoucherMutation) SetValue(f float64)
- func (m VoucherMutation) Tx() (*Tx, error)
- func (m *VoucherMutation) Type() string
- func (m *VoucherMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *VoucherMutation) Value() (r float64, exists bool)
- func (m *VoucherMutation) Where(ps ...predicate.Voucher)
- func (m *VoucherMutation) WhereP(ps ...func(*sql.Selector))
- type VoucherQuery
- func (vq *VoucherQuery) Aggregate(fns ...AggregateFunc) *VoucherSelect
- func (vq *VoucherQuery) All(ctx context.Context) ([]*Voucher, error)
- func (vq *VoucherQuery) AllX(ctx context.Context) []*Voucher
- func (vq *VoucherQuery) Clone() *VoucherQuery
- func (vq *VoucherQuery) Count(ctx context.Context) (int, error)
- func (vq *VoucherQuery) CountX(ctx context.Context) int
- func (vq *VoucherQuery) Exist(ctx context.Context) (bool, error)
- func (vq *VoucherQuery) ExistX(ctx context.Context) bool
- func (vq *VoucherQuery) First(ctx context.Context) (*Voucher, error)
- func (vq *VoucherQuery) FirstID(ctx context.Context) (id int, err error)
- func (vq *VoucherQuery) FirstIDX(ctx context.Context) int
- func (vq *VoucherQuery) FirstX(ctx context.Context) *Voucher
- func (vq *VoucherQuery) GroupBy(field string, fields ...string) *VoucherGroupBy
- func (vq *VoucherQuery) IDs(ctx context.Context) (ids []int, err error)
- func (vq *VoucherQuery) IDsX(ctx context.Context) []int
- func (vq *VoucherQuery) Limit(limit int) *VoucherQuery
- func (vq *VoucherQuery) Offset(offset int) *VoucherQuery
- func (vq *VoucherQuery) Only(ctx context.Context) (*Voucher, error)
- func (vq *VoucherQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vq *VoucherQuery) OnlyIDX(ctx context.Context) int
- func (vq *VoucherQuery) OnlyX(ctx context.Context) *Voucher
- func (vq *VoucherQuery) Order(o ...voucher.OrderOption) *VoucherQuery
- func (vq *VoucherQuery) Select(fields ...string) *VoucherSelect
- func (vq *VoucherQuery) Unique(unique bool) *VoucherQuery
- func (vq *VoucherQuery) Where(ps ...predicate.Voucher) *VoucherQuery
- type VoucherSelect
- func (vs *VoucherSelect) Aggregate(fns ...AggregateFunc) *VoucherSelect
- func (s *VoucherSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VoucherSelect) BoolX(ctx context.Context) bool
- func (s *VoucherSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VoucherSelect) BoolsX(ctx context.Context) []bool
- func (s *VoucherSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VoucherSelect) Float64X(ctx context.Context) float64
- func (s *VoucherSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VoucherSelect) Float64sX(ctx context.Context) []float64
- func (s *VoucherSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VoucherSelect) IntX(ctx context.Context) int
- func (s *VoucherSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VoucherSelect) IntsX(ctx context.Context) []int
- func (vs *VoucherSelect) Scan(ctx context.Context, v any) error
- func (s *VoucherSelect) ScanX(ctx context.Context, v any)
- func (s *VoucherSelect) String(ctx context.Context) (_ string, err error)
- func (s *VoucherSelect) StringX(ctx context.Context) string
- func (s *VoucherSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VoucherSelect) StringsX(ctx context.Context) []string
- type VoucherUpdate
- func (vu *VoucherUpdate) AddValue(f float64) *VoucherUpdate
- func (vu *VoucherUpdate) Exec(ctx context.Context) error
- func (vu *VoucherUpdate) ExecX(ctx context.Context)
- func (vu *VoucherUpdate) Mutation() *VoucherMutation
- func (vu *VoucherUpdate) Save(ctx context.Context) (int, error)
- func (vu *VoucherUpdate) SaveX(ctx context.Context) int
- func (vu *VoucherUpdate) SetName(s string) *VoucherUpdate
- func (vu *VoucherUpdate) SetType(s string) *VoucherUpdate
- func (vu *VoucherUpdate) SetUpdatedAt(t time.Time) *VoucherUpdate
- func (vu *VoucherUpdate) SetValue(f float64) *VoucherUpdate
- func (vu *VoucherUpdate) Where(ps ...predicate.Voucher) *VoucherUpdate
- type VoucherUpdateOne
- func (vuo *VoucherUpdateOne) AddValue(f float64) *VoucherUpdateOne
- func (vuo *VoucherUpdateOne) Exec(ctx context.Context) error
- func (vuo *VoucherUpdateOne) ExecX(ctx context.Context)
- func (vuo *VoucherUpdateOne) Mutation() *VoucherMutation
- func (vuo *VoucherUpdateOne) Save(ctx context.Context) (*Voucher, error)
- func (vuo *VoucherUpdateOne) SaveX(ctx context.Context) *Voucher
- func (vuo *VoucherUpdateOne) Select(field string, fields ...string) *VoucherUpdateOne
- func (vuo *VoucherUpdateOne) SetName(s string) *VoucherUpdateOne
- func (vuo *VoucherUpdateOne) SetType(s string) *VoucherUpdateOne
- func (vuo *VoucherUpdateOne) SetUpdatedAt(t time.Time) *VoucherUpdateOne
- func (vuo *VoucherUpdateOne) SetValue(f float64) *VoucherUpdateOne
- func (vuo *VoucherUpdateOne) Where(ps ...predicate.Voucher) *VoucherUpdateOne
- type Vouchers
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCampaign = "Campaign" TypeCard = "Card" TypeUser = "User" TypeUserBalance = "UserBalance" TypeUserVoucher = "UserVoucher" TypeVoucher = "Voucher" TypeVoucherCampaign = "VoucherCampaign" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Campaign ¶
type Campaign struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // CurrentSlot holds the value of the "current_slot" field. CurrentSlot int64 `json:"current_slot,omitempty"` // StartDay holds the value of the "start_day" field. StartDay time.Time `json:"start_day,omitempty"` // EndDay holds the value of the "end_day" field. EndDay time.Time `json:"end_day,omitempty"` // TotalSlot holds the value of the "total_slot" field. TotalSlot int64 `json:"total_slot,omitempty"` // IsFull holds the value of the "is_full" field. IsFull bool `json:"is_full,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
Campaign is the model entity for the Campaign schema.
func (*Campaign) Unwrap ¶
Unwrap unwraps the Campaign 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 (*Campaign) Update ¶
func (c *Campaign) Update() *CampaignUpdateOne
Update returns a builder for updating this Campaign. Note that you need to call Campaign.Unwrap() before calling this method if this Campaign was returned from a transaction, and the transaction was committed or rolled back.
type CampaignClient ¶
type CampaignClient struct {
// contains filtered or unexported fields
}
CampaignClient is a client for the Campaign schema.
func NewCampaignClient ¶
func NewCampaignClient(c config) *CampaignClient
NewCampaignClient returns a client for the Campaign from the given config.
func (*CampaignClient) Create ¶
func (c *CampaignClient) Create() *CampaignCreate
Create returns a builder for creating a Campaign entity.
func (*CampaignClient) CreateBulk ¶
func (c *CampaignClient) CreateBulk(builders ...*CampaignCreate) *CampaignCreateBulk
CreateBulk returns a builder for creating a bulk of Campaign entities.
func (*CampaignClient) Delete ¶
func (c *CampaignClient) Delete() *CampaignDelete
Delete returns a delete builder for Campaign.
func (*CampaignClient) DeleteOne ¶
func (c *CampaignClient) DeleteOne(ca *Campaign) *CampaignDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CampaignClient) DeleteOneID ¶
func (c *CampaignClient) DeleteOneID(id int) *CampaignDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CampaignClient) GetX ¶
func (c *CampaignClient) GetX(ctx context.Context, id int) *Campaign
GetX is like Get, but panics if an error occurs.
func (*CampaignClient) Hooks ¶
func (c *CampaignClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CampaignClient) Intercept ¶
func (c *CampaignClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `campaign.Intercept(f(g(h())))`.
func (*CampaignClient) Interceptors ¶
func (c *CampaignClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CampaignClient) MapCreateBulk ¶
func (c *CampaignClient) MapCreateBulk(slice any, setFunc func(*CampaignCreate, int)) *CampaignCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CampaignClient) Query ¶
func (c *CampaignClient) Query() *CampaignQuery
Query returns a query builder for Campaign.
func (*CampaignClient) Update ¶
func (c *CampaignClient) Update() *CampaignUpdate
Update returns an update builder for Campaign.
func (*CampaignClient) UpdateOne ¶
func (c *CampaignClient) UpdateOne(ca *Campaign) *CampaignUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CampaignClient) UpdateOneID ¶
func (c *CampaignClient) UpdateOneID(id int) *CampaignUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CampaignClient) Use ¶
func (c *CampaignClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `campaign.Hooks(f(g(h())))`.
type CampaignCreate ¶
type CampaignCreate struct {
// contains filtered or unexported fields
}
CampaignCreate is the builder for creating a Campaign entity.
func (*CampaignCreate) Exec ¶
func (cc *CampaignCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CampaignCreate) ExecX ¶
func (cc *CampaignCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampaignCreate) Mutation ¶
func (cc *CampaignCreate) Mutation() *CampaignMutation
Mutation returns the CampaignMutation object of the builder.
func (*CampaignCreate) Save ¶
func (cc *CampaignCreate) Save(ctx context.Context) (*Campaign, error)
Save creates the Campaign in the database.
func (*CampaignCreate) SaveX ¶
func (cc *CampaignCreate) SaveX(ctx context.Context) *Campaign
SaveX calls Save and panics if Save returns an error.
func (*CampaignCreate) SetCreatedAt ¶
func (cc *CampaignCreate) SetCreatedAt(t time.Time) *CampaignCreate
SetCreatedAt sets the "created_at" field.
func (*CampaignCreate) SetCurrentSlot ¶
func (cc *CampaignCreate) SetCurrentSlot(i int64) *CampaignCreate
SetCurrentSlot sets the "current_slot" field.
func (*CampaignCreate) SetEndDay ¶
func (cc *CampaignCreate) SetEndDay(t time.Time) *CampaignCreate
SetEndDay sets the "end_day" field.
func (*CampaignCreate) SetIsFull ¶
func (cc *CampaignCreate) SetIsFull(b bool) *CampaignCreate
SetIsFull sets the "is_full" field.
func (*CampaignCreate) SetName ¶
func (cc *CampaignCreate) SetName(s string) *CampaignCreate
SetName sets the "name" field.
func (*CampaignCreate) SetNillableCreatedAt ¶
func (cc *CampaignCreate) SetNillableCreatedAt(t *time.Time) *CampaignCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CampaignCreate) SetNillableUpdatedAt ¶
func (cc *CampaignCreate) SetNillableUpdatedAt(t *time.Time) *CampaignCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CampaignCreate) SetStartDay ¶
func (cc *CampaignCreate) SetStartDay(t time.Time) *CampaignCreate
SetStartDay sets the "start_day" field.
func (*CampaignCreate) SetTotalSlot ¶
func (cc *CampaignCreate) SetTotalSlot(i int64) *CampaignCreate
SetTotalSlot sets the "total_slot" field.
func (*CampaignCreate) SetUpdatedAt ¶
func (cc *CampaignCreate) SetUpdatedAt(t time.Time) *CampaignCreate
SetUpdatedAt sets the "updated_at" field.
type CampaignCreateBulk ¶
type CampaignCreateBulk struct {
// contains filtered or unexported fields
}
CampaignCreateBulk is the builder for creating many Campaign entities in bulk.
func (*CampaignCreateBulk) Exec ¶
func (ccb *CampaignCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CampaignCreateBulk) ExecX ¶
func (ccb *CampaignCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CampaignDelete ¶
type CampaignDelete struct {
// contains filtered or unexported fields
}
CampaignDelete is the builder for deleting a Campaign entity.
func (*CampaignDelete) Exec ¶
func (cd *CampaignDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CampaignDelete) ExecX ¶
func (cd *CampaignDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CampaignDelete) Where ¶
func (cd *CampaignDelete) Where(ps ...predicate.Campaign) *CampaignDelete
Where appends a list predicates to the CampaignDelete builder.
type CampaignDeleteOne ¶
type CampaignDeleteOne struct {
// contains filtered or unexported fields
}
CampaignDeleteOne is the builder for deleting a single Campaign entity.
func (*CampaignDeleteOne) Exec ¶
func (cdo *CampaignDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CampaignDeleteOne) ExecX ¶
func (cdo *CampaignDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampaignDeleteOne) Where ¶
func (cdo *CampaignDeleteOne) Where(ps ...predicate.Campaign) *CampaignDeleteOne
Where appends a list predicates to the CampaignDelete builder.
type CampaignGroupBy ¶
type CampaignGroupBy struct {
// contains filtered or unexported fields
}
CampaignGroupBy is the group-by builder for Campaign entities.
func (*CampaignGroupBy) Aggregate ¶
func (cgb *CampaignGroupBy) Aggregate(fns ...AggregateFunc) *CampaignGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CampaignGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CampaignGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CampaignGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CampaignGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CampaignGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CampaignGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CampaignGroupBy) Scan ¶
func (cgb *CampaignGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CampaignGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CampaignMutation ¶
type CampaignMutation struct {
// contains filtered or unexported fields
}
CampaignMutation represents an operation that mutates the Campaign nodes in the graph.
func (*CampaignMutation) AddCurrentSlot ¶
func (m *CampaignMutation) AddCurrentSlot(i int64)
AddCurrentSlot adds i to the "current_slot" field.
func (*CampaignMutation) AddField ¶
func (m *CampaignMutation) 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 (*CampaignMutation) AddTotalSlot ¶
func (m *CampaignMutation) AddTotalSlot(i int64)
AddTotalSlot adds i to the "total_slot" field.
func (*CampaignMutation) AddedCurrentSlot ¶
func (m *CampaignMutation) AddedCurrentSlot() (r int64, exists bool)
AddedCurrentSlot returns the value that was added to the "current_slot" field in this mutation.
func (*CampaignMutation) AddedEdges ¶
func (m *CampaignMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CampaignMutation) AddedField ¶
func (m *CampaignMutation) 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 (*CampaignMutation) AddedFields ¶
func (m *CampaignMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CampaignMutation) AddedIDs ¶
func (m *CampaignMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CampaignMutation) AddedTotalSlot ¶
func (m *CampaignMutation) AddedTotalSlot() (r int64, exists bool)
AddedTotalSlot returns the value that was added to the "total_slot" field in this mutation.
func (*CampaignMutation) ClearEdge ¶
func (m *CampaignMutation) 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 (*CampaignMutation) ClearField ¶
func (m *CampaignMutation) 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 (*CampaignMutation) ClearedEdges ¶
func (m *CampaignMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CampaignMutation) ClearedFields ¶
func (m *CampaignMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CampaignMutation) Client ¶
func (m CampaignMutation) 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 (*CampaignMutation) CreatedAt ¶
func (m *CampaignMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CampaignMutation) CurrentSlot ¶
func (m *CampaignMutation) CurrentSlot() (r int64, exists bool)
CurrentSlot returns the value of the "current_slot" field in the mutation.
func (*CampaignMutation) EdgeCleared ¶
func (m *CampaignMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CampaignMutation) EndDay ¶
func (m *CampaignMutation) EndDay() (r time.Time, exists bool)
EndDay returns the value of the "end_day" field in the mutation.
func (*CampaignMutation) Field ¶
func (m *CampaignMutation) 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 (*CampaignMutation) FieldCleared ¶
func (m *CampaignMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CampaignMutation) Fields ¶
func (m *CampaignMutation) 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 (*CampaignMutation) ID ¶
func (m *CampaignMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CampaignMutation) IDs ¶
func (m *CampaignMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CampaignMutation) IsFull ¶
func (m *CampaignMutation) IsFull() (r bool, exists bool)
IsFull returns the value of the "is_full" field in the mutation.
func (*CampaignMutation) Name ¶
func (m *CampaignMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CampaignMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) OldCurrentSlot ¶
func (m *CampaignMutation) OldCurrentSlot(ctx context.Context) (v int64, err error)
OldCurrentSlot returns the old "current_slot" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) OldEndDay ¶
OldEndDay returns the old "end_day" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) 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 (*CampaignMutation) OldIsFull ¶
func (m *CampaignMutation) OldIsFull(ctx context.Context) (v bool, err error)
OldIsFull returns the old "is_full" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) OldName ¶
func (m *CampaignMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) OldStartDay ¶
OldStartDay returns the old "start_day" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) OldTotalSlot ¶
func (m *CampaignMutation) OldTotalSlot(ctx context.Context) (v int64, err error)
OldTotalSlot returns the old "total_slot" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Campaign entity. If the Campaign 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 (*CampaignMutation) RemovedEdges ¶
func (m *CampaignMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CampaignMutation) RemovedIDs ¶
func (m *CampaignMutation) 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 (*CampaignMutation) ResetCreatedAt ¶
func (m *CampaignMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CampaignMutation) ResetCurrentSlot ¶
func (m *CampaignMutation) ResetCurrentSlot()
ResetCurrentSlot resets all changes to the "current_slot" field.
func (*CampaignMutation) ResetEdge ¶
func (m *CampaignMutation) 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 (*CampaignMutation) ResetEndDay ¶
func (m *CampaignMutation) ResetEndDay()
ResetEndDay resets all changes to the "end_day" field.
func (*CampaignMutation) ResetField ¶
func (m *CampaignMutation) 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 (*CampaignMutation) ResetIsFull ¶
func (m *CampaignMutation) ResetIsFull()
ResetIsFull resets all changes to the "is_full" field.
func (*CampaignMutation) ResetName ¶
func (m *CampaignMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CampaignMutation) ResetStartDay ¶
func (m *CampaignMutation) ResetStartDay()
ResetStartDay resets all changes to the "start_day" field.
func (*CampaignMutation) ResetTotalSlot ¶
func (m *CampaignMutation) ResetTotalSlot()
ResetTotalSlot resets all changes to the "total_slot" field.
func (*CampaignMutation) ResetUpdatedAt ¶
func (m *CampaignMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CampaignMutation) SetCreatedAt ¶
func (m *CampaignMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CampaignMutation) SetCurrentSlot ¶
func (m *CampaignMutation) SetCurrentSlot(i int64)
SetCurrentSlot sets the "current_slot" field.
func (*CampaignMutation) SetEndDay ¶
func (m *CampaignMutation) SetEndDay(t time.Time)
SetEndDay sets the "end_day" field.
func (*CampaignMutation) SetField ¶
func (m *CampaignMutation) 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 (*CampaignMutation) SetIsFull ¶
func (m *CampaignMutation) SetIsFull(b bool)
SetIsFull sets the "is_full" field.
func (*CampaignMutation) SetName ¶
func (m *CampaignMutation) SetName(s string)
SetName sets the "name" field.
func (*CampaignMutation) SetOp ¶
func (m *CampaignMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CampaignMutation) SetStartDay ¶
func (m *CampaignMutation) SetStartDay(t time.Time)
SetStartDay sets the "start_day" field.
func (*CampaignMutation) SetTotalSlot ¶
func (m *CampaignMutation) SetTotalSlot(i int64)
SetTotalSlot sets the "total_slot" field.
func (*CampaignMutation) SetUpdatedAt ¶
func (m *CampaignMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*CampaignMutation) StartDay ¶
func (m *CampaignMutation) StartDay() (r time.Time, exists bool)
StartDay returns the value of the "start_day" field in the mutation.
func (*CampaignMutation) TotalSlot ¶
func (m *CampaignMutation) TotalSlot() (r int64, exists bool)
TotalSlot returns the value of the "total_slot" field in the mutation.
func (CampaignMutation) Tx ¶
func (m CampaignMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CampaignMutation) Type ¶
func (m *CampaignMutation) Type() string
Type returns the node type of this mutation (Campaign).
func (*CampaignMutation) UpdatedAt ¶
func (m *CampaignMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CampaignMutation) Where ¶
func (m *CampaignMutation) Where(ps ...predicate.Campaign)
Where appends a list predicates to the CampaignMutation builder.
func (*CampaignMutation) WhereP ¶
func (m *CampaignMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CampaignMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CampaignQuery ¶
type CampaignQuery struct {
// contains filtered or unexported fields
}
CampaignQuery is the builder for querying Campaign entities.
func (*CampaignQuery) Aggregate ¶
func (cq *CampaignQuery) Aggregate(fns ...AggregateFunc) *CampaignSelect
Aggregate returns a CampaignSelect configured with the given aggregations.
func (*CampaignQuery) All ¶
func (cq *CampaignQuery) All(ctx context.Context) ([]*Campaign, error)
All executes the query and returns a list of Campaigns.
func (*CampaignQuery) AllX ¶
func (cq *CampaignQuery) AllX(ctx context.Context) []*Campaign
AllX is like All, but panics if an error occurs.
func (*CampaignQuery) Clone ¶
func (cq *CampaignQuery) Clone() *CampaignQuery
Clone returns a duplicate of the CampaignQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CampaignQuery) Count ¶
func (cq *CampaignQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CampaignQuery) CountX ¶
func (cq *CampaignQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CampaignQuery) Exist ¶
func (cq *CampaignQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CampaignQuery) ExistX ¶
func (cq *CampaignQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CampaignQuery) First ¶
func (cq *CampaignQuery) First(ctx context.Context) (*Campaign, error)
First returns the first Campaign entity from the query. Returns a *NotFoundError when no Campaign was found.
func (*CampaignQuery) FirstID ¶
func (cq *CampaignQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Campaign ID from the query. Returns a *NotFoundError when no Campaign ID was found.
func (*CampaignQuery) FirstIDX ¶
func (cq *CampaignQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CampaignQuery) FirstX ¶
func (cq *CampaignQuery) FirstX(ctx context.Context) *Campaign
FirstX is like First, but panics if an error occurs.
func (*CampaignQuery) GroupBy ¶
func (cq *CampaignQuery) GroupBy(field string, fields ...string) *CampaignGroupBy
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.Campaign.Query(). GroupBy(campaign.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CampaignQuery) IDs ¶
func (cq *CampaignQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Campaign IDs.
func (*CampaignQuery) IDsX ¶
func (cq *CampaignQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CampaignQuery) Limit ¶
func (cq *CampaignQuery) Limit(limit int) *CampaignQuery
Limit the number of records to be returned by this query.
func (*CampaignQuery) Offset ¶
func (cq *CampaignQuery) Offset(offset int) *CampaignQuery
Offset to start from.
func (*CampaignQuery) Only ¶
func (cq *CampaignQuery) Only(ctx context.Context) (*Campaign, error)
Only returns a single Campaign entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Campaign entity is found. Returns a *NotFoundError when no Campaign entities are found.
func (*CampaignQuery) OnlyID ¶
func (cq *CampaignQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Campaign ID in the query. Returns a *NotSingularError when more than one Campaign ID is found. Returns a *NotFoundError when no entities are found.
func (*CampaignQuery) OnlyIDX ¶
func (cq *CampaignQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CampaignQuery) OnlyX ¶
func (cq *CampaignQuery) OnlyX(ctx context.Context) *Campaign
OnlyX is like Only, but panics if an error occurs.
func (*CampaignQuery) Order ¶
func (cq *CampaignQuery) Order(o ...campaign.OrderOption) *CampaignQuery
Order specifies how the records should be ordered.
func (*CampaignQuery) Select ¶
func (cq *CampaignQuery) Select(fields ...string) *CampaignSelect
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.Campaign.Query(). Select(campaign.FieldName). Scan(ctx, &v)
func (*CampaignQuery) Unique ¶
func (cq *CampaignQuery) Unique(unique bool) *CampaignQuery
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 (*CampaignQuery) Where ¶
func (cq *CampaignQuery) Where(ps ...predicate.Campaign) *CampaignQuery
Where adds a new predicate for the CampaignQuery builder.
type CampaignSelect ¶
type CampaignSelect struct { *CampaignQuery // contains filtered or unexported fields }
CampaignSelect is the builder for selecting fields of Campaign entities.
func (*CampaignSelect) Aggregate ¶
func (cs *CampaignSelect) Aggregate(fns ...AggregateFunc) *CampaignSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CampaignSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CampaignSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CampaignSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CampaignSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CampaignSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CampaignSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CampaignSelect) Scan ¶
func (cs *CampaignSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CampaignSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CampaignUpdate ¶
type CampaignUpdate struct {
// contains filtered or unexported fields
}
CampaignUpdate is the builder for updating Campaign entities.
func (*CampaignUpdate) AddCurrentSlot ¶
func (cu *CampaignUpdate) AddCurrentSlot(i int64) *CampaignUpdate
AddCurrentSlot adds i to the "current_slot" field.
func (*CampaignUpdate) AddTotalSlot ¶
func (cu *CampaignUpdate) AddTotalSlot(i int64) *CampaignUpdate
AddTotalSlot adds i to the "total_slot" field.
func (*CampaignUpdate) Exec ¶
func (cu *CampaignUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CampaignUpdate) ExecX ¶
func (cu *CampaignUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampaignUpdate) Mutation ¶
func (cu *CampaignUpdate) Mutation() *CampaignMutation
Mutation returns the CampaignMutation object of the builder.
func (*CampaignUpdate) Save ¶
func (cu *CampaignUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CampaignUpdate) SaveX ¶
func (cu *CampaignUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CampaignUpdate) SetCurrentSlot ¶
func (cu *CampaignUpdate) SetCurrentSlot(i int64) *CampaignUpdate
SetCurrentSlot sets the "current_slot" field.
func (*CampaignUpdate) SetEndDay ¶
func (cu *CampaignUpdate) SetEndDay(t time.Time) *CampaignUpdate
SetEndDay sets the "end_day" field.
func (*CampaignUpdate) SetIsFull ¶
func (cu *CampaignUpdate) SetIsFull(b bool) *CampaignUpdate
SetIsFull sets the "is_full" field.
func (*CampaignUpdate) SetName ¶
func (cu *CampaignUpdate) SetName(s string) *CampaignUpdate
SetName sets the "name" field.
func (*CampaignUpdate) SetStartDay ¶
func (cu *CampaignUpdate) SetStartDay(t time.Time) *CampaignUpdate
SetStartDay sets the "start_day" field.
func (*CampaignUpdate) SetTotalSlot ¶
func (cu *CampaignUpdate) SetTotalSlot(i int64) *CampaignUpdate
SetTotalSlot sets the "total_slot" field.
func (*CampaignUpdate) SetUpdatedAt ¶
func (cu *CampaignUpdate) SetUpdatedAt(t time.Time) *CampaignUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CampaignUpdate) Where ¶
func (cu *CampaignUpdate) Where(ps ...predicate.Campaign) *CampaignUpdate
Where appends a list predicates to the CampaignUpdate builder.
type CampaignUpdateOne ¶
type CampaignUpdateOne struct {
// contains filtered or unexported fields
}
CampaignUpdateOne is the builder for updating a single Campaign entity.
func (*CampaignUpdateOne) AddCurrentSlot ¶
func (cuo *CampaignUpdateOne) AddCurrentSlot(i int64) *CampaignUpdateOne
AddCurrentSlot adds i to the "current_slot" field.
func (*CampaignUpdateOne) AddTotalSlot ¶
func (cuo *CampaignUpdateOne) AddTotalSlot(i int64) *CampaignUpdateOne
AddTotalSlot adds i to the "total_slot" field.
func (*CampaignUpdateOne) Exec ¶
func (cuo *CampaignUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CampaignUpdateOne) ExecX ¶
func (cuo *CampaignUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CampaignUpdateOne) Mutation ¶
func (cuo *CampaignUpdateOne) Mutation() *CampaignMutation
Mutation returns the CampaignMutation object of the builder.
func (*CampaignUpdateOne) Save ¶
func (cuo *CampaignUpdateOne) Save(ctx context.Context) (*Campaign, error)
Save executes the query and returns the updated Campaign entity.
func (*CampaignUpdateOne) SaveX ¶
func (cuo *CampaignUpdateOne) SaveX(ctx context.Context) *Campaign
SaveX is like Save, but panics if an error occurs.
func (*CampaignUpdateOne) Select ¶
func (cuo *CampaignUpdateOne) Select(field string, fields ...string) *CampaignUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CampaignUpdateOne) SetCurrentSlot ¶
func (cuo *CampaignUpdateOne) SetCurrentSlot(i int64) *CampaignUpdateOne
SetCurrentSlot sets the "current_slot" field.
func (*CampaignUpdateOne) SetEndDay ¶
func (cuo *CampaignUpdateOne) SetEndDay(t time.Time) *CampaignUpdateOne
SetEndDay sets the "end_day" field.
func (*CampaignUpdateOne) SetIsFull ¶
func (cuo *CampaignUpdateOne) SetIsFull(b bool) *CampaignUpdateOne
SetIsFull sets the "is_full" field.
func (*CampaignUpdateOne) SetName ¶
func (cuo *CampaignUpdateOne) SetName(s string) *CampaignUpdateOne
SetName sets the "name" field.
func (*CampaignUpdateOne) SetStartDay ¶
func (cuo *CampaignUpdateOne) SetStartDay(t time.Time) *CampaignUpdateOne
SetStartDay sets the "start_day" field.
func (*CampaignUpdateOne) SetTotalSlot ¶
func (cuo *CampaignUpdateOne) SetTotalSlot(i int64) *CampaignUpdateOne
SetTotalSlot sets the "total_slot" field.
func (*CampaignUpdateOne) SetUpdatedAt ¶
func (cuo *CampaignUpdateOne) SetUpdatedAt(t time.Time) *CampaignUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CampaignUpdateOne) Where ¶
func (cuo *CampaignUpdateOne) Where(ps ...predicate.Campaign) *CampaignUpdateOne
Where appends a list predicates to the CampaignUpdate builder.
type Card ¶
type Card struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Type holds the value of the "type" field. Type string `json:"type,omitempty"` // Value holds the value of the "value" field. Value float64 `json:"value,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
Card is the model entity for the Card schema.
func (*Card) GetValue ¶
GetValue returns the ent.Value that was dynamically selected and assigned to the Card. This includes values selected through modifiers, order, etc.
func (*Card) Unwrap ¶
Unwrap unwraps the Card 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 (*Card) Update ¶
func (c *Card) Update() *CardUpdateOne
Update returns a builder for updating this Card. Note that you need to call Card.Unwrap() before calling this method if this Card was returned from a transaction, and the transaction was committed or rolled back.
type CardClient ¶
type CardClient struct {
// contains filtered or unexported fields
}
CardClient is a client for the Card schema.
func NewCardClient ¶
func NewCardClient(c config) *CardClient
NewCardClient returns a client for the Card from the given config.
func (*CardClient) Create ¶
func (c *CardClient) Create() *CardCreate
Create returns a builder for creating a Card entity.
func (*CardClient) CreateBulk ¶
func (c *CardClient) CreateBulk(builders ...*CardCreate) *CardCreateBulk
CreateBulk returns a builder for creating a bulk of Card entities.
func (*CardClient) Delete ¶
func (c *CardClient) Delete() *CardDelete
Delete returns a delete builder for Card.
func (*CardClient) DeleteOne ¶
func (c *CardClient) DeleteOne(ca *Card) *CardDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CardClient) DeleteOneID ¶
func (c *CardClient) DeleteOneID(id int) *CardDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CardClient) GetX ¶
func (c *CardClient) GetX(ctx context.Context, id int) *Card
GetX is like Get, but panics if an error occurs.
func (*CardClient) Intercept ¶
func (c *CardClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `card.Intercept(f(g(h())))`.
func (*CardClient) Interceptors ¶
func (c *CardClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CardClient) MapCreateBulk ¶
func (c *CardClient) MapCreateBulk(slice any, setFunc func(*CardCreate, int)) *CardCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*CardClient) Query ¶
func (c *CardClient) Query() *CardQuery
Query returns a query builder for Card.
func (*CardClient) Update ¶
func (c *CardClient) Update() *CardUpdate
Update returns an update builder for Card.
func (*CardClient) UpdateOne ¶
func (c *CardClient) UpdateOne(ca *Card) *CardUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CardClient) UpdateOneID ¶
func (c *CardClient) UpdateOneID(id int) *CardUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CardClient) Use ¶
func (c *CardClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `card.Hooks(f(g(h())))`.
type CardCreate ¶
type CardCreate struct {
// contains filtered or unexported fields
}
CardCreate is the builder for creating a Card entity.
func (*CardCreate) Exec ¶
func (cc *CardCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CardCreate) ExecX ¶
func (cc *CardCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardCreate) Mutation ¶
func (cc *CardCreate) Mutation() *CardMutation
Mutation returns the CardMutation object of the builder.
func (*CardCreate) Save ¶
func (cc *CardCreate) Save(ctx context.Context) (*Card, error)
Save creates the Card in the database.
func (*CardCreate) SaveX ¶
func (cc *CardCreate) SaveX(ctx context.Context) *Card
SaveX calls Save and panics if Save returns an error.
func (*CardCreate) SetCreatedAt ¶
func (cc *CardCreate) SetCreatedAt(t time.Time) *CardCreate
SetCreatedAt sets the "created_at" field.
func (*CardCreate) SetName ¶
func (cc *CardCreate) SetName(s string) *CardCreate
SetName sets the "name" field.
func (*CardCreate) SetNillableCreatedAt ¶
func (cc *CardCreate) SetNillableCreatedAt(t *time.Time) *CardCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CardCreate) SetNillableUpdatedAt ¶
func (cc *CardCreate) SetNillableUpdatedAt(t *time.Time) *CardCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CardCreate) SetType ¶
func (cc *CardCreate) SetType(s string) *CardCreate
SetType sets the "type" field.
func (*CardCreate) SetUpdatedAt ¶
func (cc *CardCreate) SetUpdatedAt(t time.Time) *CardCreate
SetUpdatedAt sets the "updated_at" field.
func (*CardCreate) SetValue ¶
func (cc *CardCreate) SetValue(f float64) *CardCreate
SetValue sets the "value" field.
type CardCreateBulk ¶
type CardCreateBulk struct {
// contains filtered or unexported fields
}
CardCreateBulk is the builder for creating many Card entities in bulk.
func (*CardCreateBulk) Exec ¶
func (ccb *CardCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CardCreateBulk) ExecX ¶
func (ccb *CardCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CardDelete ¶
type CardDelete struct {
// contains filtered or unexported fields
}
CardDelete is the builder for deleting a Card entity.
func (*CardDelete) Exec ¶
func (cd *CardDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CardDelete) ExecX ¶
func (cd *CardDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CardDelete) Where ¶
func (cd *CardDelete) Where(ps ...predicate.Card) *CardDelete
Where appends a list predicates to the CardDelete builder.
type CardDeleteOne ¶
type CardDeleteOne struct {
// contains filtered or unexported fields
}
CardDeleteOne is the builder for deleting a single Card entity.
func (*CardDeleteOne) Exec ¶
func (cdo *CardDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CardDeleteOne) ExecX ¶
func (cdo *CardDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardDeleteOne) Where ¶
func (cdo *CardDeleteOne) Where(ps ...predicate.Card) *CardDeleteOne
Where appends a list predicates to the CardDelete builder.
type CardGroupBy ¶
type CardGroupBy struct {
// contains filtered or unexported fields
}
CardGroupBy is the group-by builder for Card entities.
func (*CardGroupBy) Aggregate ¶
func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CardGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CardGroupBy) Scan ¶
func (cgb *CardGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CardGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CardMutation ¶
type CardMutation struct {
// contains filtered or unexported fields
}
CardMutation represents an operation that mutates the Card nodes in the graph.
func (*CardMutation) AddField ¶
func (m *CardMutation) 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 (*CardMutation) AddValue ¶
func (m *CardMutation) AddValue(f float64)
AddValue adds f to the "value" field.
func (*CardMutation) AddedEdges ¶
func (m *CardMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CardMutation) AddedField ¶
func (m *CardMutation) 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 (*CardMutation) AddedFields ¶
func (m *CardMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CardMutation) AddedIDs ¶
func (m *CardMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CardMutation) AddedValue ¶
func (m *CardMutation) AddedValue() (r float64, exists bool)
AddedValue returns the value that was added to the "value" field in this mutation.
func (*CardMutation) ClearEdge ¶
func (m *CardMutation) 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 (*CardMutation) ClearField ¶
func (m *CardMutation) 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 (*CardMutation) ClearedEdges ¶
func (m *CardMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CardMutation) ClearedFields ¶
func (m *CardMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CardMutation) Client ¶
func (m CardMutation) 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 (*CardMutation) CreatedAt ¶
func (m *CardMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CardMutation) EdgeCleared ¶
func (m *CardMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CardMutation) Field ¶
func (m *CardMutation) 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 (*CardMutation) FieldCleared ¶
func (m *CardMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CardMutation) Fields ¶
func (m *CardMutation) 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 (*CardMutation) GetType ¶
func (m *CardMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*CardMutation) ID ¶
func (m *CardMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*CardMutation) IDs ¶
func (m *CardMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*CardMutation) Name ¶
func (m *CardMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CardMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Card entity. If the Card 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 (*CardMutation) 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 (*CardMutation) OldName ¶
func (m *CardMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Card entity. If the Card 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 (*CardMutation) OldType ¶
func (m *CardMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the Card entity. If the Card 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 (*CardMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Card entity. If the Card 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 (*CardMutation) OldValue ¶
func (m *CardMutation) OldValue(ctx context.Context) (v float64, err error)
OldValue returns the old "value" field's value of the Card entity. If the Card 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 (*CardMutation) RemovedEdges ¶
func (m *CardMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CardMutation) RemovedIDs ¶
func (m *CardMutation) 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 (*CardMutation) ResetCreatedAt ¶
func (m *CardMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CardMutation) ResetEdge ¶
func (m *CardMutation) 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 (*CardMutation) ResetField ¶
func (m *CardMutation) 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 (*CardMutation) ResetName ¶
func (m *CardMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CardMutation) ResetType ¶
func (m *CardMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*CardMutation) ResetUpdatedAt ¶
func (m *CardMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CardMutation) ResetValue ¶
func (m *CardMutation) ResetValue()
ResetValue resets all changes to the "value" field.
func (*CardMutation) SetCreatedAt ¶
func (m *CardMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CardMutation) SetField ¶
func (m *CardMutation) 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 (*CardMutation) SetName ¶
func (m *CardMutation) SetName(s string)
SetName sets the "name" field.
func (*CardMutation) SetOp ¶
func (m *CardMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CardMutation) SetType ¶
func (m *CardMutation) SetType(s string)
SetType sets the "type" field.
func (*CardMutation) SetUpdatedAt ¶
func (m *CardMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*CardMutation) SetValue ¶
func (m *CardMutation) SetValue(f float64)
SetValue sets the "value" field.
func (CardMutation) Tx ¶
func (m CardMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CardMutation) Type ¶
func (m *CardMutation) Type() string
Type returns the node type of this mutation (Card).
func (*CardMutation) UpdatedAt ¶
func (m *CardMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CardMutation) Value ¶
func (m *CardMutation) Value() (r float64, exists bool)
Value returns the value of the "value" field in the mutation.
func (*CardMutation) Where ¶
func (m *CardMutation) Where(ps ...predicate.Card)
Where appends a list predicates to the CardMutation builder.
func (*CardMutation) WhereP ¶
func (m *CardMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CardMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CardQuery ¶
type CardQuery struct {
// contains filtered or unexported fields
}
CardQuery is the builder for querying Card entities.
func (*CardQuery) Aggregate ¶
func (cq *CardQuery) Aggregate(fns ...AggregateFunc) *CardSelect
Aggregate returns a CardSelect configured with the given aggregations.
func (*CardQuery) Clone ¶
Clone returns a duplicate of the CardQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CardQuery) First ¶
First returns the first Card entity from the query. Returns a *NotFoundError when no Card was found.
func (*CardQuery) FirstID ¶
FirstID returns the first Card ID from the query. Returns a *NotFoundError when no Card ID was found.
func (*CardQuery) GroupBy ¶
func (cq *CardQuery) GroupBy(field string, fields ...string) *CardGroupBy
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.Card.Query(). GroupBy(card.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CardQuery) Only ¶
Only returns a single Card entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Card entity is found. Returns a *NotFoundError when no Card entities are found.
func (*CardQuery) OnlyID ¶
OnlyID is like Only, but returns the only Card ID in the query. Returns a *NotSingularError when more than one Card ID is found. Returns a *NotFoundError when no entities are found.
func (*CardQuery) Order ¶
func (cq *CardQuery) Order(o ...card.OrderOption) *CardQuery
Order specifies how the records should be ordered.
func (*CardQuery) Select ¶
func (cq *CardQuery) Select(fields ...string) *CardSelect
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.Card.Query(). Select(card.FieldName). Scan(ctx, &v)
type CardSelect ¶
type CardSelect struct { *CardQuery // contains filtered or unexported fields }
CardSelect is the builder for selecting fields of Card entities.
func (*CardSelect) Aggregate ¶
func (cs *CardSelect) Aggregate(fns ...AggregateFunc) *CardSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CardSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CardSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CardSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CardSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CardSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CardSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CardSelect) Scan ¶
func (cs *CardSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CardSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CardUpdate ¶
type CardUpdate struct {
// contains filtered or unexported fields
}
CardUpdate is the builder for updating Card entities.
func (*CardUpdate) AddValue ¶
func (cu *CardUpdate) AddValue(f float64) *CardUpdate
AddValue adds f to the "value" field.
func (*CardUpdate) Exec ¶
func (cu *CardUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CardUpdate) ExecX ¶
func (cu *CardUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardUpdate) Mutation ¶
func (cu *CardUpdate) Mutation() *CardMutation
Mutation returns the CardMutation object of the builder.
func (*CardUpdate) Save ¶
func (cu *CardUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CardUpdate) SaveX ¶
func (cu *CardUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CardUpdate) SetName ¶
func (cu *CardUpdate) SetName(s string) *CardUpdate
SetName sets the "name" field.
func (*CardUpdate) SetType ¶
func (cu *CardUpdate) SetType(s string) *CardUpdate
SetType sets the "type" field.
func (*CardUpdate) SetUpdatedAt ¶
func (cu *CardUpdate) SetUpdatedAt(t time.Time) *CardUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CardUpdate) SetValue ¶
func (cu *CardUpdate) SetValue(f float64) *CardUpdate
SetValue sets the "value" field.
func (*CardUpdate) Where ¶
func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate
Where appends a list predicates to the CardUpdate builder.
type CardUpdateOne ¶
type CardUpdateOne struct {
// contains filtered or unexported fields
}
CardUpdateOne is the builder for updating a single Card entity.
func (*CardUpdateOne) AddValue ¶
func (cuo *CardUpdateOne) AddValue(f float64) *CardUpdateOne
AddValue adds f to the "value" field.
func (*CardUpdateOne) Exec ¶
func (cuo *CardUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CardUpdateOne) ExecX ¶
func (cuo *CardUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CardUpdateOne) Mutation ¶
func (cuo *CardUpdateOne) Mutation() *CardMutation
Mutation returns the CardMutation object of the builder.
func (*CardUpdateOne) Save ¶
func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)
Save executes the query and returns the updated Card entity.
func (*CardUpdateOne) SaveX ¶
func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card
SaveX is like Save, but panics if an error occurs.
func (*CardUpdateOne) Select ¶
func (cuo *CardUpdateOne) Select(field string, fields ...string) *CardUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CardUpdateOne) SetName ¶
func (cuo *CardUpdateOne) SetName(s string) *CardUpdateOne
SetName sets the "name" field.
func (*CardUpdateOne) SetType ¶
func (cuo *CardUpdateOne) SetType(s string) *CardUpdateOne
SetType sets the "type" field.
func (*CardUpdateOne) SetUpdatedAt ¶
func (cuo *CardUpdateOne) SetUpdatedAt(t time.Time) *CardUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CardUpdateOne) SetValue ¶
func (cuo *CardUpdateOne) SetValue(f float64) *CardUpdateOne
SetValue sets the "value" field.
func (*CardUpdateOne) Where ¶
func (cuo *CardUpdateOne) Where(ps ...predicate.Card) *CardUpdateOne
Where appends a list predicates to the CardUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Campaign is the client for interacting with the Campaign builders. Campaign *CampaignClient // Card is the client for interacting with the Card builders. Card *CardClient // User is the client for interacting with the User builders. User *UserClient // UserBalance is the client for interacting with the UserBalance builders. UserBalance *UserBalanceClient // UserVoucher is the client for interacting with the UserVoucher builders. UserVoucher *UserVoucherClient // Voucher is the client for interacting with the Voucher builders. Voucher *VoucherClient // VoucherCampaign is the client for interacting with the VoucherCampaign builders. VoucherCampaign *VoucherCampaignClient // 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(). Campaign. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Campaign is the client for interacting with the Campaign builders. Campaign *CampaignClient // Card is the client for interacting with the Card builders. Card *CardClient // User is the client for interacting with the User builders. User *UserClient // UserBalance is the client for interacting with the UserBalance builders. UserBalance *UserBalanceClient // UserVoucher is the client for interacting with the UserVoucher builders. UserVoucher *UserVoucherClient // Voucher is the client for interacting with the Voucher builders. Voucher *VoucherClient // VoucherCampaign is the client for interacting with the VoucherCampaign builders. VoucherCampaign *VoucherCampaignClient // 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 int `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // UserID holds the value of the "user_id" field. UserID *string `json:"user_id,omitempty"` // Account holds the value of the "account" field. Account string `json:"account,omitempty"` // FullName holds the value of the "full_name" field. FullName string `json:"full_name,omitempty"` // PhoneNumer holds the value of the "phone_numer" field. PhoneNumer *string `json:"phone_numer,omitempty"` // Email holds the value of the "email" field. Email *string `json:"email,omitempty"` // UserName holds the value of the "user_name" field. UserName *string `json:"user_name,omitempty"` // Password holds the value of the "password" field. Password string `json:"password,omitempty"` // Birthday holds the value of the "birthday" field. Birthday time.Time `json:"birthday,omitempty"` // LatestLogin holds the value of the "latest_login" field. LatestLogin time.Time `json:"latest_login,omitempty"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserBalance ¶
type UserBalance struct { // ID of the ent. ID int `json:"id,omitempty"` // UserID holds the value of the "user_id" field. UserID string `json:"user_id,omitempty"` // Balance holds the value of the "balance" field. Balance float64 `json:"balance,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
UserBalance is the model entity for the UserBalance schema.
func (*UserBalance) String ¶
func (ub *UserBalance) String() string
String implements the fmt.Stringer.
func (*UserBalance) Unwrap ¶
func (ub *UserBalance) Unwrap() *UserBalance
Unwrap unwraps the UserBalance 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 (*UserBalance) Update ¶
func (ub *UserBalance) Update() *UserBalanceUpdateOne
Update returns a builder for updating this UserBalance. Note that you need to call UserBalance.Unwrap() before calling this method if this UserBalance was returned from a transaction, and the transaction was committed or rolled back.
type UserBalanceClient ¶
type UserBalanceClient struct {
// contains filtered or unexported fields
}
UserBalanceClient is a client for the UserBalance schema.
func NewUserBalanceClient ¶
func NewUserBalanceClient(c config) *UserBalanceClient
NewUserBalanceClient returns a client for the UserBalance from the given config.
func (*UserBalanceClient) Create ¶
func (c *UserBalanceClient) Create() *UserBalanceCreate
Create returns a builder for creating a UserBalance entity.
func (*UserBalanceClient) CreateBulk ¶
func (c *UserBalanceClient) CreateBulk(builders ...*UserBalanceCreate) *UserBalanceCreateBulk
CreateBulk returns a builder for creating a bulk of UserBalance entities.
func (*UserBalanceClient) Delete ¶
func (c *UserBalanceClient) Delete() *UserBalanceDelete
Delete returns a delete builder for UserBalance.
func (*UserBalanceClient) DeleteOne ¶
func (c *UserBalanceClient) DeleteOne(ub *UserBalance) *UserBalanceDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserBalanceClient) DeleteOneID ¶
func (c *UserBalanceClient) DeleteOneID(id int) *UserBalanceDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserBalanceClient) Get ¶
func (c *UserBalanceClient) Get(ctx context.Context, id int) (*UserBalance, error)
Get returns a UserBalance entity by its id.
func (*UserBalanceClient) GetX ¶
func (c *UserBalanceClient) GetX(ctx context.Context, id int) *UserBalance
GetX is like Get, but panics if an error occurs.
func (*UserBalanceClient) Hooks ¶
func (c *UserBalanceClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserBalanceClient) Intercept ¶
func (c *UserBalanceClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userbalance.Intercept(f(g(h())))`.
func (*UserBalanceClient) Interceptors ¶
func (c *UserBalanceClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserBalanceClient) MapCreateBulk ¶
func (c *UserBalanceClient) MapCreateBulk(slice any, setFunc func(*UserBalanceCreate, int)) *UserBalanceCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserBalanceClient) Query ¶
func (c *UserBalanceClient) Query() *UserBalanceQuery
Query returns a query builder for UserBalance.
func (*UserBalanceClient) Update ¶
func (c *UserBalanceClient) Update() *UserBalanceUpdate
Update returns an update builder for UserBalance.
func (*UserBalanceClient) UpdateOne ¶
func (c *UserBalanceClient) UpdateOne(ub *UserBalance) *UserBalanceUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserBalanceClient) UpdateOneID ¶
func (c *UserBalanceClient) UpdateOneID(id int) *UserBalanceUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserBalanceClient) Use ¶
func (c *UserBalanceClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userbalance.Hooks(f(g(h())))`.
type UserBalanceCreate ¶
type UserBalanceCreate struct {
// contains filtered or unexported fields
}
UserBalanceCreate is the builder for creating a UserBalance entity.
func (*UserBalanceCreate) Exec ¶
func (ubc *UserBalanceCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserBalanceCreate) ExecX ¶
func (ubc *UserBalanceCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserBalanceCreate) Mutation ¶
func (ubc *UserBalanceCreate) Mutation() *UserBalanceMutation
Mutation returns the UserBalanceMutation object of the builder.
func (*UserBalanceCreate) Save ¶
func (ubc *UserBalanceCreate) Save(ctx context.Context) (*UserBalance, error)
Save creates the UserBalance in the database.
func (*UserBalanceCreate) SaveX ¶
func (ubc *UserBalanceCreate) SaveX(ctx context.Context) *UserBalance
SaveX calls Save and panics if Save returns an error.
func (*UserBalanceCreate) SetBalance ¶
func (ubc *UserBalanceCreate) SetBalance(f float64) *UserBalanceCreate
SetBalance sets the "balance" field.
func (*UserBalanceCreate) SetCreatedAt ¶
func (ubc *UserBalanceCreate) SetCreatedAt(t time.Time) *UserBalanceCreate
SetCreatedAt sets the "created_at" field.
func (*UserBalanceCreate) SetNillableCreatedAt ¶
func (ubc *UserBalanceCreate) SetNillableCreatedAt(t *time.Time) *UserBalanceCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserBalanceCreate) SetNillableUpdatedAt ¶
func (ubc *UserBalanceCreate) SetNillableUpdatedAt(t *time.Time) *UserBalanceCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserBalanceCreate) SetUpdatedAt ¶
func (ubc *UserBalanceCreate) SetUpdatedAt(t time.Time) *UserBalanceCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserBalanceCreate) SetUserID ¶
func (ubc *UserBalanceCreate) SetUserID(s string) *UserBalanceCreate
SetUserID sets the "user_id" field.
type UserBalanceCreateBulk ¶
type UserBalanceCreateBulk struct {
// contains filtered or unexported fields
}
UserBalanceCreateBulk is the builder for creating many UserBalance entities in bulk.
func (*UserBalanceCreateBulk) Exec ¶
func (ubcb *UserBalanceCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserBalanceCreateBulk) ExecX ¶
func (ubcb *UserBalanceCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserBalanceCreateBulk) Save ¶
func (ubcb *UserBalanceCreateBulk) Save(ctx context.Context) ([]*UserBalance, error)
Save creates the UserBalance entities in the database.
func (*UserBalanceCreateBulk) SaveX ¶
func (ubcb *UserBalanceCreateBulk) SaveX(ctx context.Context) []*UserBalance
SaveX is like Save, but panics if an error occurs.
type UserBalanceDelete ¶
type UserBalanceDelete struct {
// contains filtered or unexported fields
}
UserBalanceDelete is the builder for deleting a UserBalance entity.
func (*UserBalanceDelete) Exec ¶
func (ubd *UserBalanceDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserBalanceDelete) ExecX ¶
func (ubd *UserBalanceDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserBalanceDelete) Where ¶
func (ubd *UserBalanceDelete) Where(ps ...predicate.UserBalance) *UserBalanceDelete
Where appends a list predicates to the UserBalanceDelete builder.
type UserBalanceDeleteOne ¶
type UserBalanceDeleteOne struct {
// contains filtered or unexported fields
}
UserBalanceDeleteOne is the builder for deleting a single UserBalance entity.
func (*UserBalanceDeleteOne) Exec ¶
func (ubdo *UserBalanceDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserBalanceDeleteOne) ExecX ¶
func (ubdo *UserBalanceDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserBalanceDeleteOne) Where ¶
func (ubdo *UserBalanceDeleteOne) Where(ps ...predicate.UserBalance) *UserBalanceDeleteOne
Where appends a list predicates to the UserBalanceDelete builder.
type UserBalanceGroupBy ¶
type UserBalanceGroupBy struct {
// contains filtered or unexported fields
}
UserBalanceGroupBy is the group-by builder for UserBalance entities.
func (*UserBalanceGroupBy) Aggregate ¶
func (ubgb *UserBalanceGroupBy) Aggregate(fns ...AggregateFunc) *UserBalanceGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserBalanceGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserBalanceGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserBalanceGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserBalanceGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserBalanceGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserBalanceGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserBalanceGroupBy) Scan ¶
func (ubgb *UserBalanceGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserBalanceGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserBalanceMutation ¶
type UserBalanceMutation struct {
// contains filtered or unexported fields
}
UserBalanceMutation represents an operation that mutates the UserBalance nodes in the graph.
func (*UserBalanceMutation) AddBalance ¶
func (m *UserBalanceMutation) AddBalance(f float64)
AddBalance adds f to the "balance" field.
func (*UserBalanceMutation) AddField ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) AddedBalance ¶
func (m *UserBalanceMutation) AddedBalance() (r float64, exists bool)
AddedBalance returns the value that was added to the "balance" field in this mutation.
func (*UserBalanceMutation) AddedEdges ¶
func (m *UserBalanceMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserBalanceMutation) AddedField ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) AddedFields ¶
func (m *UserBalanceMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserBalanceMutation) AddedIDs ¶
func (m *UserBalanceMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserBalanceMutation) Balance ¶
func (m *UserBalanceMutation) Balance() (r float64, exists bool)
Balance returns the value of the "balance" field in the mutation.
func (*UserBalanceMutation) ClearEdge ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) ClearField ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) ClearedEdges ¶
func (m *UserBalanceMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserBalanceMutation) ClearedFields ¶
func (m *UserBalanceMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserBalanceMutation) Client ¶
func (m UserBalanceMutation) 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 (*UserBalanceMutation) CreatedAt ¶
func (m *UserBalanceMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserBalanceMutation) EdgeCleared ¶
func (m *UserBalanceMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserBalanceMutation) Field ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) FieldCleared ¶
func (m *UserBalanceMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserBalanceMutation) Fields ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) ID ¶
func (m *UserBalanceMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserBalanceMutation) IDs ¶
func (m *UserBalanceMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserBalanceMutation) OldBalance ¶
func (m *UserBalanceMutation) OldBalance(ctx context.Context) (v float64, err error)
OldBalance returns the old "balance" field's value of the UserBalance entity. If the UserBalance 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 (*UserBalanceMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the UserBalance entity. If the UserBalance 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 (*UserBalanceMutation) 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 (*UserBalanceMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the UserBalance entity. If the UserBalance 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 (*UserBalanceMutation) OldUserID ¶
func (m *UserBalanceMutation) OldUserID(ctx context.Context) (v string, err error)
OldUserID returns the old "user_id" field's value of the UserBalance entity. If the UserBalance 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 (*UserBalanceMutation) Op ¶
func (m *UserBalanceMutation) Op() Op
Op returns the operation name.
func (*UserBalanceMutation) RemovedEdges ¶
func (m *UserBalanceMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserBalanceMutation) RemovedIDs ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) ResetBalance ¶
func (m *UserBalanceMutation) ResetBalance()
ResetBalance resets all changes to the "balance" field.
func (*UserBalanceMutation) ResetCreatedAt ¶
func (m *UserBalanceMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserBalanceMutation) ResetEdge ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) ResetField ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) ResetUpdatedAt ¶
func (m *UserBalanceMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserBalanceMutation) ResetUserID ¶
func (m *UserBalanceMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*UserBalanceMutation) SetBalance ¶
func (m *UserBalanceMutation) SetBalance(f float64)
SetBalance sets the "balance" field.
func (*UserBalanceMutation) SetCreatedAt ¶
func (m *UserBalanceMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserBalanceMutation) SetField ¶
func (m *UserBalanceMutation) 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 (*UserBalanceMutation) SetOp ¶
func (m *UserBalanceMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserBalanceMutation) SetUpdatedAt ¶
func (m *UserBalanceMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserBalanceMutation) SetUserID ¶
func (m *UserBalanceMutation) SetUserID(s string)
SetUserID sets the "user_id" field.
func (UserBalanceMutation) Tx ¶
func (m UserBalanceMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserBalanceMutation) Type ¶
func (m *UserBalanceMutation) Type() string
Type returns the node type of this mutation (UserBalance).
func (*UserBalanceMutation) UpdatedAt ¶
func (m *UserBalanceMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserBalanceMutation) UserID ¶
func (m *UserBalanceMutation) UserID() (r string, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*UserBalanceMutation) Where ¶
func (m *UserBalanceMutation) Where(ps ...predicate.UserBalance)
Where appends a list predicates to the UserBalanceMutation builder.
func (*UserBalanceMutation) WhereP ¶
func (m *UserBalanceMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserBalanceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserBalanceQuery ¶
type UserBalanceQuery struct {
// contains filtered or unexported fields
}
UserBalanceQuery is the builder for querying UserBalance entities.
func (*UserBalanceQuery) Aggregate ¶
func (ubq *UserBalanceQuery) Aggregate(fns ...AggregateFunc) *UserBalanceSelect
Aggregate returns a UserBalanceSelect configured with the given aggregations.
func (*UserBalanceQuery) All ¶
func (ubq *UserBalanceQuery) All(ctx context.Context) ([]*UserBalance, error)
All executes the query and returns a list of UserBalances.
func (*UserBalanceQuery) AllX ¶
func (ubq *UserBalanceQuery) AllX(ctx context.Context) []*UserBalance
AllX is like All, but panics if an error occurs.
func (*UserBalanceQuery) Clone ¶
func (ubq *UserBalanceQuery) Clone() *UserBalanceQuery
Clone returns a duplicate of the UserBalanceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserBalanceQuery) Count ¶
func (ubq *UserBalanceQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserBalanceQuery) CountX ¶
func (ubq *UserBalanceQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserBalanceQuery) Exist ¶
func (ubq *UserBalanceQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserBalanceQuery) ExistX ¶
func (ubq *UserBalanceQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserBalanceQuery) First ¶
func (ubq *UserBalanceQuery) First(ctx context.Context) (*UserBalance, error)
First returns the first UserBalance entity from the query. Returns a *NotFoundError when no UserBalance was found.
func (*UserBalanceQuery) FirstID ¶
func (ubq *UserBalanceQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first UserBalance ID from the query. Returns a *NotFoundError when no UserBalance ID was found.
func (*UserBalanceQuery) FirstIDX ¶
func (ubq *UserBalanceQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserBalanceQuery) FirstX ¶
func (ubq *UserBalanceQuery) FirstX(ctx context.Context) *UserBalance
FirstX is like First, but panics if an error occurs.
func (*UserBalanceQuery) GroupBy ¶
func (ubq *UserBalanceQuery) GroupBy(field string, fields ...string) *UserBalanceGroupBy
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 { UserID string `json:"user_id,omitempty"` Count int `json:"count,omitempty"` } client.UserBalance.Query(). GroupBy(userbalance.FieldUserID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserBalanceQuery) IDs ¶
func (ubq *UserBalanceQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of UserBalance IDs.
func (*UserBalanceQuery) IDsX ¶
func (ubq *UserBalanceQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*UserBalanceQuery) Limit ¶
func (ubq *UserBalanceQuery) Limit(limit int) *UserBalanceQuery
Limit the number of records to be returned by this query.
func (*UserBalanceQuery) Offset ¶
func (ubq *UserBalanceQuery) Offset(offset int) *UserBalanceQuery
Offset to start from.
func (*UserBalanceQuery) Only ¶
func (ubq *UserBalanceQuery) Only(ctx context.Context) (*UserBalance, error)
Only returns a single UserBalance entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserBalance entity is found. Returns a *NotFoundError when no UserBalance entities are found.
func (*UserBalanceQuery) OnlyID ¶
func (ubq *UserBalanceQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only UserBalance ID in the query. Returns a *NotSingularError when more than one UserBalance ID is found. Returns a *NotFoundError when no entities are found.
func (*UserBalanceQuery) OnlyIDX ¶
func (ubq *UserBalanceQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserBalanceQuery) OnlyX ¶
func (ubq *UserBalanceQuery) OnlyX(ctx context.Context) *UserBalance
OnlyX is like Only, but panics if an error occurs.
func (*UserBalanceQuery) Order ¶
func (ubq *UserBalanceQuery) Order(o ...userbalance.OrderOption) *UserBalanceQuery
Order specifies how the records should be ordered.
func (*UserBalanceQuery) Select ¶
func (ubq *UserBalanceQuery) Select(fields ...string) *UserBalanceSelect
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 { UserID string `json:"user_id,omitempty"` } client.UserBalance.Query(). Select(userbalance.FieldUserID). Scan(ctx, &v)
func (*UserBalanceQuery) Unique ¶
func (ubq *UserBalanceQuery) Unique(unique bool) *UserBalanceQuery
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 (*UserBalanceQuery) Where ¶
func (ubq *UserBalanceQuery) Where(ps ...predicate.UserBalance) *UserBalanceQuery
Where adds a new predicate for the UserBalanceQuery builder.
type UserBalanceSelect ¶
type UserBalanceSelect struct { *UserBalanceQuery // contains filtered or unexported fields }
UserBalanceSelect is the builder for selecting fields of UserBalance entities.
func (*UserBalanceSelect) Aggregate ¶
func (ubs *UserBalanceSelect) Aggregate(fns ...AggregateFunc) *UserBalanceSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserBalanceSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserBalanceSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserBalanceSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserBalanceSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserBalanceSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserBalanceSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserBalanceSelect) Scan ¶
func (ubs *UserBalanceSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserBalanceSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserBalanceUpdate ¶
type UserBalanceUpdate struct {
// contains filtered or unexported fields
}
UserBalanceUpdate is the builder for updating UserBalance entities.
func (*UserBalanceUpdate) AddBalance ¶
func (ubu *UserBalanceUpdate) AddBalance(f float64) *UserBalanceUpdate
AddBalance adds f to the "balance" field.
func (*UserBalanceUpdate) Exec ¶
func (ubu *UserBalanceUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserBalanceUpdate) ExecX ¶
func (ubu *UserBalanceUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserBalanceUpdate) Mutation ¶
func (ubu *UserBalanceUpdate) Mutation() *UserBalanceMutation
Mutation returns the UserBalanceMutation object of the builder.
func (*UserBalanceUpdate) Save ¶
func (ubu *UserBalanceUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserBalanceUpdate) SaveX ¶
func (ubu *UserBalanceUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserBalanceUpdate) SetBalance ¶
func (ubu *UserBalanceUpdate) SetBalance(f float64) *UserBalanceUpdate
SetBalance sets the "balance" field.
func (*UserBalanceUpdate) SetUpdatedAt ¶
func (ubu *UserBalanceUpdate) SetUpdatedAt(t time.Time) *UserBalanceUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserBalanceUpdate) SetUserID ¶
func (ubu *UserBalanceUpdate) SetUserID(s string) *UserBalanceUpdate
SetUserID sets the "user_id" field.
func (*UserBalanceUpdate) Where ¶
func (ubu *UserBalanceUpdate) Where(ps ...predicate.UserBalance) *UserBalanceUpdate
Where appends a list predicates to the UserBalanceUpdate builder.
type UserBalanceUpdateOne ¶
type UserBalanceUpdateOne struct {
// contains filtered or unexported fields
}
UserBalanceUpdateOne is the builder for updating a single UserBalance entity.
func (*UserBalanceUpdateOne) AddBalance ¶
func (ubuo *UserBalanceUpdateOne) AddBalance(f float64) *UserBalanceUpdateOne
AddBalance adds f to the "balance" field.
func (*UserBalanceUpdateOne) Exec ¶
func (ubuo *UserBalanceUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserBalanceUpdateOne) ExecX ¶
func (ubuo *UserBalanceUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserBalanceUpdateOne) Mutation ¶
func (ubuo *UserBalanceUpdateOne) Mutation() *UserBalanceMutation
Mutation returns the UserBalanceMutation object of the builder.
func (*UserBalanceUpdateOne) Save ¶
func (ubuo *UserBalanceUpdateOne) Save(ctx context.Context) (*UserBalance, error)
Save executes the query and returns the updated UserBalance entity.
func (*UserBalanceUpdateOne) SaveX ¶
func (ubuo *UserBalanceUpdateOne) SaveX(ctx context.Context) *UserBalance
SaveX is like Save, but panics if an error occurs.
func (*UserBalanceUpdateOne) Select ¶
func (ubuo *UserBalanceUpdateOne) Select(field string, fields ...string) *UserBalanceUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserBalanceUpdateOne) SetBalance ¶
func (ubuo *UserBalanceUpdateOne) SetBalance(f float64) *UserBalanceUpdateOne
SetBalance sets the "balance" field.
func (*UserBalanceUpdateOne) SetUpdatedAt ¶
func (ubuo *UserBalanceUpdateOne) SetUpdatedAt(t time.Time) *UserBalanceUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserBalanceUpdateOne) SetUserID ¶
func (ubuo *UserBalanceUpdateOne) SetUserID(s string) *UserBalanceUpdateOne
SetUserID sets the "user_id" field.
func (*UserBalanceUpdateOne) Where ¶
func (ubuo *UserBalanceUpdateOne) Where(ps ...predicate.UserBalance) *UserBalanceUpdateOne
Where appends a list predicates to the UserBalanceUpdate builder.
type UserBalances ¶
type UserBalances []*UserBalance
UserBalances is a parsable slice of UserBalance.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetAccount ¶
func (uc *UserCreate) SetAccount(s string) *UserCreate
SetAccount sets the "account" field.
func (*UserCreate) SetBirthday ¶
func (uc *UserCreate) SetBirthday(t time.Time) *UserCreate
SetBirthday sets the "birthday" field.
func (*UserCreate) SetCreatedAt ¶
func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetFullName ¶
func (uc *UserCreate) SetFullName(s string) *UserCreate
SetFullName sets the "full_name" field.
func (*UserCreate) SetLatestLogin ¶
func (uc *UserCreate) SetLatestLogin(t time.Time) *UserCreate
SetLatestLogin sets the "latest_login" field.
func (*UserCreate) SetNillableCreatedAt ¶
func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(s string) *UserCreate
SetPassword sets the "password" field.
func (*UserCreate) SetPhoneNumer ¶
func (uc *UserCreate) SetPhoneNumer(s string) *UserCreate
SetPhoneNumer sets the "phone_numer" field.
func (*UserCreate) SetUpdatedAt ¶
func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserCreate) SetUserID ¶
func (uc *UserCreate) SetUserID(s string) *UserCreate
SetUserID sets the "user_id" field.
func (*UserCreate) SetUserName ¶
func (uc *UserCreate) SetUserName(s string) *UserCreate
SetUserName sets the "user_name" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) Account ¶
func (m *UserMutation) Account() (r string, exists bool)
Account returns the value of the "account" field in the mutation.
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) 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) Birthday ¶
func (m *UserMutation) Birthday() (r time.Time, exists bool)
Birthday returns the value of the "birthday" field in the mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) 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) FullName ¶
func (m *UserMutation) FullName() (r string, exists bool)
FullName returns the value of the "full_name" field in the mutation.
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) LatestLogin ¶
func (m *UserMutation) LatestLogin() (r time.Time, exists bool)
LatestLogin returns the value of the "latest_login" field in the mutation.
func (*UserMutation) OldAccount ¶
func (m *UserMutation) OldAccount(ctx context.Context) (v string, err error)
OldAccount returns the old "account" 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) OldBirthday ¶
OldBirthday returns the old "birthday" 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) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v *string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) 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) OldFullName ¶
func (m *UserMutation) OldFullName(ctx context.Context) (v string, err error)
OldFullName returns the old "full_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldLatestLogin ¶
OldLatestLogin returns the old "latest_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) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)
OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldPhoneNumer ¶
func (m *UserMutation) OldPhoneNumer(ctx context.Context) (v *string, err error)
OldPhoneNumer returns the old "phone_numer" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUserID ¶
func (m *UserMutation) OldUserID(ctx context.Context) (v *string, err error)
OldUserID returns the old "user_id" 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) OldUserName ¶
func (m *UserMutation) OldUserName(ctx context.Context) (v *string, err error)
OldUserName returns the old "user_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) Password ¶
func (m *UserMutation) Password() (r string, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) PhoneNumer ¶
func (m *UserMutation) PhoneNumer() (r string, exists bool)
PhoneNumer returns the value of the "phone_numer" field in the mutation.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) ResetAccount ¶
func (m *UserMutation) ResetAccount()
ResetAccount resets all changes to the "account" field.
func (*UserMutation) ResetBirthday ¶
func (m *UserMutation) ResetBirthday()
ResetBirthday resets all changes to the "birthday" field.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) 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) ResetFullName ¶
func (m *UserMutation) ResetFullName()
ResetFullName resets all changes to the "full_name" field.
func (*UserMutation) ResetLatestLogin ¶
func (m *UserMutation) ResetLatestLogin()
ResetLatestLogin resets all changes to the "latest_login" field.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetPhoneNumer ¶
func (m *UserMutation) ResetPhoneNumer()
ResetPhoneNumer resets all changes to the "phone_numer" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetUserID ¶
func (m *UserMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*UserMutation) ResetUserName ¶
func (m *UserMutation) ResetUserName()
ResetUserName resets all changes to the "user_name" field.
func (*UserMutation) SetAccount ¶
func (m *UserMutation) SetAccount(s string)
SetAccount sets the "account" field.
func (*UserMutation) SetBirthday ¶
func (m *UserMutation) SetBirthday(t time.Time)
SetBirthday sets the "birthday" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) 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) SetFullName ¶
func (m *UserMutation) SetFullName(s string)
SetFullName sets the "full_name" field.
func (*UserMutation) SetLatestLogin ¶
func (m *UserMutation) SetLatestLogin(t time.Time)
SetLatestLogin sets the "latest_login" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(s string)
SetPassword sets the "password" field.
func (*UserMutation) SetPhoneNumer ¶
func (m *UserMutation) SetPhoneNumer(s string)
SetPhoneNumer sets the "phone_numer" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserMutation) SetUserID ¶
func (m *UserMutation) SetUserID(s string)
SetUserID sets the "user_id" field.
func (*UserMutation) SetUserName ¶
func (m *UserMutation) SetUserName(s string)
SetUserName sets the "user_name" 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) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) UserID ¶
func (m *UserMutation) UserID() (r string, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*UserMutation) UserName ¶
func (m *UserMutation) UserName() (r string, exists bool)
UserName returns the value of the "user_name" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) Order ¶
func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.User.Query(). Select(user.FieldCreatedAt). Scan(ctx, &v)
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetAccount ¶
func (uu *UserUpdate) SetAccount(s string) *UserUpdate
SetAccount sets the "account" field.
func (*UserUpdate) SetBirthday ¶
func (uu *UserUpdate) SetBirthday(t time.Time) *UserUpdate
SetBirthday sets the "birthday" field.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetFullName ¶
func (uu *UserUpdate) SetFullName(s string) *UserUpdate
SetFullName sets the "full_name" field.
func (*UserUpdate) SetLatestLogin ¶
func (uu *UserUpdate) SetLatestLogin(t time.Time) *UserUpdate
SetLatestLogin sets the "latest_login" field.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(s string) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) SetPhoneNumer ¶
func (uu *UserUpdate) SetPhoneNumer(s string) *UserUpdate
SetPhoneNumer sets the "phone_numer" field.
func (*UserUpdate) SetUpdatedAt ¶
func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) SetUserID ¶
func (uu *UserUpdate) SetUserID(s string) *UserUpdate
SetUserID sets the "user_id" field.
func (*UserUpdate) SetUserName ¶
func (uu *UserUpdate) SetUserName(s string) *UserUpdate
SetUserName sets the "user_name" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetAccount ¶
func (uuo *UserUpdateOne) SetAccount(s string) *UserUpdateOne
SetAccount sets the "account" field.
func (*UserUpdateOne) SetBirthday ¶
func (uuo *UserUpdateOne) SetBirthday(t time.Time) *UserUpdateOne
SetBirthday sets the "birthday" field.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetFullName ¶
func (uuo *UserUpdateOne) SetFullName(s string) *UserUpdateOne
SetFullName sets the "full_name" field.
func (*UserUpdateOne) SetLatestLogin ¶
func (uuo *UserUpdateOne) SetLatestLogin(t time.Time) *UserUpdateOne
SetLatestLogin sets the "latest_login" field.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne
SetPassword sets the "password" field.
func (*UserUpdateOne) SetPhoneNumer ¶
func (uuo *UserUpdateOne) SetPhoneNumer(s string) *UserUpdateOne
SetPhoneNumer sets the "phone_numer" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) SetUserID ¶
func (uuo *UserUpdateOne) SetUserID(s string) *UserUpdateOne
SetUserID sets the "user_id" field.
func (*UserUpdateOne) SetUserName ¶
func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne
SetUserName sets the "user_name" field.
func (*UserUpdateOne) Where ¶
func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type UserVoucher ¶
type UserVoucher struct { // ID of the ent. ID int `json:"id,omitempty"` // VoucherCampaignID holds the value of the "voucher_campaign_id" field. VoucherCampaignID int64 `json:"voucher_campaign_id,omitempty"` // UserID holds the value of the "user_id" field. UserID string `json:"user_id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
UserVoucher is the model entity for the UserVoucher schema.
func (*UserVoucher) String ¶
func (uv *UserVoucher) String() string
String implements the fmt.Stringer.
func (*UserVoucher) Unwrap ¶
func (uv *UserVoucher) Unwrap() *UserVoucher
Unwrap unwraps the UserVoucher 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 (*UserVoucher) Update ¶
func (uv *UserVoucher) Update() *UserVoucherUpdateOne
Update returns a builder for updating this UserVoucher. Note that you need to call UserVoucher.Unwrap() before calling this method if this UserVoucher was returned from a transaction, and the transaction was committed or rolled back.
type UserVoucherClient ¶
type UserVoucherClient struct {
// contains filtered or unexported fields
}
UserVoucherClient is a client for the UserVoucher schema.
func NewUserVoucherClient ¶
func NewUserVoucherClient(c config) *UserVoucherClient
NewUserVoucherClient returns a client for the UserVoucher from the given config.
func (*UserVoucherClient) Create ¶
func (c *UserVoucherClient) Create() *UserVoucherCreate
Create returns a builder for creating a UserVoucher entity.
func (*UserVoucherClient) CreateBulk ¶
func (c *UserVoucherClient) CreateBulk(builders ...*UserVoucherCreate) *UserVoucherCreateBulk
CreateBulk returns a builder for creating a bulk of UserVoucher entities.
func (*UserVoucherClient) Delete ¶
func (c *UserVoucherClient) Delete() *UserVoucherDelete
Delete returns a delete builder for UserVoucher.
func (*UserVoucherClient) DeleteOne ¶
func (c *UserVoucherClient) DeleteOne(uv *UserVoucher) *UserVoucherDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserVoucherClient) DeleteOneID ¶
func (c *UserVoucherClient) DeleteOneID(id int) *UserVoucherDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserVoucherClient) Get ¶
func (c *UserVoucherClient) Get(ctx context.Context, id int) (*UserVoucher, error)
Get returns a UserVoucher entity by its id.
func (*UserVoucherClient) GetX ¶
func (c *UserVoucherClient) GetX(ctx context.Context, id int) *UserVoucher
GetX is like Get, but panics if an error occurs.
func (*UserVoucherClient) Hooks ¶
func (c *UserVoucherClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserVoucherClient) Intercept ¶
func (c *UserVoucherClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `uservoucher.Intercept(f(g(h())))`.
func (*UserVoucherClient) Interceptors ¶
func (c *UserVoucherClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserVoucherClient) MapCreateBulk ¶
func (c *UserVoucherClient) MapCreateBulk(slice any, setFunc func(*UserVoucherCreate, int)) *UserVoucherCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserVoucherClient) Query ¶
func (c *UserVoucherClient) Query() *UserVoucherQuery
Query returns a query builder for UserVoucher.
func (*UserVoucherClient) Update ¶
func (c *UserVoucherClient) Update() *UserVoucherUpdate
Update returns an update builder for UserVoucher.
func (*UserVoucherClient) UpdateOne ¶
func (c *UserVoucherClient) UpdateOne(uv *UserVoucher) *UserVoucherUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserVoucherClient) UpdateOneID ¶
func (c *UserVoucherClient) UpdateOneID(id int) *UserVoucherUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserVoucherClient) Use ¶
func (c *UserVoucherClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `uservoucher.Hooks(f(g(h())))`.
type UserVoucherCreate ¶
type UserVoucherCreate struct {
// contains filtered or unexported fields
}
UserVoucherCreate is the builder for creating a UserVoucher entity.
func (*UserVoucherCreate) Exec ¶
func (uvc *UserVoucherCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserVoucherCreate) ExecX ¶
func (uvc *UserVoucherCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserVoucherCreate) Mutation ¶
func (uvc *UserVoucherCreate) Mutation() *UserVoucherMutation
Mutation returns the UserVoucherMutation object of the builder.
func (*UserVoucherCreate) Save ¶
func (uvc *UserVoucherCreate) Save(ctx context.Context) (*UserVoucher, error)
Save creates the UserVoucher in the database.
func (*UserVoucherCreate) SaveX ¶
func (uvc *UserVoucherCreate) SaveX(ctx context.Context) *UserVoucher
SaveX calls Save and panics if Save returns an error.
func (*UserVoucherCreate) SetCreatedAt ¶
func (uvc *UserVoucherCreate) SetCreatedAt(t time.Time) *UserVoucherCreate
SetCreatedAt sets the "created_at" field.
func (*UserVoucherCreate) SetNillableCreatedAt ¶
func (uvc *UserVoucherCreate) SetNillableCreatedAt(t *time.Time) *UserVoucherCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserVoucherCreate) SetNillableUpdatedAt ¶
func (uvc *UserVoucherCreate) SetNillableUpdatedAt(t *time.Time) *UserVoucherCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserVoucherCreate) SetUpdatedAt ¶
func (uvc *UserVoucherCreate) SetUpdatedAt(t time.Time) *UserVoucherCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserVoucherCreate) SetUserID ¶
func (uvc *UserVoucherCreate) SetUserID(s string) *UserVoucherCreate
SetUserID sets the "user_id" field.
func (*UserVoucherCreate) SetVoucherCampaignID ¶
func (uvc *UserVoucherCreate) SetVoucherCampaignID(i int64) *UserVoucherCreate
SetVoucherCampaignID sets the "voucher_campaign_id" field.
type UserVoucherCreateBulk ¶
type UserVoucherCreateBulk struct {
// contains filtered or unexported fields
}
UserVoucherCreateBulk is the builder for creating many UserVoucher entities in bulk.
func (*UserVoucherCreateBulk) Exec ¶
func (uvcb *UserVoucherCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserVoucherCreateBulk) ExecX ¶
func (uvcb *UserVoucherCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserVoucherCreateBulk) Save ¶
func (uvcb *UserVoucherCreateBulk) Save(ctx context.Context) ([]*UserVoucher, error)
Save creates the UserVoucher entities in the database.
func (*UserVoucherCreateBulk) SaveX ¶
func (uvcb *UserVoucherCreateBulk) SaveX(ctx context.Context) []*UserVoucher
SaveX is like Save, but panics if an error occurs.
type UserVoucherDelete ¶
type UserVoucherDelete struct {
// contains filtered or unexported fields
}
UserVoucherDelete is the builder for deleting a UserVoucher entity.
func (*UserVoucherDelete) Exec ¶
func (uvd *UserVoucherDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserVoucherDelete) ExecX ¶
func (uvd *UserVoucherDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserVoucherDelete) Where ¶
func (uvd *UserVoucherDelete) Where(ps ...predicate.UserVoucher) *UserVoucherDelete
Where appends a list predicates to the UserVoucherDelete builder.
type UserVoucherDeleteOne ¶
type UserVoucherDeleteOne struct {
// contains filtered or unexported fields
}
UserVoucherDeleteOne is the builder for deleting a single UserVoucher entity.
func (*UserVoucherDeleteOne) Exec ¶
func (uvdo *UserVoucherDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserVoucherDeleteOne) ExecX ¶
func (uvdo *UserVoucherDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserVoucherDeleteOne) Where ¶
func (uvdo *UserVoucherDeleteOne) Where(ps ...predicate.UserVoucher) *UserVoucherDeleteOne
Where appends a list predicates to the UserVoucherDelete builder.
type UserVoucherGroupBy ¶
type UserVoucherGroupBy struct {
// contains filtered or unexported fields
}
UserVoucherGroupBy is the group-by builder for UserVoucher entities.
func (*UserVoucherGroupBy) Aggregate ¶
func (uvgb *UserVoucherGroupBy) Aggregate(fns ...AggregateFunc) *UserVoucherGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserVoucherGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserVoucherGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserVoucherGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserVoucherGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserVoucherGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserVoucherGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserVoucherGroupBy) Scan ¶
func (uvgb *UserVoucherGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserVoucherGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserVoucherMutation ¶
type UserVoucherMutation struct {
// contains filtered or unexported fields
}
UserVoucherMutation represents an operation that mutates the UserVoucher nodes in the graph.
func (*UserVoucherMutation) AddField ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) AddVoucherCampaignID ¶
func (m *UserVoucherMutation) AddVoucherCampaignID(i int64)
AddVoucherCampaignID adds i to the "voucher_campaign_id" field.
func (*UserVoucherMutation) AddedEdges ¶
func (m *UserVoucherMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserVoucherMutation) AddedField ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) AddedFields ¶
func (m *UserVoucherMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserVoucherMutation) AddedIDs ¶
func (m *UserVoucherMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserVoucherMutation) AddedVoucherCampaignID ¶
func (m *UserVoucherMutation) AddedVoucherCampaignID() (r int64, exists bool)
AddedVoucherCampaignID returns the value that was added to the "voucher_campaign_id" field in this mutation.
func (*UserVoucherMutation) ClearEdge ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) ClearField ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) ClearedEdges ¶
func (m *UserVoucherMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserVoucherMutation) ClearedFields ¶
func (m *UserVoucherMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserVoucherMutation) Client ¶
func (m UserVoucherMutation) 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 (*UserVoucherMutation) CreatedAt ¶
func (m *UserVoucherMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserVoucherMutation) EdgeCleared ¶
func (m *UserVoucherMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserVoucherMutation) Field ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) FieldCleared ¶
func (m *UserVoucherMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserVoucherMutation) Fields ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) ID ¶
func (m *UserVoucherMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserVoucherMutation) IDs ¶
func (m *UserVoucherMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserVoucherMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the UserVoucher entity. If the UserVoucher 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 (*UserVoucherMutation) 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 (*UserVoucherMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the UserVoucher entity. If the UserVoucher 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 (*UserVoucherMutation) OldUserID ¶
func (m *UserVoucherMutation) OldUserID(ctx context.Context) (v string, err error)
OldUserID returns the old "user_id" field's value of the UserVoucher entity. If the UserVoucher 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 (*UserVoucherMutation) OldVoucherCampaignID ¶
func (m *UserVoucherMutation) OldVoucherCampaignID(ctx context.Context) (v int64, err error)
OldVoucherCampaignID returns the old "voucher_campaign_id" field's value of the UserVoucher entity. If the UserVoucher 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 (*UserVoucherMutation) Op ¶
func (m *UserVoucherMutation) Op() Op
Op returns the operation name.
func (*UserVoucherMutation) RemovedEdges ¶
func (m *UserVoucherMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserVoucherMutation) RemovedIDs ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) ResetCreatedAt ¶
func (m *UserVoucherMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserVoucherMutation) ResetEdge ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) ResetField ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) ResetUpdatedAt ¶
func (m *UserVoucherMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserVoucherMutation) ResetUserID ¶
func (m *UserVoucherMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*UserVoucherMutation) ResetVoucherCampaignID ¶
func (m *UserVoucherMutation) ResetVoucherCampaignID()
ResetVoucherCampaignID resets all changes to the "voucher_campaign_id" field.
func (*UserVoucherMutation) SetCreatedAt ¶
func (m *UserVoucherMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserVoucherMutation) SetField ¶
func (m *UserVoucherMutation) 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 (*UserVoucherMutation) SetOp ¶
func (m *UserVoucherMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserVoucherMutation) SetUpdatedAt ¶
func (m *UserVoucherMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserVoucherMutation) SetUserID ¶
func (m *UserVoucherMutation) SetUserID(s string)
SetUserID sets the "user_id" field.
func (*UserVoucherMutation) SetVoucherCampaignID ¶
func (m *UserVoucherMutation) SetVoucherCampaignID(i int64)
SetVoucherCampaignID sets the "voucher_campaign_id" field.
func (UserVoucherMutation) Tx ¶
func (m UserVoucherMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserVoucherMutation) Type ¶
func (m *UserVoucherMutation) Type() string
Type returns the node type of this mutation (UserVoucher).
func (*UserVoucherMutation) UpdatedAt ¶
func (m *UserVoucherMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserVoucherMutation) UserID ¶
func (m *UserVoucherMutation) UserID() (r string, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*UserVoucherMutation) VoucherCampaignID ¶
func (m *UserVoucherMutation) VoucherCampaignID() (r int64, exists bool)
VoucherCampaignID returns the value of the "voucher_campaign_id" field in the mutation.
func (*UserVoucherMutation) Where ¶
func (m *UserVoucherMutation) Where(ps ...predicate.UserVoucher)
Where appends a list predicates to the UserVoucherMutation builder.
func (*UserVoucherMutation) WhereP ¶
func (m *UserVoucherMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserVoucherMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserVoucherQuery ¶
type UserVoucherQuery struct {
// contains filtered or unexported fields
}
UserVoucherQuery is the builder for querying UserVoucher entities.
func (*UserVoucherQuery) Aggregate ¶
func (uvq *UserVoucherQuery) Aggregate(fns ...AggregateFunc) *UserVoucherSelect
Aggregate returns a UserVoucherSelect configured with the given aggregations.
func (*UserVoucherQuery) All ¶
func (uvq *UserVoucherQuery) All(ctx context.Context) ([]*UserVoucher, error)
All executes the query and returns a list of UserVouchers.
func (*UserVoucherQuery) AllX ¶
func (uvq *UserVoucherQuery) AllX(ctx context.Context) []*UserVoucher
AllX is like All, but panics if an error occurs.
func (*UserVoucherQuery) Clone ¶
func (uvq *UserVoucherQuery) Clone() *UserVoucherQuery
Clone returns a duplicate of the UserVoucherQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserVoucherQuery) Count ¶
func (uvq *UserVoucherQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserVoucherQuery) CountX ¶
func (uvq *UserVoucherQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserVoucherQuery) Exist ¶
func (uvq *UserVoucherQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserVoucherQuery) ExistX ¶
func (uvq *UserVoucherQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserVoucherQuery) First ¶
func (uvq *UserVoucherQuery) First(ctx context.Context) (*UserVoucher, error)
First returns the first UserVoucher entity from the query. Returns a *NotFoundError when no UserVoucher was found.
func (*UserVoucherQuery) FirstID ¶
func (uvq *UserVoucherQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first UserVoucher ID from the query. Returns a *NotFoundError when no UserVoucher ID was found.
func (*UserVoucherQuery) FirstIDX ¶
func (uvq *UserVoucherQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserVoucherQuery) FirstX ¶
func (uvq *UserVoucherQuery) FirstX(ctx context.Context) *UserVoucher
FirstX is like First, but panics if an error occurs.
func (*UserVoucherQuery) GroupBy ¶
func (uvq *UserVoucherQuery) GroupBy(field string, fields ...string) *UserVoucherGroupBy
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 { VoucherCampaignID int64 `json:"voucher_campaign_id,omitempty"` Count int `json:"count,omitempty"` } client.UserVoucher.Query(). GroupBy(uservoucher.FieldVoucherCampaignID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserVoucherQuery) IDs ¶
func (uvq *UserVoucherQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of UserVoucher IDs.
func (*UserVoucherQuery) IDsX ¶
func (uvq *UserVoucherQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*UserVoucherQuery) Limit ¶
func (uvq *UserVoucherQuery) Limit(limit int) *UserVoucherQuery
Limit the number of records to be returned by this query.
func (*UserVoucherQuery) Offset ¶
func (uvq *UserVoucherQuery) Offset(offset int) *UserVoucherQuery
Offset to start from.
func (*UserVoucherQuery) Only ¶
func (uvq *UserVoucherQuery) Only(ctx context.Context) (*UserVoucher, error)
Only returns a single UserVoucher entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserVoucher entity is found. Returns a *NotFoundError when no UserVoucher entities are found.
func (*UserVoucherQuery) OnlyID ¶
func (uvq *UserVoucherQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only UserVoucher ID in the query. Returns a *NotSingularError when more than one UserVoucher ID is found. Returns a *NotFoundError when no entities are found.
func (*UserVoucherQuery) OnlyIDX ¶
func (uvq *UserVoucherQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserVoucherQuery) OnlyX ¶
func (uvq *UserVoucherQuery) OnlyX(ctx context.Context) *UserVoucher
OnlyX is like Only, but panics if an error occurs.
func (*UserVoucherQuery) Order ¶
func (uvq *UserVoucherQuery) Order(o ...uservoucher.OrderOption) *UserVoucherQuery
Order specifies how the records should be ordered.
func (*UserVoucherQuery) Select ¶
func (uvq *UserVoucherQuery) Select(fields ...string) *UserVoucherSelect
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 { VoucherCampaignID int64 `json:"voucher_campaign_id,omitempty"` } client.UserVoucher.Query(). Select(uservoucher.FieldVoucherCampaignID). Scan(ctx, &v)
func (*UserVoucherQuery) Unique ¶
func (uvq *UserVoucherQuery) Unique(unique bool) *UserVoucherQuery
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 (*UserVoucherQuery) Where ¶
func (uvq *UserVoucherQuery) Where(ps ...predicate.UserVoucher) *UserVoucherQuery
Where adds a new predicate for the UserVoucherQuery builder.
type UserVoucherSelect ¶
type UserVoucherSelect struct { *UserVoucherQuery // contains filtered or unexported fields }
UserVoucherSelect is the builder for selecting fields of UserVoucher entities.
func (*UserVoucherSelect) Aggregate ¶
func (uvs *UserVoucherSelect) Aggregate(fns ...AggregateFunc) *UserVoucherSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserVoucherSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserVoucherSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserVoucherSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserVoucherSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserVoucherSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserVoucherSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserVoucherSelect) Scan ¶
func (uvs *UserVoucherSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserVoucherSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserVoucherUpdate ¶
type UserVoucherUpdate struct {
// contains filtered or unexported fields
}
UserVoucherUpdate is the builder for updating UserVoucher entities.
func (*UserVoucherUpdate) AddVoucherCampaignID ¶
func (uvu *UserVoucherUpdate) AddVoucherCampaignID(i int64) *UserVoucherUpdate
AddVoucherCampaignID adds i to the "voucher_campaign_id" field.
func (*UserVoucherUpdate) Exec ¶
func (uvu *UserVoucherUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserVoucherUpdate) ExecX ¶
func (uvu *UserVoucherUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserVoucherUpdate) Mutation ¶
func (uvu *UserVoucherUpdate) Mutation() *UserVoucherMutation
Mutation returns the UserVoucherMutation object of the builder.
func (*UserVoucherUpdate) Save ¶
func (uvu *UserVoucherUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserVoucherUpdate) SaveX ¶
func (uvu *UserVoucherUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserVoucherUpdate) SetUpdatedAt ¶
func (uvu *UserVoucherUpdate) SetUpdatedAt(t time.Time) *UserVoucherUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserVoucherUpdate) SetUserID ¶
func (uvu *UserVoucherUpdate) SetUserID(s string) *UserVoucherUpdate
SetUserID sets the "user_id" field.
func (*UserVoucherUpdate) SetVoucherCampaignID ¶
func (uvu *UserVoucherUpdate) SetVoucherCampaignID(i int64) *UserVoucherUpdate
SetVoucherCampaignID sets the "voucher_campaign_id" field.
func (*UserVoucherUpdate) Where ¶
func (uvu *UserVoucherUpdate) Where(ps ...predicate.UserVoucher) *UserVoucherUpdate
Where appends a list predicates to the UserVoucherUpdate builder.
type UserVoucherUpdateOne ¶
type UserVoucherUpdateOne struct {
// contains filtered or unexported fields
}
UserVoucherUpdateOne is the builder for updating a single UserVoucher entity.
func (*UserVoucherUpdateOne) AddVoucherCampaignID ¶
func (uvuo *UserVoucherUpdateOne) AddVoucherCampaignID(i int64) *UserVoucherUpdateOne
AddVoucherCampaignID adds i to the "voucher_campaign_id" field.
func (*UserVoucherUpdateOne) Exec ¶
func (uvuo *UserVoucherUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserVoucherUpdateOne) ExecX ¶
func (uvuo *UserVoucherUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserVoucherUpdateOne) Mutation ¶
func (uvuo *UserVoucherUpdateOne) Mutation() *UserVoucherMutation
Mutation returns the UserVoucherMutation object of the builder.
func (*UserVoucherUpdateOne) Save ¶
func (uvuo *UserVoucherUpdateOne) Save(ctx context.Context) (*UserVoucher, error)
Save executes the query and returns the updated UserVoucher entity.
func (*UserVoucherUpdateOne) SaveX ¶
func (uvuo *UserVoucherUpdateOne) SaveX(ctx context.Context) *UserVoucher
SaveX is like Save, but panics if an error occurs.
func (*UserVoucherUpdateOne) Select ¶
func (uvuo *UserVoucherUpdateOne) Select(field string, fields ...string) *UserVoucherUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserVoucherUpdateOne) SetUpdatedAt ¶
func (uvuo *UserVoucherUpdateOne) SetUpdatedAt(t time.Time) *UserVoucherUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserVoucherUpdateOne) SetUserID ¶
func (uvuo *UserVoucherUpdateOne) SetUserID(s string) *UserVoucherUpdateOne
SetUserID sets the "user_id" field.
func (*UserVoucherUpdateOne) SetVoucherCampaignID ¶
func (uvuo *UserVoucherUpdateOne) SetVoucherCampaignID(i int64) *UserVoucherUpdateOne
SetVoucherCampaignID sets the "voucher_campaign_id" field.
func (*UserVoucherUpdateOne) Where ¶
func (uvuo *UserVoucherUpdateOne) Where(ps ...predicate.UserVoucher) *UserVoucherUpdateOne
Where appends a list predicates to the UserVoucherUpdate builder.
type UserVouchers ¶
type UserVouchers []*UserVoucher
UserVouchers is a parsable slice of UserVoucher.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Voucher ¶
type Voucher struct { // ID of the ent. ID int `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Type holds the value of the "type" field. Type string `json:"type,omitempty"` // Value holds the value of the "value" field. Value float64 `json:"value,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
Voucher is the model entity for the Voucher schema.
func (*Voucher) GetValue ¶
GetValue returns the ent.Value that was dynamically selected and assigned to the Voucher. This includes values selected through modifiers, order, etc.
func (*Voucher) Unwrap ¶
Unwrap unwraps the Voucher 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 (*Voucher) Update ¶
func (v *Voucher) Update() *VoucherUpdateOne
Update returns a builder for updating this Voucher. Note that you need to call Voucher.Unwrap() before calling this method if this Voucher was returned from a transaction, and the transaction was committed or rolled back.
type VoucherCampaign ¶
type VoucherCampaign struct { // ID of the ent. ID int `json:"id,omitempty"` // CampaignID holds the value of the "campaign_id" field. CampaignID int64 `json:"campaign_id,omitempty"` // VoucherID holds the value of the "voucher_id" field. VoucherID int64 `json:"voucher_id,omitempty"` // StartDay holds the value of the "start_day" field. StartDay time.Time `json:"start_day,omitempty"` // ValidTo holds the value of the "valid_to" field. ValidTo time.Time `json:"valid_to,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
VoucherCampaign is the model entity for the VoucherCampaign schema.
func (*VoucherCampaign) String ¶
func (vc *VoucherCampaign) String() string
String implements the fmt.Stringer.
func (*VoucherCampaign) Unwrap ¶
func (vc *VoucherCampaign) Unwrap() *VoucherCampaign
Unwrap unwraps the VoucherCampaign 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 (*VoucherCampaign) Update ¶
func (vc *VoucherCampaign) Update() *VoucherCampaignUpdateOne
Update returns a builder for updating this VoucherCampaign. Note that you need to call VoucherCampaign.Unwrap() before calling this method if this VoucherCampaign was returned from a transaction, and the transaction was committed or rolled back.
type VoucherCampaignClient ¶
type VoucherCampaignClient struct {
// contains filtered or unexported fields
}
VoucherCampaignClient is a client for the VoucherCampaign schema.
func NewVoucherCampaignClient ¶
func NewVoucherCampaignClient(c config) *VoucherCampaignClient
NewVoucherCampaignClient returns a client for the VoucherCampaign from the given config.
func (*VoucherCampaignClient) Create ¶
func (c *VoucherCampaignClient) Create() *VoucherCampaignCreate
Create returns a builder for creating a VoucherCampaign entity.
func (*VoucherCampaignClient) CreateBulk ¶
func (c *VoucherCampaignClient) CreateBulk(builders ...*VoucherCampaignCreate) *VoucherCampaignCreateBulk
CreateBulk returns a builder for creating a bulk of VoucherCampaign entities.
func (*VoucherCampaignClient) Delete ¶
func (c *VoucherCampaignClient) Delete() *VoucherCampaignDelete
Delete returns a delete builder for VoucherCampaign.
func (*VoucherCampaignClient) DeleteOne ¶
func (c *VoucherCampaignClient) DeleteOne(vc *VoucherCampaign) *VoucherCampaignDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VoucherCampaignClient) DeleteOneID ¶
func (c *VoucherCampaignClient) DeleteOneID(id int) *VoucherCampaignDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VoucherCampaignClient) Get ¶
func (c *VoucherCampaignClient) Get(ctx context.Context, id int) (*VoucherCampaign, error)
Get returns a VoucherCampaign entity by its id.
func (*VoucherCampaignClient) GetX ¶
func (c *VoucherCampaignClient) GetX(ctx context.Context, id int) *VoucherCampaign
GetX is like Get, but panics if an error occurs.
func (*VoucherCampaignClient) Hooks ¶
func (c *VoucherCampaignClient) Hooks() []Hook
Hooks returns the client hooks.
func (*VoucherCampaignClient) Intercept ¶
func (c *VoucherCampaignClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `vouchercampaign.Intercept(f(g(h())))`.
func (*VoucherCampaignClient) Interceptors ¶
func (c *VoucherCampaignClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*VoucherCampaignClient) MapCreateBulk ¶
func (c *VoucherCampaignClient) MapCreateBulk(slice any, setFunc func(*VoucherCampaignCreate, int)) *VoucherCampaignCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*VoucherCampaignClient) Query ¶
func (c *VoucherCampaignClient) Query() *VoucherCampaignQuery
Query returns a query builder for VoucherCampaign.
func (*VoucherCampaignClient) Update ¶
func (c *VoucherCampaignClient) Update() *VoucherCampaignUpdate
Update returns an update builder for VoucherCampaign.
func (*VoucherCampaignClient) UpdateOne ¶
func (c *VoucherCampaignClient) UpdateOne(vc *VoucherCampaign) *VoucherCampaignUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VoucherCampaignClient) UpdateOneID ¶
func (c *VoucherCampaignClient) UpdateOneID(id int) *VoucherCampaignUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VoucherCampaignClient) Use ¶
func (c *VoucherCampaignClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `vouchercampaign.Hooks(f(g(h())))`.
type VoucherCampaignCreate ¶
type VoucherCampaignCreate struct {
// contains filtered or unexported fields
}
VoucherCampaignCreate is the builder for creating a VoucherCampaign entity.
func (*VoucherCampaignCreate) Exec ¶
func (vcc *VoucherCampaignCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoucherCampaignCreate) ExecX ¶
func (vcc *VoucherCampaignCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCampaignCreate) Mutation ¶
func (vcc *VoucherCampaignCreate) Mutation() *VoucherCampaignMutation
Mutation returns the VoucherCampaignMutation object of the builder.
func (*VoucherCampaignCreate) Save ¶
func (vcc *VoucherCampaignCreate) Save(ctx context.Context) (*VoucherCampaign, error)
Save creates the VoucherCampaign in the database.
func (*VoucherCampaignCreate) SaveX ¶
func (vcc *VoucherCampaignCreate) SaveX(ctx context.Context) *VoucherCampaign
SaveX calls Save and panics if Save returns an error.
func (*VoucherCampaignCreate) SetCampaignID ¶
func (vcc *VoucherCampaignCreate) SetCampaignID(i int64) *VoucherCampaignCreate
SetCampaignID sets the "campaign_id" field.
func (*VoucherCampaignCreate) SetCreatedAt ¶
func (vcc *VoucherCampaignCreate) SetCreatedAt(t time.Time) *VoucherCampaignCreate
SetCreatedAt sets the "created_at" field.
func (*VoucherCampaignCreate) SetNillableCreatedAt ¶
func (vcc *VoucherCampaignCreate) SetNillableCreatedAt(t *time.Time) *VoucherCampaignCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VoucherCampaignCreate) SetNillableUpdatedAt ¶
func (vcc *VoucherCampaignCreate) SetNillableUpdatedAt(t *time.Time) *VoucherCampaignCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*VoucherCampaignCreate) SetStartDay ¶
func (vcc *VoucherCampaignCreate) SetStartDay(t time.Time) *VoucherCampaignCreate
SetStartDay sets the "start_day" field.
func (*VoucherCampaignCreate) SetUpdatedAt ¶
func (vcc *VoucherCampaignCreate) SetUpdatedAt(t time.Time) *VoucherCampaignCreate
SetUpdatedAt sets the "updated_at" field.
func (*VoucherCampaignCreate) SetValidTo ¶
func (vcc *VoucherCampaignCreate) SetValidTo(t time.Time) *VoucherCampaignCreate
SetValidTo sets the "valid_to" field.
func (*VoucherCampaignCreate) SetVoucherID ¶
func (vcc *VoucherCampaignCreate) SetVoucherID(i int64) *VoucherCampaignCreate
SetVoucherID sets the "voucher_id" field.
type VoucherCampaignCreateBulk ¶
type VoucherCampaignCreateBulk struct {
// contains filtered or unexported fields
}
VoucherCampaignCreateBulk is the builder for creating many VoucherCampaign entities in bulk.
func (*VoucherCampaignCreateBulk) Exec ¶
func (vccb *VoucherCampaignCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VoucherCampaignCreateBulk) ExecX ¶
func (vccb *VoucherCampaignCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCampaignCreateBulk) Save ¶
func (vccb *VoucherCampaignCreateBulk) Save(ctx context.Context) ([]*VoucherCampaign, error)
Save creates the VoucherCampaign entities in the database.
func (*VoucherCampaignCreateBulk) SaveX ¶
func (vccb *VoucherCampaignCreateBulk) SaveX(ctx context.Context) []*VoucherCampaign
SaveX is like Save, but panics if an error occurs.
type VoucherCampaignDelete ¶
type VoucherCampaignDelete struct {
// contains filtered or unexported fields
}
VoucherCampaignDelete is the builder for deleting a VoucherCampaign entity.
func (*VoucherCampaignDelete) Exec ¶
func (vcd *VoucherCampaignDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VoucherCampaignDelete) ExecX ¶
func (vcd *VoucherCampaignDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCampaignDelete) Where ¶
func (vcd *VoucherCampaignDelete) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignDelete
Where appends a list predicates to the VoucherCampaignDelete builder.
type VoucherCampaignDeleteOne ¶
type VoucherCampaignDeleteOne struct {
// contains filtered or unexported fields
}
VoucherCampaignDeleteOne is the builder for deleting a single VoucherCampaign entity.
func (*VoucherCampaignDeleteOne) Exec ¶
func (vcdo *VoucherCampaignDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VoucherCampaignDeleteOne) ExecX ¶
func (vcdo *VoucherCampaignDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCampaignDeleteOne) Where ¶
func (vcdo *VoucherCampaignDeleteOne) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignDeleteOne
Where appends a list predicates to the VoucherCampaignDelete builder.
type VoucherCampaignGroupBy ¶
type VoucherCampaignGroupBy struct {
// contains filtered or unexported fields
}
VoucherCampaignGroupBy is the group-by builder for VoucherCampaign entities.
func (*VoucherCampaignGroupBy) Aggregate ¶
func (vcgb *VoucherCampaignGroupBy) Aggregate(fns ...AggregateFunc) *VoucherCampaignGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VoucherCampaignGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*VoucherCampaignGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignGroupBy) Scan ¶
func (vcgb *VoucherCampaignGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoucherCampaignGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoucherCampaignMutation ¶
type VoucherCampaignMutation struct {
// contains filtered or unexported fields
}
VoucherCampaignMutation represents an operation that mutates the VoucherCampaign nodes in the graph.
func (*VoucherCampaignMutation) AddCampaignID ¶
func (m *VoucherCampaignMutation) AddCampaignID(i int64)
AddCampaignID adds i to the "campaign_id" field.
func (*VoucherCampaignMutation) AddField ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) AddVoucherID ¶
func (m *VoucherCampaignMutation) AddVoucherID(i int64)
AddVoucherID adds i to the "voucher_id" field.
func (*VoucherCampaignMutation) AddedCampaignID ¶
func (m *VoucherCampaignMutation) AddedCampaignID() (r int64, exists bool)
AddedCampaignID returns the value that was added to the "campaign_id" field in this mutation.
func (*VoucherCampaignMutation) AddedEdges ¶
func (m *VoucherCampaignMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VoucherCampaignMutation) AddedField ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) AddedFields ¶
func (m *VoucherCampaignMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VoucherCampaignMutation) AddedIDs ¶
func (m *VoucherCampaignMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VoucherCampaignMutation) AddedVoucherID ¶
func (m *VoucherCampaignMutation) AddedVoucherID() (r int64, exists bool)
AddedVoucherID returns the value that was added to the "voucher_id" field in this mutation.
func (*VoucherCampaignMutation) CampaignID ¶
func (m *VoucherCampaignMutation) CampaignID() (r int64, exists bool)
CampaignID returns the value of the "campaign_id" field in the mutation.
func (*VoucherCampaignMutation) ClearEdge ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) ClearField ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) ClearedEdges ¶
func (m *VoucherCampaignMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VoucherCampaignMutation) ClearedFields ¶
func (m *VoucherCampaignMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VoucherCampaignMutation) Client ¶
func (m VoucherCampaignMutation) 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 (*VoucherCampaignMutation) CreatedAt ¶
func (m *VoucherCampaignMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*VoucherCampaignMutation) EdgeCleared ¶
func (m *VoucherCampaignMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VoucherCampaignMutation) Field ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) FieldCleared ¶
func (m *VoucherCampaignMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VoucherCampaignMutation) Fields ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) ID ¶
func (m *VoucherCampaignMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*VoucherCampaignMutation) IDs ¶
func (m *VoucherCampaignMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*VoucherCampaignMutation) OldCampaignID ¶
func (m *VoucherCampaignMutation) OldCampaignID(ctx context.Context) (v int64, err error)
OldCampaignID returns the old "campaign_id" field's value of the VoucherCampaign entity. If the VoucherCampaign 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 (*VoucherCampaignMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the VoucherCampaign entity. If the VoucherCampaign 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 (*VoucherCampaignMutation) 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 (*VoucherCampaignMutation) OldStartDay ¶
OldStartDay returns the old "start_day" field's value of the VoucherCampaign entity. If the VoucherCampaign 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 (*VoucherCampaignMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the VoucherCampaign entity. If the VoucherCampaign 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 (*VoucherCampaignMutation) OldValidTo ¶
OldValidTo returns the old "valid_to" field's value of the VoucherCampaign entity. If the VoucherCampaign 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 (*VoucherCampaignMutation) OldVoucherID ¶
func (m *VoucherCampaignMutation) OldVoucherID(ctx context.Context) (v int64, err error)
OldVoucherID returns the old "voucher_id" field's value of the VoucherCampaign entity. If the VoucherCampaign 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 (*VoucherCampaignMutation) Op ¶
func (m *VoucherCampaignMutation) Op() Op
Op returns the operation name.
func (*VoucherCampaignMutation) RemovedEdges ¶
func (m *VoucherCampaignMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VoucherCampaignMutation) RemovedIDs ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) ResetCampaignID ¶
func (m *VoucherCampaignMutation) ResetCampaignID()
ResetCampaignID resets all changes to the "campaign_id" field.
func (*VoucherCampaignMutation) ResetCreatedAt ¶
func (m *VoucherCampaignMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*VoucherCampaignMutation) ResetEdge ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) ResetField ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) ResetStartDay ¶
func (m *VoucherCampaignMutation) ResetStartDay()
ResetStartDay resets all changes to the "start_day" field.
func (*VoucherCampaignMutation) ResetUpdatedAt ¶
func (m *VoucherCampaignMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*VoucherCampaignMutation) ResetValidTo ¶
func (m *VoucherCampaignMutation) ResetValidTo()
ResetValidTo resets all changes to the "valid_to" field.
func (*VoucherCampaignMutation) ResetVoucherID ¶
func (m *VoucherCampaignMutation) ResetVoucherID()
ResetVoucherID resets all changes to the "voucher_id" field.
func (*VoucherCampaignMutation) SetCampaignID ¶
func (m *VoucherCampaignMutation) SetCampaignID(i int64)
SetCampaignID sets the "campaign_id" field.
func (*VoucherCampaignMutation) SetCreatedAt ¶
func (m *VoucherCampaignMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*VoucherCampaignMutation) SetField ¶
func (m *VoucherCampaignMutation) 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 (*VoucherCampaignMutation) SetOp ¶
func (m *VoucherCampaignMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*VoucherCampaignMutation) SetStartDay ¶
func (m *VoucherCampaignMutation) SetStartDay(t time.Time)
SetStartDay sets the "start_day" field.
func (*VoucherCampaignMutation) SetUpdatedAt ¶
func (m *VoucherCampaignMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*VoucherCampaignMutation) SetValidTo ¶
func (m *VoucherCampaignMutation) SetValidTo(t time.Time)
SetValidTo sets the "valid_to" field.
func (*VoucherCampaignMutation) SetVoucherID ¶
func (m *VoucherCampaignMutation) SetVoucherID(i int64)
SetVoucherID sets the "voucher_id" field.
func (*VoucherCampaignMutation) StartDay ¶
func (m *VoucherCampaignMutation) StartDay() (r time.Time, exists bool)
StartDay returns the value of the "start_day" field in the mutation.
func (VoucherCampaignMutation) Tx ¶
func (m VoucherCampaignMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VoucherCampaignMutation) Type ¶
func (m *VoucherCampaignMutation) Type() string
Type returns the node type of this mutation (VoucherCampaign).
func (*VoucherCampaignMutation) UpdatedAt ¶
func (m *VoucherCampaignMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*VoucherCampaignMutation) ValidTo ¶
func (m *VoucherCampaignMutation) ValidTo() (r time.Time, exists bool)
ValidTo returns the value of the "valid_to" field in the mutation.
func (*VoucherCampaignMutation) VoucherID ¶
func (m *VoucherCampaignMutation) VoucherID() (r int64, exists bool)
VoucherID returns the value of the "voucher_id" field in the mutation.
func (*VoucherCampaignMutation) Where ¶
func (m *VoucherCampaignMutation) Where(ps ...predicate.VoucherCampaign)
Where appends a list predicates to the VoucherCampaignMutation builder.
func (*VoucherCampaignMutation) WhereP ¶
func (m *VoucherCampaignMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the VoucherCampaignMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type VoucherCampaignQuery ¶
type VoucherCampaignQuery struct {
// contains filtered or unexported fields
}
VoucherCampaignQuery is the builder for querying VoucherCampaign entities.
func (*VoucherCampaignQuery) Aggregate ¶
func (vcq *VoucherCampaignQuery) Aggregate(fns ...AggregateFunc) *VoucherCampaignSelect
Aggregate returns a VoucherCampaignSelect configured with the given aggregations.
func (*VoucherCampaignQuery) All ¶
func (vcq *VoucherCampaignQuery) All(ctx context.Context) ([]*VoucherCampaign, error)
All executes the query and returns a list of VoucherCampaigns.
func (*VoucherCampaignQuery) AllX ¶
func (vcq *VoucherCampaignQuery) AllX(ctx context.Context) []*VoucherCampaign
AllX is like All, but panics if an error occurs.
func (*VoucherCampaignQuery) Clone ¶
func (vcq *VoucherCampaignQuery) Clone() *VoucherCampaignQuery
Clone returns a duplicate of the VoucherCampaignQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VoucherCampaignQuery) Count ¶
func (vcq *VoucherCampaignQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VoucherCampaignQuery) CountX ¶
func (vcq *VoucherCampaignQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VoucherCampaignQuery) Exist ¶
func (vcq *VoucherCampaignQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VoucherCampaignQuery) ExistX ¶
func (vcq *VoucherCampaignQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VoucherCampaignQuery) First ¶
func (vcq *VoucherCampaignQuery) First(ctx context.Context) (*VoucherCampaign, error)
First returns the first VoucherCampaign entity from the query. Returns a *NotFoundError when no VoucherCampaign was found.
func (*VoucherCampaignQuery) FirstID ¶
func (vcq *VoucherCampaignQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first VoucherCampaign ID from the query. Returns a *NotFoundError when no VoucherCampaign ID was found.
func (*VoucherCampaignQuery) FirstIDX ¶
func (vcq *VoucherCampaignQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*VoucherCampaignQuery) FirstX ¶
func (vcq *VoucherCampaignQuery) FirstX(ctx context.Context) *VoucherCampaign
FirstX is like First, but panics if an error occurs.
func (*VoucherCampaignQuery) GroupBy ¶
func (vcq *VoucherCampaignQuery) GroupBy(field string, fields ...string) *VoucherCampaignGroupBy
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 { CampaignID int64 `json:"campaign_id,omitempty"` Count int `json:"count,omitempty"` } client.VoucherCampaign.Query(). GroupBy(vouchercampaign.FieldCampaignID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VoucherCampaignQuery) IDs ¶
func (vcq *VoucherCampaignQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of VoucherCampaign IDs.
func (*VoucherCampaignQuery) IDsX ¶
func (vcq *VoucherCampaignQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*VoucherCampaignQuery) Limit ¶
func (vcq *VoucherCampaignQuery) Limit(limit int) *VoucherCampaignQuery
Limit the number of records to be returned by this query.
func (*VoucherCampaignQuery) Offset ¶
func (vcq *VoucherCampaignQuery) Offset(offset int) *VoucherCampaignQuery
Offset to start from.
func (*VoucherCampaignQuery) Only ¶
func (vcq *VoucherCampaignQuery) Only(ctx context.Context) (*VoucherCampaign, error)
Only returns a single VoucherCampaign entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one VoucherCampaign entity is found. Returns a *NotFoundError when no VoucherCampaign entities are found.
func (*VoucherCampaignQuery) OnlyID ¶
func (vcq *VoucherCampaignQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only VoucherCampaign ID in the query. Returns a *NotSingularError when more than one VoucherCampaign ID is found. Returns a *NotFoundError when no entities are found.
func (*VoucherCampaignQuery) OnlyIDX ¶
func (vcq *VoucherCampaignQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VoucherCampaignQuery) OnlyX ¶
func (vcq *VoucherCampaignQuery) OnlyX(ctx context.Context) *VoucherCampaign
OnlyX is like Only, but panics if an error occurs.
func (*VoucherCampaignQuery) Order ¶
func (vcq *VoucherCampaignQuery) Order(o ...vouchercampaign.OrderOption) *VoucherCampaignQuery
Order specifies how the records should be ordered.
func (*VoucherCampaignQuery) Select ¶
func (vcq *VoucherCampaignQuery) Select(fields ...string) *VoucherCampaignSelect
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 { CampaignID int64 `json:"campaign_id,omitempty"` } client.VoucherCampaign.Query(). Select(vouchercampaign.FieldCampaignID). Scan(ctx, &v)
func (*VoucherCampaignQuery) Unique ¶
func (vcq *VoucherCampaignQuery) Unique(unique bool) *VoucherCampaignQuery
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 (*VoucherCampaignQuery) Where ¶
func (vcq *VoucherCampaignQuery) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignQuery
Where adds a new predicate for the VoucherCampaignQuery builder.
type VoucherCampaignSelect ¶
type VoucherCampaignSelect struct { *VoucherCampaignQuery // contains filtered or unexported fields }
VoucherCampaignSelect is the builder for selecting fields of VoucherCampaign entities.
func (*VoucherCampaignSelect) Aggregate ¶
func (vcs *VoucherCampaignSelect) Aggregate(fns ...AggregateFunc) *VoucherCampaignSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VoucherCampaignSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*VoucherCampaignSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoucherCampaignSelect) Scan ¶
func (vcs *VoucherCampaignSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoucherCampaignSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoucherCampaignUpdate ¶
type VoucherCampaignUpdate struct {
// contains filtered or unexported fields
}
VoucherCampaignUpdate is the builder for updating VoucherCampaign entities.
func (*VoucherCampaignUpdate) AddCampaignID ¶
func (vcu *VoucherCampaignUpdate) AddCampaignID(i int64) *VoucherCampaignUpdate
AddCampaignID adds i to the "campaign_id" field.
func (*VoucherCampaignUpdate) AddVoucherID ¶
func (vcu *VoucherCampaignUpdate) AddVoucherID(i int64) *VoucherCampaignUpdate
AddVoucherID adds i to the "voucher_id" field.
func (*VoucherCampaignUpdate) Exec ¶
func (vcu *VoucherCampaignUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoucherCampaignUpdate) ExecX ¶
func (vcu *VoucherCampaignUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCampaignUpdate) Mutation ¶
func (vcu *VoucherCampaignUpdate) Mutation() *VoucherCampaignMutation
Mutation returns the VoucherCampaignMutation object of the builder.
func (*VoucherCampaignUpdate) Save ¶
func (vcu *VoucherCampaignUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VoucherCampaignUpdate) SaveX ¶
func (vcu *VoucherCampaignUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VoucherCampaignUpdate) SetCampaignID ¶
func (vcu *VoucherCampaignUpdate) SetCampaignID(i int64) *VoucherCampaignUpdate
SetCampaignID sets the "campaign_id" field.
func (*VoucherCampaignUpdate) SetStartDay ¶
func (vcu *VoucherCampaignUpdate) SetStartDay(t time.Time) *VoucherCampaignUpdate
SetStartDay sets the "start_day" field.
func (*VoucherCampaignUpdate) SetUpdatedAt ¶
func (vcu *VoucherCampaignUpdate) SetUpdatedAt(t time.Time) *VoucherCampaignUpdate
SetUpdatedAt sets the "updated_at" field.
func (*VoucherCampaignUpdate) SetValidTo ¶
func (vcu *VoucherCampaignUpdate) SetValidTo(t time.Time) *VoucherCampaignUpdate
SetValidTo sets the "valid_to" field.
func (*VoucherCampaignUpdate) SetVoucherID ¶
func (vcu *VoucherCampaignUpdate) SetVoucherID(i int64) *VoucherCampaignUpdate
SetVoucherID sets the "voucher_id" field.
func (*VoucherCampaignUpdate) Where ¶
func (vcu *VoucherCampaignUpdate) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignUpdate
Where appends a list predicates to the VoucherCampaignUpdate builder.
type VoucherCampaignUpdateOne ¶
type VoucherCampaignUpdateOne struct {
// contains filtered or unexported fields
}
VoucherCampaignUpdateOne is the builder for updating a single VoucherCampaign entity.
func (*VoucherCampaignUpdateOne) AddCampaignID ¶
func (vcuo *VoucherCampaignUpdateOne) AddCampaignID(i int64) *VoucherCampaignUpdateOne
AddCampaignID adds i to the "campaign_id" field.
func (*VoucherCampaignUpdateOne) AddVoucherID ¶
func (vcuo *VoucherCampaignUpdateOne) AddVoucherID(i int64) *VoucherCampaignUpdateOne
AddVoucherID adds i to the "voucher_id" field.
func (*VoucherCampaignUpdateOne) Exec ¶
func (vcuo *VoucherCampaignUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VoucherCampaignUpdateOne) ExecX ¶
func (vcuo *VoucherCampaignUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCampaignUpdateOne) Mutation ¶
func (vcuo *VoucherCampaignUpdateOne) Mutation() *VoucherCampaignMutation
Mutation returns the VoucherCampaignMutation object of the builder.
func (*VoucherCampaignUpdateOne) Save ¶
func (vcuo *VoucherCampaignUpdateOne) Save(ctx context.Context) (*VoucherCampaign, error)
Save executes the query and returns the updated VoucherCampaign entity.
func (*VoucherCampaignUpdateOne) SaveX ¶
func (vcuo *VoucherCampaignUpdateOne) SaveX(ctx context.Context) *VoucherCampaign
SaveX is like Save, but panics if an error occurs.
func (*VoucherCampaignUpdateOne) Select ¶
func (vcuo *VoucherCampaignUpdateOne) Select(field string, fields ...string) *VoucherCampaignUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VoucherCampaignUpdateOne) SetCampaignID ¶
func (vcuo *VoucherCampaignUpdateOne) SetCampaignID(i int64) *VoucherCampaignUpdateOne
SetCampaignID sets the "campaign_id" field.
func (*VoucherCampaignUpdateOne) SetStartDay ¶
func (vcuo *VoucherCampaignUpdateOne) SetStartDay(t time.Time) *VoucherCampaignUpdateOne
SetStartDay sets the "start_day" field.
func (*VoucherCampaignUpdateOne) SetUpdatedAt ¶
func (vcuo *VoucherCampaignUpdateOne) SetUpdatedAt(t time.Time) *VoucherCampaignUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*VoucherCampaignUpdateOne) SetValidTo ¶
func (vcuo *VoucherCampaignUpdateOne) SetValidTo(t time.Time) *VoucherCampaignUpdateOne
SetValidTo sets the "valid_to" field.
func (*VoucherCampaignUpdateOne) SetVoucherID ¶
func (vcuo *VoucherCampaignUpdateOne) SetVoucherID(i int64) *VoucherCampaignUpdateOne
SetVoucherID sets the "voucher_id" field.
func (*VoucherCampaignUpdateOne) Where ¶
func (vcuo *VoucherCampaignUpdateOne) Where(ps ...predicate.VoucherCampaign) *VoucherCampaignUpdateOne
Where appends a list predicates to the VoucherCampaignUpdate builder.
type VoucherCampaigns ¶
type VoucherCampaigns []*VoucherCampaign
VoucherCampaigns is a parsable slice of VoucherCampaign.
type VoucherClient ¶
type VoucherClient struct {
// contains filtered or unexported fields
}
VoucherClient is a client for the Voucher schema.
func NewVoucherClient ¶
func NewVoucherClient(c config) *VoucherClient
NewVoucherClient returns a client for the Voucher from the given config.
func (*VoucherClient) Create ¶
func (c *VoucherClient) Create() *VoucherCreate
Create returns a builder for creating a Voucher entity.
func (*VoucherClient) CreateBulk ¶
func (c *VoucherClient) CreateBulk(builders ...*VoucherCreate) *VoucherCreateBulk
CreateBulk returns a builder for creating a bulk of Voucher entities.
func (*VoucherClient) Delete ¶
func (c *VoucherClient) Delete() *VoucherDelete
Delete returns a delete builder for Voucher.
func (*VoucherClient) DeleteOne ¶
func (c *VoucherClient) DeleteOne(v *Voucher) *VoucherDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VoucherClient) DeleteOneID ¶
func (c *VoucherClient) DeleteOneID(id int) *VoucherDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VoucherClient) GetX ¶
func (c *VoucherClient) GetX(ctx context.Context, id int) *Voucher
GetX is like Get, but panics if an error occurs.
func (*VoucherClient) Hooks ¶
func (c *VoucherClient) Hooks() []Hook
Hooks returns the client hooks.
func (*VoucherClient) Intercept ¶
func (c *VoucherClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `voucher.Intercept(f(g(h())))`.
func (*VoucherClient) Interceptors ¶
func (c *VoucherClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*VoucherClient) MapCreateBulk ¶
func (c *VoucherClient) MapCreateBulk(slice any, setFunc func(*VoucherCreate, int)) *VoucherCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*VoucherClient) Query ¶
func (c *VoucherClient) Query() *VoucherQuery
Query returns a query builder for Voucher.
func (*VoucherClient) Update ¶
func (c *VoucherClient) Update() *VoucherUpdate
Update returns an update builder for Voucher.
func (*VoucherClient) UpdateOne ¶
func (c *VoucherClient) UpdateOne(v *Voucher) *VoucherUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VoucherClient) UpdateOneID ¶
func (c *VoucherClient) UpdateOneID(id int) *VoucherUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VoucherClient) Use ¶
func (c *VoucherClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `voucher.Hooks(f(g(h())))`.
type VoucherCreate ¶
type VoucherCreate struct {
// contains filtered or unexported fields
}
VoucherCreate is the builder for creating a Voucher entity.
func (*VoucherCreate) Exec ¶
func (vc *VoucherCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoucherCreate) ExecX ¶
func (vc *VoucherCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherCreate) Mutation ¶
func (vc *VoucherCreate) Mutation() *VoucherMutation
Mutation returns the VoucherMutation object of the builder.
func (*VoucherCreate) Save ¶
func (vc *VoucherCreate) Save(ctx context.Context) (*Voucher, error)
Save creates the Voucher in the database.
func (*VoucherCreate) SaveX ¶
func (vc *VoucherCreate) SaveX(ctx context.Context) *Voucher
SaveX calls Save and panics if Save returns an error.
func (*VoucherCreate) SetCreatedAt ¶
func (vc *VoucherCreate) SetCreatedAt(t time.Time) *VoucherCreate
SetCreatedAt sets the "created_at" field.
func (*VoucherCreate) SetName ¶
func (vc *VoucherCreate) SetName(s string) *VoucherCreate
SetName sets the "name" field.
func (*VoucherCreate) SetNillableCreatedAt ¶
func (vc *VoucherCreate) SetNillableCreatedAt(t *time.Time) *VoucherCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VoucherCreate) SetNillableUpdatedAt ¶
func (vc *VoucherCreate) SetNillableUpdatedAt(t *time.Time) *VoucherCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*VoucherCreate) SetType ¶
func (vc *VoucherCreate) SetType(s string) *VoucherCreate
SetType sets the "type" field.
func (*VoucherCreate) SetUpdatedAt ¶
func (vc *VoucherCreate) SetUpdatedAt(t time.Time) *VoucherCreate
SetUpdatedAt sets the "updated_at" field.
func (*VoucherCreate) SetValue ¶
func (vc *VoucherCreate) SetValue(f float64) *VoucherCreate
SetValue sets the "value" field.
type VoucherCreateBulk ¶
type VoucherCreateBulk struct {
// contains filtered or unexported fields
}
VoucherCreateBulk is the builder for creating many Voucher entities in bulk.
func (*VoucherCreateBulk) Exec ¶
func (vcb *VoucherCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VoucherCreateBulk) ExecX ¶
func (vcb *VoucherCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type VoucherDelete ¶
type VoucherDelete struct {
// contains filtered or unexported fields
}
VoucherDelete is the builder for deleting a Voucher entity.
func (*VoucherDelete) Exec ¶
func (vd *VoucherDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VoucherDelete) ExecX ¶
func (vd *VoucherDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VoucherDelete) Where ¶
func (vd *VoucherDelete) Where(ps ...predicate.Voucher) *VoucherDelete
Where appends a list predicates to the VoucherDelete builder.
type VoucherDeleteOne ¶
type VoucherDeleteOne struct {
// contains filtered or unexported fields
}
VoucherDeleteOne is the builder for deleting a single Voucher entity.
func (*VoucherDeleteOne) Exec ¶
func (vdo *VoucherDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VoucherDeleteOne) ExecX ¶
func (vdo *VoucherDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherDeleteOne) Where ¶
func (vdo *VoucherDeleteOne) Where(ps ...predicate.Voucher) *VoucherDeleteOne
Where appends a list predicates to the VoucherDelete builder.
type VoucherGroupBy ¶
type VoucherGroupBy struct {
// contains filtered or unexported fields
}
VoucherGroupBy is the group-by builder for Voucher entities.
func (*VoucherGroupBy) Aggregate ¶
func (vgb *VoucherGroupBy) Aggregate(fns ...AggregateFunc) *VoucherGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VoucherGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoucherGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoucherGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoucherGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoucherGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoucherGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoucherGroupBy) Scan ¶
func (vgb *VoucherGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoucherGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoucherMutation ¶
type VoucherMutation struct {
// contains filtered or unexported fields
}
VoucherMutation represents an operation that mutates the Voucher nodes in the graph.
func (*VoucherMutation) AddField ¶
func (m *VoucherMutation) 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 (*VoucherMutation) AddValue ¶
func (m *VoucherMutation) AddValue(f float64)
AddValue adds f to the "value" field.
func (*VoucherMutation) AddedEdges ¶
func (m *VoucherMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VoucherMutation) AddedField ¶
func (m *VoucherMutation) 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 (*VoucherMutation) AddedFields ¶
func (m *VoucherMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VoucherMutation) AddedIDs ¶
func (m *VoucherMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VoucherMutation) AddedValue ¶
func (m *VoucherMutation) AddedValue() (r float64, exists bool)
AddedValue returns the value that was added to the "value" field in this mutation.
func (*VoucherMutation) ClearEdge ¶
func (m *VoucherMutation) 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 (*VoucherMutation) ClearField ¶
func (m *VoucherMutation) 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 (*VoucherMutation) ClearedEdges ¶
func (m *VoucherMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VoucherMutation) ClearedFields ¶
func (m *VoucherMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VoucherMutation) Client ¶
func (m VoucherMutation) 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 (*VoucherMutation) CreatedAt ¶
func (m *VoucherMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*VoucherMutation) EdgeCleared ¶
func (m *VoucherMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VoucherMutation) Field ¶
func (m *VoucherMutation) 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 (*VoucherMutation) FieldCleared ¶
func (m *VoucherMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VoucherMutation) Fields ¶
func (m *VoucherMutation) 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 (*VoucherMutation) GetType ¶
func (m *VoucherMutation) GetType() (r string, exists bool)
GetType returns the value of the "type" field in the mutation.
func (*VoucherMutation) ID ¶
func (m *VoucherMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*VoucherMutation) IDs ¶
func (m *VoucherMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*VoucherMutation) Name ¶
func (m *VoucherMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*VoucherMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) 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 (*VoucherMutation) OldName ¶
func (m *VoucherMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) OldType ¶
func (m *VoucherMutation) OldType(ctx context.Context) (v string, err error)
OldType returns the old "type" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) OldValue ¶
func (m *VoucherMutation) OldValue(ctx context.Context) (v float64, err error)
OldValue returns the old "value" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) RemovedEdges ¶
func (m *VoucherMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VoucherMutation) RemovedIDs ¶
func (m *VoucherMutation) 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 (*VoucherMutation) ResetCreatedAt ¶
func (m *VoucherMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*VoucherMutation) ResetEdge ¶
func (m *VoucherMutation) 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 (*VoucherMutation) ResetField ¶
func (m *VoucherMutation) 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 (*VoucherMutation) ResetName ¶
func (m *VoucherMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*VoucherMutation) ResetType ¶
func (m *VoucherMutation) ResetType()
ResetType resets all changes to the "type" field.
func (*VoucherMutation) ResetUpdatedAt ¶
func (m *VoucherMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*VoucherMutation) ResetValue ¶
func (m *VoucherMutation) ResetValue()
ResetValue resets all changes to the "value" field.
func (*VoucherMutation) SetCreatedAt ¶
func (m *VoucherMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*VoucherMutation) SetField ¶
func (m *VoucherMutation) 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 (*VoucherMutation) SetName ¶
func (m *VoucherMutation) SetName(s string)
SetName sets the "name" field.
func (*VoucherMutation) SetOp ¶
func (m *VoucherMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*VoucherMutation) SetType ¶
func (m *VoucherMutation) SetType(s string)
SetType sets the "type" field.
func (*VoucherMutation) SetUpdatedAt ¶
func (m *VoucherMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*VoucherMutation) SetValue ¶
func (m *VoucherMutation) SetValue(f float64)
SetValue sets the "value" field.
func (VoucherMutation) Tx ¶
func (m VoucherMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VoucherMutation) Type ¶
func (m *VoucherMutation) Type() string
Type returns the node type of this mutation (Voucher).
func (*VoucherMutation) UpdatedAt ¶
func (m *VoucherMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*VoucherMutation) Value ¶
func (m *VoucherMutation) Value() (r float64, exists bool)
Value returns the value of the "value" field in the mutation.
func (*VoucherMutation) Where ¶
func (m *VoucherMutation) Where(ps ...predicate.Voucher)
Where appends a list predicates to the VoucherMutation builder.
func (*VoucherMutation) WhereP ¶
func (m *VoucherMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the VoucherMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type VoucherQuery ¶
type VoucherQuery struct {
// contains filtered or unexported fields
}
VoucherQuery is the builder for querying Voucher entities.
func (*VoucherQuery) Aggregate ¶
func (vq *VoucherQuery) Aggregate(fns ...AggregateFunc) *VoucherSelect
Aggregate returns a VoucherSelect configured with the given aggregations.
func (*VoucherQuery) All ¶
func (vq *VoucherQuery) All(ctx context.Context) ([]*Voucher, error)
All executes the query and returns a list of Vouchers.
func (*VoucherQuery) AllX ¶
func (vq *VoucherQuery) AllX(ctx context.Context) []*Voucher
AllX is like All, but panics if an error occurs.
func (*VoucherQuery) Clone ¶
func (vq *VoucherQuery) Clone() *VoucherQuery
Clone returns a duplicate of the VoucherQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VoucherQuery) Count ¶
func (vq *VoucherQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VoucherQuery) CountX ¶
func (vq *VoucherQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VoucherQuery) Exist ¶
func (vq *VoucherQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VoucherQuery) ExistX ¶
func (vq *VoucherQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VoucherQuery) First ¶
func (vq *VoucherQuery) First(ctx context.Context) (*Voucher, error)
First returns the first Voucher entity from the query. Returns a *NotFoundError when no Voucher was found.
func (*VoucherQuery) FirstID ¶
func (vq *VoucherQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Voucher ID from the query. Returns a *NotFoundError when no Voucher ID was found.
func (*VoucherQuery) FirstIDX ¶
func (vq *VoucherQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*VoucherQuery) FirstX ¶
func (vq *VoucherQuery) FirstX(ctx context.Context) *Voucher
FirstX is like First, but panics if an error occurs.
func (*VoucherQuery) GroupBy ¶
func (vq *VoucherQuery) GroupBy(field string, fields ...string) *VoucherGroupBy
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.Voucher.Query(). GroupBy(voucher.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VoucherQuery) IDs ¶
func (vq *VoucherQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Voucher IDs.
func (*VoucherQuery) IDsX ¶
func (vq *VoucherQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*VoucherQuery) Limit ¶
func (vq *VoucherQuery) Limit(limit int) *VoucherQuery
Limit the number of records to be returned by this query.
func (*VoucherQuery) Offset ¶
func (vq *VoucherQuery) Offset(offset int) *VoucherQuery
Offset to start from.
func (*VoucherQuery) Only ¶
func (vq *VoucherQuery) Only(ctx context.Context) (*Voucher, error)
Only returns a single Voucher entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Voucher entity is found. Returns a *NotFoundError when no Voucher entities are found.
func (*VoucherQuery) OnlyID ¶
func (vq *VoucherQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Voucher ID in the query. Returns a *NotSingularError when more than one Voucher ID is found. Returns a *NotFoundError when no entities are found.
func (*VoucherQuery) OnlyIDX ¶
func (vq *VoucherQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VoucherQuery) OnlyX ¶
func (vq *VoucherQuery) OnlyX(ctx context.Context) *Voucher
OnlyX is like Only, but panics if an error occurs.
func (*VoucherQuery) Order ¶
func (vq *VoucherQuery) Order(o ...voucher.OrderOption) *VoucherQuery
Order specifies how the records should be ordered.
func (*VoucherQuery) Select ¶
func (vq *VoucherQuery) Select(fields ...string) *VoucherSelect
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.Voucher.Query(). Select(voucher.FieldName). Scan(ctx, &v)
func (*VoucherQuery) Unique ¶
func (vq *VoucherQuery) Unique(unique bool) *VoucherQuery
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 (*VoucherQuery) Where ¶
func (vq *VoucherQuery) Where(ps ...predicate.Voucher) *VoucherQuery
Where adds a new predicate for the VoucherQuery builder.
type VoucherSelect ¶
type VoucherSelect struct { *VoucherQuery // contains filtered or unexported fields }
VoucherSelect is the builder for selecting fields of Voucher entities.
func (*VoucherSelect) Aggregate ¶
func (vs *VoucherSelect) Aggregate(fns ...AggregateFunc) *VoucherSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VoucherSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VoucherSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VoucherSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VoucherSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VoucherSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VoucherSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VoucherSelect) Scan ¶
func (vs *VoucherSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VoucherSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VoucherUpdate ¶
type VoucherUpdate struct {
// contains filtered or unexported fields
}
VoucherUpdate is the builder for updating Voucher entities.
func (*VoucherUpdate) AddValue ¶
func (vu *VoucherUpdate) AddValue(f float64) *VoucherUpdate
AddValue adds f to the "value" field.
func (*VoucherUpdate) Exec ¶
func (vu *VoucherUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VoucherUpdate) ExecX ¶
func (vu *VoucherUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherUpdate) Mutation ¶
func (vu *VoucherUpdate) Mutation() *VoucherMutation
Mutation returns the VoucherMutation object of the builder.
func (*VoucherUpdate) Save ¶
func (vu *VoucherUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VoucherUpdate) SaveX ¶
func (vu *VoucherUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VoucherUpdate) SetName ¶
func (vu *VoucherUpdate) SetName(s string) *VoucherUpdate
SetName sets the "name" field.
func (*VoucherUpdate) SetType ¶
func (vu *VoucherUpdate) SetType(s string) *VoucherUpdate
SetType sets the "type" field.
func (*VoucherUpdate) SetUpdatedAt ¶
func (vu *VoucherUpdate) SetUpdatedAt(t time.Time) *VoucherUpdate
SetUpdatedAt sets the "updated_at" field.
func (*VoucherUpdate) SetValue ¶
func (vu *VoucherUpdate) SetValue(f float64) *VoucherUpdate
SetValue sets the "value" field.
func (*VoucherUpdate) Where ¶
func (vu *VoucherUpdate) Where(ps ...predicate.Voucher) *VoucherUpdate
Where appends a list predicates to the VoucherUpdate builder.
type VoucherUpdateOne ¶
type VoucherUpdateOne struct {
// contains filtered or unexported fields
}
VoucherUpdateOne is the builder for updating a single Voucher entity.
func (*VoucherUpdateOne) AddValue ¶
func (vuo *VoucherUpdateOne) AddValue(f float64) *VoucherUpdateOne
AddValue adds f to the "value" field.
func (*VoucherUpdateOne) Exec ¶
func (vuo *VoucherUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VoucherUpdateOne) ExecX ¶
func (vuo *VoucherUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VoucherUpdateOne) Mutation ¶
func (vuo *VoucherUpdateOne) Mutation() *VoucherMutation
Mutation returns the VoucherMutation object of the builder.
func (*VoucherUpdateOne) Save ¶
func (vuo *VoucherUpdateOne) Save(ctx context.Context) (*Voucher, error)
Save executes the query and returns the updated Voucher entity.
func (*VoucherUpdateOne) SaveX ¶
func (vuo *VoucherUpdateOne) SaveX(ctx context.Context) *Voucher
SaveX is like Save, but panics if an error occurs.
func (*VoucherUpdateOne) Select ¶
func (vuo *VoucherUpdateOne) Select(field string, fields ...string) *VoucherUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VoucherUpdateOne) SetName ¶
func (vuo *VoucherUpdateOne) SetName(s string) *VoucherUpdateOne
SetName sets the "name" field.
func (*VoucherUpdateOne) SetType ¶
func (vuo *VoucherUpdateOne) SetType(s string) *VoucherUpdateOne
SetType sets the "type" field.
func (*VoucherUpdateOne) SetUpdatedAt ¶
func (vuo *VoucherUpdateOne) SetUpdatedAt(t time.Time) *VoucherUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*VoucherUpdateOne) SetValue ¶
func (vuo *VoucherUpdateOne) SetValue(f float64) *VoucherUpdateOne
SetValue sets the "value" field.
func (*VoucherUpdateOne) Where ¶
func (vuo *VoucherUpdateOne) Where(ps ...predicate.Voucher) *VoucherUpdateOne
Where appends a list predicates to the VoucherUpdate builder.
Source Files ¶
- campaign.go
- campaign_create.go
- campaign_delete.go
- campaign_query.go
- campaign_update.go
- card.go
- card_create.go
- card_delete.go
- card_query.go
- card_update.go
- client.go
- ent.go
- generate.go
- mutation.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go
- userbalance.go
- userbalance_create.go
- userbalance_delete.go
- userbalance_query.go
- userbalance_update.go
- uservoucher.go
- uservoucher_create.go
- uservoucher_delete.go
- uservoucher_query.go
- uservoucher_update.go
- voucher.go
- voucher_create.go
- voucher_delete.go
- voucher_query.go
- voucher_update.go
- vouchercampaign.go
- vouchercampaign_create.go
- vouchercampaign_delete.go
- vouchercampaign_query.go
- vouchercampaign_update.go