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 Site
- type SiteClient
- func (c *SiteClient) Create() *SiteCreate
- func (c *SiteClient) CreateBulk(builders ...*SiteCreate) *SiteCreateBulk
- func (c *SiteClient) Delete() *SiteDelete
- func (c *SiteClient) DeleteOne(s *Site) *SiteDeleteOne
- func (c *SiteClient) DeleteOneID(id int) *SiteDeleteOne
- func (c *SiteClient) Get(ctx context.Context, id int) (*Site, error)
- func (c *SiteClient) GetX(ctx context.Context, id int) *Site
- func (c *SiteClient) Hooks() []Hook
- func (c *SiteClient) Query() *SiteQuery
- func (c *SiteClient) QueryUsers(s *Site) *UserQuery
- func (c *SiteClient) QueryVisits(s *Site) *VisitQuery
- func (c *SiteClient) Update() *SiteUpdate
- func (c *SiteClient) UpdateOne(s *Site) *SiteUpdateOne
- func (c *SiteClient) UpdateOneID(id int) *SiteUpdateOne
- func (c *SiteClient) Use(hooks ...Hook)
- type SiteCreate
- func (sc *SiteCreate) AddUserIDs(ids ...int) *SiteCreate
- func (sc *SiteCreate) AddUsers(u ...*User) *SiteCreate
- func (sc *SiteCreate) AddVisitIDs(ids ...int) *SiteCreate
- func (sc *SiteCreate) AddVisits(v ...*Visit) *SiteCreate
- func (sc *SiteCreate) Exec(ctx context.Context) error
- func (sc *SiteCreate) ExecX(ctx context.Context)
- func (sc *SiteCreate) Mutation() *SiteMutation
- func (sc *SiteCreate) Save(ctx context.Context) (*Site, error)
- func (sc *SiteCreate) SaveX(ctx context.Context) *Site
- func (sc *SiteCreate) SetDomain(s string) *SiteCreate
- func (sc *SiteCreate) SetFavicon(s string) *SiteCreate
- func (sc *SiteCreate) SetNillableFavicon(s *string) *SiteCreate
- type SiteCreateBulk
- type SiteDelete
- type SiteDeleteOne
- type SiteEdges
- type SiteGroupBy
- func (sgb *SiteGroupBy) Aggregate(fns ...AggregateFunc) *SiteGroupBy
- func (s *SiteGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SiteGroupBy) BoolX(ctx context.Context) bool
- func (s *SiteGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SiteGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SiteGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SiteGroupBy) Float64X(ctx context.Context) float64
- func (s *SiteGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SiteGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SiteGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SiteGroupBy) IntX(ctx context.Context) int
- func (s *SiteGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SiteGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SiteGroupBy) Scan(ctx context.Context, v any) error
- func (s *SiteGroupBy) ScanX(ctx context.Context, v any)
- func (s *SiteGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SiteGroupBy) StringX(ctx context.Context) string
- func (s *SiteGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SiteGroupBy) StringsX(ctx context.Context) []string
- type SiteMutation
- func (m *SiteMutation) AddField(name string, value ent.Value) error
- func (m *SiteMutation) AddUserIDs(ids ...int)
- func (m *SiteMutation) AddVisitIDs(ids ...int)
- func (m *SiteMutation) AddedEdges() []string
- func (m *SiteMutation) AddedField(name string) (ent.Value, bool)
- func (m *SiteMutation) AddedFields() []string
- func (m *SiteMutation) AddedIDs(name string) []ent.Value
- func (m *SiteMutation) ClearEdge(name string) error
- func (m *SiteMutation) ClearFavicon()
- func (m *SiteMutation) ClearField(name string) error
- func (m *SiteMutation) ClearUsers()
- func (m *SiteMutation) ClearVisits()
- func (m *SiteMutation) ClearedEdges() []string
- func (m *SiteMutation) ClearedFields() []string
- func (m SiteMutation) Client() *Client
- func (m *SiteMutation) Domain() (r string, exists bool)
- func (m *SiteMutation) EdgeCleared(name string) bool
- func (m *SiteMutation) Favicon() (r string, exists bool)
- func (m *SiteMutation) FaviconCleared() bool
- func (m *SiteMutation) Field(name string) (ent.Value, bool)
- func (m *SiteMutation) FieldCleared(name string) bool
- func (m *SiteMutation) Fields() []string
- func (m *SiteMutation) ID() (id int, exists bool)
- func (m *SiteMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SiteMutation) OldDomain(ctx context.Context) (v string, err error)
- func (m *SiteMutation) OldFavicon(ctx context.Context) (v string, err error)
- func (m *SiteMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SiteMutation) Op() Op
- func (m *SiteMutation) RemoveUserIDs(ids ...int)
- func (m *SiteMutation) RemoveVisitIDs(ids ...int)
- func (m *SiteMutation) RemovedEdges() []string
- func (m *SiteMutation) RemovedIDs(name string) []ent.Value
- func (m *SiteMutation) RemovedUsersIDs() (ids []int)
- func (m *SiteMutation) RemovedVisitsIDs() (ids []int)
- func (m *SiteMutation) ResetDomain()
- func (m *SiteMutation) ResetEdge(name string) error
- func (m *SiteMutation) ResetFavicon()
- func (m *SiteMutation) ResetField(name string) error
- func (m *SiteMutation) ResetUsers()
- func (m *SiteMutation) ResetVisits()
- func (m *SiteMutation) SetDomain(s string)
- func (m *SiteMutation) SetFavicon(s string)
- func (m *SiteMutation) SetField(name string, value ent.Value) error
- func (m SiteMutation) Tx() (*Tx, error)
- func (m *SiteMutation) Type() string
- func (m *SiteMutation) UsersCleared() bool
- func (m *SiteMutation) UsersIDs() (ids []int)
- func (m *SiteMutation) VisitsCleared() bool
- func (m *SiteMutation) VisitsIDs() (ids []int)
- func (m *SiteMutation) Where(ps ...predicate.Site)
- type SiteQuery
- func (sq *SiteQuery) Aggregate(fns ...AggregateFunc) *SiteSelect
- func (sq *SiteQuery) All(ctx context.Context) ([]*Site, error)
- func (sq *SiteQuery) AllX(ctx context.Context) []*Site
- func (sq *SiteQuery) Clone() *SiteQuery
- func (sq *SiteQuery) Count(ctx context.Context) (int, error)
- func (sq *SiteQuery) CountX(ctx context.Context) int
- func (sq *SiteQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SiteQuery) ExistX(ctx context.Context) bool
- func (sq *SiteQuery) First(ctx context.Context) (*Site, error)
- func (sq *SiteQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SiteQuery) FirstIDX(ctx context.Context) int
- func (sq *SiteQuery) FirstX(ctx context.Context) *Site
- func (sq *SiteQuery) GroupBy(field string, fields ...string) *SiteGroupBy
- func (sq *SiteQuery) IDs(ctx context.Context) ([]int, error)
- func (sq *SiteQuery) IDsX(ctx context.Context) []int
- func (sq *SiteQuery) Limit(limit int) *SiteQuery
- func (sq *SiteQuery) Offset(offset int) *SiteQuery
- func (sq *SiteQuery) Only(ctx context.Context) (*Site, error)
- func (sq *SiteQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SiteQuery) OnlyIDX(ctx context.Context) int
- func (sq *SiteQuery) OnlyX(ctx context.Context) *Site
- func (sq *SiteQuery) Order(o ...OrderFunc) *SiteQuery
- func (sq *SiteQuery) QueryUsers() *UserQuery
- func (sq *SiteQuery) QueryVisits() *VisitQuery
- func (sq *SiteQuery) Select(fields ...string) *SiteSelect
- func (sq *SiteQuery) Unique(unique bool) *SiteQuery
- func (sq *SiteQuery) Where(ps ...predicate.Site) *SiteQuery
- func (sq *SiteQuery) WithUsers(opts ...func(*UserQuery)) *SiteQuery
- func (sq *SiteQuery) WithVisits(opts ...func(*VisitQuery)) *SiteQuery
- type SiteSelect
- func (ss *SiteSelect) Aggregate(fns ...AggregateFunc) *SiteSelect
- func (s *SiteSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SiteSelect) BoolX(ctx context.Context) bool
- func (s *SiteSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SiteSelect) BoolsX(ctx context.Context) []bool
- func (s *SiteSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SiteSelect) Float64X(ctx context.Context) float64
- func (s *SiteSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SiteSelect) Float64sX(ctx context.Context) []float64
- func (s *SiteSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SiteSelect) IntX(ctx context.Context) int
- func (s *SiteSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SiteSelect) IntsX(ctx context.Context) []int
- func (ss *SiteSelect) Scan(ctx context.Context, v any) error
- func (s *SiteSelect) ScanX(ctx context.Context, v any)
- func (s *SiteSelect) String(ctx context.Context) (_ string, err error)
- func (s *SiteSelect) StringX(ctx context.Context) string
- func (s *SiteSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SiteSelect) StringsX(ctx context.Context) []string
- type SiteUpdate
- func (su *SiteUpdate) AddUserIDs(ids ...int) *SiteUpdate
- func (su *SiteUpdate) AddUsers(u ...*User) *SiteUpdate
- func (su *SiteUpdate) AddVisitIDs(ids ...int) *SiteUpdate
- func (su *SiteUpdate) AddVisits(v ...*Visit) *SiteUpdate
- func (su *SiteUpdate) ClearFavicon() *SiteUpdate
- func (su *SiteUpdate) ClearUsers() *SiteUpdate
- func (su *SiteUpdate) ClearVisits() *SiteUpdate
- func (su *SiteUpdate) Exec(ctx context.Context) error
- func (su *SiteUpdate) ExecX(ctx context.Context)
- func (su *SiteUpdate) Mutation() *SiteMutation
- func (su *SiteUpdate) RemoveUserIDs(ids ...int) *SiteUpdate
- func (su *SiteUpdate) RemoveUsers(u ...*User) *SiteUpdate
- func (su *SiteUpdate) RemoveVisitIDs(ids ...int) *SiteUpdate
- func (su *SiteUpdate) RemoveVisits(v ...*Visit) *SiteUpdate
- func (su *SiteUpdate) Save(ctx context.Context) (int, error)
- func (su *SiteUpdate) SaveX(ctx context.Context) int
- func (su *SiteUpdate) SetDomain(s string) *SiteUpdate
- func (su *SiteUpdate) SetFavicon(s string) *SiteUpdate
- func (su *SiteUpdate) SetNillableFavicon(s *string) *SiteUpdate
- func (su *SiteUpdate) Where(ps ...predicate.Site) *SiteUpdate
- type SiteUpdateOne
- func (suo *SiteUpdateOne) AddUserIDs(ids ...int) *SiteUpdateOne
- func (suo *SiteUpdateOne) AddUsers(u ...*User) *SiteUpdateOne
- func (suo *SiteUpdateOne) AddVisitIDs(ids ...int) *SiteUpdateOne
- func (suo *SiteUpdateOne) AddVisits(v ...*Visit) *SiteUpdateOne
- func (suo *SiteUpdateOne) ClearFavicon() *SiteUpdateOne
- func (suo *SiteUpdateOne) ClearUsers() *SiteUpdateOne
- func (suo *SiteUpdateOne) ClearVisits() *SiteUpdateOne
- func (suo *SiteUpdateOne) Exec(ctx context.Context) error
- func (suo *SiteUpdateOne) ExecX(ctx context.Context)
- func (suo *SiteUpdateOne) Mutation() *SiteMutation
- func (suo *SiteUpdateOne) RemoveUserIDs(ids ...int) *SiteUpdateOne
- func (suo *SiteUpdateOne) RemoveUsers(u ...*User) *SiteUpdateOne
- func (suo *SiteUpdateOne) RemoveVisitIDs(ids ...int) *SiteUpdateOne
- func (suo *SiteUpdateOne) RemoveVisits(v ...*Visit) *SiteUpdateOne
- func (suo *SiteUpdateOne) Save(ctx context.Context) (*Site, error)
- func (suo *SiteUpdateOne) SaveX(ctx context.Context) *Site
- func (suo *SiteUpdateOne) Select(field string, fields ...string) *SiteUpdateOne
- func (suo *SiteUpdateOne) SetDomain(s string) *SiteUpdateOne
- func (suo *SiteUpdateOne) SetFavicon(s string) *SiteUpdateOne
- func (suo *SiteUpdateOne) SetNillableFavicon(s *string) *SiteUpdateOne
- type Sites
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QuerySites(u *User) *SiteQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) AddSiteIDs(ids ...int) *UserCreate
- func (uc *UserCreate) AddSites(s ...*Site) *UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetEmail(s string) *UserCreate
- func (uc *UserCreate) SetPassword(b []byte) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddSiteIDs(ids ...int)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearSites()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldPassword(ctx context.Context) (v []byte, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) Password() (r []byte, exists bool)
- func (m *UserMutation) RemoveSiteIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedSitesIDs() (ids []int)
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetPassword()
- func (m *UserMutation) ResetSites()
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetPassword(b []byte)
- func (m *UserMutation) SitesCleared() bool
- func (m *UserMutation) SitesIDs() (ids []int)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (uq *UserQuery) QuerySites() *SiteQuery
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (uq *UserQuery) WithSites(opts ...func(*SiteQuery)) *UserQuery
- type UserSelect
- func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v any) error
- func (s *UserSelect) ScanX(ctx context.Context, v any)
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddSiteIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) AddSites(s ...*Site) *UserUpdate
- func (uu *UserUpdate) ClearSites() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) RemoveSiteIDs(ids ...int) *UserUpdate
- func (uu *UserUpdate) RemoveSites(s ...*Site) *UserUpdate
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetEmail(s string) *UserUpdate
- func (uu *UserUpdate) SetPassword(b []byte) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddSiteIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddSites(s ...*Site) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearSites() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) RemoveSiteIDs(ids ...int) *UserUpdateOne
- func (uuo *UserUpdateOne) RemoveSites(s ...*Site) *UserUpdateOne
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetPassword(b []byte) *UserUpdateOne
- type Users
- type ValidationError
- type Value
- type Visit
- type VisitClient
- func (c *VisitClient) Create() *VisitCreate
- func (c *VisitClient) CreateBulk(builders ...*VisitCreate) *VisitCreateBulk
- func (c *VisitClient) Delete() *VisitDelete
- func (c *VisitClient) DeleteOne(v *Visit) *VisitDeleteOne
- func (c *VisitClient) DeleteOneID(id int) *VisitDeleteOne
- func (c *VisitClient) Get(ctx context.Context, id int) (*Visit, error)
- func (c *VisitClient) GetX(ctx context.Context, id int) *Visit
- func (c *VisitClient) Hooks() []Hook
- func (c *VisitClient) Query() *VisitQuery
- func (c *VisitClient) QuerySite(v *Visit) *SiteQuery
- func (c *VisitClient) Update() *VisitUpdate
- func (c *VisitClient) UpdateOne(v *Visit) *VisitUpdateOne
- func (c *VisitClient) UpdateOneID(id int) *VisitUpdateOne
- func (c *VisitClient) Use(hooks ...Hook)
- type VisitCreate
- func (vc *VisitCreate) Exec(ctx context.Context) error
- func (vc *VisitCreate) ExecX(ctx context.Context)
- func (vc *VisitCreate) Mutation() *VisitMutation
- func (vc *VisitCreate) Save(ctx context.Context) (*Visit, error)
- func (vc *VisitCreate) SaveX(ctx context.Context) *Visit
- func (vc *VisitCreate) SetIP(s string) *VisitCreate
- func (vc *VisitCreate) SetPath(s string) *VisitCreate
- func (vc *VisitCreate) SetReferrer(s string) *VisitCreate
- func (vc *VisitCreate) SetSite(s *Site) *VisitCreate
- func (vc *VisitCreate) SetSiteID(id int) *VisitCreate
- func (vc *VisitCreate) SetTimestamp(t time.Time) *VisitCreate
- type VisitCreateBulk
- type VisitDelete
- type VisitDeleteOne
- type VisitEdges
- type VisitGroupBy
- func (vgb *VisitGroupBy) Aggregate(fns ...AggregateFunc) *VisitGroupBy
- func (s *VisitGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *VisitGroupBy) BoolX(ctx context.Context) bool
- func (s *VisitGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *VisitGroupBy) BoolsX(ctx context.Context) []bool
- func (s *VisitGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *VisitGroupBy) Float64X(ctx context.Context) float64
- func (s *VisitGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *VisitGroupBy) Float64sX(ctx context.Context) []float64
- func (s *VisitGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *VisitGroupBy) IntX(ctx context.Context) int
- func (s *VisitGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *VisitGroupBy) IntsX(ctx context.Context) []int
- func (vgb *VisitGroupBy) Scan(ctx context.Context, v any) error
- func (s *VisitGroupBy) ScanX(ctx context.Context, v any)
- func (s *VisitGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *VisitGroupBy) StringX(ctx context.Context) string
- func (s *VisitGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *VisitGroupBy) StringsX(ctx context.Context) []string
- type VisitMutation
- func (m *VisitMutation) AddField(name string, value ent.Value) error
- func (m *VisitMutation) AddedEdges() []string
- func (m *VisitMutation) AddedField(name string) (ent.Value, bool)
- func (m *VisitMutation) AddedFields() []string
- func (m *VisitMutation) AddedIDs(name string) []ent.Value
- func (m *VisitMutation) ClearEdge(name string) error
- func (m *VisitMutation) ClearField(name string) error
- func (m *VisitMutation) ClearSite()
- func (m *VisitMutation) ClearedEdges() []string
- func (m *VisitMutation) ClearedFields() []string
- func (m VisitMutation) Client() *Client
- func (m *VisitMutation) EdgeCleared(name string) bool
- func (m *VisitMutation) Field(name string) (ent.Value, bool)
- func (m *VisitMutation) FieldCleared(name string) bool
- func (m *VisitMutation) Fields() []string
- func (m *VisitMutation) ID() (id int, exists bool)
- func (m *VisitMutation) IDs(ctx context.Context) ([]int, error)
- func (m *VisitMutation) IP() (r string, exists bool)
- func (m *VisitMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *VisitMutation) OldIP(ctx context.Context) (v string, err error)
- func (m *VisitMutation) OldPath(ctx context.Context) (v string, err error)
- func (m *VisitMutation) OldReferrer(ctx context.Context) (v string, err error)
- func (m *VisitMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *VisitMutation) Op() Op
- func (m *VisitMutation) Path() (r string, exists bool)
- func (m *VisitMutation) Referrer() (r string, exists bool)
- func (m *VisitMutation) RemovedEdges() []string
- func (m *VisitMutation) RemovedIDs(name string) []ent.Value
- func (m *VisitMutation) ResetEdge(name string) error
- func (m *VisitMutation) ResetField(name string) error
- func (m *VisitMutation) ResetIP()
- func (m *VisitMutation) ResetPath()
- func (m *VisitMutation) ResetReferrer()
- func (m *VisitMutation) ResetSite()
- func (m *VisitMutation) ResetTimestamp()
- func (m *VisitMutation) SetField(name string, value ent.Value) error
- func (m *VisitMutation) SetIP(s string)
- func (m *VisitMutation) SetPath(s string)
- func (m *VisitMutation) SetReferrer(s string)
- func (m *VisitMutation) SetSiteID(id int)
- func (m *VisitMutation) SetTimestamp(t time.Time)
- func (m *VisitMutation) SiteCleared() bool
- func (m *VisitMutation) SiteID() (id int, exists bool)
- func (m *VisitMutation) SiteIDs() (ids []int)
- func (m *VisitMutation) Timestamp() (r time.Time, exists bool)
- func (m VisitMutation) Tx() (*Tx, error)
- func (m *VisitMutation) Type() string
- func (m *VisitMutation) Where(ps ...predicate.Visit)
- type VisitQuery
- func (vq *VisitQuery) Aggregate(fns ...AggregateFunc) *VisitSelect
- func (vq *VisitQuery) All(ctx context.Context) ([]*Visit, error)
- func (vq *VisitQuery) AllX(ctx context.Context) []*Visit
- func (vq *VisitQuery) Clone() *VisitQuery
- func (vq *VisitQuery) Count(ctx context.Context) (int, error)
- func (vq *VisitQuery) CountX(ctx context.Context) int
- func (vq *VisitQuery) Exist(ctx context.Context) (bool, error)
- func (vq *VisitQuery) ExistX(ctx context.Context) bool
- func (vq *VisitQuery) First(ctx context.Context) (*Visit, error)
- func (vq *VisitQuery) FirstID(ctx context.Context) (id int, err error)
- func (vq *VisitQuery) FirstIDX(ctx context.Context) int
- func (vq *VisitQuery) FirstX(ctx context.Context) *Visit
- func (vq *VisitQuery) GroupBy(field string, fields ...string) *VisitGroupBy
- func (vq *VisitQuery) IDs(ctx context.Context) ([]int, error)
- func (vq *VisitQuery) IDsX(ctx context.Context) []int
- func (vq *VisitQuery) Limit(limit int) *VisitQuery
- func (vq *VisitQuery) Offset(offset int) *VisitQuery
- func (vq *VisitQuery) Only(ctx context.Context) (*Visit, error)
- func (vq *VisitQuery) OnlyID(ctx context.Context) (id int, err error)
- func (vq *VisitQuery) OnlyIDX(ctx context.Context) int
- func (vq *VisitQuery) OnlyX(ctx context.Context) *Visit
- func (vq *VisitQuery) Order(o ...OrderFunc) *VisitQuery
- func (vq *VisitQuery) QuerySite() *SiteQuery
- func (vq *VisitQuery) Select(fields ...string) *VisitSelect
- func (vq *VisitQuery) Unique(unique bool) *VisitQuery
- func (vq *VisitQuery) Where(ps ...predicate.Visit) *VisitQuery
- func (vq *VisitQuery) WithSite(opts ...func(*SiteQuery)) *VisitQuery
- type VisitSelect
- func (vs *VisitSelect) Aggregate(fns ...AggregateFunc) *VisitSelect
- func (s *VisitSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *VisitSelect) BoolX(ctx context.Context) bool
- func (s *VisitSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *VisitSelect) BoolsX(ctx context.Context) []bool
- func (s *VisitSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *VisitSelect) Float64X(ctx context.Context) float64
- func (s *VisitSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *VisitSelect) Float64sX(ctx context.Context) []float64
- func (s *VisitSelect) Int(ctx context.Context) (_ int, err error)
- func (s *VisitSelect) IntX(ctx context.Context) int
- func (s *VisitSelect) Ints(ctx context.Context) ([]int, error)
- func (s *VisitSelect) IntsX(ctx context.Context) []int
- func (vs *VisitSelect) Scan(ctx context.Context, v any) error
- func (s *VisitSelect) ScanX(ctx context.Context, v any)
- func (s *VisitSelect) String(ctx context.Context) (_ string, err error)
- func (s *VisitSelect) StringX(ctx context.Context) string
- func (s *VisitSelect) Strings(ctx context.Context) ([]string, error)
- func (s *VisitSelect) StringsX(ctx context.Context) []string
- type VisitUpdate
- func (vu *VisitUpdate) ClearSite() *VisitUpdate
- func (vu *VisitUpdate) Exec(ctx context.Context) error
- func (vu *VisitUpdate) ExecX(ctx context.Context)
- func (vu *VisitUpdate) Mutation() *VisitMutation
- func (vu *VisitUpdate) Save(ctx context.Context) (int, error)
- func (vu *VisitUpdate) SaveX(ctx context.Context) int
- func (vu *VisitUpdate) SetIP(s string) *VisitUpdate
- func (vu *VisitUpdate) SetPath(s string) *VisitUpdate
- func (vu *VisitUpdate) SetReferrer(s string) *VisitUpdate
- func (vu *VisitUpdate) SetSite(s *Site) *VisitUpdate
- func (vu *VisitUpdate) SetSiteID(id int) *VisitUpdate
- func (vu *VisitUpdate) SetTimestamp(t time.Time) *VisitUpdate
- func (vu *VisitUpdate) Where(ps ...predicate.Visit) *VisitUpdate
- type VisitUpdateOne
- func (vuo *VisitUpdateOne) ClearSite() *VisitUpdateOne
- func (vuo *VisitUpdateOne) Exec(ctx context.Context) error
- func (vuo *VisitUpdateOne) ExecX(ctx context.Context)
- func (vuo *VisitUpdateOne) Mutation() *VisitMutation
- func (vuo *VisitUpdateOne) Save(ctx context.Context) (*Visit, error)
- func (vuo *VisitUpdateOne) SaveX(ctx context.Context) *Visit
- func (vuo *VisitUpdateOne) Select(field string, fields ...string) *VisitUpdateOne
- func (vuo *VisitUpdateOne) SetIP(s string) *VisitUpdateOne
- func (vuo *VisitUpdateOne) SetPath(s string) *VisitUpdateOne
- func (vuo *VisitUpdateOne) SetReferrer(s string) *VisitUpdateOne
- func (vuo *VisitUpdateOne) SetSite(s *Site) *VisitUpdateOne
- func (vuo *VisitUpdateOne) SetSiteID(id int) *VisitUpdateOne
- func (vuo *VisitUpdateOne) SetTimestamp(t time.Time) *VisitUpdateOne
- type Visits
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeSite = "Site" TypeUser = "User" TypeVisit = "Visit" )
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 // Site is the client for interacting with the Site builders. Site *SiteClient // User is the client for interacting with the User builders. User *UserClient // Visit is the client for interacting with the Visit builders. Visit *VisitClient // 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(). Site. 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 Site ¶
type Site struct { // ID of the ent. ID int `json:"id,omitempty"` // Domain holds the value of the "domain" field. Domain string `json:"domain,omitempty"` // Favicon holds the value of the "favicon" field. Favicon string `json:"favicon,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SiteQuery when eager-loading is set. Edges SiteEdges `json:"edges"` // contains filtered or unexported fields }
Site is the model entity for the Site schema.
func (*Site) QueryUsers ¶
QueryUsers queries the "users" edge of the Site entity.
func (*Site) QueryVisits ¶
func (s *Site) QueryVisits() *VisitQuery
QueryVisits queries the "visits" edge of the Site entity.
func (*Site) Unwrap ¶
Unwrap unwraps the Site 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 (*Site) Update ¶
func (s *Site) Update() *SiteUpdateOne
Update returns a builder for updating this Site. Note that you need to call Site.Unwrap() before calling this method if this Site was returned from a transaction, and the transaction was committed or rolled back.
type SiteClient ¶
type SiteClient struct {
// contains filtered or unexported fields
}
SiteClient is a client for the Site schema.
func NewSiteClient ¶
func NewSiteClient(c config) *SiteClient
NewSiteClient returns a client for the Site from the given config.
func (*SiteClient) Create ¶
func (c *SiteClient) Create() *SiteCreate
Create returns a builder for creating a Site entity.
func (*SiteClient) CreateBulk ¶
func (c *SiteClient) CreateBulk(builders ...*SiteCreate) *SiteCreateBulk
CreateBulk returns a builder for creating a bulk of Site entities.
func (*SiteClient) Delete ¶
func (c *SiteClient) Delete() *SiteDelete
Delete returns a delete builder for Site.
func (*SiteClient) DeleteOne ¶
func (c *SiteClient) DeleteOne(s *Site) *SiteDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SiteClient) DeleteOneID ¶
func (c *SiteClient) DeleteOneID(id int) *SiteDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SiteClient) GetX ¶
func (c *SiteClient) GetX(ctx context.Context, id int) *Site
GetX is like Get, but panics if an error occurs.
func (*SiteClient) Query ¶
func (c *SiteClient) Query() *SiteQuery
Query returns a query builder for Site.
func (*SiteClient) QueryUsers ¶
func (c *SiteClient) QueryUsers(s *Site) *UserQuery
QueryUsers queries the users edge of a Site.
func (*SiteClient) QueryVisits ¶
func (c *SiteClient) QueryVisits(s *Site) *VisitQuery
QueryVisits queries the visits edge of a Site.
func (*SiteClient) Update ¶
func (c *SiteClient) Update() *SiteUpdate
Update returns an update builder for Site.
func (*SiteClient) UpdateOne ¶
func (c *SiteClient) UpdateOne(s *Site) *SiteUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SiteClient) UpdateOneID ¶
func (c *SiteClient) UpdateOneID(id int) *SiteUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SiteClient) Use ¶
func (c *SiteClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `site.Hooks(f(g(h())))`.
type SiteCreate ¶
type SiteCreate struct {
// contains filtered or unexported fields
}
SiteCreate is the builder for creating a Site entity.
func (*SiteCreate) AddUserIDs ¶
func (sc *SiteCreate) AddUserIDs(ids ...int) *SiteCreate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*SiteCreate) AddUsers ¶
func (sc *SiteCreate) AddUsers(u ...*User) *SiteCreate
AddUsers adds the "users" edges to the User entity.
func (*SiteCreate) AddVisitIDs ¶
func (sc *SiteCreate) AddVisitIDs(ids ...int) *SiteCreate
AddVisitIDs adds the "visits" edge to the Visit entity by IDs.
func (*SiteCreate) AddVisits ¶
func (sc *SiteCreate) AddVisits(v ...*Visit) *SiteCreate
AddVisits adds the "visits" edges to the Visit entity.
func (*SiteCreate) Exec ¶
func (sc *SiteCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SiteCreate) ExecX ¶
func (sc *SiteCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SiteCreate) Mutation ¶
func (sc *SiteCreate) Mutation() *SiteMutation
Mutation returns the SiteMutation object of the builder.
func (*SiteCreate) Save ¶
func (sc *SiteCreate) Save(ctx context.Context) (*Site, error)
Save creates the Site in the database.
func (*SiteCreate) SaveX ¶
func (sc *SiteCreate) SaveX(ctx context.Context) *Site
SaveX calls Save and panics if Save returns an error.
func (*SiteCreate) SetDomain ¶
func (sc *SiteCreate) SetDomain(s string) *SiteCreate
SetDomain sets the "domain" field.
func (*SiteCreate) SetFavicon ¶
func (sc *SiteCreate) SetFavicon(s string) *SiteCreate
SetFavicon sets the "favicon" field.
func (*SiteCreate) SetNillableFavicon ¶
func (sc *SiteCreate) SetNillableFavicon(s *string) *SiteCreate
SetNillableFavicon sets the "favicon" field if the given value is not nil.
type SiteCreateBulk ¶
type SiteCreateBulk struct {
// contains filtered or unexported fields
}
SiteCreateBulk is the builder for creating many Site entities in bulk.
func (*SiteCreateBulk) Exec ¶
func (scb *SiteCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SiteCreateBulk) ExecX ¶
func (scb *SiteCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SiteDelete ¶
type SiteDelete struct {
// contains filtered or unexported fields
}
SiteDelete is the builder for deleting a Site entity.
func (*SiteDelete) Exec ¶
func (sd *SiteDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SiteDelete) ExecX ¶
func (sd *SiteDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SiteDelete) Where ¶
func (sd *SiteDelete) Where(ps ...predicate.Site) *SiteDelete
Where appends a list predicates to the SiteDelete builder.
type SiteDeleteOne ¶
type SiteDeleteOne struct {
// contains filtered or unexported fields
}
SiteDeleteOne is the builder for deleting a single Site entity.
func (*SiteDeleteOne) Exec ¶
func (sdo *SiteDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SiteDeleteOne) ExecX ¶
func (sdo *SiteDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SiteEdges ¶
type SiteEdges struct { // Users holds the value of the users edge. Users []*User `json:"users,omitempty"` // Visits holds the value of the visits edge. Visits []*Visit `json:"visits,omitempty"` // contains filtered or unexported fields }
SiteEdges holds the relations/edges for other nodes in the graph.
func (SiteEdges) UsersOrErr ¶
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.
func (SiteEdges) VisitsOrErr ¶
VisitsOrErr returns the Visits value or an error if the edge was not loaded in eager-loading.
type SiteGroupBy ¶
type SiteGroupBy struct {
// contains filtered or unexported fields
}
SiteGroupBy is the group-by builder for Site entities.
func (*SiteGroupBy) Aggregate ¶
func (sgb *SiteGroupBy) Aggregate(fns ...AggregateFunc) *SiteGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SiteGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SiteGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SiteGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SiteGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SiteGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SiteGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SiteGroupBy) Scan ¶
func (sgb *SiteGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*SiteGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SiteMutation ¶
type SiteMutation struct {
// contains filtered or unexported fields
}
SiteMutation represents an operation that mutates the Site nodes in the graph.
func (*SiteMutation) AddField ¶
func (m *SiteMutation) 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 (*SiteMutation) AddUserIDs ¶
func (m *SiteMutation) AddUserIDs(ids ...int)
AddUserIDs adds the "users" edge to the User entity by ids.
func (*SiteMutation) AddVisitIDs ¶
func (m *SiteMutation) AddVisitIDs(ids ...int)
AddVisitIDs adds the "visits" edge to the Visit entity by ids.
func (*SiteMutation) AddedEdges ¶
func (m *SiteMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SiteMutation) AddedField ¶
func (m *SiteMutation) 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 (*SiteMutation) AddedFields ¶
func (m *SiteMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SiteMutation) AddedIDs ¶
func (m *SiteMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SiteMutation) ClearEdge ¶
func (m *SiteMutation) 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 (*SiteMutation) ClearFavicon ¶
func (m *SiteMutation) ClearFavicon()
ClearFavicon clears the value of the "favicon" field.
func (*SiteMutation) ClearField ¶
func (m *SiteMutation) 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 (*SiteMutation) ClearUsers ¶
func (m *SiteMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*SiteMutation) ClearVisits ¶
func (m *SiteMutation) ClearVisits()
ClearVisits clears the "visits" edge to the Visit entity.
func (*SiteMutation) ClearedEdges ¶
func (m *SiteMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SiteMutation) ClearedFields ¶
func (m *SiteMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SiteMutation) Client ¶
func (m SiteMutation) 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 (*SiteMutation) Domain ¶
func (m *SiteMutation) Domain() (r string, exists bool)
Domain returns the value of the "domain" field in the mutation.
func (*SiteMutation) EdgeCleared ¶
func (m *SiteMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SiteMutation) Favicon ¶
func (m *SiteMutation) Favicon() (r string, exists bool)
Favicon returns the value of the "favicon" field in the mutation.
func (*SiteMutation) FaviconCleared ¶
func (m *SiteMutation) FaviconCleared() bool
FaviconCleared returns if the "favicon" field was cleared in this mutation.
func (*SiteMutation) Field ¶
func (m *SiteMutation) 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 (*SiteMutation) FieldCleared ¶
func (m *SiteMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SiteMutation) Fields ¶
func (m *SiteMutation) 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 (*SiteMutation) ID ¶
func (m *SiteMutation) 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 (*SiteMutation) IDs ¶
func (m *SiteMutation) 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 (*SiteMutation) OldDomain ¶
func (m *SiteMutation) OldDomain(ctx context.Context) (v string, err error)
OldDomain returns the old "domain" field's value of the Site entity. If the Site 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 (*SiteMutation) OldFavicon ¶
func (m *SiteMutation) OldFavicon(ctx context.Context) (v string, err error)
OldFavicon returns the old "favicon" field's value of the Site entity. If the Site 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 (*SiteMutation) 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 (*SiteMutation) RemoveUserIDs ¶
func (m *SiteMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (*SiteMutation) RemoveVisitIDs ¶
func (m *SiteMutation) RemoveVisitIDs(ids ...int)
RemoveVisitIDs removes the "visits" edge to the Visit entity by IDs.
func (*SiteMutation) RemovedEdges ¶
func (m *SiteMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SiteMutation) RemovedIDs ¶
func (m *SiteMutation) 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 (*SiteMutation) RemovedUsersIDs ¶
func (m *SiteMutation) RemovedUsersIDs() (ids []int)
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (*SiteMutation) RemovedVisitsIDs ¶
func (m *SiteMutation) RemovedVisitsIDs() (ids []int)
RemovedVisits returns the removed IDs of the "visits" edge to the Visit entity.
func (*SiteMutation) ResetDomain ¶
func (m *SiteMutation) ResetDomain()
ResetDomain resets all changes to the "domain" field.
func (*SiteMutation) ResetEdge ¶
func (m *SiteMutation) 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 (*SiteMutation) ResetFavicon ¶
func (m *SiteMutation) ResetFavicon()
ResetFavicon resets all changes to the "favicon" field.
func (*SiteMutation) ResetField ¶
func (m *SiteMutation) 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 (*SiteMutation) ResetUsers ¶
func (m *SiteMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*SiteMutation) ResetVisits ¶
func (m *SiteMutation) ResetVisits()
ResetVisits resets all changes to the "visits" edge.
func (*SiteMutation) SetDomain ¶
func (m *SiteMutation) SetDomain(s string)
SetDomain sets the "domain" field.
func (*SiteMutation) SetFavicon ¶
func (m *SiteMutation) SetFavicon(s string)
SetFavicon sets the "favicon" field.
func (*SiteMutation) SetField ¶
func (m *SiteMutation) 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 (SiteMutation) Tx ¶
func (m SiteMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SiteMutation) Type ¶
func (m *SiteMutation) Type() string
Type returns the node type of this mutation (Site).
func (*SiteMutation) UsersCleared ¶
func (m *SiteMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*SiteMutation) UsersIDs ¶
func (m *SiteMutation) UsersIDs() (ids []int)
UsersIDs returns the "users" edge IDs in the mutation.
func (*SiteMutation) VisitsCleared ¶
func (m *SiteMutation) VisitsCleared() bool
VisitsCleared reports if the "visits" edge to the Visit entity was cleared.
func (*SiteMutation) VisitsIDs ¶
func (m *SiteMutation) VisitsIDs() (ids []int)
VisitsIDs returns the "visits" edge IDs in the mutation.
func (*SiteMutation) Where ¶
func (m *SiteMutation) Where(ps ...predicate.Site)
Where appends a list predicates to the SiteMutation builder.
type SiteQuery ¶
type SiteQuery struct {
// contains filtered or unexported fields
}
SiteQuery is the builder for querying Site entities.
func (*SiteQuery) Aggregate ¶
func (sq *SiteQuery) Aggregate(fns ...AggregateFunc) *SiteSelect
Aggregate returns a SiteSelect configured with the given aggregations.
func (*SiteQuery) Clone ¶
Clone returns a duplicate of the SiteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SiteQuery) First ¶
First returns the first Site entity from the query. Returns a *NotFoundError when no Site was found.
func (*SiteQuery) FirstID ¶
FirstID returns the first Site ID from the query. Returns a *NotFoundError when no Site ID was found.
func (*SiteQuery) GroupBy ¶
func (sq *SiteQuery) GroupBy(field string, fields ...string) *SiteGroupBy
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 { Domain string `json:"domain,omitempty"` Count int `json:"count,omitempty"` } client.Site.Query(). GroupBy(site.FieldDomain). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SiteQuery) Only ¶
Only returns a single Site entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Site entity is found. Returns a *NotFoundError when no Site entities are found.
func (*SiteQuery) OnlyID ¶
OnlyID is like Only, but returns the only Site ID in the query. Returns a *NotSingularError when more than one Site ID is found. Returns a *NotFoundError when no entities are found.
func (*SiteQuery) QueryUsers ¶
QueryUsers chains the current query on the "users" edge.
func (*SiteQuery) QueryVisits ¶
func (sq *SiteQuery) QueryVisits() *VisitQuery
QueryVisits chains the current query on the "visits" edge.
func (*SiteQuery) Select ¶
func (sq *SiteQuery) Select(fields ...string) *SiteSelect
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 { Domain string `json:"domain,omitempty"` } client.Site.Query(). Select(site.FieldDomain). Scan(ctx, &v)
func (*SiteQuery) 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 (*SiteQuery) WithUsers ¶
WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.
func (*SiteQuery) WithVisits ¶
func (sq *SiteQuery) WithVisits(opts ...func(*VisitQuery)) *SiteQuery
WithVisits tells the query-builder to eager-load the nodes that are connected to the "visits" edge. The optional arguments are used to configure the query builder of the edge.
type SiteSelect ¶
type SiteSelect struct { *SiteQuery // contains filtered or unexported fields }
SiteSelect is the builder for selecting fields of Site entities.
func (*SiteSelect) Aggregate ¶
func (ss *SiteSelect) Aggregate(fns ...AggregateFunc) *SiteSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SiteSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SiteSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SiteSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SiteSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SiteSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SiteSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SiteSelect) Scan ¶
func (ss *SiteSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SiteSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SiteUpdate ¶
type SiteUpdate struct {
// contains filtered or unexported fields
}
SiteUpdate is the builder for updating Site entities.
func (*SiteUpdate) AddUserIDs ¶
func (su *SiteUpdate) AddUserIDs(ids ...int) *SiteUpdate
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*SiteUpdate) AddUsers ¶
func (su *SiteUpdate) AddUsers(u ...*User) *SiteUpdate
AddUsers adds the "users" edges to the User entity.
func (*SiteUpdate) AddVisitIDs ¶
func (su *SiteUpdate) AddVisitIDs(ids ...int) *SiteUpdate
AddVisitIDs adds the "visits" edge to the Visit entity by IDs.
func (*SiteUpdate) AddVisits ¶
func (su *SiteUpdate) AddVisits(v ...*Visit) *SiteUpdate
AddVisits adds the "visits" edges to the Visit entity.
func (*SiteUpdate) ClearFavicon ¶
func (su *SiteUpdate) ClearFavicon() *SiteUpdate
ClearFavicon clears the value of the "favicon" field.
func (*SiteUpdate) ClearUsers ¶
func (su *SiteUpdate) ClearUsers() *SiteUpdate
ClearUsers clears all "users" edges to the User entity.
func (*SiteUpdate) ClearVisits ¶
func (su *SiteUpdate) ClearVisits() *SiteUpdate
ClearVisits clears all "visits" edges to the Visit entity.
func (*SiteUpdate) Exec ¶
func (su *SiteUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SiteUpdate) ExecX ¶
func (su *SiteUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SiteUpdate) Mutation ¶
func (su *SiteUpdate) Mutation() *SiteMutation
Mutation returns the SiteMutation object of the builder.
func (*SiteUpdate) RemoveUserIDs ¶
func (su *SiteUpdate) RemoveUserIDs(ids ...int) *SiteUpdate
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*SiteUpdate) RemoveUsers ¶
func (su *SiteUpdate) RemoveUsers(u ...*User) *SiteUpdate
RemoveUsers removes "users" edges to User entities.
func (*SiteUpdate) RemoveVisitIDs ¶
func (su *SiteUpdate) RemoveVisitIDs(ids ...int) *SiteUpdate
RemoveVisitIDs removes the "visits" edge to Visit entities by IDs.
func (*SiteUpdate) RemoveVisits ¶
func (su *SiteUpdate) RemoveVisits(v ...*Visit) *SiteUpdate
RemoveVisits removes "visits" edges to Visit entities.
func (*SiteUpdate) Save ¶
func (su *SiteUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SiteUpdate) SaveX ¶
func (su *SiteUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SiteUpdate) SetDomain ¶
func (su *SiteUpdate) SetDomain(s string) *SiteUpdate
SetDomain sets the "domain" field.
func (*SiteUpdate) SetFavicon ¶
func (su *SiteUpdate) SetFavicon(s string) *SiteUpdate
SetFavicon sets the "favicon" field.
func (*SiteUpdate) SetNillableFavicon ¶
func (su *SiteUpdate) SetNillableFavicon(s *string) *SiteUpdate
SetNillableFavicon sets the "favicon" field if the given value is not nil.
func (*SiteUpdate) Where ¶
func (su *SiteUpdate) Where(ps ...predicate.Site) *SiteUpdate
Where appends a list predicates to the SiteUpdate builder.
type SiteUpdateOne ¶
type SiteUpdateOne struct {
// contains filtered or unexported fields
}
SiteUpdateOne is the builder for updating a single Site entity.
func (*SiteUpdateOne) AddUserIDs ¶
func (suo *SiteUpdateOne) AddUserIDs(ids ...int) *SiteUpdateOne
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*SiteUpdateOne) AddUsers ¶
func (suo *SiteUpdateOne) AddUsers(u ...*User) *SiteUpdateOne
AddUsers adds the "users" edges to the User entity.
func (*SiteUpdateOne) AddVisitIDs ¶
func (suo *SiteUpdateOne) AddVisitIDs(ids ...int) *SiteUpdateOne
AddVisitIDs adds the "visits" edge to the Visit entity by IDs.
func (*SiteUpdateOne) AddVisits ¶
func (suo *SiteUpdateOne) AddVisits(v ...*Visit) *SiteUpdateOne
AddVisits adds the "visits" edges to the Visit entity.
func (*SiteUpdateOne) ClearFavicon ¶
func (suo *SiteUpdateOne) ClearFavicon() *SiteUpdateOne
ClearFavicon clears the value of the "favicon" field.
func (*SiteUpdateOne) ClearUsers ¶
func (suo *SiteUpdateOne) ClearUsers() *SiteUpdateOne
ClearUsers clears all "users" edges to the User entity.
func (*SiteUpdateOne) ClearVisits ¶
func (suo *SiteUpdateOne) ClearVisits() *SiteUpdateOne
ClearVisits clears all "visits" edges to the Visit entity.
func (*SiteUpdateOne) Exec ¶
func (suo *SiteUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SiteUpdateOne) ExecX ¶
func (suo *SiteUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SiteUpdateOne) Mutation ¶
func (suo *SiteUpdateOne) Mutation() *SiteMutation
Mutation returns the SiteMutation object of the builder.
func (*SiteUpdateOne) RemoveUserIDs ¶
func (suo *SiteUpdateOne) RemoveUserIDs(ids ...int) *SiteUpdateOne
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*SiteUpdateOne) RemoveUsers ¶
func (suo *SiteUpdateOne) RemoveUsers(u ...*User) *SiteUpdateOne
RemoveUsers removes "users" edges to User entities.
func (*SiteUpdateOne) RemoveVisitIDs ¶
func (suo *SiteUpdateOne) RemoveVisitIDs(ids ...int) *SiteUpdateOne
RemoveVisitIDs removes the "visits" edge to Visit entities by IDs.
func (*SiteUpdateOne) RemoveVisits ¶
func (suo *SiteUpdateOne) RemoveVisits(v ...*Visit) *SiteUpdateOne
RemoveVisits removes "visits" edges to Visit entities.
func (*SiteUpdateOne) Save ¶
func (suo *SiteUpdateOne) Save(ctx context.Context) (*Site, error)
Save executes the query and returns the updated Site entity.
func (*SiteUpdateOne) SaveX ¶
func (suo *SiteUpdateOne) SaveX(ctx context.Context) *Site
SaveX is like Save, but panics if an error occurs.
func (*SiteUpdateOne) Select ¶
func (suo *SiteUpdateOne) Select(field string, fields ...string) *SiteUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SiteUpdateOne) SetDomain ¶
func (suo *SiteUpdateOne) SetDomain(s string) *SiteUpdateOne
SetDomain sets the "domain" field.
func (*SiteUpdateOne) SetFavicon ¶
func (suo *SiteUpdateOne) SetFavicon(s string) *SiteUpdateOne
SetFavicon sets the "favicon" field.
func (*SiteUpdateOne) SetNillableFavicon ¶
func (suo *SiteUpdateOne) SetNillableFavicon(s *string) *SiteUpdateOne
SetNillableFavicon sets the "favicon" field if the given value is not nil.
type Tx ¶
type Tx struct { // Site is the client for interacting with the Site builders. Site *SiteClient // User is the client for interacting with the User builders. User *UserClient // Visit is the client for interacting with the Visit builders. Visit *VisitClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Email holds the value of the "email" field. Email string `json:"email,omitempty"` // Password holds the value of the "password" field. Password []byte `json:"password,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the UserQuery when eager-loading is set. Edges UserEdges `json:"edges"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) QuerySites ¶
QuerySites queries the "sites" edge of the User entity.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a builder for creating a User entity.
func (*UserClient) CreateBulk ¶
func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
CreateBulk returns a builder for creating a bulk of User entities.
func (*UserClient) Delete ¶
func (c *UserClient) Delete() *UserDelete
Delete returns a delete builder for User.
func (*UserClient) DeleteOne ¶
func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QuerySites ¶
func (c *UserClient) QuerySites(u *User) *SiteQuery
QuerySites queries the sites edge of a User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) AddSiteIDs ¶
func (uc *UserCreate) AddSiteIDs(ids ...int) *UserCreate
AddSiteIDs adds the "sites" edge to the Site entity by IDs.
func (*UserCreate) AddSites ¶
func (uc *UserCreate) AddSites(s ...*Site) *UserCreate
AddSites adds the "sites" edges to the Site entity.
func (*UserCreate) Exec ¶
func (uc *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (uc *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (uc *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (uc *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (uc *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetEmail ¶
func (uc *UserCreate) SetEmail(s string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetPassword ¶
func (uc *UserCreate) SetPassword(b []byte) *UserCreate
SetPassword sets the "password" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserEdges ¶
type UserEdges struct { // Sites holds the value of the sites edge. Sites []*Site `json:"sites,omitempty"` // contains filtered or unexported fields }
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) SitesOrErr ¶
SitesOrErr returns the Sites value or an error if the edge was not loaded in eager-loading.
type UserGroupBy ¶
type UserGroupBy struct {
// contains filtered or unexported fields
}
UserGroupBy is the group-by builder for User entities.
func (*UserGroupBy) Aggregate ¶
func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddSiteIDs ¶
func (m *UserMutation) AddSiteIDs(ids ...int)
AddSiteIDs adds the "sites" edge to the Site entity by ids.
func (*UserMutation) AddedEdges ¶
func (m *UserMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserMutation) AddedField ¶
func (m *UserMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) AddedFields ¶
func (m *UserMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserMutation) AddedIDs ¶
func (m *UserMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) ClearField ¶
func (m *UserMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ClearSites ¶
func (m *UserMutation) ClearSites()
ClearSites clears the "sites" edge to the Site entity.
func (*UserMutation) ClearedEdges ¶
func (m *UserMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserMutation) ClearedFields ¶
func (m *UserMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserMutation) Client ¶
func (m UserMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) ID ¶
func (m *UserMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*UserMutation) IDs ¶
func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldPassword ¶
func (m *UserMutation) OldPassword(ctx context.Context) (v []byte, err error)
OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) Password ¶
func (m *UserMutation) Password() (r []byte, exists bool)
Password returns the value of the "password" field in the mutation.
func (*UserMutation) RemoveSiteIDs ¶
func (m *UserMutation) RemoveSiteIDs(ids ...int)
RemoveSiteIDs removes the "sites" edge to the Site entity by IDs.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) RemovedSitesIDs ¶
func (m *UserMutation) RemovedSitesIDs() (ids []int)
RemovedSites returns the removed IDs of the "sites" edge to the Site entity.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetPassword ¶
func (m *UserMutation) ResetPassword()
ResetPassword resets all changes to the "password" field.
func (*UserMutation) ResetSites ¶
func (m *UserMutation) ResetSites()
ResetSites resets all changes to the "sites" edge.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetPassword ¶
func (m *UserMutation) SetPassword(b []byte)
SetPassword sets the "password" field.
func (*UserMutation) SitesCleared ¶
func (m *UserMutation) SitesCleared() bool
SitesCleared reports if the "sites" edge to the Site entity was cleared.
func (*UserMutation) SitesIDs ¶
func (m *UserMutation) SitesIDs() (ids []int)
SitesIDs returns the "sites" edge IDs in the mutation.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate returns a UserSelect configured with the given aggregations.
func (*UserQuery) Clone ¶
Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
func (*UserQuery) GroupBy ¶
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Email string `json:"email,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldEmail). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.
func (*UserQuery) OnlyID ¶
OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.
func (*UserQuery) QuerySites ¶
QuerySites chains the current query on the "sites" edge.
func (*UserQuery) Select ¶
func (uq *UserQuery) Select(fields ...string) *UserSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Email string `json:"email,omitempty"` } client.User.Query(). Select(user.FieldEmail). Scan(ctx, &v)
func (*UserQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddSiteIDs ¶
func (uu *UserUpdate) AddSiteIDs(ids ...int) *UserUpdate
AddSiteIDs adds the "sites" edge to the Site entity by IDs.
func (*UserUpdate) AddSites ¶
func (uu *UserUpdate) AddSites(s ...*Site) *UserUpdate
AddSites adds the "sites" edges to the Site entity.
func (*UserUpdate) ClearSites ¶
func (uu *UserUpdate) ClearSites() *UserUpdate
ClearSites clears all "sites" edges to the Site entity.
func (*UserUpdate) Exec ¶
func (uu *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (uu *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveSiteIDs ¶
func (uu *UserUpdate) RemoveSiteIDs(ids ...int) *UserUpdate
RemoveSiteIDs removes the "sites" edge to Site entities by IDs.
func (*UserUpdate) RemoveSites ¶
func (uu *UserUpdate) RemoveSites(s ...*Site) *UserUpdate
RemoveSites removes "sites" edges to Site entities.
func (*UserUpdate) Save ¶
func (uu *UserUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserUpdate) SaveX ¶
func (uu *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetEmail ¶
func (uu *UserUpdate) SetEmail(s string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetPassword ¶
func (uu *UserUpdate) SetPassword(b []byte) *UserUpdate
SetPassword sets the "password" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddSiteIDs ¶
func (uuo *UserUpdateOne) AddSiteIDs(ids ...int) *UserUpdateOne
AddSiteIDs adds the "sites" edge to the Site entity by IDs.
func (*UserUpdateOne) AddSites ¶
func (uuo *UserUpdateOne) AddSites(s ...*Site) *UserUpdateOne
AddSites adds the "sites" edges to the Site entity.
func (*UserUpdateOne) ClearSites ¶
func (uuo *UserUpdateOne) ClearSites() *UserUpdateOne
ClearSites clears all "sites" edges to the Site entity.
func (*UserUpdateOne) Exec ¶
func (uuo *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (uuo *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveSiteIDs ¶
func (uuo *UserUpdateOne) RemoveSiteIDs(ids ...int) *UserUpdateOne
RemoveSiteIDs removes the "sites" edge to Site entities by IDs.
func (*UserUpdateOne) RemoveSites ¶
func (uuo *UserUpdateOne) RemoveSites(s ...*Site) *UserUpdateOne
RemoveSites removes "sites" edges to Site entities.
func (*UserUpdateOne) Save ¶
func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserUpdateOne) SetEmail ¶
func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetPassword ¶
func (uuo *UserUpdateOne) SetPassword(b []byte) *UserUpdateOne
SetPassword sets the "password" field.
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 Visit ¶
type Visit struct { // ID of the ent. ID int `json:"id,omitempty"` // Path holds the value of the "path" field. Path string `json:"path,omitempty"` // Referrer holds the value of the "referrer" field. Referrer string `json:"referrer,omitempty"` // Timestamp holds the value of the "timestamp" field. Timestamp time.Time `json:"timestamp,omitempty"` // IP holds the value of the "ip" field. IP string `json:"ip,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the VisitQuery when eager-loading is set. Edges VisitEdges `json:"edges"` // contains filtered or unexported fields }
Visit is the model entity for the Visit schema.
func (*Visit) Unwrap ¶
Unwrap unwraps the Visit 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 (*Visit) Update ¶
func (v *Visit) Update() *VisitUpdateOne
Update returns a builder for updating this Visit. Note that you need to call Visit.Unwrap() before calling this method if this Visit was returned from a transaction, and the transaction was committed or rolled back.
type VisitClient ¶
type VisitClient struct {
// contains filtered or unexported fields
}
VisitClient is a client for the Visit schema.
func NewVisitClient ¶
func NewVisitClient(c config) *VisitClient
NewVisitClient returns a client for the Visit from the given config.
func (*VisitClient) Create ¶
func (c *VisitClient) Create() *VisitCreate
Create returns a builder for creating a Visit entity.
func (*VisitClient) CreateBulk ¶
func (c *VisitClient) CreateBulk(builders ...*VisitCreate) *VisitCreateBulk
CreateBulk returns a builder for creating a bulk of Visit entities.
func (*VisitClient) Delete ¶
func (c *VisitClient) Delete() *VisitDelete
Delete returns a delete builder for Visit.
func (*VisitClient) DeleteOne ¶
func (c *VisitClient) DeleteOne(v *Visit) *VisitDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*VisitClient) DeleteOneID ¶
func (c *VisitClient) DeleteOneID(id int) *VisitDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*VisitClient) GetX ¶
func (c *VisitClient) GetX(ctx context.Context, id int) *Visit
GetX is like Get, but panics if an error occurs.
func (*VisitClient) Query ¶
func (c *VisitClient) Query() *VisitQuery
Query returns a query builder for Visit.
func (*VisitClient) QuerySite ¶
func (c *VisitClient) QuerySite(v *Visit) *SiteQuery
QuerySite queries the site edge of a Visit.
func (*VisitClient) Update ¶
func (c *VisitClient) Update() *VisitUpdate
Update returns an update builder for Visit.
func (*VisitClient) UpdateOne ¶
func (c *VisitClient) UpdateOne(v *Visit) *VisitUpdateOne
UpdateOne returns an update builder for the given entity.
func (*VisitClient) UpdateOneID ¶
func (c *VisitClient) UpdateOneID(id int) *VisitUpdateOne
UpdateOneID returns an update builder for the given id.
func (*VisitClient) Use ¶
func (c *VisitClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `visit.Hooks(f(g(h())))`.
type VisitCreate ¶
type VisitCreate struct {
// contains filtered or unexported fields
}
VisitCreate is the builder for creating a Visit entity.
func (*VisitCreate) Exec ¶
func (vc *VisitCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*VisitCreate) ExecX ¶
func (vc *VisitCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VisitCreate) Mutation ¶
func (vc *VisitCreate) Mutation() *VisitMutation
Mutation returns the VisitMutation object of the builder.
func (*VisitCreate) Save ¶
func (vc *VisitCreate) Save(ctx context.Context) (*Visit, error)
Save creates the Visit in the database.
func (*VisitCreate) SaveX ¶
func (vc *VisitCreate) SaveX(ctx context.Context) *Visit
SaveX calls Save and panics if Save returns an error.
func (*VisitCreate) SetIP ¶
func (vc *VisitCreate) SetIP(s string) *VisitCreate
SetIP sets the "ip" field.
func (*VisitCreate) SetPath ¶
func (vc *VisitCreate) SetPath(s string) *VisitCreate
SetPath sets the "path" field.
func (*VisitCreate) SetReferrer ¶
func (vc *VisitCreate) SetReferrer(s string) *VisitCreate
SetReferrer sets the "referrer" field.
func (*VisitCreate) SetSite ¶
func (vc *VisitCreate) SetSite(s *Site) *VisitCreate
SetSite sets the "site" edge to the Site entity.
func (*VisitCreate) SetSiteID ¶
func (vc *VisitCreate) SetSiteID(id int) *VisitCreate
SetSiteID sets the "site" edge to the Site entity by ID.
func (*VisitCreate) SetTimestamp ¶
func (vc *VisitCreate) SetTimestamp(t time.Time) *VisitCreate
SetTimestamp sets the "timestamp" field.
type VisitCreateBulk ¶
type VisitCreateBulk struct {
// contains filtered or unexported fields
}
VisitCreateBulk is the builder for creating many Visit entities in bulk.
func (*VisitCreateBulk) Exec ¶
func (vcb *VisitCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*VisitCreateBulk) ExecX ¶
func (vcb *VisitCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type VisitDelete ¶
type VisitDelete struct {
// contains filtered or unexported fields
}
VisitDelete is the builder for deleting a Visit entity.
func (*VisitDelete) Exec ¶
func (vd *VisitDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*VisitDelete) ExecX ¶
func (vd *VisitDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*VisitDelete) Where ¶
func (vd *VisitDelete) Where(ps ...predicate.Visit) *VisitDelete
Where appends a list predicates to the VisitDelete builder.
type VisitDeleteOne ¶
type VisitDeleteOne struct {
// contains filtered or unexported fields
}
VisitDeleteOne is the builder for deleting a single Visit entity.
func (*VisitDeleteOne) Exec ¶
func (vdo *VisitDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*VisitDeleteOne) ExecX ¶
func (vdo *VisitDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type VisitEdges ¶
type VisitEdges struct { // Site holds the value of the site edge. Site *Site `json:"site,omitempty"` // contains filtered or unexported fields }
VisitEdges holds the relations/edges for other nodes in the graph.
func (VisitEdges) SiteOrErr ¶
func (e VisitEdges) SiteOrErr() (*Site, error)
SiteOrErr returns the Site value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type VisitGroupBy ¶
type VisitGroupBy struct {
// contains filtered or unexported fields
}
VisitGroupBy is the group-by builder for Visit entities.
func (*VisitGroupBy) Aggregate ¶
func (vgb *VisitGroupBy) Aggregate(fns ...AggregateFunc) *VisitGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*VisitGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VisitGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VisitGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VisitGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VisitGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VisitGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VisitGroupBy) Scan ¶
func (vgb *VisitGroupBy) Scan(ctx context.Context, v any) error
Scan applies the group-by query and scans the result into the given value.
func (*VisitGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VisitMutation ¶
type VisitMutation struct {
// contains filtered or unexported fields
}
VisitMutation represents an operation that mutates the Visit nodes in the graph.
func (*VisitMutation) AddField ¶
func (m *VisitMutation) 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 (*VisitMutation) AddedEdges ¶
func (m *VisitMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*VisitMutation) AddedField ¶
func (m *VisitMutation) 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 (*VisitMutation) AddedFields ¶
func (m *VisitMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*VisitMutation) AddedIDs ¶
func (m *VisitMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*VisitMutation) ClearEdge ¶
func (m *VisitMutation) 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 (*VisitMutation) ClearField ¶
func (m *VisitMutation) 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 (*VisitMutation) ClearSite ¶
func (m *VisitMutation) ClearSite()
ClearSite clears the "site" edge to the Site entity.
func (*VisitMutation) ClearedEdges ¶
func (m *VisitMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*VisitMutation) ClearedFields ¶
func (m *VisitMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (VisitMutation) Client ¶
func (m VisitMutation) 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 (*VisitMutation) EdgeCleared ¶
func (m *VisitMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*VisitMutation) Field ¶
func (m *VisitMutation) 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 (*VisitMutation) FieldCleared ¶
func (m *VisitMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*VisitMutation) Fields ¶
func (m *VisitMutation) 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 (*VisitMutation) ID ¶
func (m *VisitMutation) 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 (*VisitMutation) IDs ¶
func (m *VisitMutation) 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 (*VisitMutation) IP ¶
func (m *VisitMutation) IP() (r string, exists bool)
IP returns the value of the "ip" field in the mutation.
func (*VisitMutation) 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 (*VisitMutation) OldIP ¶
func (m *VisitMutation) OldIP(ctx context.Context) (v string, err error)
OldIP returns the old "ip" field's value of the Visit entity. If the Visit 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 (*VisitMutation) OldPath ¶
func (m *VisitMutation) OldPath(ctx context.Context) (v string, err error)
OldPath returns the old "path" field's value of the Visit entity. If the Visit 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 (*VisitMutation) OldReferrer ¶
func (m *VisitMutation) OldReferrer(ctx context.Context) (v string, err error)
OldReferrer returns the old "referrer" field's value of the Visit entity. If the Visit 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 (*VisitMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Visit entity. If the Visit 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 (*VisitMutation) Path ¶
func (m *VisitMutation) Path() (r string, exists bool)
Path returns the value of the "path" field in the mutation.
func (*VisitMutation) Referrer ¶
func (m *VisitMutation) Referrer() (r string, exists bool)
Referrer returns the value of the "referrer" field in the mutation.
func (*VisitMutation) RemovedEdges ¶
func (m *VisitMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*VisitMutation) RemovedIDs ¶
func (m *VisitMutation) 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 (*VisitMutation) ResetEdge ¶
func (m *VisitMutation) 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 (*VisitMutation) ResetField ¶
func (m *VisitMutation) 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 (*VisitMutation) ResetIP ¶
func (m *VisitMutation) ResetIP()
ResetIP resets all changes to the "ip" field.
func (*VisitMutation) ResetPath ¶
func (m *VisitMutation) ResetPath()
ResetPath resets all changes to the "path" field.
func (*VisitMutation) ResetReferrer ¶
func (m *VisitMutation) ResetReferrer()
ResetReferrer resets all changes to the "referrer" field.
func (*VisitMutation) ResetSite ¶
func (m *VisitMutation) ResetSite()
ResetSite resets all changes to the "site" edge.
func (*VisitMutation) ResetTimestamp ¶
func (m *VisitMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*VisitMutation) SetField ¶
func (m *VisitMutation) 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 (*VisitMutation) SetPath ¶
func (m *VisitMutation) SetPath(s string)
SetPath sets the "path" field.
func (*VisitMutation) SetReferrer ¶
func (m *VisitMutation) SetReferrer(s string)
SetReferrer sets the "referrer" field.
func (*VisitMutation) SetSiteID ¶
func (m *VisitMutation) SetSiteID(id int)
SetSiteID sets the "site" edge to the Site entity by id.
func (*VisitMutation) SetTimestamp ¶
func (m *VisitMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*VisitMutation) SiteCleared ¶
func (m *VisitMutation) SiteCleared() bool
SiteCleared reports if the "site" edge to the Site entity was cleared.
func (*VisitMutation) SiteID ¶
func (m *VisitMutation) SiteID() (id int, exists bool)
SiteID returns the "site" edge ID in the mutation.
func (*VisitMutation) SiteIDs ¶
func (m *VisitMutation) SiteIDs() (ids []int)
SiteIDs returns the "site" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SiteID instead. It exists only for internal usage by the builders.
func (*VisitMutation) Timestamp ¶
func (m *VisitMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (VisitMutation) Tx ¶
func (m VisitMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*VisitMutation) Type ¶
func (m *VisitMutation) Type() string
Type returns the node type of this mutation (Visit).
func (*VisitMutation) Where ¶
func (m *VisitMutation) Where(ps ...predicate.Visit)
Where appends a list predicates to the VisitMutation builder.
type VisitQuery ¶
type VisitQuery struct {
// contains filtered or unexported fields
}
VisitQuery is the builder for querying Visit entities.
func (*VisitQuery) Aggregate ¶
func (vq *VisitQuery) Aggregate(fns ...AggregateFunc) *VisitSelect
Aggregate returns a VisitSelect configured with the given aggregations.
func (*VisitQuery) All ¶
func (vq *VisitQuery) All(ctx context.Context) ([]*Visit, error)
All executes the query and returns a list of Visits.
func (*VisitQuery) AllX ¶
func (vq *VisitQuery) AllX(ctx context.Context) []*Visit
AllX is like All, but panics if an error occurs.
func (*VisitQuery) Clone ¶
func (vq *VisitQuery) Clone() *VisitQuery
Clone returns a duplicate of the VisitQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*VisitQuery) Count ¶
func (vq *VisitQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*VisitQuery) CountX ¶
func (vq *VisitQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*VisitQuery) Exist ¶
func (vq *VisitQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*VisitQuery) ExistX ¶
func (vq *VisitQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*VisitQuery) First ¶
func (vq *VisitQuery) First(ctx context.Context) (*Visit, error)
First returns the first Visit entity from the query. Returns a *NotFoundError when no Visit was found.
func (*VisitQuery) FirstID ¶
func (vq *VisitQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Visit ID from the query. Returns a *NotFoundError when no Visit ID was found.
func (*VisitQuery) FirstIDX ¶
func (vq *VisitQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*VisitQuery) FirstX ¶
func (vq *VisitQuery) FirstX(ctx context.Context) *Visit
FirstX is like First, but panics if an error occurs.
func (*VisitQuery) GroupBy ¶
func (vq *VisitQuery) GroupBy(field string, fields ...string) *VisitGroupBy
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 { Path string `json:"path,omitempty"` Count int `json:"count,omitempty"` } client.Visit.Query(). GroupBy(visit.FieldPath). Aggregate(ent.Count()). Scan(ctx, &v)
func (*VisitQuery) IDs ¶
func (vq *VisitQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Visit IDs.
func (*VisitQuery) IDsX ¶
func (vq *VisitQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*VisitQuery) Limit ¶
func (vq *VisitQuery) Limit(limit int) *VisitQuery
Limit adds a limit step to the query.
func (*VisitQuery) Offset ¶
func (vq *VisitQuery) Offset(offset int) *VisitQuery
Offset adds an offset step to the query.
func (*VisitQuery) Only ¶
func (vq *VisitQuery) Only(ctx context.Context) (*Visit, error)
Only returns a single Visit entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Visit entity is found. Returns a *NotFoundError when no Visit entities are found.
func (*VisitQuery) OnlyID ¶
func (vq *VisitQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Visit ID in the query. Returns a *NotSingularError when more than one Visit ID is found. Returns a *NotFoundError when no entities are found.
func (*VisitQuery) OnlyIDX ¶
func (vq *VisitQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*VisitQuery) OnlyX ¶
func (vq *VisitQuery) OnlyX(ctx context.Context) *Visit
OnlyX is like Only, but panics if an error occurs.
func (*VisitQuery) Order ¶
func (vq *VisitQuery) Order(o ...OrderFunc) *VisitQuery
Order adds an order step to the query.
func (*VisitQuery) QuerySite ¶
func (vq *VisitQuery) QuerySite() *SiteQuery
QuerySite chains the current query on the "site" edge.
func (*VisitQuery) Select ¶
func (vq *VisitQuery) Select(fields ...string) *VisitSelect
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 { Path string `json:"path,omitempty"` } client.Visit.Query(). Select(visit.FieldPath). Scan(ctx, &v)
func (*VisitQuery) Unique ¶
func (vq *VisitQuery) Unique(unique bool) *VisitQuery
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 (*VisitQuery) Where ¶
func (vq *VisitQuery) Where(ps ...predicate.Visit) *VisitQuery
Where adds a new predicate for the VisitQuery builder.
func (*VisitQuery) WithSite ¶
func (vq *VisitQuery) WithSite(opts ...func(*SiteQuery)) *VisitQuery
WithSite tells the query-builder to eager-load the nodes that are connected to the "site" edge. The optional arguments are used to configure the query builder of the edge.
type VisitSelect ¶
type VisitSelect struct { *VisitQuery // contains filtered or unexported fields }
VisitSelect is the builder for selecting fields of Visit entities.
func (*VisitSelect) Aggregate ¶
func (vs *VisitSelect) Aggregate(fns ...AggregateFunc) *VisitSelect
Aggregate adds the given aggregation functions to the selector query.
func (*VisitSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*VisitSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*VisitSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*VisitSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*VisitSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*VisitSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*VisitSelect) Scan ¶
func (vs *VisitSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*VisitSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type VisitUpdate ¶
type VisitUpdate struct {
// contains filtered or unexported fields
}
VisitUpdate is the builder for updating Visit entities.
func (*VisitUpdate) ClearSite ¶
func (vu *VisitUpdate) ClearSite() *VisitUpdate
ClearSite clears the "site" edge to the Site entity.
func (*VisitUpdate) Exec ¶
func (vu *VisitUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*VisitUpdate) ExecX ¶
func (vu *VisitUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VisitUpdate) Mutation ¶
func (vu *VisitUpdate) Mutation() *VisitMutation
Mutation returns the VisitMutation object of the builder.
func (*VisitUpdate) Save ¶
func (vu *VisitUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*VisitUpdate) SaveX ¶
func (vu *VisitUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*VisitUpdate) SetIP ¶
func (vu *VisitUpdate) SetIP(s string) *VisitUpdate
SetIP sets the "ip" field.
func (*VisitUpdate) SetPath ¶
func (vu *VisitUpdate) SetPath(s string) *VisitUpdate
SetPath sets the "path" field.
func (*VisitUpdate) SetReferrer ¶
func (vu *VisitUpdate) SetReferrer(s string) *VisitUpdate
SetReferrer sets the "referrer" field.
func (*VisitUpdate) SetSite ¶
func (vu *VisitUpdate) SetSite(s *Site) *VisitUpdate
SetSite sets the "site" edge to the Site entity.
func (*VisitUpdate) SetSiteID ¶
func (vu *VisitUpdate) SetSiteID(id int) *VisitUpdate
SetSiteID sets the "site" edge to the Site entity by ID.
func (*VisitUpdate) SetTimestamp ¶
func (vu *VisitUpdate) SetTimestamp(t time.Time) *VisitUpdate
SetTimestamp sets the "timestamp" field.
func (*VisitUpdate) Where ¶
func (vu *VisitUpdate) Where(ps ...predicate.Visit) *VisitUpdate
Where appends a list predicates to the VisitUpdate builder.
type VisitUpdateOne ¶
type VisitUpdateOne struct {
// contains filtered or unexported fields
}
VisitUpdateOne is the builder for updating a single Visit entity.
func (*VisitUpdateOne) ClearSite ¶
func (vuo *VisitUpdateOne) ClearSite() *VisitUpdateOne
ClearSite clears the "site" edge to the Site entity.
func (*VisitUpdateOne) Exec ¶
func (vuo *VisitUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*VisitUpdateOne) ExecX ¶
func (vuo *VisitUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*VisitUpdateOne) Mutation ¶
func (vuo *VisitUpdateOne) Mutation() *VisitMutation
Mutation returns the VisitMutation object of the builder.
func (*VisitUpdateOne) Save ¶
func (vuo *VisitUpdateOne) Save(ctx context.Context) (*Visit, error)
Save executes the query and returns the updated Visit entity.
func (*VisitUpdateOne) SaveX ¶
func (vuo *VisitUpdateOne) SaveX(ctx context.Context) *Visit
SaveX is like Save, but panics if an error occurs.
func (*VisitUpdateOne) Select ¶
func (vuo *VisitUpdateOne) Select(field string, fields ...string) *VisitUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*VisitUpdateOne) SetIP ¶
func (vuo *VisitUpdateOne) SetIP(s string) *VisitUpdateOne
SetIP sets the "ip" field.
func (*VisitUpdateOne) SetPath ¶
func (vuo *VisitUpdateOne) SetPath(s string) *VisitUpdateOne
SetPath sets the "path" field.
func (*VisitUpdateOne) SetReferrer ¶
func (vuo *VisitUpdateOne) SetReferrer(s string) *VisitUpdateOne
SetReferrer sets the "referrer" field.
func (*VisitUpdateOne) SetSite ¶
func (vuo *VisitUpdateOne) SetSite(s *Site) *VisitUpdateOne
SetSite sets the "site" edge to the Site entity.
func (*VisitUpdateOne) SetSiteID ¶
func (vuo *VisitUpdateOne) SetSiteID(id int) *VisitUpdateOne
SetSiteID sets the "site" edge to the Site entity by ID.
func (*VisitUpdateOne) SetTimestamp ¶
func (vuo *VisitUpdateOne) SetTimestamp(t time.Time) *VisitUpdateOne
SetTimestamp sets the "timestamp" field.