Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type URLCreate
- func (uc *URLCreate) AddLogIDs(ids ...int) *URLCreate
- func (uc *URLCreate) AddLogs(v ...*VisitLog) *URLCreate
- func (uc *URLCreate) Exec(ctx context.Context) error
- func (uc *URLCreate) ExecX(ctx context.Context)
- func (uc *URLCreate) Mutation() *URLMutation
- func (uc *URLCreate) Save(ctx context.Context) (*Url, error)
- func (uc *URLCreate) SaveX(ctx context.Context) *Url
- func (uc *URLCreate) SetCreatedAt(t time.Time) *URLCreate
- func (uc *URLCreate) SetCurrentTimes(i int) *URLCreate
- func (uc *URLCreate) SetExpireAt(t time.Time) *URLCreate
- func (uc *URLCreate) SetMaxTimes(i int) *URLCreate
- func (uc *URLCreate) SetNillableCreatedAt(t *time.Time) *URLCreate
- func (uc *URLCreate) SetNillableCurrentTimes(i *int) *URLCreate
- func (uc *URLCreate) SetNillableExpireAt(t *time.Time) *URLCreate
- func (uc *URLCreate) SetNillableMaxTimes(i *int) *URLCreate
- func (uc *URLCreate) SetPath(s string) *URLCreate
- func (uc *URLCreate) SetURL(s string) *URLCreate
- type URLCreateBulk
- type URLDelete
- type URLDeleteOne
- type URLGroupBy
- func (ugb *URLGroupBy) Aggregate(fns ...AggregateFunc) *URLGroupBy
- func (ugb *URLGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (ugb *URLGroupBy) BoolX(ctx context.Context) bool
- func (ugb *URLGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (ugb *URLGroupBy) BoolsX(ctx context.Context) []bool
- func (ugb *URLGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (ugb *URLGroupBy) Float64X(ctx context.Context) float64
- func (ugb *URLGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (ugb *URLGroupBy) Float64sX(ctx context.Context) []float64
- func (ugb *URLGroupBy) Int(ctx context.Context) (_ int, err error)
- func (ugb *URLGroupBy) IntX(ctx context.Context) int
- func (ugb *URLGroupBy) Ints(ctx context.Context) ([]int, error)
- func (ugb *URLGroupBy) IntsX(ctx context.Context) []int
- func (ugb *URLGroupBy) Scan(ctx context.Context, v interface{}) error
- func (ugb *URLGroupBy) ScanX(ctx context.Context, v interface{})
- func (ugb *URLGroupBy) String(ctx context.Context) (_ string, err error)
- func (ugb *URLGroupBy) StringX(ctx context.Context) string
- func (ugb *URLGroupBy) Strings(ctx context.Context) ([]string, error)
- func (ugb *URLGroupBy) StringsX(ctx context.Context) []string
- type URLMutation
- func (m *URLMutation) AddCurrentTimes(i int)
- func (m *URLMutation) AddField(name string, value ent.Value) error
- func (m *URLMutation) AddLogIDs(ids ...int)
- func (m *URLMutation) AddMaxTimes(i int)
- func (m *URLMutation) AddedCurrentTimes() (r int, exists bool)
- func (m *URLMutation) AddedEdges() []string
- func (m *URLMutation) AddedField(name string) (ent.Value, bool)
- func (m *URLMutation) AddedFields() []string
- func (m *URLMutation) AddedIDs(name string) []ent.Value
- func (m *URLMutation) AddedMaxTimes() (r int, exists bool)
- func (m *URLMutation) ClearEdge(name string) error
- func (m *URLMutation) ClearExpireAt()
- func (m *URLMutation) ClearField(name string) error
- func (m *URLMutation) ClearLogs()
- func (m *URLMutation) ClearedEdges() []string
- func (m *URLMutation) ClearedFields() []string
- func (m URLMutation) Client() *Client
- func (m *URLMutation) CreatedAt() (r time.Time, exists bool)
- func (m *URLMutation) CurrentTimes() (r int, exists bool)
- func (m *URLMutation) EdgeCleared(name string) bool
- func (m *URLMutation) ExpireAt() (r time.Time, exists bool)
- func (m *URLMutation) ExpireAtCleared() bool
- func (m *URLMutation) Field(name string) (ent.Value, bool)
- func (m *URLMutation) FieldCleared(name string) bool
- func (m *URLMutation) Fields() []string
- func (m *URLMutation) ID() (id int, exists bool)
- func (m *URLMutation) IDs(ctx context.Context) ([]int, error)
- func (m *URLMutation) LogsCleared() bool
- func (m *URLMutation) LogsIDs() (ids []int)
- func (m *URLMutation) MaxTimes() (r int, exists bool)
- func (m *URLMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *URLMutation) OldCurrentTimes(ctx context.Context) (v int, err error)
- func (m *URLMutation) OldExpireAt(ctx context.Context) (v *time.Time, err error)
- func (m *URLMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *URLMutation) OldMaxTimes(ctx context.Context) (v int, err error)
- func (m *URLMutation) OldPath(ctx context.Context) (v string, err error)
- func (m *URLMutation) OldURL(ctx context.Context) (v string, err error)
- func (m *URLMutation) Op() Op
- func (m *URLMutation) Path() (r string, exists bool)
- func (m *URLMutation) RemoveLogIDs(ids ...int)
- func (m *URLMutation) RemovedEdges() []string
- func (m *URLMutation) RemovedIDs(name string) []ent.Value
- func (m *URLMutation) RemovedLogsIDs() (ids []int)
- func (m *URLMutation) ResetCreatedAt()
- func (m *URLMutation) ResetCurrentTimes()
- func (m *URLMutation) ResetEdge(name string) error
- func (m *URLMutation) ResetExpireAt()
- func (m *URLMutation) ResetField(name string) error
- func (m *URLMutation) ResetLogs()
- func (m *URLMutation) ResetMaxTimes()
- func (m *URLMutation) ResetPath()
- func (m *URLMutation) ResetURL()
- func (m *URLMutation) SetCreatedAt(t time.Time)
- func (m *URLMutation) SetCurrentTimes(i int)
- func (m *URLMutation) SetExpireAt(t time.Time)
- func (m *URLMutation) SetField(name string, value ent.Value) error
- func (m *URLMutation) SetMaxTimes(i int)
- func (m *URLMutation) SetPath(s string)
- func (m *URLMutation) SetURL(s string)
- func (m URLMutation) Tx() (*Tx, error)
- func (m *URLMutation) Type() string
- func (m *URLMutation) URL() (r string, exists bool)
- func (m *URLMutation) Where(ps ...predicate.Url)
- type URLQuery
- func (uq *URLQuery) All(ctx context.Context) ([]*Url, error)
- func (uq *URLQuery) AllX(ctx context.Context) []*Url
- func (uq *URLQuery) Clone() *URLQuery
- func (uq *URLQuery) Count(ctx context.Context) (int, error)
- func (uq *URLQuery) CountX(ctx context.Context) int
- func (uq *URLQuery) Exist(ctx context.Context) (bool, error)
- func (uq *URLQuery) ExistX(ctx context.Context) bool
- func (uq *URLQuery) First(ctx context.Context) (*Url, error)
- func (uq *URLQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *URLQuery) FirstIDX(ctx context.Context) int
- func (uq *URLQuery) FirstX(ctx context.Context) *Url
- func (uq *URLQuery) GroupBy(field string, fields ...string) *URLGroupBy
- func (uq *URLQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *URLQuery) IDsX(ctx context.Context) []int
- func (uq *URLQuery) Limit(limit int) *URLQuery
- func (uq *URLQuery) Offset(offset int) *URLQuery
- func (uq *URLQuery) Only(ctx context.Context) (*Url, error)
- func (uq *URLQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *URLQuery) OnlyIDX(ctx context.Context) int
- func (uq *URLQuery) OnlyX(ctx context.Context) *Url
- func (uq *URLQuery) Order(o ...OrderFunc) *URLQuery
- func (uq *URLQuery) QueryLogs() *VisitLogQuery
- func (uq *URLQuery) Select(fields ...string) *URLSelect
- func (uq *URLQuery) Unique(unique bool) *URLQuery
- func (uq *URLQuery) Where(ps ...predicate.Url) *URLQuery
- func (uq *URLQuery) WithLogs(opts ...func(*VisitLogQuery)) *URLQuery
- type URLSelect
- func (us *URLSelect) Bool(ctx context.Context) (_ bool, err error)
- func (us *URLSelect) BoolX(ctx context.Context) bool
- func (us *URLSelect) Bools(ctx context.Context) ([]bool, error)
- func (us *URLSelect) BoolsX(ctx context.Context) []bool
- func (us *URLSelect) Float64(ctx context.Context) (_ float64, err error)
- func (us *URLSelect) Float64X(ctx context.Context) float64
- func (us *URLSelect) Float64s(ctx context.Context) ([]float64, error)
- func (us *URLSelect) Float64sX(ctx context.Context) []float64
- func (us *URLSelect) Int(ctx context.Context) (_ int, err error)
- func (us *URLSelect) IntX(ctx context.Context) int
- func (us *URLSelect) Ints(ctx context.Context) ([]int, error)
- func (us *URLSelect) IntsX(ctx context.Context) []int
- func (us *URLSelect) Scan(ctx context.Context, v interface{}) error
- func (us *URLSelect) ScanX(ctx context.Context, v interface{})
- func (us *URLSelect) String(ctx context.Context) (_ string, err error)
- func (us *URLSelect) StringX(ctx context.Context) string
- func (us *URLSelect) Strings(ctx context.Context) ([]string, error)
- func (us *URLSelect) StringsX(ctx context.Context) []string
- type URLUpdate
- func (uu *URLUpdate) AddCurrentTimes(i int) *URLUpdate
- func (uu *URLUpdate) AddLogIDs(ids ...int) *URLUpdate
- func (uu *URLUpdate) AddLogs(v ...*VisitLog) *URLUpdate
- func (uu *URLUpdate) AddMaxTimes(i int) *URLUpdate
- func (uu *URLUpdate) ClearExpireAt() *URLUpdate
- func (uu *URLUpdate) ClearLogs() *URLUpdate
- func (uu *URLUpdate) Exec(ctx context.Context) error
- func (uu *URLUpdate) ExecX(ctx context.Context)
- func (uu *URLUpdate) Mutation() *URLMutation
- func (uu *URLUpdate) RemoveLogIDs(ids ...int) *URLUpdate
- func (uu *URLUpdate) RemoveLogs(v ...*VisitLog) *URLUpdate
- func (uu *URLUpdate) Save(ctx context.Context) (int, error)
- func (uu *URLUpdate) SaveX(ctx context.Context) int
- func (uu *URLUpdate) SetCreatedAt(t time.Time) *URLUpdate
- func (uu *URLUpdate) SetCurrentTimes(i int) *URLUpdate
- func (uu *URLUpdate) SetExpireAt(t time.Time) *URLUpdate
- func (uu *URLUpdate) SetMaxTimes(i int) *URLUpdate
- func (uu *URLUpdate) SetNillableCreatedAt(t *time.Time) *URLUpdate
- func (uu *URLUpdate) SetNillableCurrentTimes(i *int) *URLUpdate
- func (uu *URLUpdate) SetNillableExpireAt(t *time.Time) *URLUpdate
- func (uu *URLUpdate) SetNillableMaxTimes(i *int) *URLUpdate
- func (uu *URLUpdate) SetPath(s string) *URLUpdate
- func (uu *URLUpdate) SetURL(s string) *URLUpdate
- func (uu *URLUpdate) Where(ps ...predicate.Url) *URLUpdate
- type URLUpdateOne
- func (uuo *URLUpdateOne) AddCurrentTimes(i int) *URLUpdateOne
- func (uuo *URLUpdateOne) AddLogIDs(ids ...int) *URLUpdateOne
- func (uuo *URLUpdateOne) AddLogs(v ...*VisitLog) *URLUpdateOne
- func (uuo *URLUpdateOne) AddMaxTimes(i int) *URLUpdateOne
- func (uuo *URLUpdateOne) ClearExpireAt() *URLUpdateOne
- func (uuo *URLUpdateOne) ClearLogs() *URLUpdateOne
- func (uuo *URLUpdateOne) Exec(ctx context.Context) error
- func (uuo *URLUpdateOne) ExecX(ctx context.Context)
- func (uuo *URLUpdateOne) Mutation() *URLMutation
- func (uuo *URLUpdateOne) RemoveLogIDs(ids ...int) *URLUpdateOne
- func (uuo *URLUpdateOne) RemoveLogs(v ...*VisitLog) *URLUpdateOne
- func (uuo *URLUpdateOne) Save(ctx context.Context) (*Url, error)
- func (uuo *URLUpdateOne) SaveX(ctx context.Context) *Url
- func (uuo *URLUpdateOne) Select(field string, fields ...string) *URLUpdateOne
- func (uuo *URLUpdateOne) SetCreatedAt(t time.Time) *URLUpdateOne
- func (uuo *URLUpdateOne) SetCurrentTimes(i int) *URLUpdateOne
- func (uuo *URLUpdateOne) SetExpireAt(t time.Time) *URLUpdateOne
- func (uuo *URLUpdateOne) SetMaxTimes(i int) *URLUpdateOne
- func (uuo *URLUpdateOne) SetNillableCreatedAt(t *time.Time) *URLUpdateOne
- func (uuo *URLUpdateOne) SetNillableCurrentTimes(i *int) *URLUpdateOne
- func (uuo *URLUpdateOne) SetNillableExpireAt(t *time.Time) *URLUpdateOne
- func (uuo *URLUpdateOne) SetNillableMaxTimes(i *int) *URLUpdateOne
- func (uuo *URLUpdateOne) SetPath(s string) *URLUpdateOne
- func (uuo *URLUpdateOne) SetURL(s string) *URLUpdateOne
- type Url
- type UrlClient
- func (c *UrlClient) Create() *URLCreate
- func (c *UrlClient) CreateBulk(builders ...*URLCreate) *URLCreateBulk
- func (c *UrlClient) Delete() *URLDelete
- func (c *UrlClient) DeleteOne(u *Url) *URLDeleteOne
- func (c *UrlClient) DeleteOneID(id int) *URLDeleteOne
- func (c *UrlClient) Get(ctx context.Context, id int) (*Url, error)
- func (c *UrlClient) GetX(ctx context.Context, id int) *Url
- func (c *UrlClient) Hooks() []Hook
- func (c *UrlClient) Query() *URLQuery
- func (c *UrlClient) QueryLogs(u *Url) *VisitLogQuery
- func (c *UrlClient) Update() *URLUpdate
- func (c *UrlClient) UpdateOne(u *Url) *URLUpdateOne
- func (c *UrlClient) UpdateOneID(id int) *URLUpdateOne
- func (c *UrlClient) Use(hooks ...Hook)
- type UrlEdges
- type Urls
- type ValidationError
- type Value
- type VisitLog
- type VisitLogClient
- func (c *VisitLogClient) Create() *VisitLogCreate
- func (c *VisitLogClient) CreateBulk(builders ...*VisitLogCreate) *VisitLogCreateBulk
- func (c *VisitLogClient) Delete() *VisitLogDelete
- func (c *VisitLogClient) DeleteOne(vl *VisitLog) *VisitLogDeleteOne
- func (c *VisitLogClient) DeleteOneID(id int) *VisitLogDeleteOne
- func (c *VisitLogClient) Get(ctx context.Context, id int) (*VisitLog, error)
- func (c *VisitLogClient) GetX(ctx context.Context, id int) *VisitLog
- func (c *VisitLogClient) Hooks() []Hook
- func (c *VisitLogClient) Query() *VisitLogQuery
- func (c *VisitLogClient) QueryURL(vl *VisitLog) *URLQuery
- func (c *VisitLogClient) Update() *VisitLogUpdate
- func (c *VisitLogClient) UpdateOne(vl *VisitLog) *VisitLogUpdateOne
- func (c *VisitLogClient) UpdateOneID(id int) *VisitLogUpdateOne
- func (c *VisitLogClient) Use(hooks ...Hook)
- type VisitLogCreate
- func (vlc *VisitLogCreate) Exec(ctx context.Context) error
- func (vlc *VisitLogCreate) ExecX(ctx context.Context)
- func (vlc *VisitLogCreate) Mutation() *VisitLogMutation
- func (vlc *VisitLogCreate) Save(ctx context.Context) (*VisitLog, error)
- func (vlc *VisitLogCreate) SaveX(ctx context.Context) *VisitLog
- func (vlc *VisitLogCreate) SetBot(b bool) *VisitLogCreate
- func (vlc *VisitLogCreate) SetBrowserName(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetBrowserVersion(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetCreatedAt(t time.Time) *VisitLogCreate
- func (vlc *VisitLogCreate) SetEngineName(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetEngineVersion(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetIP(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetMobile(b bool) *VisitLogCreate
- func (vlc *VisitLogCreate) SetMozilla(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetNillableCreatedAt(t *time.Time) *VisitLogCreate
- func (vlc *VisitLogCreate) SetNillableURLID(id *int) *VisitLogCreate
- func (vlc *VisitLogCreate) SetOs(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetPlatform(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetReferer(s string) *VisitLogCreate
- func (vlc *VisitLogCreate) SetURL(u *Url) *VisitLogCreate
- func (vlc *VisitLogCreate) SetURLID(id int) *VisitLogCreate
- type VisitLogCreateBulk
- type VisitLogDelete
- type VisitLogDeleteOne
- type VisitLogEdges
- type VisitLogGroupBy
- func (vlgb *VisitLogGroupBy) Aggregate(fns ...AggregateFunc) *VisitLogGroupBy
- func (vlgb *VisitLogGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (vlgb *VisitLogGroupBy) BoolX(ctx context.Context) bool
- func (vlgb *VisitLogGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (vlgb *VisitLogGroupBy) BoolsX(ctx context.Context) []bool
- func (vlgb *VisitLogGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (vlgb *VisitLogGroupBy) Float64X(ctx context.Context) float64
- func (vlgb *VisitLogGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (vlgb *VisitLogGroupBy) Float64sX(ctx context.Context) []float64
- func (vlgb *VisitLogGroupBy) Int(ctx context.Context) (_ int, err error)
- func (vlgb *VisitLogGroupBy) IntX(ctx context.Context) int
- func (vlgb *VisitLogGroupBy) Ints(ctx context.Context) ([]int, error)
- func (vlgb *VisitLogGroupBy) IntsX(ctx context.Context) []int
- func (vlgb *VisitLogGroupBy) Scan(ctx context.Context, v interface{}) error
- func (vlgb *VisitLogGroupBy) ScanX(ctx context.Context, v interface{})
- func (vlgb *VisitLogGroupBy) String(ctx context.Context) (_ string, err error)
- func (vlgb *VisitLogGroupBy) StringX(ctx context.Context) string
- func (vlgb *VisitLogGroupBy) Strings(ctx context.Context) ([]string, error)
- func (vlgb *VisitLogGroupBy) StringsX(ctx context.Context) []string
- type VisitLogMutation
- func (m *VisitLogMutation) AddField(name string, value ent.Value) error
- func (m *VisitLogMutation) AddedEdges() []string
- func (m *VisitLogMutation) AddedField(name string) (ent.Value, bool)
- func (m *VisitLogMutation) AddedFields() []string
- func (m *VisitLogMutation) AddedIDs(name string) []ent.Value
- func (m *VisitLogMutation) Bot() (r bool, exists bool)
- func (m *VisitLogMutation) BrowserName() (r string, exists bool)
- func (m *VisitLogMutation) BrowserVersion() (r string, exists bool)
- func (m *VisitLogMutation) ClearEdge(name string) error
- func (m *VisitLogMutation) ClearField(name string) error
- func (m *VisitLogMutation) ClearURL()
- func (m *VisitLogMutation) ClearedEdges() []string
- func (m *VisitLogMutation) ClearedFields() []string
- func (m VisitLogMutation) Client() *Client
- func (m *VisitLogMutation) CreatedAt() (r time.Time, exists bool)
- func (m *VisitLogMutation) EdgeCleared(name string) bool
- func (m *VisitLogMutation) EngineName() (r string, exists bool)
- func (m *VisitLogMutation) EngineVersion() (r string, exists bool)
- func (m *VisitLogMutation) Field(name string) (ent.Value, bool)
- func (m *VisitLogMutation) FieldCleared(name string) bool
- func (m *VisitLogMutation) Fields() []string
- func (m *VisitLogMutation) ID() (id int, exists bool)
- func (m *VisitLogMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VisitLogMutation) IP() (r string, exists bool)
- func (m *VisitLogMutation) Mobile() (r bool, exists bool)
- func (m *VisitLogMutation) Mozilla() (r string, exists bool)
- func (m *VisitLogMutation) OldBot(ctx context.Context) (v bool, err error)
- func (m *VisitLogMutation) OldBrowserName(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldBrowserVersion(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *VisitLogMutation) OldEngineName(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldEngineVersion(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VisitLogMutation) OldIP(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldMobile(ctx context.Context) (v bool, err error)
- func (m *VisitLogMutation) OldMozilla(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldOs(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldPlatform(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) OldReferer(ctx context.Context) (v string, err error)
- func (m *VisitLogMutation) Op() Op
- func (m *VisitLogMutation) Os() (r string, exists bool)
- func (m *VisitLogMutation) Platform() (r string, exists bool)
- func (m *VisitLogMutation) Referer() (r string, exists bool)
- func (m *VisitLogMutation) RemovedEdges() []string
- func (m *VisitLogMutation) RemovedIDs(name string) []ent.Value
- func (m *VisitLogMutation) ResetBot()
- func (m *VisitLogMutation) ResetBrowserName()
- func (m *VisitLogMutation) ResetBrowserVersion()
- func (m *VisitLogMutation) ResetCreatedAt()
- func (m *VisitLogMutation) ResetEdge(name string) error
- func (m *VisitLogMutation) ResetEngineName()
- func (m *VisitLogMutation) ResetEngineVersion()
- func (m *VisitLogMutation) ResetField(name string) error
- func (m *VisitLogMutation) ResetIP()
- func (m *VisitLogMutation) ResetMobile()
- func (m *VisitLogMutation) ResetMozilla()
- func (m *VisitLogMutation) ResetOs()
- func (m *VisitLogMutation) ResetPlatform()
- func (m *VisitLogMutation) ResetReferer()
- func (m *VisitLogMutation) ResetURL()
- func (m *VisitLogMutation) SetBot(b bool)
- func (m *VisitLogMutation) SetBrowserName(s string)
- func (m *VisitLogMutation) SetBrowserVersion(s string)
- func (m *VisitLogMutation) SetCreatedAt(t time.Time)
- func (m *VisitLogMutation) SetEngineName(s string)
- func (m *VisitLogMutation) SetEngineVersion(s string)
- func (m *VisitLogMutation) SetField(name string, value ent.Value) error
- func (m *VisitLogMutation) SetIP(s string)
- func (m *VisitLogMutation) SetMobile(b bool)
- func (m *VisitLogMutation) SetMozilla(s string)
- func (m *VisitLogMutation) SetOs(s string)
- func (m *VisitLogMutation) SetPlatform(s string)
- func (m *VisitLogMutation) SetReferer(s string)
- func (m *VisitLogMutation) SetURLID(id int)
- func (m VisitLogMutation) Tx() (*Tx, error)
- func (m *VisitLogMutation) Type() string
- func (m *VisitLogMutation) URLCleared() bool
- func (m *VisitLogMutation) URLID() (id int, exists bool)
- func (m *VisitLogMutation) URLIDs() (ids []int)
- func (m *VisitLogMutation) Where(ps ...predicate.VisitLog)
- type VisitLogQuery
- func (vlq *VisitLogQuery) All(ctx context.Context) ([]*VisitLog, error)
- func (vlq *VisitLogQuery) AllX(ctx context.Context) []*VisitLog
- func (vlq *VisitLogQuery) Clone() *VisitLogQuery
- func (vlq *VisitLogQuery) Count(ctx context.Context) (int, error)
- func (vlq *VisitLogQuery) CountX(ctx context.Context) int
- func (vlq *VisitLogQuery) Exist(ctx context.Context) (bool, error)
- func (vlq *VisitLogQuery) ExistX(ctx context.Context) bool
- func (vlq *VisitLogQuery) First(ctx context.Context) (*VisitLog, error)
- func (vlq *VisitLogQuery) FirstID(ctx context.Context) (id int, err error)
- func (vlq *VisitLogQuery) FirstIDX(ctx context.Context) int
- func (vlq *VisitLogQuery) FirstX(ctx context.Context) *VisitLog
- func (vlq *VisitLogQuery) GroupBy(field string, fields ...string) *VisitLogGroupBy
- func (vlq *VisitLogQuery) IDs(ctx context.Context) ([]int, error)
- func (vlq *VisitLogQuery) IDsX(ctx context.Context) []int
- func (vlq *VisitLogQuery) Limit(limit int) *VisitLogQuery
- func (vlq *VisitLogQuery) Offset(offset int) *VisitLogQuery
- func (vlq *VisitLogQuery) Only(ctx context.Context) (*VisitLog, error)
- func (vlq *VisitLogQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vlq *VisitLogQuery) OnlyIDX(ctx context.Context) int
- func (vlq *VisitLogQuery) OnlyX(ctx context.Context) *VisitLog
- func (vlq *VisitLogQuery) Order(o ...OrderFunc) *VisitLogQuery
- func (vlq *VisitLogQuery) QueryURL() *URLQuery
- func (vlq *VisitLogQuery) Select(fields ...string) *VisitLogSelect
- func (vlq *VisitLogQuery) Unique(unique bool) *VisitLogQuery
- func (vlq *VisitLogQuery) Where(ps ...predicate.VisitLog) *VisitLogQuery
- func (vlq *VisitLogQuery) WithURL(opts ...func(*URLQuery)) *VisitLogQuery
- type VisitLogSelect
- func (vls *VisitLogSelect) Bool(ctx context.Context) (_ bool, err error)
- func (vls *VisitLogSelect) BoolX(ctx context.Context) bool
- func (vls *VisitLogSelect) Bools(ctx context.Context) ([]bool, error)
- func (vls *VisitLogSelect) BoolsX(ctx context.Context) []bool
- func (vls *VisitLogSelect) Float64(ctx context.Context) (_ float64, err error)
- func (vls *VisitLogSelect) Float64X(ctx context.Context) float64
- func (vls *VisitLogSelect) Float64s(ctx context.Context) ([]float64, error)
- func (vls *VisitLogSelect) Float64sX(ctx context.Context) []float64
- func (vls *VisitLogSelect) Int(ctx context.Context) (_ int, err error)
- func (vls *VisitLogSelect) IntX(ctx context.Context) int
- func (vls *VisitLogSelect) Ints(ctx context.Context) ([]int, error)
- func (vls *VisitLogSelect) IntsX(ctx context.Context) []int
- func (vls *VisitLogSelect) Scan(ctx context.Context, v interface{}) error
- func (vls *VisitLogSelect) ScanX(ctx context.Context, v interface{})
- func (vls *VisitLogSelect) String(ctx context.Context) (_ string, err error)
- func (vls *VisitLogSelect) StringX(ctx context.Context) string
- func (vls *VisitLogSelect) Strings(ctx context.Context) ([]string, error)
- func (vls *VisitLogSelect) StringsX(ctx context.Context) []string
- type VisitLogUpdate
- func (vlu *VisitLogUpdate) ClearURL() *VisitLogUpdate
- func (vlu *VisitLogUpdate) Exec(ctx context.Context) error
- func (vlu *VisitLogUpdate) ExecX(ctx context.Context)
- func (vlu *VisitLogUpdate) Mutation() *VisitLogMutation
- func (vlu *VisitLogUpdate) Save(ctx context.Context) (int, error)
- func (vlu *VisitLogUpdate) SaveX(ctx context.Context) int
- func (vlu *VisitLogUpdate) SetBot(b bool) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetBrowserName(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetBrowserVersion(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetCreatedAt(t time.Time) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetEngineName(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetEngineVersion(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetIP(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetMobile(b bool) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetMozilla(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetNillableCreatedAt(t *time.Time) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetNillableURLID(id *int) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetOs(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetPlatform(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetReferer(s string) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetURL(u *Url) *VisitLogUpdate
- func (vlu *VisitLogUpdate) SetURLID(id int) *VisitLogUpdate
- func (vlu *VisitLogUpdate) Where(ps ...predicate.VisitLog) *VisitLogUpdate
- type VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) ClearURL() *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) Exec(ctx context.Context) error
- func (vluo *VisitLogUpdateOne) ExecX(ctx context.Context)
- func (vluo *VisitLogUpdateOne) Mutation() *VisitLogMutation
- func (vluo *VisitLogUpdateOne) Save(ctx context.Context) (*VisitLog, error)
- func (vluo *VisitLogUpdateOne) SaveX(ctx context.Context) *VisitLog
- func (vluo *VisitLogUpdateOne) Select(field string, fields ...string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetBot(b bool) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetBrowserName(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetBrowserVersion(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetCreatedAt(t time.Time) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetEngineName(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetEngineVersion(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetIP(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetMobile(b bool) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetMozilla(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetNillableCreatedAt(t *time.Time) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetNillableURLID(id *int) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetOs(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetPlatform(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetReferer(s string) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetURL(u *Url) *VisitLogUpdateOne
- func (vluo *VisitLogUpdateOne) SetURLID(id int) *VisitLogUpdateOne
- type VisitLogs
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeUrl = "Url" TypeVisitLog = "VisitLog" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Url is the client for interacting with the Url builders. Url *UrlClient // VisitLog is the client for interacting with the VisitLog builders. VisitLog *VisitLogClient // 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(). Url. Query(). Count(ctx)
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type 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 RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Tx ¶
type Tx struct { // Url is the client for interacting with the Url builders. Url *UrlClient // VisitLog is the client for interacting with the VisitLog builders. VisitLog *VisitLogClient // 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 URLCreate ¶
type URLCreate struct {
// contains filtered or unexported fields
}
URLCreate is the builder for creating a Url entity.
func (*URLCreate) Mutation ¶
func (uc *URLCreate) Mutation() *URLMutation
Mutation returns the URLMutation object of the builder.
func (*URLCreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*URLCreate) SetCurrentTimes ¶
SetCurrentTimes sets the "current_times" field.
func (*URLCreate) SetExpireAt ¶
SetExpireAt sets the "expire_at" field.
func (*URLCreate) SetMaxTimes ¶
SetMaxTimes sets the "max_times" field.
func (*URLCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*URLCreate) SetNillableCurrentTimes ¶
SetNillableCurrentTimes sets the "current_times" field if the given value is not nil.
func (*URLCreate) SetNillableExpireAt ¶
SetNillableExpireAt sets the "expire_at" field if the given value is not nil.
func (*URLCreate) SetNillableMaxTimes ¶
SetNillableMaxTimes sets the "max_times" field if the given value is not nil.
type URLCreateBulk ¶
type URLCreateBulk struct {
// contains filtered or unexported fields
}
URLCreateBulk is the builder for creating many Url entities in bulk.
func (*URLCreateBulk) Exec ¶
func (ucb *URLCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*URLCreateBulk) ExecX ¶
func (ucb *URLCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type URLDelete ¶
type URLDelete struct {
// contains filtered or unexported fields
}
URLDelete is the builder for deleting a Url entity.
func (*URLDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type URLDeleteOne ¶
type URLDeleteOne struct {
// contains filtered or unexported fields
}
URLDeleteOne is the builder for deleting a single Url entity.
func (*URLDeleteOne) Exec ¶
func (udo *URLDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*URLDeleteOne) ExecX ¶
func (udo *URLDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type URLGroupBy ¶
type URLGroupBy struct {
// contains filtered or unexported fields
}
URLGroupBy is the group-by builder for Url entities.
func (*URLGroupBy) Aggregate ¶
func (ugb *URLGroupBy) Aggregate(fns ...AggregateFunc) *URLGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*URLGroupBy) Bool ¶
func (ugb *URLGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) BoolX ¶
func (ugb *URLGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*URLGroupBy) Bools ¶
func (ugb *URLGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) BoolsX ¶
func (ugb *URLGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*URLGroupBy) Float64 ¶
func (ugb *URLGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) Float64X ¶
func (ugb *URLGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*URLGroupBy) Float64s ¶
func (ugb *URLGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) Float64sX ¶
func (ugb *URLGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*URLGroupBy) Int ¶
func (ugb *URLGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) IntX ¶
func (ugb *URLGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*URLGroupBy) Ints ¶
func (ugb *URLGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) IntsX ¶
func (ugb *URLGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*URLGroupBy) Scan ¶
func (ugb *URLGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*URLGroupBy) ScanX ¶
func (ugb *URLGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*URLGroupBy) String ¶
func (ugb *URLGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*URLGroupBy) StringX ¶
func (ugb *URLGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type URLMutation ¶
type URLMutation struct {
// contains filtered or unexported fields
}
URLMutation represents an operation that mutates the Url nodes in the graph.
func (*URLMutation) AddCurrentTimes ¶
func (m *URLMutation) AddCurrentTimes(i int)
AddCurrentTimes adds i to the "current_times" field.
func (*URLMutation) AddField ¶
func (m *URLMutation) 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 (*URLMutation) AddLogIDs ¶
func (m *URLMutation) AddLogIDs(ids ...int)
AddLogIDs adds the "logs" edge to the VisitLog entity by ids.
func (*URLMutation) AddMaxTimes ¶
func (m *URLMutation) AddMaxTimes(i int)
AddMaxTimes adds i to the "max_times" field.
func (*URLMutation) AddedCurrentTimes ¶
func (m *URLMutation) AddedCurrentTimes() (r int, exists bool)
AddedCurrentTimes returns the value that was added to the "current_times" field in this mutation.
func (*URLMutation) AddedEdges ¶
func (m *URLMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*URLMutation) AddedField ¶
func (m *URLMutation) 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 (*URLMutation) AddedFields ¶
func (m *URLMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*URLMutation) AddedIDs ¶
func (m *URLMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*URLMutation) AddedMaxTimes ¶
func (m *URLMutation) AddedMaxTimes() (r int, exists bool)
AddedMaxTimes returns the value that was added to the "max_times" field in this mutation.
func (*URLMutation) ClearEdge ¶
func (m *URLMutation) 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 (*URLMutation) ClearExpireAt ¶
func (m *URLMutation) ClearExpireAt()
ClearExpireAt clears the value of the "expire_at" field.
func (*URLMutation) ClearField ¶
func (m *URLMutation) 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 (*URLMutation) ClearLogs ¶
func (m *URLMutation) ClearLogs()
ClearLogs clears the "logs" edge to the VisitLog entity.
func (*URLMutation) ClearedEdges ¶
func (m *URLMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*URLMutation) ClearedFields ¶
func (m *URLMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (URLMutation) Client ¶
func (m URLMutation) 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 (*URLMutation) CreatedAt ¶
func (m *URLMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*URLMutation) CurrentTimes ¶
func (m *URLMutation) CurrentTimes() (r int, exists bool)
CurrentTimes returns the value of the "current_times" field in the mutation.
func (*URLMutation) EdgeCleared ¶
func (m *URLMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*URLMutation) ExpireAt ¶
func (m *URLMutation) ExpireAt() (r time.Time, exists bool)
ExpireAt returns the value of the "expire_at" field in the mutation.
func (*URLMutation) ExpireAtCleared ¶
func (m *URLMutation) ExpireAtCleared() bool
ExpireAtCleared returns if the "expire_at" field was cleared in this mutation.
func (*URLMutation) Field ¶
func (m *URLMutation) 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 (*URLMutation) FieldCleared ¶
func (m *URLMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*URLMutation) Fields ¶
func (m *URLMutation) 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 (*URLMutation) ID ¶
func (m *URLMutation) 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 (*URLMutation) IDs ¶
func (m *URLMutation) 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 (*URLMutation) LogsCleared ¶
func (m *URLMutation) LogsCleared() bool
LogsCleared reports if the "logs" edge to the VisitLog entity was cleared.
func (*URLMutation) LogsIDs ¶
func (m *URLMutation) LogsIDs() (ids []int)
LogsIDs returns the "logs" edge IDs in the mutation.
func (*URLMutation) MaxTimes ¶
func (m *URLMutation) MaxTimes() (r int, exists bool)
MaxTimes returns the value of the "max_times" field in the mutation.
func (*URLMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Url entity. If the Url 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 (*URLMutation) OldCurrentTimes ¶
func (m *URLMutation) OldCurrentTimes(ctx context.Context) (v int, err error)
OldCurrentTimes returns the old "current_times" field's value of the Url entity. If the Url 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 (*URLMutation) OldExpireAt ¶
OldExpireAt returns the old "expire_at" field's value of the Url entity. If the Url 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 (*URLMutation) 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 (*URLMutation) OldMaxTimes ¶
func (m *URLMutation) OldMaxTimes(ctx context.Context) (v int, err error)
OldMaxTimes returns the old "max_times" field's value of the Url entity. If the Url 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 (*URLMutation) OldPath ¶
func (m *URLMutation) OldPath(ctx context.Context) (v string, err error)
OldPath returns the old "path" field's value of the Url entity. If the Url 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 (*URLMutation) OldURL ¶
func (m *URLMutation) OldURL(ctx context.Context) (v string, err error)
OldURL returns the old "url" field's value of the Url entity. If the Url 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 (*URLMutation) Path ¶
func (m *URLMutation) Path() (r string, exists bool)
Path returns the value of the "path" field in the mutation.
func (*URLMutation) RemoveLogIDs ¶
func (m *URLMutation) RemoveLogIDs(ids ...int)
RemoveLogIDs removes the "logs" edge to the VisitLog entity by IDs.
func (*URLMutation) RemovedEdges ¶
func (m *URLMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*URLMutation) RemovedIDs ¶
func (m *URLMutation) 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 (*URLMutation) RemovedLogsIDs ¶
func (m *URLMutation) RemovedLogsIDs() (ids []int)
RemovedLogs returns the removed IDs of the "logs" edge to the VisitLog entity.
func (*URLMutation) ResetCreatedAt ¶
func (m *URLMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*URLMutation) ResetCurrentTimes ¶
func (m *URLMutation) ResetCurrentTimes()
ResetCurrentTimes resets all changes to the "current_times" field.
func (*URLMutation) ResetEdge ¶
func (m *URLMutation) 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 (*URLMutation) ResetExpireAt ¶
func (m *URLMutation) ResetExpireAt()
ResetExpireAt resets all changes to the "expire_at" field.
func (*URLMutation) ResetField ¶
func (m *URLMutation) 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 (*URLMutation) ResetLogs ¶
func (m *URLMutation) ResetLogs()
ResetLogs resets all changes to the "logs" edge.
func (*URLMutation) ResetMaxTimes ¶
func (m *URLMutation) ResetMaxTimes()
ResetMaxTimes resets all changes to the "max_times" field.
func (*URLMutation) ResetPath ¶
func (m *URLMutation) ResetPath()
ResetPath resets all changes to the "path" field.
func (*URLMutation) ResetURL ¶
func (m *URLMutation) ResetURL()
ResetURL resets all changes to the "url" field.
func (*URLMutation) SetCreatedAt ¶
func (m *URLMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*URLMutation) SetCurrentTimes ¶
func (m *URLMutation) SetCurrentTimes(i int)
SetCurrentTimes sets the "current_times" field.
func (*URLMutation) SetExpireAt ¶
func (m *URLMutation) SetExpireAt(t time.Time)
SetExpireAt sets the "expire_at" field.
func (*URLMutation) SetField ¶
func (m *URLMutation) 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 (*URLMutation) SetMaxTimes ¶
func (m *URLMutation) SetMaxTimes(i int)
SetMaxTimes sets the "max_times" field.
func (*URLMutation) SetPath ¶
func (m *URLMutation) SetPath(s string)
SetPath sets the "path" field.
func (URLMutation) Tx ¶
func (m URLMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*URLMutation) Type ¶
func (m *URLMutation) Type() string
Type returns the node type of this mutation (Url).
func (*URLMutation) URL ¶
func (m *URLMutation) URL() (r string, exists bool)
URL returns the value of the "url" field in the mutation.
func (*URLMutation) Where ¶
func (m *URLMutation) Where(ps ...predicate.Url)
Where appends a list predicates to the URLMutation builder.
type URLQuery ¶
type URLQuery struct {
// contains filtered or unexported fields
}
URLQuery is the builder for querying Url entities.
func (*URLQuery) Clone ¶
Clone returns a duplicate of the URLQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*URLQuery) First ¶
First returns the first Url entity from the query. Returns a *NotFoundError when no Url was found.
func (*URLQuery) FirstID ¶
FirstID returns the first Url ID from the query. Returns a *NotFoundError when no Url ID was found.
func (*URLQuery) GroupBy ¶
func (uq *URLQuery) GroupBy(field string, fields ...string) *URLGroupBy
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 { URL string `json:"url,omitempty"` Count int `json:"count,omitempty"` } client.URL.Query(). GroupBy(url.FieldURL). Aggregate(ent.Count()). Scan(ctx, &v)
func (*URLQuery) Only ¶
Only returns a single Url entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Url entity is found. Returns a *NotFoundError when no Url entities are found.
func (*URLQuery) OnlyID ¶
OnlyID is like Only, but returns the only Url ID in the query. Returns a *NotSingularError when more than one Url ID is found. Returns a *NotFoundError when no entities are found.
func (*URLQuery) QueryLogs ¶
func (uq *URLQuery) QueryLogs() *VisitLogQuery
QueryLogs chains the current query on the "logs" edge.
func (*URLQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { URL string `json:"url,omitempty"` } client.URL.Query(). Select(url.FieldURL). Scan(ctx, &v)
func (*URLQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*URLQuery) WithLogs ¶
func (uq *URLQuery) WithLogs(opts ...func(*VisitLogQuery)) *URLQuery
WithLogs tells the query-builder to eager-load the nodes that are connected to the "logs" edge. The optional arguments are used to configure the query builder of the edge.
type URLSelect ¶
type URLSelect struct { *URLQuery // contains filtered or unexported fields }
URLSelect is the builder for selecting fields of URL entities.
func (*URLSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*URLSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*URLSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*URLSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*URLSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*URLSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*URLSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type URLUpdate ¶
type URLUpdate struct {
// contains filtered or unexported fields
}
URLUpdate is the builder for updating Url entities.
func (*URLUpdate) AddCurrentTimes ¶
AddCurrentTimes adds i to the "current_times" field.
func (*URLUpdate) AddMaxTimes ¶
AddMaxTimes adds i to the "max_times" field.
func (*URLUpdate) ClearExpireAt ¶
ClearExpireAt clears the value of the "expire_at" field.
func (*URLUpdate) Mutation ¶
func (uu *URLUpdate) Mutation() *URLMutation
Mutation returns the URLMutation object of the builder.
func (*URLUpdate) RemoveLogIDs ¶
RemoveLogIDs removes the "logs" edge to VisitLog entities by IDs.
func (*URLUpdate) RemoveLogs ¶
RemoveLogs removes "logs" edges to VisitLog entities.
func (*URLUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*URLUpdate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*URLUpdate) SetCurrentTimes ¶
SetCurrentTimes sets the "current_times" field.
func (*URLUpdate) SetExpireAt ¶
SetExpireAt sets the "expire_at" field.
func (*URLUpdate) SetMaxTimes ¶
SetMaxTimes sets the "max_times" field.
func (*URLUpdate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*URLUpdate) SetNillableCurrentTimes ¶
SetNillableCurrentTimes sets the "current_times" field if the given value is not nil.
func (*URLUpdate) SetNillableExpireAt ¶
SetNillableExpireAt sets the "expire_at" field if the given value is not nil.
func (*URLUpdate) SetNillableMaxTimes ¶
SetNillableMaxTimes sets the "max_times" field if the given value is not nil.
type URLUpdateOne ¶
type URLUpdateOne struct {
// contains filtered or unexported fields
}
URLUpdateOne is the builder for updating a single Url entity.
func (*URLUpdateOne) AddCurrentTimes ¶
func (uuo *URLUpdateOne) AddCurrentTimes(i int) *URLUpdateOne
AddCurrentTimes adds i to the "current_times" field.
func (*URLUpdateOne) AddLogIDs ¶
func (uuo *URLUpdateOne) AddLogIDs(ids ...int) *URLUpdateOne
AddLogIDs adds the "logs" edge to the VisitLog entity by IDs.
func (*URLUpdateOne) AddLogs ¶
func (uuo *URLUpdateOne) AddLogs(v ...*VisitLog) *URLUpdateOne
AddLogs adds the "logs" edges to the VisitLog entity.
func (*URLUpdateOne) AddMaxTimes ¶
func (uuo *URLUpdateOne) AddMaxTimes(i int) *URLUpdateOne
AddMaxTimes adds i to the "max_times" field.
func (*URLUpdateOne) ClearExpireAt ¶
func (uuo *URLUpdateOne) ClearExpireAt() *URLUpdateOne
ClearExpireAt clears the value of the "expire_at" field.
func (*URLUpdateOne) ClearLogs ¶
func (uuo *URLUpdateOne) ClearLogs() *URLUpdateOne
ClearLogs clears all "logs" edges to the VisitLog entity.
func (*URLUpdateOne) Exec ¶
func (uuo *URLUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*URLUpdateOne) ExecX ¶
func (uuo *URLUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*URLUpdateOne) Mutation ¶
func (uuo *URLUpdateOne) Mutation() *URLMutation
Mutation returns the URLMutation object of the builder.
func (*URLUpdateOne) RemoveLogIDs ¶
func (uuo *URLUpdateOne) RemoveLogIDs(ids ...int) *URLUpdateOne
RemoveLogIDs removes the "logs" edge to VisitLog entities by IDs.
func (*URLUpdateOne) RemoveLogs ¶
func (uuo *URLUpdateOne) RemoveLogs(v ...*VisitLog) *URLUpdateOne
RemoveLogs removes "logs" edges to VisitLog entities.
func (*URLUpdateOne) Save ¶
func (uuo *URLUpdateOne) Save(ctx context.Context) (*Url, error)
Save executes the query and returns the updated Url entity.
func (*URLUpdateOne) SaveX ¶
func (uuo *URLUpdateOne) SaveX(ctx context.Context) *Url
SaveX is like Save, but panics if an error occurs.
func (*URLUpdateOne) Select ¶
func (uuo *URLUpdateOne) Select(field string, fields ...string) *URLUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*URLUpdateOne) SetCreatedAt ¶
func (uuo *URLUpdateOne) SetCreatedAt(t time.Time) *URLUpdateOne
SetCreatedAt sets the "created_at" field.
func (*URLUpdateOne) SetCurrentTimes ¶
func (uuo *URLUpdateOne) SetCurrentTimes(i int) *URLUpdateOne
SetCurrentTimes sets the "current_times" field.
func (*URLUpdateOne) SetExpireAt ¶
func (uuo *URLUpdateOne) SetExpireAt(t time.Time) *URLUpdateOne
SetExpireAt sets the "expire_at" field.
func (*URLUpdateOne) SetMaxTimes ¶
func (uuo *URLUpdateOne) SetMaxTimes(i int) *URLUpdateOne
SetMaxTimes sets the "max_times" field.
func (*URLUpdateOne) SetNillableCreatedAt ¶
func (uuo *URLUpdateOne) SetNillableCreatedAt(t *time.Time) *URLUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*URLUpdateOne) SetNillableCurrentTimes ¶
func (uuo *URLUpdateOne) SetNillableCurrentTimes(i *int) *URLUpdateOne
SetNillableCurrentTimes sets the "current_times" field if the given value is not nil.
func (*URLUpdateOne) SetNillableExpireAt ¶
func (uuo *URLUpdateOne) SetNillableExpireAt(t *time.Time) *URLUpdateOne
SetNillableExpireAt sets the "expire_at" field if the given value is not nil.
func (*URLUpdateOne) SetNillableMaxTimes ¶
func (uuo *URLUpdateOne) SetNillableMaxTimes(i *int) *URLUpdateOne
SetNillableMaxTimes sets the "max_times" field if the given value is not nil.
func (*URLUpdateOne) SetPath ¶
func (uuo *URLUpdateOne) SetPath(s string) *URLUpdateOne
SetPath sets the "path" field.
func (*URLUpdateOne) SetURL ¶
func (uuo *URLUpdateOne) SetURL(s string) *URLUpdateOne
SetURL sets the "url" field.
type Url ¶
type Url struct { // ID of the ent. ID int `json:"id,omitempty"` // URL holds the value of the "url" field. URL string `json:"url,omitempty"` // Path holds the value of the "path" field. Path string `json:"path,omitempty"` // CurrentTimes holds the value of the "current_times" field. CurrentTimes int `json:"current_times,omitempty"` // MaxTimes holds the value of the "max_times" field. MaxTimes int `json:"max_times,omitempty"` // ExpireAt holds the value of the "expire_at" field. ExpireAt *time.Time `json:"expire_at,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UrlQuery when eager-loading is set. Edges UrlEdges `json:"edges"` // contains filtered or unexported fields }
Url is the model entity for the Url schema.
func (*Url) QueryLogs ¶
func (u *Url) QueryLogs() *VisitLogQuery
QueryLogs queries the "logs" edge of the Url entity.
func (*Url) Unwrap ¶
Unwrap unwraps the Url 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 (*Url) Update ¶
func (u *Url) Update() *URLUpdateOne
Update returns a builder for updating this Url. Note that you need to call Url.Unwrap() before calling this method if this Url was returned from a transaction, and the transaction was committed or rolled back.
type UrlClient ¶
type UrlClient struct {
// contains filtered or unexported fields
}
UrlClient is a client for the Url schema.
func NewUrlClient ¶
func NewUrlClient(c config) *UrlClient
NewUrlClient returns a client for the Url from the given config.
func (*UrlClient) CreateBulk ¶
func (c *UrlClient) CreateBulk(builders ...*URLCreate) *URLCreateBulk
CreateBulk returns a builder for creating a bulk of Url entities.
func (*UrlClient) DeleteOne ¶
func (c *UrlClient) DeleteOne(u *Url) *URLDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*UrlClient) DeleteOneID ¶
func (c *UrlClient) DeleteOneID(id int) *URLDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*UrlClient) QueryLogs ¶
func (c *UrlClient) QueryLogs(u *Url) *VisitLogQuery
QueryLogs queries the logs edge of a Url.
func (*UrlClient) UpdateOne ¶
func (c *UrlClient) UpdateOne(u *Url) *URLUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UrlClient) UpdateOneID ¶
func (c *UrlClient) UpdateOneID(id int) *URLUpdateOne
UpdateOneID returns an update builder for the given id.
type UrlEdges ¶
type UrlEdges struct { // Logs holds the value of the logs edge. Logs []*VisitLog `json:"logs,omitempty"` // contains filtered or unexported fields }
UrlEdges holds the relations/edges for other nodes in the graph.
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 VisitLog ¶
type VisitLog struct { // ID of the ent. ID int `json:"id,omitempty"` // Platform holds the value of the "platform" field. Platform string `json:"platform,omitempty"` // Os holds the value of the "os" field. Os string `json:"os,omitempty"` // IP holds the value of the "ip" field. IP string `json:"ip,omitempty"` // Referer holds the value of the "referer" field. Referer string `json:"referer,omitempty"` // EngineName holds the value of the "engine_name" field. EngineName string `json:"engine_name,omitempty"` // EngineVersion holds the value of the "engine_version" field. EngineVersion string `json:"engine_version,omitempty"` // BrowserName holds the value of the "browser_name" field. BrowserName string `json:"browser_name,omitempty"` // BrowserVersion holds the value of the "browser_version" field. BrowserVersion string `json:"browser_version,omitempty"` // Mozilla holds the value of the "mozilla" field. Mozilla string `json:"mozilla,omitempty"` // Bot holds the value of the "bot" field. Bot bool `json:"bot,omitempty"` // Mobile holds the value of the "mobile" field. Mobile bool `json:"mobile,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the VisitLogQuery when eager-loading is set. Edges VisitLogEdges `json:"edges"` // contains filtered or unexported fields }
VisitLog is the model entity for the VisitLog schema.
func (*VisitLog) Unwrap ¶
Unwrap unwraps the VisitLog 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 (*VisitLog) Update ¶
func (vl *VisitLog) Update() *VisitLogUpdateOne
Update returns a builder for updating this VisitLog. Note that you need to call VisitLog.Unwrap() before calling this method if this VisitLog was returned from a transaction, and the transaction was committed or rolled back.
type VisitLogClient ¶
type VisitLogClient struct {
// contains filtered or unexported fields
}
VisitLogClient is a client for the VisitLog schema.
func NewVisitLogClient ¶
func NewVisitLogClient(c config) *VisitLogClient
NewVisitLogClient returns a client for the VisitLog from the given config.
func (*VisitLogClient) Create ¶
func (c *VisitLogClient) Create() *VisitLogCreate
Create returns a create builder for VisitLog.
func (*VisitLogClient) CreateBulk ¶
func (c *VisitLogClient) CreateBulk(builders ...*VisitLogCreate) *VisitLogCreateBulk
CreateBulk returns a builder for creating a bulk of VisitLog entities.
func (*VisitLogClient) Delete ¶
func (c *VisitLogClient) Delete() *VisitLogDelete
Delete returns a delete builder for VisitLog.
func (*VisitLogClient) DeleteOne ¶
func (c *VisitLogClient) DeleteOne(vl *VisitLog) *VisitLogDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*VisitLogClient) DeleteOneID ¶
func (c *VisitLogClient) DeleteOneID(id int) *VisitLogDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*VisitLogClient) GetX ¶
func (c *VisitLogClient) GetX(ctx context.Context, id int) *VisitLog
GetX is like Get, but panics if an error occurs.
func (*VisitLogClient) Hooks ¶
func (c *VisitLogClient) Hooks() []Hook
Hooks returns the client hooks.
func (*VisitLogClient) Query ¶
func (c *VisitLogClient) Query() *VisitLogQuery
Query returns a query builder for VisitLog.
func (*VisitLogClient) QueryURL ¶
func (c *VisitLogClient) QueryURL(vl *VisitLog) *URLQuery
QueryURL queries the url edge of a VisitLog.
func (*VisitLogClient) Update ¶
func (c *VisitLogClient) Update() *VisitLogUpdate
Update returns an update builder for VisitLog.
func (*VisitLogClient) UpdateOne ¶
func (c *VisitLogClient) UpdateOne(vl *VisitLog) *VisitLogUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VisitLogClient) UpdateOneID ¶
func (c *VisitLogClient) UpdateOneID(id int) *VisitLogUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VisitLogClient) Use ¶
func (c *VisitLogClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `visitlog.Hooks(f(g(h())))`.
type VisitLogCreate ¶
type VisitLogCreate struct {
// contains filtered or unexported fields
}
VisitLogCreate is the builder for creating a VisitLog entity.
func (*VisitLogCreate) Exec ¶
func (vlc *VisitLogCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VisitLogCreate) ExecX ¶
func (vlc *VisitLogCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VisitLogCreate) Mutation ¶
func (vlc *VisitLogCreate) Mutation() *VisitLogMutation
Mutation returns the VisitLogMutation object of the builder.
func (*VisitLogCreate) Save ¶
func (vlc *VisitLogCreate) Save(ctx context.Context) (*VisitLog, error)
Save creates the VisitLog in the database.
func (*VisitLogCreate) SaveX ¶
func (vlc *VisitLogCreate) SaveX(ctx context.Context) *VisitLog
SaveX calls Save and panics if Save returns an error.
func (*VisitLogCreate) SetBot ¶
func (vlc *VisitLogCreate) SetBot(b bool) *VisitLogCreate
SetBot sets the "bot" field.
func (*VisitLogCreate) SetBrowserName ¶
func (vlc *VisitLogCreate) SetBrowserName(s string) *VisitLogCreate
SetBrowserName sets the "browser_name" field.
func (*VisitLogCreate) SetBrowserVersion ¶
func (vlc *VisitLogCreate) SetBrowserVersion(s string) *VisitLogCreate
SetBrowserVersion sets the "browser_version" field.
func (*VisitLogCreate) SetCreatedAt ¶
func (vlc *VisitLogCreate) SetCreatedAt(t time.Time) *VisitLogCreate
SetCreatedAt sets the "created_at" field.
func (*VisitLogCreate) SetEngineName ¶
func (vlc *VisitLogCreate) SetEngineName(s string) *VisitLogCreate
SetEngineName sets the "engine_name" field.
func (*VisitLogCreate) SetEngineVersion ¶
func (vlc *VisitLogCreate) SetEngineVersion(s string) *VisitLogCreate
SetEngineVersion sets the "engine_version" field.
func (*VisitLogCreate) SetIP ¶
func (vlc *VisitLogCreate) SetIP(s string) *VisitLogCreate
SetIP sets the "ip" field.
func (*VisitLogCreate) SetMobile ¶
func (vlc *VisitLogCreate) SetMobile(b bool) *VisitLogCreate
SetMobile sets the "mobile" field.
func (*VisitLogCreate) SetMozilla ¶
func (vlc *VisitLogCreate) SetMozilla(s string) *VisitLogCreate
SetMozilla sets the "mozilla" field.
func (*VisitLogCreate) SetNillableCreatedAt ¶
func (vlc *VisitLogCreate) SetNillableCreatedAt(t *time.Time) *VisitLogCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VisitLogCreate) SetNillableURLID ¶
func (vlc *VisitLogCreate) SetNillableURLID(id *int) *VisitLogCreate
SetNillableURLID sets the "url" edge to the Url entity by ID if the given value is not nil.
func (*VisitLogCreate) SetOs ¶
func (vlc *VisitLogCreate) SetOs(s string) *VisitLogCreate
SetOs sets the "os" field.
func (*VisitLogCreate) SetPlatform ¶
func (vlc *VisitLogCreate) SetPlatform(s string) *VisitLogCreate
SetPlatform sets the "platform" field.
func (*VisitLogCreate) SetReferer ¶
func (vlc *VisitLogCreate) SetReferer(s string) *VisitLogCreate
SetReferer sets the "referer" field.
func (*VisitLogCreate) SetURL ¶
func (vlc *VisitLogCreate) SetURL(u *Url) *VisitLogCreate
SetURL sets the "url" edge to the Url entity.
func (*VisitLogCreate) SetURLID ¶
func (vlc *VisitLogCreate) SetURLID(id int) *VisitLogCreate
SetURLID sets the "url" edge to the Url entity by ID.
type VisitLogCreateBulk ¶
type VisitLogCreateBulk struct {
// contains filtered or unexported fields
}
VisitLogCreateBulk is the builder for creating many VisitLog entities in bulk.
func (*VisitLogCreateBulk) Exec ¶
func (vlcb *VisitLogCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VisitLogCreateBulk) ExecX ¶
func (vlcb *VisitLogCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type VisitLogDelete ¶
type VisitLogDelete struct {
// contains filtered or unexported fields
}
VisitLogDelete is the builder for deleting a VisitLog entity.
func (*VisitLogDelete) Exec ¶
func (vld *VisitLogDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VisitLogDelete) ExecX ¶
func (vld *VisitLogDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VisitLogDelete) Where ¶
func (vld *VisitLogDelete) Where(ps ...predicate.VisitLog) *VisitLogDelete
Where appends a list predicates to the VisitLogDelete builder.
type VisitLogDeleteOne ¶
type VisitLogDeleteOne struct {
// contains filtered or unexported fields
}
VisitLogDeleteOne is the builder for deleting a single VisitLog entity.
func (*VisitLogDeleteOne) Exec ¶
func (vldo *VisitLogDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VisitLogDeleteOne) ExecX ¶
func (vldo *VisitLogDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type VisitLogEdges ¶
type VisitLogEdges struct { // URL holds the value of the url edge. URL *Url `json:"url,omitempty"` // contains filtered or unexported fields }
VisitLogEdges holds the relations/edges for other nodes in the graph.
func (VisitLogEdges) URLOrErr ¶
func (e VisitLogEdges) URLOrErr() (*Url, error)
URLOrErr returns the URL value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type VisitLogGroupBy ¶
type VisitLogGroupBy struct {
// contains filtered or unexported fields
}
VisitLogGroupBy is the group-by builder for VisitLog entities.
func (*VisitLogGroupBy) Aggregate ¶
func (vlgb *VisitLogGroupBy) Aggregate(fns ...AggregateFunc) *VisitLogGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VisitLogGroupBy) Bool ¶
func (vlgb *VisitLogGroupBy) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) BoolX ¶
func (vlgb *VisitLogGroupBy) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*VisitLogGroupBy) Bools ¶
func (vlgb *VisitLogGroupBy) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) BoolsX ¶
func (vlgb *VisitLogGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*VisitLogGroupBy) Float64 ¶
func (vlgb *VisitLogGroupBy) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) Float64X ¶
func (vlgb *VisitLogGroupBy) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*VisitLogGroupBy) Float64s ¶
func (vlgb *VisitLogGroupBy) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) Float64sX ¶
func (vlgb *VisitLogGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*VisitLogGroupBy) Int ¶
func (vlgb *VisitLogGroupBy) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) IntX ¶
func (vlgb *VisitLogGroupBy) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*VisitLogGroupBy) Ints ¶
func (vlgb *VisitLogGroupBy) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) IntsX ¶
func (vlgb *VisitLogGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*VisitLogGroupBy) Scan ¶
func (vlgb *VisitLogGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*VisitLogGroupBy) ScanX ¶
func (vlgb *VisitLogGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*VisitLogGroupBy) String ¶
func (vlgb *VisitLogGroupBy) String(ctx context.Context) (_ string, err error)
String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.
func (*VisitLogGroupBy) StringX ¶
func (vlgb *VisitLogGroupBy) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type VisitLogMutation ¶
type VisitLogMutation struct {
// contains filtered or unexported fields
}
VisitLogMutation represents an operation that mutates the VisitLog nodes in the graph.
func (*VisitLogMutation) AddField ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) AddedEdges ¶
func (m *VisitLogMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VisitLogMutation) AddedField ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) AddedFields ¶
func (m *VisitLogMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VisitLogMutation) AddedIDs ¶
func (m *VisitLogMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VisitLogMutation) Bot ¶
func (m *VisitLogMutation) Bot() (r bool, exists bool)
Bot returns the value of the "bot" field in the mutation.
func (*VisitLogMutation) BrowserName ¶
func (m *VisitLogMutation) BrowserName() (r string, exists bool)
BrowserName returns the value of the "browser_name" field in the mutation.
func (*VisitLogMutation) BrowserVersion ¶
func (m *VisitLogMutation) BrowserVersion() (r string, exists bool)
BrowserVersion returns the value of the "browser_version" field in the mutation.
func (*VisitLogMutation) ClearEdge ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) ClearField ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) ClearURL ¶
func (m *VisitLogMutation) ClearURL()
ClearURL clears the "url" edge to the Url entity.
func (*VisitLogMutation) ClearedEdges ¶
func (m *VisitLogMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VisitLogMutation) ClearedFields ¶
func (m *VisitLogMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VisitLogMutation) Client ¶
func (m VisitLogMutation) 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 (*VisitLogMutation) CreatedAt ¶
func (m *VisitLogMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*VisitLogMutation) EdgeCleared ¶
func (m *VisitLogMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VisitLogMutation) EngineName ¶
func (m *VisitLogMutation) EngineName() (r string, exists bool)
EngineName returns the value of the "engine_name" field in the mutation.
func (*VisitLogMutation) EngineVersion ¶
func (m *VisitLogMutation) EngineVersion() (r string, exists bool)
EngineVersion returns the value of the "engine_version" field in the mutation.
func (*VisitLogMutation) Field ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) FieldCleared ¶
func (m *VisitLogMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VisitLogMutation) Fields ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) ID ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) IDs ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) IP ¶
func (m *VisitLogMutation) IP() (r string, exists bool)
IP returns the value of the "ip" field in the mutation.
func (*VisitLogMutation) Mobile ¶
func (m *VisitLogMutation) Mobile() (r bool, exists bool)
Mobile returns the value of the "mobile" field in the mutation.
func (*VisitLogMutation) Mozilla ¶
func (m *VisitLogMutation) Mozilla() (r string, exists bool)
Mozilla returns the value of the "mozilla" field in the mutation.
func (*VisitLogMutation) OldBot ¶
func (m *VisitLogMutation) OldBot(ctx context.Context) (v bool, err error)
OldBot returns the old "bot" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldBrowserName ¶
func (m *VisitLogMutation) OldBrowserName(ctx context.Context) (v string, err error)
OldBrowserName returns the old "browser_name" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldBrowserVersion ¶
func (m *VisitLogMutation) OldBrowserVersion(ctx context.Context) (v string, err error)
OldBrowserVersion returns the old "browser_version" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldEngineName ¶
func (m *VisitLogMutation) OldEngineName(ctx context.Context) (v string, err error)
OldEngineName returns the old "engine_name" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldEngineVersion ¶
func (m *VisitLogMutation) OldEngineVersion(ctx context.Context) (v string, err error)
OldEngineVersion returns the old "engine_version" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) 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 (*VisitLogMutation) OldIP ¶
func (m *VisitLogMutation) OldIP(ctx context.Context) (v string, err error)
OldIP returns the old "ip" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldMobile ¶
func (m *VisitLogMutation) OldMobile(ctx context.Context) (v bool, err error)
OldMobile returns the old "mobile" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldMozilla ¶
func (m *VisitLogMutation) OldMozilla(ctx context.Context) (v string, err error)
OldMozilla returns the old "mozilla" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldOs ¶
func (m *VisitLogMutation) OldOs(ctx context.Context) (v string, err error)
OldOs returns the old "os" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldPlatform ¶
func (m *VisitLogMutation) OldPlatform(ctx context.Context) (v string, err error)
OldPlatform returns the old "platform" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) OldReferer ¶
func (m *VisitLogMutation) OldReferer(ctx context.Context) (v string, err error)
OldReferer returns the old "referer" field's value of the VisitLog entity. If the VisitLog 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 (*VisitLogMutation) Os ¶
func (m *VisitLogMutation) Os() (r string, exists bool)
Os returns the value of the "os" field in the mutation.
func (*VisitLogMutation) Platform ¶
func (m *VisitLogMutation) Platform() (r string, exists bool)
Platform returns the value of the "platform" field in the mutation.
func (*VisitLogMutation) Referer ¶
func (m *VisitLogMutation) Referer() (r string, exists bool)
Referer returns the value of the "referer" field in the mutation.
func (*VisitLogMutation) RemovedEdges ¶
func (m *VisitLogMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VisitLogMutation) RemovedIDs ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) ResetBot ¶
func (m *VisitLogMutation) ResetBot()
ResetBot resets all changes to the "bot" field.
func (*VisitLogMutation) ResetBrowserName ¶
func (m *VisitLogMutation) ResetBrowserName()
ResetBrowserName resets all changes to the "browser_name" field.
func (*VisitLogMutation) ResetBrowserVersion ¶
func (m *VisitLogMutation) ResetBrowserVersion()
ResetBrowserVersion resets all changes to the "browser_version" field.
func (*VisitLogMutation) ResetCreatedAt ¶
func (m *VisitLogMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*VisitLogMutation) ResetEdge ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) ResetEngineName ¶
func (m *VisitLogMutation) ResetEngineName()
ResetEngineName resets all changes to the "engine_name" field.
func (*VisitLogMutation) ResetEngineVersion ¶
func (m *VisitLogMutation) ResetEngineVersion()
ResetEngineVersion resets all changes to the "engine_version" field.
func (*VisitLogMutation) ResetField ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) ResetIP ¶
func (m *VisitLogMutation) ResetIP()
ResetIP resets all changes to the "ip" field.
func (*VisitLogMutation) ResetMobile ¶
func (m *VisitLogMutation) ResetMobile()
ResetMobile resets all changes to the "mobile" field.
func (*VisitLogMutation) ResetMozilla ¶
func (m *VisitLogMutation) ResetMozilla()
ResetMozilla resets all changes to the "mozilla" field.
func (*VisitLogMutation) ResetOs ¶
func (m *VisitLogMutation) ResetOs()
ResetOs resets all changes to the "os" field.
func (*VisitLogMutation) ResetPlatform ¶
func (m *VisitLogMutation) ResetPlatform()
ResetPlatform resets all changes to the "platform" field.
func (*VisitLogMutation) ResetReferer ¶
func (m *VisitLogMutation) ResetReferer()
ResetReferer resets all changes to the "referer" field.
func (*VisitLogMutation) ResetURL ¶
func (m *VisitLogMutation) ResetURL()
ResetURL resets all changes to the "url" edge.
func (*VisitLogMutation) SetBot ¶
func (m *VisitLogMutation) SetBot(b bool)
SetBot sets the "bot" field.
func (*VisitLogMutation) SetBrowserName ¶
func (m *VisitLogMutation) SetBrowserName(s string)
SetBrowserName sets the "browser_name" field.
func (*VisitLogMutation) SetBrowserVersion ¶
func (m *VisitLogMutation) SetBrowserVersion(s string)
SetBrowserVersion sets the "browser_version" field.
func (*VisitLogMutation) SetCreatedAt ¶
func (m *VisitLogMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*VisitLogMutation) SetEngineName ¶
func (m *VisitLogMutation) SetEngineName(s string)
SetEngineName sets the "engine_name" field.
func (*VisitLogMutation) SetEngineVersion ¶
func (m *VisitLogMutation) SetEngineVersion(s string)
SetEngineVersion sets the "engine_version" field.
func (*VisitLogMutation) SetField ¶
func (m *VisitLogMutation) 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 (*VisitLogMutation) SetIP ¶
func (m *VisitLogMutation) SetIP(s string)
SetIP sets the "ip" field.
func (*VisitLogMutation) SetMobile ¶
func (m *VisitLogMutation) SetMobile(b bool)
SetMobile sets the "mobile" field.
func (*VisitLogMutation) SetMozilla ¶
func (m *VisitLogMutation) SetMozilla(s string)
SetMozilla sets the "mozilla" field.
func (*VisitLogMutation) SetOs ¶
func (m *VisitLogMutation) SetOs(s string)
SetOs sets the "os" field.
func (*VisitLogMutation) SetPlatform ¶
func (m *VisitLogMutation) SetPlatform(s string)
SetPlatform sets the "platform" field.
func (*VisitLogMutation) SetReferer ¶
func (m *VisitLogMutation) SetReferer(s string)
SetReferer sets the "referer" field.
func (*VisitLogMutation) SetURLID ¶
func (m *VisitLogMutation) SetURLID(id int)
SetURLID sets the "url" edge to the Url entity by id.
func (VisitLogMutation) Tx ¶
func (m VisitLogMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VisitLogMutation) Type ¶
func (m *VisitLogMutation) Type() string
Type returns the node type of this mutation (VisitLog).
func (*VisitLogMutation) URLCleared ¶
func (m *VisitLogMutation) URLCleared() bool
URLCleared reports if the "url" edge to the Url entity was cleared.
func (*VisitLogMutation) URLID ¶
func (m *VisitLogMutation) URLID() (id int, exists bool)
URLID returns the "url" edge ID in the mutation.
func (*VisitLogMutation) URLIDs ¶
func (m *VisitLogMutation) URLIDs() (ids []int)
URLIDs returns the "url" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use URLID instead. It exists only for internal usage by the builders.
func (*VisitLogMutation) Where ¶
func (m *VisitLogMutation) Where(ps ...predicate.VisitLog)
Where appends a list predicates to the VisitLogMutation builder.
type VisitLogQuery ¶
type VisitLogQuery struct {
// contains filtered or unexported fields
}
VisitLogQuery is the builder for querying VisitLog entities.
func (*VisitLogQuery) All ¶
func (vlq *VisitLogQuery) All(ctx context.Context) ([]*VisitLog, error)
All executes the query and returns a list of VisitLogs.
func (*VisitLogQuery) AllX ¶
func (vlq *VisitLogQuery) AllX(ctx context.Context) []*VisitLog
AllX is like All, but panics if an error occurs.
func (*VisitLogQuery) Clone ¶
func (vlq *VisitLogQuery) Clone() *VisitLogQuery
Clone returns a duplicate of the VisitLogQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VisitLogQuery) Count ¶
func (vlq *VisitLogQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VisitLogQuery) CountX ¶
func (vlq *VisitLogQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VisitLogQuery) Exist ¶
func (vlq *VisitLogQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VisitLogQuery) ExistX ¶
func (vlq *VisitLogQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VisitLogQuery) First ¶
func (vlq *VisitLogQuery) First(ctx context.Context) (*VisitLog, error)
First returns the first VisitLog entity from the query. Returns a *NotFoundError when no VisitLog was found.
func (*VisitLogQuery) FirstID ¶
func (vlq *VisitLogQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first VisitLog ID from the query. Returns a *NotFoundError when no VisitLog ID was found.
func (*VisitLogQuery) FirstIDX ¶
func (vlq *VisitLogQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*VisitLogQuery) FirstX ¶
func (vlq *VisitLogQuery) FirstX(ctx context.Context) *VisitLog
FirstX is like First, but panics if an error occurs.
func (*VisitLogQuery) GroupBy ¶
func (vlq *VisitLogQuery) GroupBy(field string, fields ...string) *VisitLogGroupBy
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 { Platform string `json:"platform,omitempty"` Count int `json:"count,omitempty"` } client.VisitLog.Query(). GroupBy(visitlog.FieldPlatform). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VisitLogQuery) IDs ¶
func (vlq *VisitLogQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of VisitLog IDs.
func (*VisitLogQuery) IDsX ¶
func (vlq *VisitLogQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*VisitLogQuery) Limit ¶
func (vlq *VisitLogQuery) Limit(limit int) *VisitLogQuery
Limit adds a limit step to the query.
func (*VisitLogQuery) Offset ¶
func (vlq *VisitLogQuery) Offset(offset int) *VisitLogQuery
Offset adds an offset step to the query.
func (*VisitLogQuery) Only ¶
func (vlq *VisitLogQuery) Only(ctx context.Context) (*VisitLog, error)
Only returns a single VisitLog entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one VisitLog entity is found. Returns a *NotFoundError when no VisitLog entities are found.
func (*VisitLogQuery) OnlyID ¶
func (vlq *VisitLogQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only VisitLog ID in the query. Returns a *NotSingularError when more than one VisitLog ID is found. Returns a *NotFoundError when no entities are found.
func (*VisitLogQuery) OnlyIDX ¶
func (vlq *VisitLogQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VisitLogQuery) OnlyX ¶
func (vlq *VisitLogQuery) OnlyX(ctx context.Context) *VisitLog
OnlyX is like Only, but panics if an error occurs.
func (*VisitLogQuery) Order ¶
func (vlq *VisitLogQuery) Order(o ...OrderFunc) *VisitLogQuery
Order adds an order step to the query.
func (*VisitLogQuery) QueryURL ¶
func (vlq *VisitLogQuery) QueryURL() *URLQuery
QueryURL chains the current query on the "url" edge.
func (*VisitLogQuery) Select ¶
func (vlq *VisitLogQuery) Select(fields ...string) *VisitLogSelect
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 { Platform string `json:"platform,omitempty"` } client.VisitLog.Query(). Select(visitlog.FieldPlatform). Scan(ctx, &v)
func (*VisitLogQuery) Unique ¶
func (vlq *VisitLogQuery) Unique(unique bool) *VisitLogQuery
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 (*VisitLogQuery) Where ¶
func (vlq *VisitLogQuery) Where(ps ...predicate.VisitLog) *VisitLogQuery
Where adds a new predicate for the VisitLogQuery builder.
func (*VisitLogQuery) WithURL ¶
func (vlq *VisitLogQuery) WithURL(opts ...func(*URLQuery)) *VisitLogQuery
WithURL tells the query-builder to eager-load the nodes that are connected to the "url" edge. The optional arguments are used to configure the query builder of the edge.
type VisitLogSelect ¶
type VisitLogSelect struct { *VisitLogQuery // contains filtered or unexported fields }
VisitLogSelect is the builder for selecting fields of VisitLog entities.
func (*VisitLogSelect) Bool ¶
func (vls *VisitLogSelect) Bool(ctx context.Context) (_ bool, err error)
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) BoolX ¶
func (vls *VisitLogSelect) BoolX(ctx context.Context) bool
BoolX is like Bool, but panics if an error occurs.
func (*VisitLogSelect) Bools ¶
func (vls *VisitLogSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) BoolsX ¶
func (vls *VisitLogSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*VisitLogSelect) Float64 ¶
func (vls *VisitLogSelect) Float64(ctx context.Context) (_ float64, err error)
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) Float64X ¶
func (vls *VisitLogSelect) Float64X(ctx context.Context) float64
Float64X is like Float64, but panics if an error occurs.
func (*VisitLogSelect) Float64s ¶
func (vls *VisitLogSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) Float64sX ¶
func (vls *VisitLogSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*VisitLogSelect) Int ¶
func (vls *VisitLogSelect) Int(ctx context.Context) (_ int, err error)
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) IntX ¶
func (vls *VisitLogSelect) IntX(ctx context.Context) int
IntX is like Int, but panics if an error occurs.
func (*VisitLogSelect) Ints ¶
func (vls *VisitLogSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) IntsX ¶
func (vls *VisitLogSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*VisitLogSelect) Scan ¶
func (vls *VisitLogSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*VisitLogSelect) ScanX ¶
func (vls *VisitLogSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
func (*VisitLogSelect) String ¶
func (vls *VisitLogSelect) String(ctx context.Context) (_ string, err error)
String returns a single string from a selector. It is only allowed when selecting one field.
func (*VisitLogSelect) StringX ¶
func (vls *VisitLogSelect) StringX(ctx context.Context) string
StringX is like String, but panics if an error occurs.
type VisitLogUpdate ¶
type VisitLogUpdate struct {
// contains filtered or unexported fields
}
VisitLogUpdate is the builder for updating VisitLog entities.
func (*VisitLogUpdate) ClearURL ¶
func (vlu *VisitLogUpdate) ClearURL() *VisitLogUpdate
ClearURL clears the "url" edge to the Url entity.
func (*VisitLogUpdate) Exec ¶
func (vlu *VisitLogUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VisitLogUpdate) ExecX ¶
func (vlu *VisitLogUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VisitLogUpdate) Mutation ¶
func (vlu *VisitLogUpdate) Mutation() *VisitLogMutation
Mutation returns the VisitLogMutation object of the builder.
func (*VisitLogUpdate) Save ¶
func (vlu *VisitLogUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VisitLogUpdate) SaveX ¶
func (vlu *VisitLogUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VisitLogUpdate) SetBot ¶
func (vlu *VisitLogUpdate) SetBot(b bool) *VisitLogUpdate
SetBot sets the "bot" field.
func (*VisitLogUpdate) SetBrowserName ¶
func (vlu *VisitLogUpdate) SetBrowserName(s string) *VisitLogUpdate
SetBrowserName sets the "browser_name" field.
func (*VisitLogUpdate) SetBrowserVersion ¶
func (vlu *VisitLogUpdate) SetBrowserVersion(s string) *VisitLogUpdate
SetBrowserVersion sets the "browser_version" field.
func (*VisitLogUpdate) SetCreatedAt ¶
func (vlu *VisitLogUpdate) SetCreatedAt(t time.Time) *VisitLogUpdate
SetCreatedAt sets the "created_at" field.
func (*VisitLogUpdate) SetEngineName ¶
func (vlu *VisitLogUpdate) SetEngineName(s string) *VisitLogUpdate
SetEngineName sets the "engine_name" field.
func (*VisitLogUpdate) SetEngineVersion ¶
func (vlu *VisitLogUpdate) SetEngineVersion(s string) *VisitLogUpdate
SetEngineVersion sets the "engine_version" field.
func (*VisitLogUpdate) SetIP ¶
func (vlu *VisitLogUpdate) SetIP(s string) *VisitLogUpdate
SetIP sets the "ip" field.
func (*VisitLogUpdate) SetMobile ¶
func (vlu *VisitLogUpdate) SetMobile(b bool) *VisitLogUpdate
SetMobile sets the "mobile" field.
func (*VisitLogUpdate) SetMozilla ¶
func (vlu *VisitLogUpdate) SetMozilla(s string) *VisitLogUpdate
SetMozilla sets the "mozilla" field.
func (*VisitLogUpdate) SetNillableCreatedAt ¶
func (vlu *VisitLogUpdate) SetNillableCreatedAt(t *time.Time) *VisitLogUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VisitLogUpdate) SetNillableURLID ¶
func (vlu *VisitLogUpdate) SetNillableURLID(id *int) *VisitLogUpdate
SetNillableURLID sets the "url" edge to the Url entity by ID if the given value is not nil.
func (*VisitLogUpdate) SetOs ¶
func (vlu *VisitLogUpdate) SetOs(s string) *VisitLogUpdate
SetOs sets the "os" field.
func (*VisitLogUpdate) SetPlatform ¶
func (vlu *VisitLogUpdate) SetPlatform(s string) *VisitLogUpdate
SetPlatform sets the "platform" field.
func (*VisitLogUpdate) SetReferer ¶
func (vlu *VisitLogUpdate) SetReferer(s string) *VisitLogUpdate
SetReferer sets the "referer" field.
func (*VisitLogUpdate) SetURL ¶
func (vlu *VisitLogUpdate) SetURL(u *Url) *VisitLogUpdate
SetURL sets the "url" edge to the Url entity.
func (*VisitLogUpdate) SetURLID ¶
func (vlu *VisitLogUpdate) SetURLID(id int) *VisitLogUpdate
SetURLID sets the "url" edge to the Url entity by ID.
func (*VisitLogUpdate) Where ¶
func (vlu *VisitLogUpdate) Where(ps ...predicate.VisitLog) *VisitLogUpdate
Where appends a list predicates to the VisitLogUpdate builder.
type VisitLogUpdateOne ¶
type VisitLogUpdateOne struct {
// contains filtered or unexported fields
}
VisitLogUpdateOne is the builder for updating a single VisitLog entity.
func (*VisitLogUpdateOne) ClearURL ¶
func (vluo *VisitLogUpdateOne) ClearURL() *VisitLogUpdateOne
ClearURL clears the "url" edge to the Url entity.
func (*VisitLogUpdateOne) Exec ¶
func (vluo *VisitLogUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VisitLogUpdateOne) ExecX ¶
func (vluo *VisitLogUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VisitLogUpdateOne) Mutation ¶
func (vluo *VisitLogUpdateOne) Mutation() *VisitLogMutation
Mutation returns the VisitLogMutation object of the builder.
func (*VisitLogUpdateOne) Save ¶
func (vluo *VisitLogUpdateOne) Save(ctx context.Context) (*VisitLog, error)
Save executes the query and returns the updated VisitLog entity.
func (*VisitLogUpdateOne) SaveX ¶
func (vluo *VisitLogUpdateOne) SaveX(ctx context.Context) *VisitLog
SaveX is like Save, but panics if an error occurs.
func (*VisitLogUpdateOne) Select ¶
func (vluo *VisitLogUpdateOne) Select(field string, fields ...string) *VisitLogUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VisitLogUpdateOne) SetBot ¶
func (vluo *VisitLogUpdateOne) SetBot(b bool) *VisitLogUpdateOne
SetBot sets the "bot" field.
func (*VisitLogUpdateOne) SetBrowserName ¶
func (vluo *VisitLogUpdateOne) SetBrowserName(s string) *VisitLogUpdateOne
SetBrowserName sets the "browser_name" field.
func (*VisitLogUpdateOne) SetBrowserVersion ¶
func (vluo *VisitLogUpdateOne) SetBrowserVersion(s string) *VisitLogUpdateOne
SetBrowserVersion sets the "browser_version" field.
func (*VisitLogUpdateOne) SetCreatedAt ¶
func (vluo *VisitLogUpdateOne) SetCreatedAt(t time.Time) *VisitLogUpdateOne
SetCreatedAt sets the "created_at" field.
func (*VisitLogUpdateOne) SetEngineName ¶
func (vluo *VisitLogUpdateOne) SetEngineName(s string) *VisitLogUpdateOne
SetEngineName sets the "engine_name" field.
func (*VisitLogUpdateOne) SetEngineVersion ¶
func (vluo *VisitLogUpdateOne) SetEngineVersion(s string) *VisitLogUpdateOne
SetEngineVersion sets the "engine_version" field.
func (*VisitLogUpdateOne) SetIP ¶
func (vluo *VisitLogUpdateOne) SetIP(s string) *VisitLogUpdateOne
SetIP sets the "ip" field.
func (*VisitLogUpdateOne) SetMobile ¶
func (vluo *VisitLogUpdateOne) SetMobile(b bool) *VisitLogUpdateOne
SetMobile sets the "mobile" field.
func (*VisitLogUpdateOne) SetMozilla ¶
func (vluo *VisitLogUpdateOne) SetMozilla(s string) *VisitLogUpdateOne
SetMozilla sets the "mozilla" field.
func (*VisitLogUpdateOne) SetNillableCreatedAt ¶
func (vluo *VisitLogUpdateOne) SetNillableCreatedAt(t *time.Time) *VisitLogUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*VisitLogUpdateOne) SetNillableURLID ¶
func (vluo *VisitLogUpdateOne) SetNillableURLID(id *int) *VisitLogUpdateOne
SetNillableURLID sets the "url" edge to the Url entity by ID if the given value is not nil.
func (*VisitLogUpdateOne) SetOs ¶
func (vluo *VisitLogUpdateOne) SetOs(s string) *VisitLogUpdateOne
SetOs sets the "os" field.
func (*VisitLogUpdateOne) SetPlatform ¶
func (vluo *VisitLogUpdateOne) SetPlatform(s string) *VisitLogUpdateOne
SetPlatform sets the "platform" field.
func (*VisitLogUpdateOne) SetReferer ¶
func (vluo *VisitLogUpdateOne) SetReferer(s string) *VisitLogUpdateOne
SetReferer sets the "referer" field.
func (*VisitLogUpdateOne) SetURL ¶
func (vluo *VisitLogUpdateOne) SetURL(u *Url) *VisitLogUpdateOne
SetURL sets the "url" edge to the Url entity.
func (*VisitLogUpdateOne) SetURLID ¶
func (vluo *VisitLogUpdateOne) SetURLID(id int) *VisitLogUpdateOne
SetURLID sets the "url" edge to the Url entity by ID.