Documentation
¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Org
- type OrgClient
- func (c *OrgClient) Create() *OrgCreate
- func (c *OrgClient) CreateBulk(builders ...*OrgCreate) *OrgCreateBulk
- func (c *OrgClient) Delete() *OrgDelete
- func (c *OrgClient) DeleteOne(_m *Org) *OrgDeleteOne
- func (c *OrgClient) DeleteOneID(id int) *OrgDeleteOne
- func (c *OrgClient) Get(ctx context.Context, id int) (*Org, error)
- func (c *OrgClient) GetX(ctx context.Context, id int) *Org
- func (c *OrgClient) Hooks() []Hook
- func (c *OrgClient) Intercept(interceptors ...Interceptor)
- func (c *OrgClient) Interceptors() []Interceptor
- func (c *OrgClient) MapCreateBulk(slice any, setFunc func(*OrgCreate, int)) *OrgCreateBulk
- func (c *OrgClient) Query() *OrgQuery
- func (c *OrgClient) QueryProxies(_m *Org) *ProxyQuery
- func (c *OrgClient) QueryUsers(_m *Org) *UserQuery
- func (c *OrgClient) Update() *OrgUpdate
- func (c *OrgClient) UpdateOne(_m *Org) *OrgUpdateOne
- func (c *OrgClient) UpdateOneID(id int) *OrgUpdateOne
- func (c *OrgClient) Use(hooks ...Hook)
- type OrgCreate
- func (_c *OrgCreate) AddProxies(v ...*Proxy) *OrgCreate
- func (_c *OrgCreate) AddProxyIDs(ids ...int) *OrgCreate
- func (_c *OrgCreate) AddUserIDs(ids ...int) *OrgCreate
- func (_c *OrgCreate) AddUsers(v ...*User) *OrgCreate
- func (_c *OrgCreate) Exec(ctx context.Context) error
- func (_c *OrgCreate) ExecX(ctx context.Context)
- func (_c *OrgCreate) Mutation() *OrgMutation
- func (_c *OrgCreate) Save(ctx context.Context) (*Org, error)
- func (_c *OrgCreate) SaveX(ctx context.Context) *Org
- func (_c *OrgCreate) SetActive(v bool) *OrgCreate
- func (_c *OrgCreate) SetCreatedAt(v time.Time) *OrgCreate
- func (_c *OrgCreate) SetMaxProxies(v int) *OrgCreate
- func (_c *OrgCreate) SetName(v string) *OrgCreate
- func (_c *OrgCreate) SetNillableActive(v *bool) *OrgCreate
- func (_c *OrgCreate) SetNillableCreatedAt(v *time.Time) *OrgCreate
- func (_c *OrgCreate) SetNillableMaxProxies(v *int) *OrgCreate
- func (_c *OrgCreate) SetNillablePlan(v *org.Plan) *OrgCreate
- func (_c *OrgCreate) SetNillableTrafficRetentionDays(v *int) *OrgCreate
- func (_c *OrgCreate) SetNillableUpdatedAt(v *time.Time) *OrgCreate
- func (_c *OrgCreate) SetPlan(v org.Plan) *OrgCreate
- func (_c *OrgCreate) SetSlug(v string) *OrgCreate
- func (_c *OrgCreate) SetTrafficRetentionDays(v int) *OrgCreate
- func (_c *OrgCreate) SetUpdatedAt(v time.Time) *OrgCreate
- type OrgCreateBulk
- type OrgDelete
- type OrgDeleteOne
- type OrgEdges
- type OrgGroupBy
- func (_g *OrgGroupBy) Aggregate(fns ...AggregateFunc) *OrgGroupBy
- func (s *OrgGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrgGroupBy) BoolX(ctx context.Context) bool
- func (s *OrgGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *OrgGroupBy) BoolsX(ctx context.Context) []bool
- func (s *OrgGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrgGroupBy) Float64X(ctx context.Context) float64
- func (s *OrgGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrgGroupBy) Float64sX(ctx context.Context) []float64
- func (s *OrgGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *OrgGroupBy) IntX(ctx context.Context) int
- func (s *OrgGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *OrgGroupBy) IntsX(ctx context.Context) []int
- func (_g *OrgGroupBy) Scan(ctx context.Context, v any) error
- func (s *OrgGroupBy) ScanX(ctx context.Context, v any)
- func (s *OrgGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *OrgGroupBy) StringX(ctx context.Context) string
- func (s *OrgGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *OrgGroupBy) StringsX(ctx context.Context) []string
- type OrgMutation
- func (m *OrgMutation) Active() (r bool, exists bool)
- func (m *OrgMutation) AddField(name string, value ent.Value) error
- func (m *OrgMutation) AddMaxProxies(i int)
- func (m *OrgMutation) AddProxyIDs(ids ...int)
- func (m *OrgMutation) AddTrafficRetentionDays(i int)
- func (m *OrgMutation) AddUserIDs(ids ...int)
- func (m *OrgMutation) AddedEdges() []string
- func (m *OrgMutation) AddedField(name string) (ent.Value, bool)
- func (m *OrgMutation) AddedFields() []string
- func (m *OrgMutation) AddedIDs(name string) []ent.Value
- func (m *OrgMutation) AddedMaxProxies() (r int, exists bool)
- func (m *OrgMutation) AddedTrafficRetentionDays() (r int, exists bool)
- func (m *OrgMutation) ClearEdge(name string) error
- func (m *OrgMutation) ClearField(name string) error
- func (m *OrgMutation) ClearProxies()
- func (m *OrgMutation) ClearUsers()
- func (m *OrgMutation) ClearedEdges() []string
- func (m *OrgMutation) ClearedFields() []string
- func (m OrgMutation) Client() *Client
- func (m *OrgMutation) CreatedAt() (r time.Time, exists bool)
- func (m *OrgMutation) EdgeCleared(name string) bool
- func (m *OrgMutation) Field(name string) (ent.Value, bool)
- func (m *OrgMutation) FieldCleared(name string) bool
- func (m *OrgMutation) Fields() []string
- func (m *OrgMutation) ID() (id int, exists bool)
- func (m *OrgMutation) IDs(ctx context.Context) ([]int, error)
- func (m *OrgMutation) MaxProxies() (r int, exists bool)
- func (m *OrgMutation) Name() (r string, exists bool)
- func (m *OrgMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *OrgMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *OrgMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *OrgMutation) OldMaxProxies(ctx context.Context) (v int, err error)
- func (m *OrgMutation) OldName(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldPlan(ctx context.Context) (v org.Plan, err error)
- func (m *OrgMutation) OldSlug(ctx context.Context) (v string, err error)
- func (m *OrgMutation) OldTrafficRetentionDays(ctx context.Context) (v int, err error)
- func (m *OrgMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *OrgMutation) Op() Op
- func (m *OrgMutation) Plan() (r org.Plan, exists bool)
- func (m *OrgMutation) ProxiesCleared() bool
- func (m *OrgMutation) ProxiesIDs() (ids []int)
- func (m *OrgMutation) RemoveProxyIDs(ids ...int)
- func (m *OrgMutation) RemoveUserIDs(ids ...int)
- func (m *OrgMutation) RemovedEdges() []string
- func (m *OrgMutation) RemovedIDs(name string) []ent.Value
- func (m *OrgMutation) RemovedProxiesIDs() (ids []int)
- func (m *OrgMutation) RemovedUsersIDs() (ids []int)
- func (m *OrgMutation) ResetActive()
- func (m *OrgMutation) ResetCreatedAt()
- func (m *OrgMutation) ResetEdge(name string) error
- func (m *OrgMutation) ResetField(name string) error
- func (m *OrgMutation) ResetMaxProxies()
- func (m *OrgMutation) ResetName()
- func (m *OrgMutation) ResetPlan()
- func (m *OrgMutation) ResetProxies()
- func (m *OrgMutation) ResetSlug()
- func (m *OrgMutation) ResetTrafficRetentionDays()
- func (m *OrgMutation) ResetUpdatedAt()
- func (m *OrgMutation) ResetUsers()
- func (m *OrgMutation) SetActive(b bool)
- func (m *OrgMutation) SetCreatedAt(t time.Time)
- func (m *OrgMutation) SetField(name string, value ent.Value) error
- func (m *OrgMutation) SetMaxProxies(i int)
- func (m *OrgMutation) SetName(s string)
- func (m *OrgMutation) SetOp(op Op)
- func (m *OrgMutation) SetPlan(o org.Plan)
- func (m *OrgMutation) SetSlug(s string)
- func (m *OrgMutation) SetTrafficRetentionDays(i int)
- func (m *OrgMutation) SetUpdatedAt(t time.Time)
- func (m *OrgMutation) Slug() (r string, exists bool)
- func (m *OrgMutation) TrafficRetentionDays() (r int, exists bool)
- func (m OrgMutation) Tx() (*Tx, error)
- func (m *OrgMutation) Type() string
- func (m *OrgMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *OrgMutation) UsersCleared() bool
- func (m *OrgMutation) UsersIDs() (ids []int)
- func (m *OrgMutation) Where(ps ...predicate.Org)
- func (m *OrgMutation) WhereP(ps ...func(*sql.Selector))
- type OrgQuery
- func (_q *OrgQuery) Aggregate(fns ...AggregateFunc) *OrgSelect
- func (_q *OrgQuery) All(ctx context.Context) ([]*Org, error)
- func (_q *OrgQuery) AllX(ctx context.Context) []*Org
- func (_q *OrgQuery) Clone() *OrgQuery
- func (_q *OrgQuery) Count(ctx context.Context) (int, error)
- func (_q *OrgQuery) CountX(ctx context.Context) int
- func (_q *OrgQuery) Exist(ctx context.Context) (bool, error)
- func (_q *OrgQuery) ExistX(ctx context.Context) bool
- func (_q *OrgQuery) First(ctx context.Context) (*Org, error)
- func (_q *OrgQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *OrgQuery) FirstIDX(ctx context.Context) int
- func (_q *OrgQuery) FirstX(ctx context.Context) *Org
- func (_q *OrgQuery) GroupBy(field string, fields ...string) *OrgGroupBy
- func (_q *OrgQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *OrgQuery) IDsX(ctx context.Context) []int
- func (_q *OrgQuery) Limit(limit int) *OrgQuery
- func (_q *OrgQuery) Offset(offset int) *OrgQuery
- func (_q *OrgQuery) Only(ctx context.Context) (*Org, error)
- func (_q *OrgQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *OrgQuery) OnlyIDX(ctx context.Context) int
- func (_q *OrgQuery) OnlyX(ctx context.Context) *Org
- func (_q *OrgQuery) Order(o ...org.OrderOption) *OrgQuery
- func (_q *OrgQuery) QueryProxies() *ProxyQuery
- func (_q *OrgQuery) QueryUsers() *UserQuery
- func (_q *OrgQuery) Select(fields ...string) *OrgSelect
- func (_q *OrgQuery) Unique(unique bool) *OrgQuery
- func (_q *OrgQuery) Where(ps ...predicate.Org) *OrgQuery
- func (_q *OrgQuery) WithProxies(opts ...func(*ProxyQuery)) *OrgQuery
- func (_q *OrgQuery) WithUsers(opts ...func(*UserQuery)) *OrgQuery
- type OrgSelect
- func (_s *OrgSelect) Aggregate(fns ...AggregateFunc) *OrgSelect
- func (s *OrgSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *OrgSelect) BoolX(ctx context.Context) bool
- func (s *OrgSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *OrgSelect) BoolsX(ctx context.Context) []bool
- func (s *OrgSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *OrgSelect) Float64X(ctx context.Context) float64
- func (s *OrgSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *OrgSelect) Float64sX(ctx context.Context) []float64
- func (s *OrgSelect) Int(ctx context.Context) (_ int, err error)
- func (s *OrgSelect) IntX(ctx context.Context) int
- func (s *OrgSelect) Ints(ctx context.Context) ([]int, error)
- func (s *OrgSelect) IntsX(ctx context.Context) []int
- func (_s *OrgSelect) Scan(ctx context.Context, v any) error
- func (s *OrgSelect) ScanX(ctx context.Context, v any)
- func (s *OrgSelect) String(ctx context.Context) (_ string, err error)
- func (s *OrgSelect) StringX(ctx context.Context) string
- func (s *OrgSelect) Strings(ctx context.Context) ([]string, error)
- func (s *OrgSelect) StringsX(ctx context.Context) []string
- type OrgUpdate
- func (_u *OrgUpdate) AddMaxProxies(v int) *OrgUpdate
- func (_u *OrgUpdate) AddProxies(v ...*Proxy) *OrgUpdate
- func (_u *OrgUpdate) AddProxyIDs(ids ...int) *OrgUpdate
- func (_u *OrgUpdate) AddTrafficRetentionDays(v int) *OrgUpdate
- func (_u *OrgUpdate) AddUserIDs(ids ...int) *OrgUpdate
- func (_u *OrgUpdate) AddUsers(v ...*User) *OrgUpdate
- func (_u *OrgUpdate) ClearProxies() *OrgUpdate
- func (_u *OrgUpdate) ClearUsers() *OrgUpdate
- func (_u *OrgUpdate) Exec(ctx context.Context) error
- func (_u *OrgUpdate) ExecX(ctx context.Context)
- func (_u *OrgUpdate) Mutation() *OrgMutation
- func (_u *OrgUpdate) RemoveProxies(v ...*Proxy) *OrgUpdate
- func (_u *OrgUpdate) RemoveProxyIDs(ids ...int) *OrgUpdate
- func (_u *OrgUpdate) RemoveUserIDs(ids ...int) *OrgUpdate
- func (_u *OrgUpdate) RemoveUsers(v ...*User) *OrgUpdate
- func (_u *OrgUpdate) Save(ctx context.Context) (int, error)
- func (_u *OrgUpdate) SaveX(ctx context.Context) int
- func (_u *OrgUpdate) SetActive(v bool) *OrgUpdate
- func (_u *OrgUpdate) SetMaxProxies(v int) *OrgUpdate
- func (_u *OrgUpdate) SetName(v string) *OrgUpdate
- func (_u *OrgUpdate) SetNillableActive(v *bool) *OrgUpdate
- func (_u *OrgUpdate) SetNillableMaxProxies(v *int) *OrgUpdate
- func (_u *OrgUpdate) SetNillableName(v *string) *OrgUpdate
- func (_u *OrgUpdate) SetNillablePlan(v *org.Plan) *OrgUpdate
- func (_u *OrgUpdate) SetNillableSlug(v *string) *OrgUpdate
- func (_u *OrgUpdate) SetNillableTrafficRetentionDays(v *int) *OrgUpdate
- func (_u *OrgUpdate) SetPlan(v org.Plan) *OrgUpdate
- func (_u *OrgUpdate) SetSlug(v string) *OrgUpdate
- func (_u *OrgUpdate) SetTrafficRetentionDays(v int) *OrgUpdate
- func (_u *OrgUpdate) SetUpdatedAt(v time.Time) *OrgUpdate
- func (_u *OrgUpdate) Where(ps ...predicate.Org) *OrgUpdate
- type OrgUpdateOne
- func (_u *OrgUpdateOne) AddMaxProxies(v int) *OrgUpdateOne
- func (_u *OrgUpdateOne) AddProxies(v ...*Proxy) *OrgUpdateOne
- func (_u *OrgUpdateOne) AddProxyIDs(ids ...int) *OrgUpdateOne
- func (_u *OrgUpdateOne) AddTrafficRetentionDays(v int) *OrgUpdateOne
- func (_u *OrgUpdateOne) AddUserIDs(ids ...int) *OrgUpdateOne
- func (_u *OrgUpdateOne) AddUsers(v ...*User) *OrgUpdateOne
- func (_u *OrgUpdateOne) ClearProxies() *OrgUpdateOne
- func (_u *OrgUpdateOne) ClearUsers() *OrgUpdateOne
- func (_u *OrgUpdateOne) Exec(ctx context.Context) error
- func (_u *OrgUpdateOne) ExecX(ctx context.Context)
- func (_u *OrgUpdateOne) Mutation() *OrgMutation
- func (_u *OrgUpdateOne) RemoveProxies(v ...*Proxy) *OrgUpdateOne
- func (_u *OrgUpdateOne) RemoveProxyIDs(ids ...int) *OrgUpdateOne
- func (_u *OrgUpdateOne) RemoveUserIDs(ids ...int) *OrgUpdateOne
- func (_u *OrgUpdateOne) RemoveUsers(v ...*User) *OrgUpdateOne
- func (_u *OrgUpdateOne) Save(ctx context.Context) (*Org, error)
- func (_u *OrgUpdateOne) SaveX(ctx context.Context) *Org
- func (_u *OrgUpdateOne) Select(field string, fields ...string) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetActive(v bool) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetMaxProxies(v int) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetName(v string) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetNillableActive(v *bool) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetNillableMaxProxies(v *int) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetNillableName(v *string) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetNillablePlan(v *org.Plan) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetNillableSlug(v *string) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetNillableTrafficRetentionDays(v *int) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetPlan(v org.Plan) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetSlug(v string) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetTrafficRetentionDays(v int) *OrgUpdateOne
- func (_u *OrgUpdateOne) SetUpdatedAt(v time.Time) *OrgUpdateOne
- func (_u *OrgUpdateOne) Where(ps ...predicate.Org) *OrgUpdateOne
- type Orgs
- type Policy
- type Proxies
- type Proxy
- type ProxyClient
- func (c *ProxyClient) Create() *ProxyCreate
- func (c *ProxyClient) CreateBulk(builders ...*ProxyCreate) *ProxyCreateBulk
- func (c *ProxyClient) Delete() *ProxyDelete
- func (c *ProxyClient) DeleteOne(_m *Proxy) *ProxyDeleteOne
- func (c *ProxyClient) DeleteOneID(id int) *ProxyDeleteOne
- func (c *ProxyClient) Get(ctx context.Context, id int) (*Proxy, error)
- func (c *ProxyClient) GetX(ctx context.Context, id int) *Proxy
- func (c *ProxyClient) Hooks() []Hook
- func (c *ProxyClient) Intercept(interceptors ...Interceptor)
- func (c *ProxyClient) Interceptors() []Interceptor
- func (c *ProxyClient) MapCreateBulk(slice any, setFunc func(*ProxyCreate, int)) *ProxyCreateBulk
- func (c *ProxyClient) Query() *ProxyQuery
- func (c *ProxyClient) QueryOrg(_m *Proxy) *OrgQuery
- func (c *ProxyClient) QueryTraffic(_m *Proxy) *TrafficQuery
- func (c *ProxyClient) Update() *ProxyUpdate
- func (c *ProxyClient) UpdateOne(_m *Proxy) *ProxyUpdateOne
- func (c *ProxyClient) UpdateOneID(id int) *ProxyUpdateOne
- func (c *ProxyClient) Use(hooks ...Hook)
- type ProxyCreate
- func (_c *ProxyCreate) AddTraffic(v ...*Traffic) *ProxyCreate
- func (_c *ProxyCreate) AddTrafficIDs(ids ...int) *ProxyCreate
- func (_c *ProxyCreate) Exec(ctx context.Context) error
- func (_c *ProxyCreate) ExecX(ctx context.Context)
- func (_c *ProxyCreate) Mutation() *ProxyMutation
- func (_c *ProxyCreate) Save(ctx context.Context) (*Proxy, error)
- func (_c *ProxyCreate) SaveX(ctx context.Context) *Proxy
- func (_c *ProxyCreate) SetActive(v bool) *ProxyCreate
- func (_c *ProxyCreate) SetCreatedAt(v time.Time) *ProxyCreate
- func (_c *ProxyCreate) SetExcludeHosts(v []string) *ProxyCreate
- func (_c *ProxyCreate) SetExcludePaths(v []string) *ProxyCreate
- func (_c *ProxyCreate) SetHost(v string) *ProxyCreate
- func (_c *ProxyCreate) SetIncludeHosts(v []string) *ProxyCreate
- func (_c *ProxyCreate) SetIncludePaths(v []string) *ProxyCreate
- func (_c *ProxyCreate) SetLastStartedAt(v time.Time) *ProxyCreate
- func (_c *ProxyCreate) SetMitmEnabled(v bool) *ProxyCreate
- func (_c *ProxyCreate) SetMode(v proxy.Mode) *ProxyCreate
- func (_c *ProxyCreate) SetName(v string) *ProxyCreate
- func (_c *ProxyCreate) SetNillableActive(v *bool) *ProxyCreate
- func (_c *ProxyCreate) SetNillableCreatedAt(v *time.Time) *ProxyCreate
- func (_c *ProxyCreate) SetNillableHost(v *string) *ProxyCreate
- func (_c *ProxyCreate) SetNillableLastStartedAt(v *time.Time) *ProxyCreate
- func (_c *ProxyCreate) SetNillableMitmEnabled(v *bool) *ProxyCreate
- func (_c *ProxyCreate) SetNillableMode(v *proxy.Mode) *ProxyCreate
- func (_c *ProxyCreate) SetNillablePort(v *int) *ProxyCreate
- func (_c *ProxyCreate) SetNillableSkipBinary(v *bool) *ProxyCreate
- func (_c *ProxyCreate) SetNillableUpdatedAt(v *time.Time) *ProxyCreate
- func (_c *ProxyCreate) SetNillableUpstream(v *string) *ProxyCreate
- func (_c *ProxyCreate) SetOrg(v *Org) *ProxyCreate
- func (_c *ProxyCreate) SetOrgID(id int) *ProxyCreate
- func (_c *ProxyCreate) SetPort(v int) *ProxyCreate
- func (_c *ProxyCreate) SetSkipBinary(v bool) *ProxyCreate
- func (_c *ProxyCreate) SetSkipHosts(v []string) *ProxyCreate
- func (_c *ProxyCreate) SetSlug(v string) *ProxyCreate
- func (_c *ProxyCreate) SetUpdatedAt(v time.Time) *ProxyCreate
- func (_c *ProxyCreate) SetUpstream(v string) *ProxyCreate
- type ProxyCreateBulk
- type ProxyDelete
- type ProxyDeleteOne
- type ProxyEdges
- type ProxyGroupBy
- func (_g *ProxyGroupBy) Aggregate(fns ...AggregateFunc) *ProxyGroupBy
- func (s *ProxyGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProxyGroupBy) BoolX(ctx context.Context) bool
- func (s *ProxyGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProxyGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProxyGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProxyGroupBy) Float64X(ctx context.Context) float64
- func (s *ProxyGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProxyGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProxyGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProxyGroupBy) IntX(ctx context.Context) int
- func (s *ProxyGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProxyGroupBy) IntsX(ctx context.Context) []int
- func (_g *ProxyGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProxyGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProxyGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProxyGroupBy) StringX(ctx context.Context) string
- func (s *ProxyGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProxyGroupBy) StringsX(ctx context.Context) []string
- type ProxyMutation
- func (m *ProxyMutation) Active() (r bool, exists bool)
- func (m *ProxyMutation) AddField(name string, value ent.Value) error
- func (m *ProxyMutation) AddPort(i int)
- func (m *ProxyMutation) AddTrafficIDs(ids ...int)
- func (m *ProxyMutation) AddedEdges() []string
- func (m *ProxyMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProxyMutation) AddedFields() []string
- func (m *ProxyMutation) AddedIDs(name string) []ent.Value
- func (m *ProxyMutation) AddedPort() (r int, exists bool)
- func (m *ProxyMutation) AppendExcludeHosts(s []string)
- func (m *ProxyMutation) AppendExcludePaths(s []string)
- func (m *ProxyMutation) AppendIncludeHosts(s []string)
- func (m *ProxyMutation) AppendIncludePaths(s []string)
- func (m *ProxyMutation) AppendSkipHosts(s []string)
- func (m *ProxyMutation) AppendedExcludeHosts() ([]string, bool)
- func (m *ProxyMutation) AppendedExcludePaths() ([]string, bool)
- func (m *ProxyMutation) AppendedIncludeHosts() ([]string, bool)
- func (m *ProxyMutation) AppendedIncludePaths() ([]string, bool)
- func (m *ProxyMutation) AppendedSkipHosts() ([]string, bool)
- func (m *ProxyMutation) ClearEdge(name string) error
- func (m *ProxyMutation) ClearExcludeHosts()
- func (m *ProxyMutation) ClearExcludePaths()
- func (m *ProxyMutation) ClearField(name string) error
- func (m *ProxyMutation) ClearIncludeHosts()
- func (m *ProxyMutation) ClearIncludePaths()
- func (m *ProxyMutation) ClearLastStartedAt()
- func (m *ProxyMutation) ClearOrg()
- func (m *ProxyMutation) ClearSkipHosts()
- func (m *ProxyMutation) ClearTraffic()
- func (m *ProxyMutation) ClearUpstream()
- func (m *ProxyMutation) ClearedEdges() []string
- func (m *ProxyMutation) ClearedFields() []string
- func (m ProxyMutation) Client() *Client
- func (m *ProxyMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProxyMutation) EdgeCleared(name string) bool
- func (m *ProxyMutation) ExcludeHosts() (r []string, exists bool)
- func (m *ProxyMutation) ExcludeHostsCleared() bool
- func (m *ProxyMutation) ExcludePaths() (r []string, exists bool)
- func (m *ProxyMutation) ExcludePathsCleared() bool
- func (m *ProxyMutation) Field(name string) (ent.Value, bool)
- func (m *ProxyMutation) FieldCleared(name string) bool
- func (m *ProxyMutation) Fields() []string
- func (m *ProxyMutation) Host() (r string, exists bool)
- func (m *ProxyMutation) ID() (id int, exists bool)
- func (m *ProxyMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProxyMutation) IncludeHosts() (r []string, exists bool)
- func (m *ProxyMutation) IncludeHostsCleared() bool
- func (m *ProxyMutation) IncludePaths() (r []string, exists bool)
- func (m *ProxyMutation) IncludePathsCleared() bool
- func (m *ProxyMutation) LastStartedAt() (r time.Time, exists bool)
- func (m *ProxyMutation) LastStartedAtCleared() bool
- func (m *ProxyMutation) MitmEnabled() (r bool, exists bool)
- func (m *ProxyMutation) Mode() (r proxy.Mode, exists bool)
- func (m *ProxyMutation) Name() (r string, exists bool)
- func (m *ProxyMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *ProxyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProxyMutation) OldExcludeHosts(ctx context.Context) (v []string, err error)
- func (m *ProxyMutation) OldExcludePaths(ctx context.Context) (v []string, err error)
- func (m *ProxyMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProxyMutation) OldHost(ctx context.Context) (v string, err error)
- func (m *ProxyMutation) OldIncludeHosts(ctx context.Context) (v []string, err error)
- func (m *ProxyMutation) OldIncludePaths(ctx context.Context) (v []string, err error)
- func (m *ProxyMutation) OldLastStartedAt(ctx context.Context) (v *time.Time, err error)
- func (m *ProxyMutation) OldMitmEnabled(ctx context.Context) (v bool, err error)
- func (m *ProxyMutation) OldMode(ctx context.Context) (v proxy.Mode, err error)
- func (m *ProxyMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProxyMutation) OldPort(ctx context.Context) (v int, err error)
- func (m *ProxyMutation) OldSkipBinary(ctx context.Context) (v bool, err error)
- func (m *ProxyMutation) OldSkipHosts(ctx context.Context) (v []string, err error)
- func (m *ProxyMutation) OldSlug(ctx context.Context) (v string, err error)
- func (m *ProxyMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProxyMutation) OldUpstream(ctx context.Context) (v string, err error)
- func (m *ProxyMutation) Op() Op
- func (m *ProxyMutation) OrgCleared() bool
- func (m *ProxyMutation) OrgID() (id int, exists bool)
- func (m *ProxyMutation) OrgIDs() (ids []int)
- func (m *ProxyMutation) Port() (r int, exists bool)
- func (m *ProxyMutation) RemoveTrafficIDs(ids ...int)
- func (m *ProxyMutation) RemovedEdges() []string
- func (m *ProxyMutation) RemovedIDs(name string) []ent.Value
- func (m *ProxyMutation) RemovedTrafficIDs() (ids []int)
- func (m *ProxyMutation) ResetActive()
- func (m *ProxyMutation) ResetCreatedAt()
- func (m *ProxyMutation) ResetEdge(name string) error
- func (m *ProxyMutation) ResetExcludeHosts()
- func (m *ProxyMutation) ResetExcludePaths()
- func (m *ProxyMutation) ResetField(name string) error
- func (m *ProxyMutation) ResetHost()
- func (m *ProxyMutation) ResetIncludeHosts()
- func (m *ProxyMutation) ResetIncludePaths()
- func (m *ProxyMutation) ResetLastStartedAt()
- func (m *ProxyMutation) ResetMitmEnabled()
- func (m *ProxyMutation) ResetMode()
- func (m *ProxyMutation) ResetName()
- func (m *ProxyMutation) ResetOrg()
- func (m *ProxyMutation) ResetPort()
- func (m *ProxyMutation) ResetSkipBinary()
- func (m *ProxyMutation) ResetSkipHosts()
- func (m *ProxyMutation) ResetSlug()
- func (m *ProxyMutation) ResetTraffic()
- func (m *ProxyMutation) ResetUpdatedAt()
- func (m *ProxyMutation) ResetUpstream()
- func (m *ProxyMutation) SetActive(b bool)
- func (m *ProxyMutation) SetCreatedAt(t time.Time)
- func (m *ProxyMutation) SetExcludeHosts(s []string)
- func (m *ProxyMutation) SetExcludePaths(s []string)
- func (m *ProxyMutation) SetField(name string, value ent.Value) error
- func (m *ProxyMutation) SetHost(s string)
- func (m *ProxyMutation) SetIncludeHosts(s []string)
- func (m *ProxyMutation) SetIncludePaths(s []string)
- func (m *ProxyMutation) SetLastStartedAt(t time.Time)
- func (m *ProxyMutation) SetMitmEnabled(b bool)
- func (m *ProxyMutation) SetMode(pr proxy.Mode)
- func (m *ProxyMutation) SetName(s string)
- func (m *ProxyMutation) SetOp(op Op)
- func (m *ProxyMutation) SetOrgID(id int)
- func (m *ProxyMutation) SetPort(i int)
- func (m *ProxyMutation) SetSkipBinary(b bool)
- func (m *ProxyMutation) SetSkipHosts(s []string)
- func (m *ProxyMutation) SetSlug(s string)
- func (m *ProxyMutation) SetUpdatedAt(t time.Time)
- func (m *ProxyMutation) SetUpstream(s string)
- func (m *ProxyMutation) SkipBinary() (r bool, exists bool)
- func (m *ProxyMutation) SkipHosts() (r []string, exists bool)
- func (m *ProxyMutation) SkipHostsCleared() bool
- func (m *ProxyMutation) Slug() (r string, exists bool)
- func (m *ProxyMutation) TrafficCleared() bool
- func (m *ProxyMutation) TrafficIDs() (ids []int)
- func (m ProxyMutation) Tx() (*Tx, error)
- func (m *ProxyMutation) Type() string
- func (m *ProxyMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProxyMutation) Upstream() (r string, exists bool)
- func (m *ProxyMutation) UpstreamCleared() bool
- func (m *ProxyMutation) Where(ps ...predicate.Proxy)
- func (m *ProxyMutation) WhereP(ps ...func(*sql.Selector))
- type ProxyQuery
- func (_q *ProxyQuery) Aggregate(fns ...AggregateFunc) *ProxySelect
- func (_q *ProxyQuery) All(ctx context.Context) ([]*Proxy, error)
- func (_q *ProxyQuery) AllX(ctx context.Context) []*Proxy
- func (_q *ProxyQuery) Clone() *ProxyQuery
- func (_q *ProxyQuery) Count(ctx context.Context) (int, error)
- func (_q *ProxyQuery) CountX(ctx context.Context) int
- func (_q *ProxyQuery) Exist(ctx context.Context) (bool, error)
- func (_q *ProxyQuery) ExistX(ctx context.Context) bool
- func (_q *ProxyQuery) First(ctx context.Context) (*Proxy, error)
- func (_q *ProxyQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *ProxyQuery) FirstIDX(ctx context.Context) int
- func (_q *ProxyQuery) FirstX(ctx context.Context) *Proxy
- func (_q *ProxyQuery) GroupBy(field string, fields ...string) *ProxyGroupBy
- func (_q *ProxyQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *ProxyQuery) IDsX(ctx context.Context) []int
- func (_q *ProxyQuery) Limit(limit int) *ProxyQuery
- func (_q *ProxyQuery) Offset(offset int) *ProxyQuery
- func (_q *ProxyQuery) Only(ctx context.Context) (*Proxy, error)
- func (_q *ProxyQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *ProxyQuery) OnlyIDX(ctx context.Context) int
- func (_q *ProxyQuery) OnlyX(ctx context.Context) *Proxy
- func (_q *ProxyQuery) Order(o ...proxy.OrderOption) *ProxyQuery
- func (_q *ProxyQuery) QueryOrg() *OrgQuery
- func (_q *ProxyQuery) QueryTraffic() *TrafficQuery
- func (_q *ProxyQuery) Select(fields ...string) *ProxySelect
- func (_q *ProxyQuery) Unique(unique bool) *ProxyQuery
- func (_q *ProxyQuery) Where(ps ...predicate.Proxy) *ProxyQuery
- func (_q *ProxyQuery) WithOrg(opts ...func(*OrgQuery)) *ProxyQuery
- func (_q *ProxyQuery) WithTraffic(opts ...func(*TrafficQuery)) *ProxyQuery
- type ProxySelect
- func (_s *ProxySelect) Aggregate(fns ...AggregateFunc) *ProxySelect
- func (s *ProxySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProxySelect) BoolX(ctx context.Context) bool
- func (s *ProxySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProxySelect) BoolsX(ctx context.Context) []bool
- func (s *ProxySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProxySelect) Float64X(ctx context.Context) float64
- func (s *ProxySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProxySelect) Float64sX(ctx context.Context) []float64
- func (s *ProxySelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProxySelect) IntX(ctx context.Context) int
- func (s *ProxySelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProxySelect) IntsX(ctx context.Context) []int
- func (_s *ProxySelect) Scan(ctx context.Context, v any) error
- func (s *ProxySelect) ScanX(ctx context.Context, v any)
- func (s *ProxySelect) String(ctx context.Context) (_ string, err error)
- func (s *ProxySelect) StringX(ctx context.Context) string
- func (s *ProxySelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProxySelect) StringsX(ctx context.Context) []string
- type ProxyUpdate
- func (_u *ProxyUpdate) AddPort(v int) *ProxyUpdate
- func (_u *ProxyUpdate) AddTraffic(v ...*Traffic) *ProxyUpdate
- func (_u *ProxyUpdate) AddTrafficIDs(ids ...int) *ProxyUpdate
- func (_u *ProxyUpdate) AppendExcludeHosts(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) AppendExcludePaths(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) AppendIncludeHosts(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) AppendIncludePaths(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) AppendSkipHosts(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) ClearExcludeHosts() *ProxyUpdate
- func (_u *ProxyUpdate) ClearExcludePaths() *ProxyUpdate
- func (_u *ProxyUpdate) ClearIncludeHosts() *ProxyUpdate
- func (_u *ProxyUpdate) ClearIncludePaths() *ProxyUpdate
- func (_u *ProxyUpdate) ClearLastStartedAt() *ProxyUpdate
- func (_u *ProxyUpdate) ClearOrg() *ProxyUpdate
- func (_u *ProxyUpdate) ClearSkipHosts() *ProxyUpdate
- func (_u *ProxyUpdate) ClearTraffic() *ProxyUpdate
- func (_u *ProxyUpdate) ClearUpstream() *ProxyUpdate
- func (_u *ProxyUpdate) Exec(ctx context.Context) error
- func (_u *ProxyUpdate) ExecX(ctx context.Context)
- func (_u *ProxyUpdate) Mutation() *ProxyMutation
- func (_u *ProxyUpdate) RemoveTraffic(v ...*Traffic) *ProxyUpdate
- func (_u *ProxyUpdate) RemoveTrafficIDs(ids ...int) *ProxyUpdate
- func (_u *ProxyUpdate) Save(ctx context.Context) (int, error)
- func (_u *ProxyUpdate) SaveX(ctx context.Context) int
- func (_u *ProxyUpdate) SetActive(v bool) *ProxyUpdate
- func (_u *ProxyUpdate) SetExcludeHosts(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) SetExcludePaths(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) SetHost(v string) *ProxyUpdate
- func (_u *ProxyUpdate) SetIncludeHosts(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) SetIncludePaths(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) SetLastStartedAt(v time.Time) *ProxyUpdate
- func (_u *ProxyUpdate) SetMitmEnabled(v bool) *ProxyUpdate
- func (_u *ProxyUpdate) SetMode(v proxy.Mode) *ProxyUpdate
- func (_u *ProxyUpdate) SetName(v string) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableActive(v *bool) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableHost(v *string) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableLastStartedAt(v *time.Time) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableMitmEnabled(v *bool) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableMode(v *proxy.Mode) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableName(v *string) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillablePort(v *int) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableSkipBinary(v *bool) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableSlug(v *string) *ProxyUpdate
- func (_u *ProxyUpdate) SetNillableUpstream(v *string) *ProxyUpdate
- func (_u *ProxyUpdate) SetOrg(v *Org) *ProxyUpdate
- func (_u *ProxyUpdate) SetOrgID(id int) *ProxyUpdate
- func (_u *ProxyUpdate) SetPort(v int) *ProxyUpdate
- func (_u *ProxyUpdate) SetSkipBinary(v bool) *ProxyUpdate
- func (_u *ProxyUpdate) SetSkipHosts(v []string) *ProxyUpdate
- func (_u *ProxyUpdate) SetSlug(v string) *ProxyUpdate
- func (_u *ProxyUpdate) SetUpdatedAt(v time.Time) *ProxyUpdate
- func (_u *ProxyUpdate) SetUpstream(v string) *ProxyUpdate
- func (_u *ProxyUpdate) Where(ps ...predicate.Proxy) *ProxyUpdate
- type ProxyUpdateOne
- func (_u *ProxyUpdateOne) AddPort(v int) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AddTraffic(v ...*Traffic) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AddTrafficIDs(ids ...int) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AppendExcludeHosts(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AppendExcludePaths(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AppendIncludeHosts(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AppendIncludePaths(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) AppendSkipHosts(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearExcludeHosts() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearExcludePaths() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearIncludeHosts() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearIncludePaths() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearLastStartedAt() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearOrg() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearSkipHosts() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearTraffic() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) ClearUpstream() *ProxyUpdateOne
- func (_u *ProxyUpdateOne) Exec(ctx context.Context) error
- func (_u *ProxyUpdateOne) ExecX(ctx context.Context)
- func (_u *ProxyUpdateOne) Mutation() *ProxyMutation
- func (_u *ProxyUpdateOne) RemoveTraffic(v ...*Traffic) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) RemoveTrafficIDs(ids ...int) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) Save(ctx context.Context) (*Proxy, error)
- func (_u *ProxyUpdateOne) SaveX(ctx context.Context) *Proxy
- func (_u *ProxyUpdateOne) Select(field string, fields ...string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetActive(v bool) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetExcludeHosts(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetExcludePaths(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetHost(v string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetIncludeHosts(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetIncludePaths(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetLastStartedAt(v time.Time) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetMitmEnabled(v bool) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetMode(v proxy.Mode) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetName(v string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableActive(v *bool) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableHost(v *string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableLastStartedAt(v *time.Time) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableMitmEnabled(v *bool) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableMode(v *proxy.Mode) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableName(v *string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillablePort(v *int) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableSkipBinary(v *bool) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableSlug(v *string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetNillableUpstream(v *string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetOrg(v *Org) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetOrgID(id int) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetPort(v int) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetSkipBinary(v bool) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetSkipHosts(v []string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetSlug(v string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetUpdatedAt(v time.Time) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) SetUpstream(v string) *ProxyUpdateOne
- func (_u *ProxyUpdateOne) Where(ps ...predicate.Proxy) *ProxyUpdateOne
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Session
- type SessionClient
- func (c *SessionClient) Create() *SessionCreate
- func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk
- func (c *SessionClient) Delete() *SessionDelete
- func (c *SessionClient) DeleteOne(_m *Session) *SessionDeleteOne
- func (c *SessionClient) DeleteOneID(id int) *SessionDeleteOne
- func (c *SessionClient) Get(ctx context.Context, id int) (*Session, error)
- func (c *SessionClient) GetX(ctx context.Context, id int) *Session
- func (c *SessionClient) Hooks() []Hook
- func (c *SessionClient) Intercept(interceptors ...Interceptor)
- func (c *SessionClient) Interceptors() []Interceptor
- func (c *SessionClient) MapCreateBulk(slice any, setFunc func(*SessionCreate, int)) *SessionCreateBulk
- func (c *SessionClient) Query() *SessionQuery
- func (c *SessionClient) QueryUser(_m *Session) *UserQuery
- func (c *SessionClient) Update() *SessionUpdate
- func (c *SessionClient) UpdateOne(_m *Session) *SessionUpdateOne
- func (c *SessionClient) UpdateOneID(id int) *SessionUpdateOne
- func (c *SessionClient) Use(hooks ...Hook)
- type SessionCreate
- func (_c *SessionCreate) Exec(ctx context.Context) error
- func (_c *SessionCreate) ExecX(ctx context.Context)
- func (_c *SessionCreate) Mutation() *SessionMutation
- func (_c *SessionCreate) Save(ctx context.Context) (*Session, error)
- func (_c *SessionCreate) SaveX(ctx context.Context) *Session
- func (_c *SessionCreate) SetCreatedAt(v time.Time) *SessionCreate
- func (_c *SessionCreate) SetExpiresAt(v time.Time) *SessionCreate
- func (_c *SessionCreate) SetIPAddress(v string) *SessionCreate
- func (_c *SessionCreate) SetLastActiveAt(v time.Time) *SessionCreate
- func (_c *SessionCreate) SetNillableCreatedAt(v *time.Time) *SessionCreate
- func (_c *SessionCreate) SetNillableIPAddress(v *string) *SessionCreate
- func (_c *SessionCreate) SetNillableLastActiveAt(v *time.Time) *SessionCreate
- func (_c *SessionCreate) SetNillableUserAgent(v *string) *SessionCreate
- func (_c *SessionCreate) SetToken(v string) *SessionCreate
- func (_c *SessionCreate) SetUser(v *User) *SessionCreate
- func (_c *SessionCreate) SetUserAgent(v string) *SessionCreate
- func (_c *SessionCreate) SetUserID(id int) *SessionCreate
- type SessionCreateBulk
- type SessionDelete
- type SessionDeleteOne
- type SessionEdges
- type SessionGroupBy
- func (_g *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy
- func (s *SessionGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SessionGroupBy) BoolX(ctx context.Context) bool
- func (s *SessionGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SessionGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SessionGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SessionGroupBy) Float64X(ctx context.Context) float64
- func (s *SessionGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SessionGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SessionGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SessionGroupBy) IntX(ctx context.Context) int
- func (s *SessionGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SessionGroupBy) IntsX(ctx context.Context) []int
- func (_g *SessionGroupBy) Scan(ctx context.Context, v any) error
- func (s *SessionGroupBy) ScanX(ctx context.Context, v any)
- func (s *SessionGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SessionGroupBy) StringX(ctx context.Context) string
- func (s *SessionGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SessionGroupBy) StringsX(ctx context.Context) []string
- type SessionMutation
- func (m *SessionMutation) AddField(name string, value ent.Value) error
- func (m *SessionMutation) AddedEdges() []string
- func (m *SessionMutation) AddedField(name string) (ent.Value, bool)
- func (m *SessionMutation) AddedFields() []string
- func (m *SessionMutation) AddedIDs(name string) []ent.Value
- func (m *SessionMutation) ClearEdge(name string) error
- func (m *SessionMutation) ClearField(name string) error
- func (m *SessionMutation) ClearIPAddress()
- func (m *SessionMutation) ClearUser()
- func (m *SessionMutation) ClearUserAgent()
- func (m *SessionMutation) ClearedEdges() []string
- func (m *SessionMutation) ClearedFields() []string
- func (m SessionMutation) Client() *Client
- func (m *SessionMutation) CreatedAt() (r time.Time, exists bool)
- func (m *SessionMutation) EdgeCleared(name string) bool
- func (m *SessionMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *SessionMutation) Field(name string) (ent.Value, bool)
- func (m *SessionMutation) FieldCleared(name string) bool
- func (m *SessionMutation) Fields() []string
- func (m *SessionMutation) ID() (id int, exists bool)
- func (m *SessionMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SessionMutation) IPAddress() (r string, exists bool)
- func (m *SessionMutation) IPAddressCleared() bool
- func (m *SessionMutation) LastActiveAt() (r time.Time, exists bool)
- func (m *SessionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SessionMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *SessionMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SessionMutation) OldIPAddress(ctx context.Context) (v string, err error)
- func (m *SessionMutation) OldLastActiveAt(ctx context.Context) (v time.Time, err error)
- func (m *SessionMutation) OldToken(ctx context.Context) (v string, err error)
- func (m *SessionMutation) OldUserAgent(ctx context.Context) (v string, err error)
- func (m *SessionMutation) Op() Op
- func (m *SessionMutation) RemovedEdges() []string
- func (m *SessionMutation) RemovedIDs(name string) []ent.Value
- func (m *SessionMutation) ResetCreatedAt()
- func (m *SessionMutation) ResetEdge(name string) error
- func (m *SessionMutation) ResetExpiresAt()
- func (m *SessionMutation) ResetField(name string) error
- func (m *SessionMutation) ResetIPAddress()
- func (m *SessionMutation) ResetLastActiveAt()
- func (m *SessionMutation) ResetToken()
- func (m *SessionMutation) ResetUser()
- func (m *SessionMutation) ResetUserAgent()
- func (m *SessionMutation) SetCreatedAt(t time.Time)
- func (m *SessionMutation) SetExpiresAt(t time.Time)
- func (m *SessionMutation) SetField(name string, value ent.Value) error
- func (m *SessionMutation) SetIPAddress(s string)
- func (m *SessionMutation) SetLastActiveAt(t time.Time)
- func (m *SessionMutation) SetOp(op Op)
- func (m *SessionMutation) SetToken(s string)
- func (m *SessionMutation) SetUserAgent(s string)
- func (m *SessionMutation) SetUserID(id int)
- func (m *SessionMutation) Token() (r string, exists bool)
- func (m SessionMutation) Tx() (*Tx, error)
- func (m *SessionMutation) Type() string
- func (m *SessionMutation) UserAgent() (r string, exists bool)
- func (m *SessionMutation) UserAgentCleared() bool
- func (m *SessionMutation) UserCleared() bool
- func (m *SessionMutation) UserID() (id int, exists bool)
- func (m *SessionMutation) UserIDs() (ids []int)
- func (m *SessionMutation) Where(ps ...predicate.Session)
- func (m *SessionMutation) WhereP(ps ...func(*sql.Selector))
- type SessionQuery
- func (_q *SessionQuery) Aggregate(fns ...AggregateFunc) *SessionSelect
- func (_q *SessionQuery) All(ctx context.Context) ([]*Session, error)
- func (_q *SessionQuery) AllX(ctx context.Context) []*Session
- func (_q *SessionQuery) Clone() *SessionQuery
- func (_q *SessionQuery) Count(ctx context.Context) (int, error)
- func (_q *SessionQuery) CountX(ctx context.Context) int
- func (_q *SessionQuery) Exist(ctx context.Context) (bool, error)
- func (_q *SessionQuery) ExistX(ctx context.Context) bool
- func (_q *SessionQuery) First(ctx context.Context) (*Session, error)
- func (_q *SessionQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *SessionQuery) FirstIDX(ctx context.Context) int
- func (_q *SessionQuery) FirstX(ctx context.Context) *Session
- func (_q *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy
- func (_q *SessionQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *SessionQuery) IDsX(ctx context.Context) []int
- func (_q *SessionQuery) Limit(limit int) *SessionQuery
- func (_q *SessionQuery) Offset(offset int) *SessionQuery
- func (_q *SessionQuery) Only(ctx context.Context) (*Session, error)
- func (_q *SessionQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *SessionQuery) OnlyIDX(ctx context.Context) int
- func (_q *SessionQuery) OnlyX(ctx context.Context) *Session
- func (_q *SessionQuery) Order(o ...session.OrderOption) *SessionQuery
- func (_q *SessionQuery) QueryUser() *UserQuery
- func (_q *SessionQuery) Select(fields ...string) *SessionSelect
- func (_q *SessionQuery) Unique(unique bool) *SessionQuery
- func (_q *SessionQuery) Where(ps ...predicate.Session) *SessionQuery
- func (_q *SessionQuery) WithUser(opts ...func(*UserQuery)) *SessionQuery
- type SessionSelect
- func (_s *SessionSelect) Aggregate(fns ...AggregateFunc) *SessionSelect
- func (s *SessionSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SessionSelect) BoolX(ctx context.Context) bool
- func (s *SessionSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SessionSelect) BoolsX(ctx context.Context) []bool
- func (s *SessionSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SessionSelect) Float64X(ctx context.Context) float64
- func (s *SessionSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SessionSelect) Float64sX(ctx context.Context) []float64
- func (s *SessionSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SessionSelect) IntX(ctx context.Context) int
- func (s *SessionSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SessionSelect) IntsX(ctx context.Context) []int
- func (_s *SessionSelect) Scan(ctx context.Context, v any) error
- func (s *SessionSelect) ScanX(ctx context.Context, v any)
- func (s *SessionSelect) String(ctx context.Context) (_ string, err error)
- func (s *SessionSelect) StringX(ctx context.Context) string
- func (s *SessionSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SessionSelect) StringsX(ctx context.Context) []string
- type SessionUpdate
- func (_u *SessionUpdate) ClearIPAddress() *SessionUpdate
- func (_u *SessionUpdate) ClearUser() *SessionUpdate
- func (_u *SessionUpdate) ClearUserAgent() *SessionUpdate
- func (_u *SessionUpdate) Exec(ctx context.Context) error
- func (_u *SessionUpdate) ExecX(ctx context.Context)
- func (_u *SessionUpdate) Mutation() *SessionMutation
- func (_u *SessionUpdate) Save(ctx context.Context) (int, error)
- func (_u *SessionUpdate) SaveX(ctx context.Context) int
- func (_u *SessionUpdate) SetExpiresAt(v time.Time) *SessionUpdate
- func (_u *SessionUpdate) SetIPAddress(v string) *SessionUpdate
- func (_u *SessionUpdate) SetLastActiveAt(v time.Time) *SessionUpdate
- func (_u *SessionUpdate) SetNillableExpiresAt(v *time.Time) *SessionUpdate
- func (_u *SessionUpdate) SetNillableIPAddress(v *string) *SessionUpdate
- func (_u *SessionUpdate) SetNillableLastActiveAt(v *time.Time) *SessionUpdate
- func (_u *SessionUpdate) SetNillableToken(v *string) *SessionUpdate
- func (_u *SessionUpdate) SetNillableUserAgent(v *string) *SessionUpdate
- func (_u *SessionUpdate) SetToken(v string) *SessionUpdate
- func (_u *SessionUpdate) SetUser(v *User) *SessionUpdate
- func (_u *SessionUpdate) SetUserAgent(v string) *SessionUpdate
- func (_u *SessionUpdate) SetUserID(id int) *SessionUpdate
- func (_u *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate
- type SessionUpdateOne
- func (_u *SessionUpdateOne) ClearIPAddress() *SessionUpdateOne
- func (_u *SessionUpdateOne) ClearUser() *SessionUpdateOne
- func (_u *SessionUpdateOne) ClearUserAgent() *SessionUpdateOne
- func (_u *SessionUpdateOne) Exec(ctx context.Context) error
- func (_u *SessionUpdateOne) ExecX(ctx context.Context)
- func (_u *SessionUpdateOne) Mutation() *SessionMutation
- func (_u *SessionUpdateOne) Save(ctx context.Context) (*Session, error)
- func (_u *SessionUpdateOne) SaveX(ctx context.Context) *Session
- func (_u *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetExpiresAt(v time.Time) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetIPAddress(v string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetLastActiveAt(v time.Time) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetNillableExpiresAt(v *time.Time) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetNillableIPAddress(v *string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetNillableLastActiveAt(v *time.Time) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetNillableToken(v *string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetNillableUserAgent(v *string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetToken(v string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetUser(v *User) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetUserAgent(v string) *SessionUpdateOne
- func (_u *SessionUpdateOne) SetUserID(id int) *SessionUpdateOne
- func (_u *SessionUpdateOne) Where(ps ...predicate.Session) *SessionUpdateOne
- type Sessions
- type Traffic
- type TrafficClient
- func (c *TrafficClient) Create() *TrafficCreate
- func (c *TrafficClient) CreateBulk(builders ...*TrafficCreate) *TrafficCreateBulk
- func (c *TrafficClient) Delete() *TrafficDelete
- func (c *TrafficClient) DeleteOne(_m *Traffic) *TrafficDeleteOne
- func (c *TrafficClient) DeleteOneID(id int) *TrafficDeleteOne
- func (c *TrafficClient) Get(ctx context.Context, id int) (*Traffic, error)
- func (c *TrafficClient) GetX(ctx context.Context, id int) *Traffic
- func (c *TrafficClient) Hooks() []Hook
- func (c *TrafficClient) Intercept(interceptors ...Interceptor)
- func (c *TrafficClient) Interceptors() []Interceptor
- func (c *TrafficClient) MapCreateBulk(slice any, setFunc func(*TrafficCreate, int)) *TrafficCreateBulk
- func (c *TrafficClient) Query() *TrafficQuery
- func (c *TrafficClient) QueryProxy(_m *Traffic) *ProxyQuery
- func (c *TrafficClient) Update() *TrafficUpdate
- func (c *TrafficClient) UpdateOne(_m *Traffic) *TrafficUpdateOne
- func (c *TrafficClient) UpdateOneID(id int) *TrafficUpdateOne
- func (c *TrafficClient) Use(hooks ...Hook)
- type TrafficCreate
- func (_c *TrafficCreate) Exec(ctx context.Context) error
- func (_c *TrafficCreate) ExecX(ctx context.Context)
- func (_c *TrafficCreate) Mutation() *TrafficMutation
- func (_c *TrafficCreate) Save(ctx context.Context) (*Traffic, error)
- func (_c *TrafficCreate) SaveX(ctx context.Context) *Traffic
- func (_c *TrafficCreate) SetClientIP(v string) *TrafficCreate
- func (_c *TrafficCreate) SetContentType(v string) *TrafficCreate
- func (_c *TrafficCreate) SetCreatedAt(v time.Time) *TrafficCreate
- func (_c *TrafficCreate) SetDurationMs(v float64) *TrafficCreate
- func (_c *TrafficCreate) SetError(v string) *TrafficCreate
- func (_c *TrafficCreate) SetHost(v string) *TrafficCreate
- func (_c *TrafficCreate) SetMethod(v string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableClientIP(v *string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableContentType(v *string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableCreatedAt(v *time.Time) *TrafficCreate
- func (_c *TrafficCreate) SetNillableError(v *string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableQuery(v *string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableRequestBodySize(v *int64) *TrafficCreate
- func (_c *TrafficCreate) SetNillableRequestIsBinary(v *bool) *TrafficCreate
- func (_c *TrafficCreate) SetNillableResponseBodySize(v *int64) *TrafficCreate
- func (_c *TrafficCreate) SetNillableResponseContentType(v *string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableResponseIsBinary(v *bool) *TrafficCreate
- func (_c *TrafficCreate) SetNillableStatusText(v *string) *TrafficCreate
- func (_c *TrafficCreate) SetNillableTtfbMs(v *float64) *TrafficCreate
- func (_c *TrafficCreate) SetPath(v string) *TrafficCreate
- func (_c *TrafficCreate) SetProxy(v *Proxy) *TrafficCreate
- func (_c *TrafficCreate) SetProxyID(id int) *TrafficCreate
- func (_c *TrafficCreate) SetQuery(v string) *TrafficCreate
- func (_c *TrafficCreate) SetRequestBody(v []byte) *TrafficCreate
- func (_c *TrafficCreate) SetRequestBodySize(v int64) *TrafficCreate
- func (_c *TrafficCreate) SetRequestHeaders(v map[string][]string) *TrafficCreate
- func (_c *TrafficCreate) SetRequestIsBinary(v bool) *TrafficCreate
- func (_c *TrafficCreate) SetResponseBody(v []byte) *TrafficCreate
- func (_c *TrafficCreate) SetResponseBodySize(v int64) *TrafficCreate
- func (_c *TrafficCreate) SetResponseContentType(v string) *TrafficCreate
- func (_c *TrafficCreate) SetResponseHeaders(v map[string][]string) *TrafficCreate
- func (_c *TrafficCreate) SetResponseIsBinary(v bool) *TrafficCreate
- func (_c *TrafficCreate) SetScheme(v string) *TrafficCreate
- func (_c *TrafficCreate) SetStartedAt(v time.Time) *TrafficCreate
- func (_c *TrafficCreate) SetStatusCode(v int) *TrafficCreate
- func (_c *TrafficCreate) SetStatusText(v string) *TrafficCreate
- func (_c *TrafficCreate) SetTags(v []string) *TrafficCreate
- func (_c *TrafficCreate) SetTtfbMs(v float64) *TrafficCreate
- func (_c *TrafficCreate) SetURL(v string) *TrafficCreate
- type TrafficCreateBulk
- type TrafficDelete
- type TrafficDeleteOne
- type TrafficEdges
- type TrafficGroupBy
- func (_g *TrafficGroupBy) Aggregate(fns ...AggregateFunc) *TrafficGroupBy
- func (s *TrafficGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TrafficGroupBy) BoolX(ctx context.Context) bool
- func (s *TrafficGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TrafficGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TrafficGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TrafficGroupBy) Float64X(ctx context.Context) float64
- func (s *TrafficGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TrafficGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TrafficGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TrafficGroupBy) IntX(ctx context.Context) int
- func (s *TrafficGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TrafficGroupBy) IntsX(ctx context.Context) []int
- func (_g *TrafficGroupBy) Scan(ctx context.Context, v any) error
- func (s *TrafficGroupBy) ScanX(ctx context.Context, v any)
- func (s *TrafficGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TrafficGroupBy) StringX(ctx context.Context) string
- func (s *TrafficGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TrafficGroupBy) StringsX(ctx context.Context) []string
- type TrafficMutation
- func (m *TrafficMutation) AddDurationMs(f float64)
- func (m *TrafficMutation) AddField(name string, value ent.Value) error
- func (m *TrafficMutation) AddRequestBodySize(i int64)
- func (m *TrafficMutation) AddResponseBodySize(i int64)
- func (m *TrafficMutation) AddStatusCode(i int)
- func (m *TrafficMutation) AddTtfbMs(f float64)
- func (m *TrafficMutation) AddedDurationMs() (r float64, exists bool)
- func (m *TrafficMutation) AddedEdges() []string
- func (m *TrafficMutation) AddedField(name string) (ent.Value, bool)
- func (m *TrafficMutation) AddedFields() []string
- func (m *TrafficMutation) AddedIDs(name string) []ent.Value
- func (m *TrafficMutation) AddedRequestBodySize() (r int64, exists bool)
- func (m *TrafficMutation) AddedResponseBodySize() (r int64, exists bool)
- func (m *TrafficMutation) AddedStatusCode() (r int, exists bool)
- func (m *TrafficMutation) AddedTtfbMs() (r float64, exists bool)
- func (m *TrafficMutation) AppendTags(s []string)
- func (m *TrafficMutation) AppendedTags() ([]string, bool)
- func (m *TrafficMutation) ClearClientIP()
- func (m *TrafficMutation) ClearContentType()
- func (m *TrafficMutation) ClearEdge(name string) error
- func (m *TrafficMutation) ClearError()
- func (m *TrafficMutation) ClearField(name string) error
- func (m *TrafficMutation) ClearProxy()
- func (m *TrafficMutation) ClearQuery()
- func (m *TrafficMutation) ClearRequestBody()
- func (m *TrafficMutation) ClearRequestHeaders()
- func (m *TrafficMutation) ClearResponseBody()
- func (m *TrafficMutation) ClearResponseContentType()
- func (m *TrafficMutation) ClearResponseHeaders()
- func (m *TrafficMutation) ClearStatusText()
- func (m *TrafficMutation) ClearTags()
- func (m *TrafficMutation) ClearTtfbMs()
- func (m *TrafficMutation) ClearedEdges() []string
- func (m *TrafficMutation) ClearedFields() []string
- func (m TrafficMutation) Client() *Client
- func (m *TrafficMutation) ClientIP() (r string, exists bool)
- func (m *TrafficMutation) ClientIPCleared() bool
- func (m *TrafficMutation) ContentType() (r string, exists bool)
- func (m *TrafficMutation) ContentTypeCleared() bool
- func (m *TrafficMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TrafficMutation) DurationMs() (r float64, exists bool)
- func (m *TrafficMutation) EdgeCleared(name string) bool
- func (m *TrafficMutation) Error() (r string, exists bool)
- func (m *TrafficMutation) ErrorCleared() bool
- func (m *TrafficMutation) Field(name string) (ent.Value, bool)
- func (m *TrafficMutation) FieldCleared(name string) bool
- func (m *TrafficMutation) Fields() []string
- func (m *TrafficMutation) Host() (r string, exists bool)
- func (m *TrafficMutation) ID() (id int, exists bool)
- func (m *TrafficMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TrafficMutation) Method() (r string, exists bool)
- func (m *TrafficMutation) OldClientIP(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldContentType(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TrafficMutation) OldDurationMs(ctx context.Context) (v float64, err error)
- func (m *TrafficMutation) OldError(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TrafficMutation) OldHost(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldMethod(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldPath(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldQuery(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldRequestBody(ctx context.Context) (v []byte, err error)
- func (m *TrafficMutation) OldRequestBodySize(ctx context.Context) (v int64, err error)
- func (m *TrafficMutation) OldRequestHeaders(ctx context.Context) (v map[string][]string, err error)
- func (m *TrafficMutation) OldRequestIsBinary(ctx context.Context) (v bool, err error)
- func (m *TrafficMutation) OldResponseBody(ctx context.Context) (v []byte, err error)
- func (m *TrafficMutation) OldResponseBodySize(ctx context.Context) (v int64, err error)
- func (m *TrafficMutation) OldResponseContentType(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldResponseHeaders(ctx context.Context) (v map[string][]string, err error)
- func (m *TrafficMutation) OldResponseIsBinary(ctx context.Context) (v bool, err error)
- func (m *TrafficMutation) OldScheme(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)
- func (m *TrafficMutation) OldStatusCode(ctx context.Context) (v int, err error)
- func (m *TrafficMutation) OldStatusText(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) OldTags(ctx context.Context) (v []string, err error)
- func (m *TrafficMutation) OldTtfbMs(ctx context.Context) (v *float64, err error)
- func (m *TrafficMutation) OldURL(ctx context.Context) (v string, err error)
- func (m *TrafficMutation) Op() Op
- func (m *TrafficMutation) Path() (r string, exists bool)
- func (m *TrafficMutation) ProxyCleared() bool
- func (m *TrafficMutation) ProxyID() (id int, exists bool)
- func (m *TrafficMutation) ProxyIDs() (ids []int)
- func (m *TrafficMutation) Query() (r string, exists bool)
- func (m *TrafficMutation) QueryCleared() bool
- func (m *TrafficMutation) RemovedEdges() []string
- func (m *TrafficMutation) RemovedIDs(name string) []ent.Value
- func (m *TrafficMutation) RequestBody() (r []byte, exists bool)
- func (m *TrafficMutation) RequestBodyCleared() bool
- func (m *TrafficMutation) RequestBodySize() (r int64, exists bool)
- func (m *TrafficMutation) RequestHeaders() (r map[string][]string, exists bool)
- func (m *TrafficMutation) RequestHeadersCleared() bool
- func (m *TrafficMutation) RequestIsBinary() (r bool, exists bool)
- func (m *TrafficMutation) ResetClientIP()
- func (m *TrafficMutation) ResetContentType()
- func (m *TrafficMutation) ResetCreatedAt()
- func (m *TrafficMutation) ResetDurationMs()
- func (m *TrafficMutation) ResetEdge(name string) error
- func (m *TrafficMutation) ResetError()
- func (m *TrafficMutation) ResetField(name string) error
- func (m *TrafficMutation) ResetHost()
- func (m *TrafficMutation) ResetMethod()
- func (m *TrafficMutation) ResetPath()
- func (m *TrafficMutation) ResetProxy()
- func (m *TrafficMutation) ResetQuery()
- func (m *TrafficMutation) ResetRequestBody()
- func (m *TrafficMutation) ResetRequestBodySize()
- func (m *TrafficMutation) ResetRequestHeaders()
- func (m *TrafficMutation) ResetRequestIsBinary()
- func (m *TrafficMutation) ResetResponseBody()
- func (m *TrafficMutation) ResetResponseBodySize()
- func (m *TrafficMutation) ResetResponseContentType()
- func (m *TrafficMutation) ResetResponseHeaders()
- func (m *TrafficMutation) ResetResponseIsBinary()
- func (m *TrafficMutation) ResetScheme()
- func (m *TrafficMutation) ResetStartedAt()
- func (m *TrafficMutation) ResetStatusCode()
- func (m *TrafficMutation) ResetStatusText()
- func (m *TrafficMutation) ResetTags()
- func (m *TrafficMutation) ResetTtfbMs()
- func (m *TrafficMutation) ResetURL()
- func (m *TrafficMutation) ResponseBody() (r []byte, exists bool)
- func (m *TrafficMutation) ResponseBodyCleared() bool
- func (m *TrafficMutation) ResponseBodySize() (r int64, exists bool)
- func (m *TrafficMutation) ResponseContentType() (r string, exists bool)
- func (m *TrafficMutation) ResponseContentTypeCleared() bool
- func (m *TrafficMutation) ResponseHeaders() (r map[string][]string, exists bool)
- func (m *TrafficMutation) ResponseHeadersCleared() bool
- func (m *TrafficMutation) ResponseIsBinary() (r bool, exists bool)
- func (m *TrafficMutation) Scheme() (r string, exists bool)
- func (m *TrafficMutation) SetClientIP(s string)
- func (m *TrafficMutation) SetContentType(s string)
- func (m *TrafficMutation) SetCreatedAt(t time.Time)
- func (m *TrafficMutation) SetDurationMs(f float64)
- func (m *TrafficMutation) SetError(s string)
- func (m *TrafficMutation) SetField(name string, value ent.Value) error
- func (m *TrafficMutation) SetHost(s string)
- func (m *TrafficMutation) SetMethod(s string)
- func (m *TrafficMutation) SetOp(op Op)
- func (m *TrafficMutation) SetPath(s string)
- func (m *TrafficMutation) SetProxyID(id int)
- func (m *TrafficMutation) SetQuery(s string)
- func (m *TrafficMutation) SetRequestBody(b []byte)
- func (m *TrafficMutation) SetRequestBodySize(i int64)
- func (m *TrafficMutation) SetRequestHeaders(value map[string][]string)
- func (m *TrafficMutation) SetRequestIsBinary(b bool)
- func (m *TrafficMutation) SetResponseBody(b []byte)
- func (m *TrafficMutation) SetResponseBodySize(i int64)
- func (m *TrafficMutation) SetResponseContentType(s string)
- func (m *TrafficMutation) SetResponseHeaders(value map[string][]string)
- func (m *TrafficMutation) SetResponseIsBinary(b bool)
- func (m *TrafficMutation) SetScheme(s string)
- func (m *TrafficMutation) SetStartedAt(t time.Time)
- func (m *TrafficMutation) SetStatusCode(i int)
- func (m *TrafficMutation) SetStatusText(s string)
- func (m *TrafficMutation) SetTags(s []string)
- func (m *TrafficMutation) SetTtfbMs(f float64)
- func (m *TrafficMutation) SetURL(s string)
- func (m *TrafficMutation) StartedAt() (r time.Time, exists bool)
- func (m *TrafficMutation) StatusCode() (r int, exists bool)
- func (m *TrafficMutation) StatusText() (r string, exists bool)
- func (m *TrafficMutation) StatusTextCleared() bool
- func (m *TrafficMutation) Tags() (r []string, exists bool)
- func (m *TrafficMutation) TagsCleared() bool
- func (m *TrafficMutation) TtfbMs() (r float64, exists bool)
- func (m *TrafficMutation) TtfbMsCleared() bool
- func (m TrafficMutation) Tx() (*Tx, error)
- func (m *TrafficMutation) Type() string
- func (m *TrafficMutation) URL() (r string, exists bool)
- func (m *TrafficMutation) Where(ps ...predicate.Traffic)
- func (m *TrafficMutation) WhereP(ps ...func(*sql.Selector))
- type TrafficQuery
- func (_q *TrafficQuery) Aggregate(fns ...AggregateFunc) *TrafficSelect
- func (_q *TrafficQuery) All(ctx context.Context) ([]*Traffic, error)
- func (_q *TrafficQuery) AllX(ctx context.Context) []*Traffic
- func (_q *TrafficQuery) Clone() *TrafficQuery
- func (_q *TrafficQuery) Count(ctx context.Context) (int, error)
- func (_q *TrafficQuery) CountX(ctx context.Context) int
- func (_q *TrafficQuery) Exist(ctx context.Context) (bool, error)
- func (_q *TrafficQuery) ExistX(ctx context.Context) bool
- func (_q *TrafficQuery) First(ctx context.Context) (*Traffic, error)
- func (_q *TrafficQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *TrafficQuery) FirstIDX(ctx context.Context) int
- func (_q *TrafficQuery) FirstX(ctx context.Context) *Traffic
- func (_q *TrafficQuery) GroupBy(field string, fields ...string) *TrafficGroupBy
- func (_q *TrafficQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *TrafficQuery) IDsX(ctx context.Context) []int
- func (_q *TrafficQuery) Limit(limit int) *TrafficQuery
- func (_q *TrafficQuery) Offset(offset int) *TrafficQuery
- func (_q *TrafficQuery) Only(ctx context.Context) (*Traffic, error)
- func (_q *TrafficQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *TrafficQuery) OnlyIDX(ctx context.Context) int
- func (_q *TrafficQuery) OnlyX(ctx context.Context) *Traffic
- func (_q *TrafficQuery) Order(o ...traffic.OrderOption) *TrafficQuery
- func (_q *TrafficQuery) QueryProxy() *ProxyQuery
- func (_q *TrafficQuery) Select(fields ...string) *TrafficSelect
- func (_q *TrafficQuery) Unique(unique bool) *TrafficQuery
- func (_q *TrafficQuery) Where(ps ...predicate.Traffic) *TrafficQuery
- func (_q *TrafficQuery) WithProxy(opts ...func(*ProxyQuery)) *TrafficQuery
- type TrafficSelect
- func (_s *TrafficSelect) Aggregate(fns ...AggregateFunc) *TrafficSelect
- func (s *TrafficSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TrafficSelect) BoolX(ctx context.Context) bool
- func (s *TrafficSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TrafficSelect) BoolsX(ctx context.Context) []bool
- func (s *TrafficSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TrafficSelect) Float64X(ctx context.Context) float64
- func (s *TrafficSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TrafficSelect) Float64sX(ctx context.Context) []float64
- func (s *TrafficSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TrafficSelect) IntX(ctx context.Context) int
- func (s *TrafficSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TrafficSelect) IntsX(ctx context.Context) []int
- func (_s *TrafficSelect) Scan(ctx context.Context, v any) error
- func (s *TrafficSelect) ScanX(ctx context.Context, v any)
- func (s *TrafficSelect) String(ctx context.Context) (_ string, err error)
- func (s *TrafficSelect) StringX(ctx context.Context) string
- func (s *TrafficSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TrafficSelect) StringsX(ctx context.Context) []string
- type TrafficUpdate
- func (_u *TrafficUpdate) AddDurationMs(v float64) *TrafficUpdate
- func (_u *TrafficUpdate) AddRequestBodySize(v int64) *TrafficUpdate
- func (_u *TrafficUpdate) AddResponseBodySize(v int64) *TrafficUpdate
- func (_u *TrafficUpdate) AddStatusCode(v int) *TrafficUpdate
- func (_u *TrafficUpdate) AddTtfbMs(v float64) *TrafficUpdate
- func (_u *TrafficUpdate) AppendTags(v []string) *TrafficUpdate
- func (_u *TrafficUpdate) ClearClientIP() *TrafficUpdate
- func (_u *TrafficUpdate) ClearContentType() *TrafficUpdate
- func (_u *TrafficUpdate) ClearError() *TrafficUpdate
- func (_u *TrafficUpdate) ClearProxy() *TrafficUpdate
- func (_u *TrafficUpdate) ClearQuery() *TrafficUpdate
- func (_u *TrafficUpdate) ClearRequestBody() *TrafficUpdate
- func (_u *TrafficUpdate) ClearRequestHeaders() *TrafficUpdate
- func (_u *TrafficUpdate) ClearResponseBody() *TrafficUpdate
- func (_u *TrafficUpdate) ClearResponseContentType() *TrafficUpdate
- func (_u *TrafficUpdate) ClearResponseHeaders() *TrafficUpdate
- func (_u *TrafficUpdate) ClearStatusText() *TrafficUpdate
- func (_u *TrafficUpdate) ClearTags() *TrafficUpdate
- func (_u *TrafficUpdate) ClearTtfbMs() *TrafficUpdate
- func (_u *TrafficUpdate) Exec(ctx context.Context) error
- func (_u *TrafficUpdate) ExecX(ctx context.Context)
- func (_u *TrafficUpdate) Mutation() *TrafficMutation
- func (_u *TrafficUpdate) Save(ctx context.Context) (int, error)
- func (_u *TrafficUpdate) SaveX(ctx context.Context) int
- func (_u *TrafficUpdate) SetClientIP(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetContentType(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetDurationMs(v float64) *TrafficUpdate
- func (_u *TrafficUpdate) SetError(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetHost(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetMethod(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableClientIP(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableContentType(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableDurationMs(v *float64) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableError(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableHost(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableMethod(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillablePath(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableQuery(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableRequestBodySize(v *int64) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableRequestIsBinary(v *bool) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableResponseBodySize(v *int64) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableResponseContentType(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableResponseIsBinary(v *bool) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableScheme(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableStartedAt(v *time.Time) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableStatusCode(v *int) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableStatusText(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableTtfbMs(v *float64) *TrafficUpdate
- func (_u *TrafficUpdate) SetNillableURL(v *string) *TrafficUpdate
- func (_u *TrafficUpdate) SetPath(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetProxy(v *Proxy) *TrafficUpdate
- func (_u *TrafficUpdate) SetProxyID(id int) *TrafficUpdate
- func (_u *TrafficUpdate) SetQuery(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetRequestBody(v []byte) *TrafficUpdate
- func (_u *TrafficUpdate) SetRequestBodySize(v int64) *TrafficUpdate
- func (_u *TrafficUpdate) SetRequestHeaders(v map[string][]string) *TrafficUpdate
- func (_u *TrafficUpdate) SetRequestIsBinary(v bool) *TrafficUpdate
- func (_u *TrafficUpdate) SetResponseBody(v []byte) *TrafficUpdate
- func (_u *TrafficUpdate) SetResponseBodySize(v int64) *TrafficUpdate
- func (_u *TrafficUpdate) SetResponseContentType(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetResponseHeaders(v map[string][]string) *TrafficUpdate
- func (_u *TrafficUpdate) SetResponseIsBinary(v bool) *TrafficUpdate
- func (_u *TrafficUpdate) SetScheme(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetStartedAt(v time.Time) *TrafficUpdate
- func (_u *TrafficUpdate) SetStatusCode(v int) *TrafficUpdate
- func (_u *TrafficUpdate) SetStatusText(v string) *TrafficUpdate
- func (_u *TrafficUpdate) SetTags(v []string) *TrafficUpdate
- func (_u *TrafficUpdate) SetTtfbMs(v float64) *TrafficUpdate
- func (_u *TrafficUpdate) SetURL(v string) *TrafficUpdate
- func (_u *TrafficUpdate) Where(ps ...predicate.Traffic) *TrafficUpdate
- type TrafficUpdateOne
- func (_u *TrafficUpdateOne) AddDurationMs(v float64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) AddRequestBodySize(v int64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) AddResponseBodySize(v int64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) AddStatusCode(v int) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) AddTtfbMs(v float64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) AppendTags(v []string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearClientIP() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearContentType() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearError() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearProxy() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearQuery() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearRequestBody() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearRequestHeaders() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearResponseBody() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearResponseContentType() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearResponseHeaders() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearStatusText() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearTags() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) ClearTtfbMs() *TrafficUpdateOne
- func (_u *TrafficUpdateOne) Exec(ctx context.Context) error
- func (_u *TrafficUpdateOne) ExecX(ctx context.Context)
- func (_u *TrafficUpdateOne) Mutation() *TrafficMutation
- func (_u *TrafficUpdateOne) Save(ctx context.Context) (*Traffic, error)
- func (_u *TrafficUpdateOne) SaveX(ctx context.Context) *Traffic
- func (_u *TrafficUpdateOne) Select(field string, fields ...string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetClientIP(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetContentType(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetDurationMs(v float64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetError(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetHost(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetMethod(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableClientIP(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableContentType(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableDurationMs(v *float64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableError(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableHost(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableMethod(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillablePath(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableQuery(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableRequestBodySize(v *int64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableRequestIsBinary(v *bool) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableResponseBodySize(v *int64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableResponseContentType(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableResponseIsBinary(v *bool) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableScheme(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableStartedAt(v *time.Time) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableStatusCode(v *int) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableStatusText(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableTtfbMs(v *float64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetNillableURL(v *string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetPath(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetProxy(v *Proxy) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetProxyID(id int) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetQuery(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetRequestBody(v []byte) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetRequestBodySize(v int64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetRequestHeaders(v map[string][]string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetRequestIsBinary(v bool) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetResponseBody(v []byte) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetResponseBodySize(v int64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetResponseContentType(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetResponseHeaders(v map[string][]string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetResponseIsBinary(v bool) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetScheme(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetStartedAt(v time.Time) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetStatusCode(v int) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetStatusText(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetTags(v []string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetTtfbMs(v float64) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) SetURL(v string) *TrafficUpdateOne
- func (_u *TrafficUpdateOne) Where(ps ...predicate.Traffic) *TrafficUpdateOne
- type Traffics
- type TraverseFunc
- type Traverser
- 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(_m *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Intercept(interceptors ...Interceptor)
- func (c *UserClient) Interceptors() []Interceptor
- func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) QueryOrg(_m *User) *OrgQuery
- func (c *UserClient) QuerySessions(_m *User) *SessionQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(_m *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (_c *UserCreate) AddSessionIDs(ids ...int) *UserCreate
- func (_c *UserCreate) AddSessions(v ...*Session) *UserCreate
- func (_c *UserCreate) Exec(ctx context.Context) error
- func (_c *UserCreate) ExecX(ctx context.Context)
- func (_c *UserCreate) Mutation() *UserMutation
- func (_c *UserCreate) Save(ctx context.Context) (*User, error)
- func (_c *UserCreate) SaveX(ctx context.Context) *User
- func (_c *UserCreate) SetActive(v bool) *UserCreate
- func (_c *UserCreate) SetAuthProvider(v user.AuthProvider) *UserCreate
- func (_c *UserCreate) SetAuthProviderID(v string) *UserCreate
- func (_c *UserCreate) SetAvatarURL(v string) *UserCreate
- func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate
- func (_c *UserCreate) SetEmail(v string) *UserCreate
- func (_c *UserCreate) SetLastLoginAt(v time.Time) *UserCreate
- func (_c *UserCreate) SetName(v string) *UserCreate
- func (_c *UserCreate) SetNillableActive(v *bool) *UserCreate
- func (_c *UserCreate) SetNillableAuthProvider(v *user.AuthProvider) *UserCreate
- func (_c *UserCreate) SetNillableAuthProviderID(v *string) *UserCreate
- func (_c *UserCreate) SetNillableAvatarURL(v *string) *UserCreate
- func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetNillableLastLoginAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetNillableName(v *string) *UserCreate
- func (_c *UserCreate) SetNillableOrgID(id *int) *UserCreate
- func (_c *UserCreate) SetNillablePasswordHash(v *string) *UserCreate
- func (_c *UserCreate) SetNillableRole(v *user.Role) *UserCreate
- func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetOrg(v *Org) *UserCreate
- func (_c *UserCreate) SetOrgID(id int) *UserCreate
- func (_c *UserCreate) SetPasswordHash(v string) *UserCreate
- func (_c *UserCreate) SetRole(v user.Role) *UserCreate
- func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserEdges
- type UserGroupBy
- func (_g *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 (_g *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) Active() (r bool, exists bool)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddSessionIDs(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) AuthProvider() (r user.AuthProvider, exists bool)
- func (m *UserMutation) AuthProviderID() (r string, exists bool)
- func (m *UserMutation) AuthProviderIDCleared() bool
- func (m *UserMutation) AvatarURL() (r string, exists bool)
- func (m *UserMutation) AvatarURLCleared() bool
- func (m *UserMutation) ClearAuthProviderID()
- func (m *UserMutation) ClearAvatarURL()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearLastLoginAt()
- func (m *UserMutation) ClearName()
- func (m *UserMutation) ClearOrg()
- func (m *UserMutation) ClearPasswordHash()
- func (m *UserMutation) ClearSessions()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Email() (r string, exists bool)
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) LastLoginAt() (r time.Time, exists bool)
- func (m *UserMutation) LastLoginAtCleared() bool
- func (m *UserMutation) Name() (r string, exists bool)
- func (m *UserMutation) NameCleared() bool
- func (m *UserMutation) OldActive(ctx context.Context) (v bool, err error)
- func (m *UserMutation) OldAuthProvider(ctx context.Context) (v user.AuthProvider, err error)
- func (m *UserMutation) OldAuthProviderID(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldAvatarURL(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldLastLoginAt(ctx context.Context) (v *time.Time, err error)
- func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) OrgCleared() bool
- func (m *UserMutation) OrgID() (id int, exists bool)
- func (m *UserMutation) OrgIDs() (ids []int)
- func (m *UserMutation) PasswordHash() (r string, exists bool)
- func (m *UserMutation) PasswordHashCleared() bool
- func (m *UserMutation) RemoveSessionIDs(ids ...int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedSessionsIDs() (ids []int)
- func (m *UserMutation) ResetActive()
- func (m *UserMutation) ResetAuthProvider()
- func (m *UserMutation) ResetAuthProviderID()
- func (m *UserMutation) ResetAvatarURL()
- func (m *UserMutation) ResetCreatedAt()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetEmail()
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetLastLoginAt()
- func (m *UserMutation) ResetName()
- func (m *UserMutation) ResetOrg()
- func (m *UserMutation) ResetPasswordHash()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetSessions()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) Role() (r user.Role, exists bool)
- func (m *UserMutation) SessionsCleared() bool
- func (m *UserMutation) SessionsIDs() (ids []int)
- func (m *UserMutation) SetActive(b bool)
- func (m *UserMutation) SetAuthProvider(up user.AuthProvider)
- func (m *UserMutation) SetAuthProviderID(s string)
- func (m *UserMutation) SetAvatarURL(s string)
- func (m *UserMutation) SetCreatedAt(t time.Time)
- func (m *UserMutation) SetEmail(s string)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetLastLoginAt(t time.Time)
- func (m *UserMutation) SetName(s string)
- func (m *UserMutation) SetOp(op Op)
- func (m *UserMutation) SetOrgID(id int)
- func (m *UserMutation) SetPasswordHash(s string)
- func (m *UserMutation) SetRole(u user.Role)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
- type UserQuery
- func (_q *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect
- func (_q *UserQuery) All(ctx context.Context) ([]*User, error)
- func (_q *UserQuery) AllX(ctx context.Context) []*User
- func (_q *UserQuery) Clone() *UserQuery
- func (_q *UserQuery) Count(ctx context.Context) (int, error)
- func (_q *UserQuery) CountX(ctx context.Context) int
- func (_q *UserQuery) Exist(ctx context.Context) (bool, error)
- func (_q *UserQuery) ExistX(ctx context.Context) bool
- func (_q *UserQuery) First(ctx context.Context) (*User, error)
- func (_q *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *UserQuery) FirstIDX(ctx context.Context) int
- func (_q *UserQuery) FirstX(ctx context.Context) *User
- func (_q *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (_q *UserQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *UserQuery) IDsX(ctx context.Context) []int
- func (_q *UserQuery) Limit(limit int) *UserQuery
- func (_q *UserQuery) Offset(offset int) *UserQuery
- func (_q *UserQuery) Only(ctx context.Context) (*User, error)
- func (_q *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *UserQuery) OnlyIDX(ctx context.Context) int
- func (_q *UserQuery) OnlyX(ctx context.Context) *User
- func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery
- func (_q *UserQuery) QueryOrg() *OrgQuery
- func (_q *UserQuery) QuerySessions() *SessionQuery
- func (_q *UserQuery) Select(fields ...string) *UserSelect
- func (_q *UserQuery) Unique(unique bool) *UserQuery
- func (_q *UserQuery) Where(ps ...predicate.User) *UserQuery
- func (_q *UserQuery) WithOrg(opts ...func(*OrgQuery)) *UserQuery
- func (_q *UserQuery) WithSessions(opts ...func(*SessionQuery)) *UserQuery
- type UserSelect
- func (_s *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 (_s *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 (_u *UserUpdate) AddSessionIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) AddSessions(v ...*Session) *UserUpdate
- func (_u *UserUpdate) ClearAuthProviderID() *UserUpdate
- func (_u *UserUpdate) ClearAvatarURL() *UserUpdate
- func (_u *UserUpdate) ClearLastLoginAt() *UserUpdate
- func (_u *UserUpdate) ClearName() *UserUpdate
- func (_u *UserUpdate) ClearOrg() *UserUpdate
- func (_u *UserUpdate) ClearPasswordHash() *UserUpdate
- func (_u *UserUpdate) ClearSessions() *UserUpdate
- func (_u *UserUpdate) Exec(ctx context.Context) error
- func (_u *UserUpdate) ExecX(ctx context.Context)
- func (_u *UserUpdate) Mutation() *UserMutation
- func (_u *UserUpdate) RemoveSessionIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) RemoveSessions(v ...*Session) *UserUpdate
- func (_u *UserUpdate) Save(ctx context.Context) (int, error)
- func (_u *UserUpdate) SaveX(ctx context.Context) int
- func (_u *UserUpdate) SetActive(v bool) *UserUpdate
- func (_u *UserUpdate) SetAuthProvider(v user.AuthProvider) *UserUpdate
- func (_u *UserUpdate) SetAuthProviderID(v string) *UserUpdate
- func (_u *UserUpdate) SetAvatarURL(v string) *UserUpdate
- func (_u *UserUpdate) SetEmail(v string) *UserUpdate
- func (_u *UserUpdate) SetLastLoginAt(v time.Time) *UserUpdate
- func (_u *UserUpdate) SetName(v string) *UserUpdate
- func (_u *UserUpdate) SetNillableActive(v *bool) *UserUpdate
- func (_u *UserUpdate) SetNillableAuthProvider(v *user.AuthProvider) *UserUpdate
- func (_u *UserUpdate) SetNillableAuthProviderID(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableAvatarURL(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableLastLoginAt(v *time.Time) *UserUpdate
- func (_u *UserUpdate) SetNillableName(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableOrgID(id *int) *UserUpdate
- func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableRole(v *user.Role) *UserUpdate
- func (_u *UserUpdate) SetOrg(v *Org) *UserUpdate
- func (_u *UserUpdate) SetOrgID(id int) *UserUpdate
- func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate
- func (_u *UserUpdate) SetRole(v user.Role) *UserUpdate
- func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate
- func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (_u *UserUpdateOne) AddSessionIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) AddSessions(v ...*Session) *UserUpdateOne
- func (_u *UserUpdateOne) ClearAuthProviderID() *UserUpdateOne
- func (_u *UserUpdateOne) ClearAvatarURL() *UserUpdateOne
- func (_u *UserUpdateOne) ClearLastLoginAt() *UserUpdateOne
- func (_u *UserUpdateOne) ClearName() *UserUpdateOne
- func (_u *UserUpdateOne) ClearOrg() *UserUpdateOne
- func (_u *UserUpdateOne) ClearPasswordHash() *UserUpdateOne
- func (_u *UserUpdateOne) ClearSessions() *UserUpdateOne
- func (_u *UserUpdateOne) Exec(ctx context.Context) error
- func (_u *UserUpdateOne) ExecX(ctx context.Context)
- func (_u *UserUpdateOne) Mutation() *UserMutation
- func (_u *UserUpdateOne) RemoveSessionIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveSessions(v ...*Session) *UserUpdateOne
- func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (_u *UserUpdateOne) SaveX(ctx context.Context) *User
- func (_u *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (_u *UserUpdateOne) SetActive(v bool) *UserUpdateOne
- func (_u *UserUpdateOne) SetAuthProvider(v user.AuthProvider) *UserUpdateOne
- func (_u *UserUpdateOne) SetAuthProviderID(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetAvatarURL(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetLastLoginAt(v time.Time) *UserUpdateOne
- func (_u *UserUpdateOne) SetName(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableActive(v *bool) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableAuthProvider(v *user.AuthProvider) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableAuthProviderID(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableAvatarURL(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableLastLoginAt(v *time.Time) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableName(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableOrgID(id *int) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableRole(v *user.Role) *UserUpdateOne
- func (_u *UserUpdateOne) SetOrg(v *Org) *UserUpdateOne
- func (_u *UserUpdateOne) SetOrgID(id int) *UserUpdateOne
- func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetRole(v user.Role) *UserUpdateOne
- func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne
- func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeOrg = "Org" TypeProxy = "Proxy" TypeSession = "Session" TypeTraffic = "Traffic" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct {
// Schema is the client for creating, migrating and dropping schema.
Schema *migrate.Schema
// Org is the client for interacting with the Org builders.
Org *OrgClient
// Proxy is the client for interacting with the Proxy builders.
Proxy *ProxyClient
// Session is the client for interacting with the Session builders.
Session *SessionClient
// Traffic is the client for interacting with the Traffic builders.
Traffic *TrafficClient
// User is the client for interacting with the User builders.
User *UserClient
// contains filtered or unexported fields
}
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Org. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer {
return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Commit(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type Org ¶
type Org struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Organization display name
Name string `json:"name,omitempty"`
// URL-friendly unique identifier
Slug string `json:"slug,omitempty"`
// Subscription plan
Plan org.Plan `json:"plan,omitempty"`
// How long to retain traffic data
TrafficRetentionDays int `json:"traffic_retention_days,omitempty"`
// Maximum number of proxy instances
MaxProxies int `json:"max_proxies,omitempty"`
// Whether the org is active
Active bool `json:"active,omitempty"`
// When the org was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the org was last updated
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the OrgQuery when eager-loading is set.
Edges OrgEdges `json:"edges"`
// contains filtered or unexported fields
}
Org is the model entity for the Org schema.
func (*Org) QueryProxies ¶
func (_m *Org) QueryProxies() *ProxyQuery
QueryProxies queries the "proxies" edge of the Org entity.
func (*Org) QueryUsers ¶
QueryUsers queries the "users" edge of the Org entity.
func (*Org) Unwrap ¶
Unwrap unwraps the Org 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 (*Org) Update ¶
func (_m *Org) Update() *OrgUpdateOne
Update returns a builder for updating this Org. Note that you need to call Org.Unwrap() before calling this method if this Org was returned from a transaction, and the transaction was committed or rolled back.
type OrgClient ¶
type OrgClient struct {
// contains filtered or unexported fields
}
OrgClient is a client for the Org schema.
func NewOrgClient ¶
func NewOrgClient(c config) *OrgClient
NewOrgClient returns a client for the Org from the given config.
func (*OrgClient) CreateBulk ¶
func (c *OrgClient) CreateBulk(builders ...*OrgCreate) *OrgCreateBulk
CreateBulk returns a builder for creating a bulk of Org entities.
func (*OrgClient) DeleteOne ¶
func (c *OrgClient) DeleteOne(_m *Org) *OrgDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*OrgClient) DeleteOneID ¶
func (c *OrgClient) DeleteOneID(id int) *OrgDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*OrgClient) Intercept ¶
func (c *OrgClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `org.Intercept(f(g(h())))`.
func (*OrgClient) Interceptors ¶
func (c *OrgClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*OrgClient) MapCreateBulk ¶
func (c *OrgClient) MapCreateBulk(slice any, setFunc func(*OrgCreate, int)) *OrgCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*OrgClient) QueryProxies ¶
func (c *OrgClient) QueryProxies(_m *Org) *ProxyQuery
QueryProxies queries the proxies edge of a Org.
func (*OrgClient) QueryUsers ¶
QueryUsers queries the users edge of a Org.
func (*OrgClient) UpdateOne ¶
func (c *OrgClient) UpdateOne(_m *Org) *OrgUpdateOne
UpdateOne returns an update builder for the given entity.
func (*OrgClient) UpdateOneID ¶
func (c *OrgClient) UpdateOneID(id int) *OrgUpdateOne
UpdateOneID returns an update builder for the given id.
type OrgCreate ¶
type OrgCreate struct {
// contains filtered or unexported fields
}
OrgCreate is the builder for creating a Org entity.
func (*OrgCreate) AddProxies ¶
AddProxies adds the "proxies" edges to the Proxy entity.
func (*OrgCreate) AddProxyIDs ¶
AddProxyIDs adds the "proxies" edge to the Proxy entity by IDs.
func (*OrgCreate) AddUserIDs ¶
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*OrgCreate) Mutation ¶
func (_c *OrgCreate) Mutation() *OrgMutation
Mutation returns the OrgMutation object of the builder.
func (*OrgCreate) SetCreatedAt ¶
SetCreatedAt sets the "created_at" field.
func (*OrgCreate) SetMaxProxies ¶
SetMaxProxies sets the "max_proxies" field.
func (*OrgCreate) SetNillableActive ¶
SetNillableActive sets the "active" field if the given value is not nil.
func (*OrgCreate) SetNillableCreatedAt ¶
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*OrgCreate) SetNillableMaxProxies ¶
SetNillableMaxProxies sets the "max_proxies" field if the given value is not nil.
func (*OrgCreate) SetNillablePlan ¶
SetNillablePlan sets the "plan" field if the given value is not nil.
func (*OrgCreate) SetNillableTrafficRetentionDays ¶
SetNillableTrafficRetentionDays sets the "traffic_retention_days" field if the given value is not nil.
func (*OrgCreate) SetNillableUpdatedAt ¶
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*OrgCreate) SetTrafficRetentionDays ¶
SetTrafficRetentionDays sets the "traffic_retention_days" field.
type OrgCreateBulk ¶
type OrgCreateBulk struct {
// contains filtered or unexported fields
}
OrgCreateBulk is the builder for creating many Org entities in bulk.
func (*OrgCreateBulk) Exec ¶
func (_c *OrgCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*OrgCreateBulk) ExecX ¶
func (_c *OrgCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type OrgDelete ¶
type OrgDelete struct {
// contains filtered or unexported fields
}
OrgDelete is the builder for deleting a Org entity.
func (*OrgDelete) Exec ¶
Exec executes the deletion query and returns how many vertices were deleted.
type OrgDeleteOne ¶
type OrgDeleteOne struct {
// contains filtered or unexported fields
}
OrgDeleteOne is the builder for deleting a single Org entity.
func (*OrgDeleteOne) Exec ¶
func (_d *OrgDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*OrgDeleteOne) ExecX ¶
func (_d *OrgDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgDeleteOne) Where ¶
func (_d *OrgDeleteOne) Where(ps ...predicate.Org) *OrgDeleteOne
Where appends a list predicates to the OrgDelete builder.
type OrgEdges ¶
type OrgEdges struct {
// Users belonging to this org
Users []*User `json:"users,omitempty"`
// Proxy instances belonging to this org
Proxies []*Proxy `json:"proxies,omitempty"`
// contains filtered or unexported fields
}
OrgEdges holds the relations/edges for other nodes in the graph.
func (OrgEdges) ProxiesOrErr ¶
ProxiesOrErr returns the Proxies value or an error if the edge was not loaded in eager-loading.
func (OrgEdges) UsersOrErr ¶
UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.
type OrgGroupBy ¶
type OrgGroupBy struct {
// contains filtered or unexported fields
}
OrgGroupBy is the group-by builder for Org entities.
func (*OrgGroupBy) Aggregate ¶
func (_g *OrgGroupBy) Aggregate(fns ...AggregateFunc) *OrgGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*OrgGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrgGroupBy) Scan ¶
func (_g *OrgGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*OrgGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrgMutation ¶
type OrgMutation struct {
// contains filtered or unexported fields
}
OrgMutation represents an operation that mutates the Org nodes in the graph.
func (*OrgMutation) Active ¶
func (m *OrgMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*OrgMutation) AddField ¶
func (m *OrgMutation) 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 (*OrgMutation) AddMaxProxies ¶
func (m *OrgMutation) AddMaxProxies(i int)
AddMaxProxies adds i to the "max_proxies" field.
func (*OrgMutation) AddProxyIDs ¶
func (m *OrgMutation) AddProxyIDs(ids ...int)
AddProxyIDs adds the "proxies" edge to the Proxy entity by ids.
func (*OrgMutation) AddTrafficRetentionDays ¶
func (m *OrgMutation) AddTrafficRetentionDays(i int)
AddTrafficRetentionDays adds i to the "traffic_retention_days" field.
func (*OrgMutation) AddUserIDs ¶
func (m *OrgMutation) AddUserIDs(ids ...int)
AddUserIDs adds the "users" edge to the User entity by ids.
func (*OrgMutation) AddedEdges ¶
func (m *OrgMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*OrgMutation) AddedField ¶
func (m *OrgMutation) 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 (*OrgMutation) AddedFields ¶
func (m *OrgMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*OrgMutation) AddedIDs ¶
func (m *OrgMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*OrgMutation) AddedMaxProxies ¶
func (m *OrgMutation) AddedMaxProxies() (r int, exists bool)
AddedMaxProxies returns the value that was added to the "max_proxies" field in this mutation.
func (*OrgMutation) AddedTrafficRetentionDays ¶
func (m *OrgMutation) AddedTrafficRetentionDays() (r int, exists bool)
AddedTrafficRetentionDays returns the value that was added to the "traffic_retention_days" field in this mutation.
func (*OrgMutation) ClearEdge ¶
func (m *OrgMutation) 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 (*OrgMutation) ClearField ¶
func (m *OrgMutation) 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 (*OrgMutation) ClearProxies ¶
func (m *OrgMutation) ClearProxies()
ClearProxies clears the "proxies" edge to the Proxy entity.
func (*OrgMutation) ClearUsers ¶
func (m *OrgMutation) ClearUsers()
ClearUsers clears the "users" edge to the User entity.
func (*OrgMutation) ClearedEdges ¶
func (m *OrgMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*OrgMutation) ClearedFields ¶
func (m *OrgMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (OrgMutation) Client ¶
func (m OrgMutation) 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 (*OrgMutation) CreatedAt ¶
func (m *OrgMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*OrgMutation) EdgeCleared ¶
func (m *OrgMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*OrgMutation) Field ¶
func (m *OrgMutation) 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 (*OrgMutation) FieldCleared ¶
func (m *OrgMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*OrgMutation) Fields ¶
func (m *OrgMutation) 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 (*OrgMutation) ID ¶
func (m *OrgMutation) 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 (*OrgMutation) IDs ¶
func (m *OrgMutation) 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 (*OrgMutation) MaxProxies ¶
func (m *OrgMutation) MaxProxies() (r int, exists bool)
MaxProxies returns the value of the "max_proxies" field in the mutation.
func (*OrgMutation) Name ¶
func (m *OrgMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*OrgMutation) OldActive ¶
func (m *OrgMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" field's value of the Org entity. If the Org 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 (*OrgMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Org entity. If the Org 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 (*OrgMutation) 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 (*OrgMutation) OldMaxProxies ¶
func (m *OrgMutation) OldMaxProxies(ctx context.Context) (v int, err error)
OldMaxProxies returns the old "max_proxies" field's value of the Org entity. If the Org 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 (*OrgMutation) OldName ¶
func (m *OrgMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Org entity. If the Org 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 (*OrgMutation) OldPlan ¶
OldPlan returns the old "plan" field's value of the Org entity. If the Org 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 (*OrgMutation) OldSlug ¶
func (m *OrgMutation) OldSlug(ctx context.Context) (v string, err error)
OldSlug returns the old "slug" field's value of the Org entity. If the Org 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 (*OrgMutation) OldTrafficRetentionDays ¶
func (m *OrgMutation) OldTrafficRetentionDays(ctx context.Context) (v int, err error)
OldTrafficRetentionDays returns the old "traffic_retention_days" field's value of the Org entity. If the Org 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 (*OrgMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Org entity. If the Org 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 (*OrgMutation) Plan ¶
func (m *OrgMutation) Plan() (r org.Plan, exists bool)
Plan returns the value of the "plan" field in the mutation.
func (*OrgMutation) ProxiesCleared ¶
func (m *OrgMutation) ProxiesCleared() bool
ProxiesCleared reports if the "proxies" edge to the Proxy entity was cleared.
func (*OrgMutation) ProxiesIDs ¶
func (m *OrgMutation) ProxiesIDs() (ids []int)
ProxiesIDs returns the "proxies" edge IDs in the mutation.
func (*OrgMutation) RemoveProxyIDs ¶
func (m *OrgMutation) RemoveProxyIDs(ids ...int)
RemoveProxyIDs removes the "proxies" edge to the Proxy entity by IDs.
func (*OrgMutation) RemoveUserIDs ¶
func (m *OrgMutation) RemoveUserIDs(ids ...int)
RemoveUserIDs removes the "users" edge to the User entity by IDs.
func (*OrgMutation) RemovedEdges ¶
func (m *OrgMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*OrgMutation) RemovedIDs ¶
func (m *OrgMutation) 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 (*OrgMutation) RemovedProxiesIDs ¶
func (m *OrgMutation) RemovedProxiesIDs() (ids []int)
RemovedProxies returns the removed IDs of the "proxies" edge to the Proxy entity.
func (*OrgMutation) RemovedUsersIDs ¶
func (m *OrgMutation) RemovedUsersIDs() (ids []int)
RemovedUsers returns the removed IDs of the "users" edge to the User entity.
func (*OrgMutation) ResetActive ¶
func (m *OrgMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*OrgMutation) ResetCreatedAt ¶
func (m *OrgMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*OrgMutation) ResetEdge ¶
func (m *OrgMutation) 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 (*OrgMutation) ResetField ¶
func (m *OrgMutation) 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 (*OrgMutation) ResetMaxProxies ¶
func (m *OrgMutation) ResetMaxProxies()
ResetMaxProxies resets all changes to the "max_proxies" field.
func (*OrgMutation) ResetName ¶
func (m *OrgMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*OrgMutation) ResetPlan ¶
func (m *OrgMutation) ResetPlan()
ResetPlan resets all changes to the "plan" field.
func (*OrgMutation) ResetProxies ¶
func (m *OrgMutation) ResetProxies()
ResetProxies resets all changes to the "proxies" edge.
func (*OrgMutation) ResetSlug ¶
func (m *OrgMutation) ResetSlug()
ResetSlug resets all changes to the "slug" field.
func (*OrgMutation) ResetTrafficRetentionDays ¶
func (m *OrgMutation) ResetTrafficRetentionDays()
ResetTrafficRetentionDays resets all changes to the "traffic_retention_days" field.
func (*OrgMutation) ResetUpdatedAt ¶
func (m *OrgMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*OrgMutation) ResetUsers ¶
func (m *OrgMutation) ResetUsers()
ResetUsers resets all changes to the "users" edge.
func (*OrgMutation) SetActive ¶
func (m *OrgMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*OrgMutation) SetCreatedAt ¶
func (m *OrgMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*OrgMutation) SetField ¶
func (m *OrgMutation) 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 (*OrgMutation) SetMaxProxies ¶
func (m *OrgMutation) SetMaxProxies(i int)
SetMaxProxies sets the "max_proxies" field.
func (*OrgMutation) SetName ¶
func (m *OrgMutation) SetName(s string)
SetName sets the "name" field.
func (*OrgMutation) SetOp ¶
func (m *OrgMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*OrgMutation) SetPlan ¶
func (m *OrgMutation) SetPlan(o org.Plan)
SetPlan sets the "plan" field.
func (*OrgMutation) SetSlug ¶
func (m *OrgMutation) SetSlug(s string)
SetSlug sets the "slug" field.
func (*OrgMutation) SetTrafficRetentionDays ¶
func (m *OrgMutation) SetTrafficRetentionDays(i int)
SetTrafficRetentionDays sets the "traffic_retention_days" field.
func (*OrgMutation) SetUpdatedAt ¶
func (m *OrgMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*OrgMutation) Slug ¶
func (m *OrgMutation) Slug() (r string, exists bool)
Slug returns the value of the "slug" field in the mutation.
func (*OrgMutation) TrafficRetentionDays ¶
func (m *OrgMutation) TrafficRetentionDays() (r int, exists bool)
TrafficRetentionDays returns the value of the "traffic_retention_days" field in the mutation.
func (OrgMutation) Tx ¶
func (m OrgMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*OrgMutation) Type ¶
func (m *OrgMutation) Type() string
Type returns the node type of this mutation (Org).
func (*OrgMutation) UpdatedAt ¶
func (m *OrgMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*OrgMutation) UsersCleared ¶
func (m *OrgMutation) UsersCleared() bool
UsersCleared reports if the "users" edge to the User entity was cleared.
func (*OrgMutation) UsersIDs ¶
func (m *OrgMutation) UsersIDs() (ids []int)
UsersIDs returns the "users" edge IDs in the mutation.
func (*OrgMutation) Where ¶
func (m *OrgMutation) Where(ps ...predicate.Org)
Where appends a list predicates to the OrgMutation builder.
func (*OrgMutation) WhereP ¶
func (m *OrgMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the OrgMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type OrgQuery ¶
type OrgQuery struct {
// contains filtered or unexported fields
}
OrgQuery is the builder for querying Org entities.
func (*OrgQuery) Aggregate ¶
func (_q *OrgQuery) Aggregate(fns ...AggregateFunc) *OrgSelect
Aggregate returns a OrgSelect configured with the given aggregations.
func (*OrgQuery) Clone ¶
Clone returns a duplicate of the OrgQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*OrgQuery) First ¶
First returns the first Org entity from the query. Returns a *NotFoundError when no Org was found.
func (*OrgQuery) FirstID ¶
FirstID returns the first Org ID from the query. Returns a *NotFoundError when no Org ID was found.
func (*OrgQuery) GroupBy ¶
func (_q *OrgQuery) GroupBy(field string, fields ...string) *OrgGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.Org.Query().
GroupBy(org.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*OrgQuery) Only ¶
Only returns a single Org entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Org entity is found. Returns a *NotFoundError when no Org entities are found.
func (*OrgQuery) OnlyID ¶
OnlyID is like Only, but returns the only Org ID in the query. Returns a *NotSingularError when more than one Org ID is found. Returns a *NotFoundError when no entities are found.
func (*OrgQuery) Order ¶
func (_q *OrgQuery) Order(o ...org.OrderOption) *OrgQuery
Order specifies how the records should be ordered.
func (*OrgQuery) QueryProxies ¶
func (_q *OrgQuery) QueryProxies() *ProxyQuery
QueryProxies chains the current query on the "proxies" edge.
func (*OrgQuery) QueryUsers ¶
QueryUsers chains the current query on the "users" edge.
func (*OrgQuery) Select ¶
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Name string `json:"name,omitempty"`
}
client.Org.Query().
Select(org.FieldName).
Scan(ctx, &v)
func (*OrgQuery) 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 (*OrgQuery) WithProxies ¶
func (_q *OrgQuery) WithProxies(opts ...func(*ProxyQuery)) *OrgQuery
WithProxies tells the query-builder to eager-load the nodes that are connected to the "proxies" edge. The optional arguments are used to configure the query builder of the edge.
type OrgSelect ¶
type OrgSelect struct {
*OrgQuery
// contains filtered or unexported fields
}
OrgSelect is the builder for selecting fields of Org entities.
func (*OrgSelect) Aggregate ¶
func (_s *OrgSelect) Aggregate(fns ...AggregateFunc) *OrgSelect
Aggregate adds the given aggregation functions to the selector query.
func (*OrgSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*OrgSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*OrgSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type OrgUpdate ¶
type OrgUpdate struct {
// contains filtered or unexported fields
}
OrgUpdate is the builder for updating Org entities.
func (*OrgUpdate) AddMaxProxies ¶
AddMaxProxies adds value to the "max_proxies" field.
func (*OrgUpdate) AddProxies ¶
AddProxies adds the "proxies" edges to the Proxy entity.
func (*OrgUpdate) AddProxyIDs ¶
AddProxyIDs adds the "proxies" edge to the Proxy entity by IDs.
func (*OrgUpdate) AddTrafficRetentionDays ¶
AddTrafficRetentionDays adds value to the "traffic_retention_days" field.
func (*OrgUpdate) AddUserIDs ¶
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*OrgUpdate) ClearProxies ¶
ClearProxies clears all "proxies" edges to the Proxy entity.
func (*OrgUpdate) ClearUsers ¶
ClearUsers clears all "users" edges to the User entity.
func (*OrgUpdate) Mutation ¶
func (_u *OrgUpdate) Mutation() *OrgMutation
Mutation returns the OrgMutation object of the builder.
func (*OrgUpdate) RemoveProxies ¶
RemoveProxies removes "proxies" edges to Proxy entities.
func (*OrgUpdate) RemoveProxyIDs ¶
RemoveProxyIDs removes the "proxies" edge to Proxy entities by IDs.
func (*OrgUpdate) RemoveUserIDs ¶
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*OrgUpdate) RemoveUsers ¶
RemoveUsers removes "users" edges to User entities.
func (*OrgUpdate) Save ¶
Save executes the query and returns the number of nodes affected by the update operation.
func (*OrgUpdate) SetMaxProxies ¶
SetMaxProxies sets the "max_proxies" field.
func (*OrgUpdate) SetNillableActive ¶
SetNillableActive sets the "active" field if the given value is not nil.
func (*OrgUpdate) SetNillableMaxProxies ¶
SetNillableMaxProxies sets the "max_proxies" field if the given value is not nil.
func (*OrgUpdate) SetNillableName ¶
SetNillableName sets the "name" field if the given value is not nil.
func (*OrgUpdate) SetNillablePlan ¶
SetNillablePlan sets the "plan" field if the given value is not nil.
func (*OrgUpdate) SetNillableSlug ¶
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*OrgUpdate) SetNillableTrafficRetentionDays ¶
SetNillableTrafficRetentionDays sets the "traffic_retention_days" field if the given value is not nil.
func (*OrgUpdate) SetTrafficRetentionDays ¶
SetTrafficRetentionDays sets the "traffic_retention_days" field.
func (*OrgUpdate) SetUpdatedAt ¶
SetUpdatedAt sets the "updated_at" field.
type OrgUpdateOne ¶
type OrgUpdateOne struct {
// contains filtered or unexported fields
}
OrgUpdateOne is the builder for updating a single Org entity.
func (*OrgUpdateOne) AddMaxProxies ¶
func (_u *OrgUpdateOne) AddMaxProxies(v int) *OrgUpdateOne
AddMaxProxies adds value to the "max_proxies" field.
func (*OrgUpdateOne) AddProxies ¶
func (_u *OrgUpdateOne) AddProxies(v ...*Proxy) *OrgUpdateOne
AddProxies adds the "proxies" edges to the Proxy entity.
func (*OrgUpdateOne) AddProxyIDs ¶
func (_u *OrgUpdateOne) AddProxyIDs(ids ...int) *OrgUpdateOne
AddProxyIDs adds the "proxies" edge to the Proxy entity by IDs.
func (*OrgUpdateOne) AddTrafficRetentionDays ¶
func (_u *OrgUpdateOne) AddTrafficRetentionDays(v int) *OrgUpdateOne
AddTrafficRetentionDays adds value to the "traffic_retention_days" field.
func (*OrgUpdateOne) AddUserIDs ¶
func (_u *OrgUpdateOne) AddUserIDs(ids ...int) *OrgUpdateOne
AddUserIDs adds the "users" edge to the User entity by IDs.
func (*OrgUpdateOne) AddUsers ¶
func (_u *OrgUpdateOne) AddUsers(v ...*User) *OrgUpdateOne
AddUsers adds the "users" edges to the User entity.
func (*OrgUpdateOne) ClearProxies ¶
func (_u *OrgUpdateOne) ClearProxies() *OrgUpdateOne
ClearProxies clears all "proxies" edges to the Proxy entity.
func (*OrgUpdateOne) ClearUsers ¶
func (_u *OrgUpdateOne) ClearUsers() *OrgUpdateOne
ClearUsers clears all "users" edges to the User entity.
func (*OrgUpdateOne) Exec ¶
func (_u *OrgUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*OrgUpdateOne) ExecX ¶
func (_u *OrgUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*OrgUpdateOne) Mutation ¶
func (_u *OrgUpdateOne) Mutation() *OrgMutation
Mutation returns the OrgMutation object of the builder.
func (*OrgUpdateOne) RemoveProxies ¶
func (_u *OrgUpdateOne) RemoveProxies(v ...*Proxy) *OrgUpdateOne
RemoveProxies removes "proxies" edges to Proxy entities.
func (*OrgUpdateOne) RemoveProxyIDs ¶
func (_u *OrgUpdateOne) RemoveProxyIDs(ids ...int) *OrgUpdateOne
RemoveProxyIDs removes the "proxies" edge to Proxy entities by IDs.
func (*OrgUpdateOne) RemoveUserIDs ¶
func (_u *OrgUpdateOne) RemoveUserIDs(ids ...int) *OrgUpdateOne
RemoveUserIDs removes the "users" edge to User entities by IDs.
func (*OrgUpdateOne) RemoveUsers ¶
func (_u *OrgUpdateOne) RemoveUsers(v ...*User) *OrgUpdateOne
RemoveUsers removes "users" edges to User entities.
func (*OrgUpdateOne) Save ¶
func (_u *OrgUpdateOne) Save(ctx context.Context) (*Org, error)
Save executes the query and returns the updated Org entity.
func (*OrgUpdateOne) SaveX ¶
func (_u *OrgUpdateOne) SaveX(ctx context.Context) *Org
SaveX is like Save, but panics if an error occurs.
func (*OrgUpdateOne) Select ¶
func (_u *OrgUpdateOne) Select(field string, fields ...string) *OrgUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*OrgUpdateOne) SetActive ¶
func (_u *OrgUpdateOne) SetActive(v bool) *OrgUpdateOne
SetActive sets the "active" field.
func (*OrgUpdateOne) SetMaxProxies ¶
func (_u *OrgUpdateOne) SetMaxProxies(v int) *OrgUpdateOne
SetMaxProxies sets the "max_proxies" field.
func (*OrgUpdateOne) SetName ¶
func (_u *OrgUpdateOne) SetName(v string) *OrgUpdateOne
SetName sets the "name" field.
func (*OrgUpdateOne) SetNillableActive ¶
func (_u *OrgUpdateOne) SetNillableActive(v *bool) *OrgUpdateOne
SetNillableActive sets the "active" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableMaxProxies ¶
func (_u *OrgUpdateOne) SetNillableMaxProxies(v *int) *OrgUpdateOne
SetNillableMaxProxies sets the "max_proxies" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableName ¶
func (_u *OrgUpdateOne) SetNillableName(v *string) *OrgUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*OrgUpdateOne) SetNillablePlan ¶
func (_u *OrgUpdateOne) SetNillablePlan(v *org.Plan) *OrgUpdateOne
SetNillablePlan sets the "plan" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableSlug ¶
func (_u *OrgUpdateOne) SetNillableSlug(v *string) *OrgUpdateOne
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*OrgUpdateOne) SetNillableTrafficRetentionDays ¶
func (_u *OrgUpdateOne) SetNillableTrafficRetentionDays(v *int) *OrgUpdateOne
SetNillableTrafficRetentionDays sets the "traffic_retention_days" field if the given value is not nil.
func (*OrgUpdateOne) SetPlan ¶
func (_u *OrgUpdateOne) SetPlan(v org.Plan) *OrgUpdateOne
SetPlan sets the "plan" field.
func (*OrgUpdateOne) SetSlug ¶
func (_u *OrgUpdateOne) SetSlug(v string) *OrgUpdateOne
SetSlug sets the "slug" field.
func (*OrgUpdateOne) SetTrafficRetentionDays ¶
func (_u *OrgUpdateOne) SetTrafficRetentionDays(v int) *OrgUpdateOne
SetTrafficRetentionDays sets the "traffic_retention_days" field.
func (*OrgUpdateOne) SetUpdatedAt ¶
func (_u *OrgUpdateOne) SetUpdatedAt(v time.Time) *OrgUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*OrgUpdateOne) Where ¶
func (_u *OrgUpdateOne) Where(ps ...predicate.Org) *OrgUpdateOne
Where appends a list predicates to the OrgUpdate builder.
type Proxy ¶
type Proxy struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Display name for this proxy
Name string `json:"name,omitempty"`
// URL-friendly identifier within org
Slug string `json:"slug,omitempty"`
// Proxy operating mode
Mode proxy.Mode `json:"mode,omitempty"`
// Port to listen on
Port int `json:"port,omitempty"`
// Host to bind to
Host string `json:"host,omitempty"`
// Enable HTTPS MITM interception
MitmEnabled bool `json:"mitm_enabled,omitempty"`
// Hosts to skip MITM for
SkipHosts []string `json:"skip_hosts,omitempty"`
// Only capture traffic for these hosts
IncludeHosts []string `json:"include_hosts,omitempty"`
// Exclude traffic from these hosts
ExcludeHosts []string `json:"exclude_hosts,omitempty"`
// Only capture traffic for these paths
IncludePaths []string `json:"include_paths,omitempty"`
// Exclude traffic matching these paths
ExcludePaths []string `json:"exclude_paths,omitempty"`
// Upstream proxy URL
Upstream string `json:"upstream,omitempty"`
// Skip capturing binary content
SkipBinary bool `json:"skip_binary,omitempty"`
// Whether the proxy is active
Active bool `json:"active,omitempty"`
// Last time the proxy was started
LastStartedAt *time.Time `json:"last_started_at,omitempty"`
// When the proxy was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the proxy was last updated
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the ProxyQuery when eager-loading is set.
Edges ProxyEdges `json:"edges"`
// contains filtered or unexported fields
}
Proxy is the model entity for the Proxy schema.
func (*Proxy) QueryTraffic ¶
func (_m *Proxy) QueryTraffic() *TrafficQuery
QueryTraffic queries the "traffic" edge of the Proxy entity.
func (*Proxy) Unwrap ¶
Unwrap unwraps the Proxy 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 (*Proxy) Update ¶
func (_m *Proxy) Update() *ProxyUpdateOne
Update returns a builder for updating this Proxy. Note that you need to call Proxy.Unwrap() before calling this method if this Proxy was returned from a transaction, and the transaction was committed or rolled back.
type ProxyClient ¶
type ProxyClient struct {
// contains filtered or unexported fields
}
ProxyClient is a client for the Proxy schema.
func NewProxyClient ¶
func NewProxyClient(c config) *ProxyClient
NewProxyClient returns a client for the Proxy from the given config.
func (*ProxyClient) Create ¶
func (c *ProxyClient) Create() *ProxyCreate
Create returns a builder for creating a Proxy entity.
func (*ProxyClient) CreateBulk ¶
func (c *ProxyClient) CreateBulk(builders ...*ProxyCreate) *ProxyCreateBulk
CreateBulk returns a builder for creating a bulk of Proxy entities.
func (*ProxyClient) Delete ¶
func (c *ProxyClient) Delete() *ProxyDelete
Delete returns a delete builder for Proxy.
func (*ProxyClient) DeleteOne ¶
func (c *ProxyClient) DeleteOne(_m *Proxy) *ProxyDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProxyClient) DeleteOneID ¶
func (c *ProxyClient) DeleteOneID(id int) *ProxyDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProxyClient) GetX ¶
func (c *ProxyClient) GetX(ctx context.Context, id int) *Proxy
GetX is like Get, but panics if an error occurs.
func (*ProxyClient) Intercept ¶
func (c *ProxyClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `proxy.Intercept(f(g(h())))`.
func (*ProxyClient) Interceptors ¶
func (c *ProxyClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProxyClient) MapCreateBulk ¶
func (c *ProxyClient) MapCreateBulk(slice any, setFunc func(*ProxyCreate, int)) *ProxyCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ProxyClient) Query ¶
func (c *ProxyClient) Query() *ProxyQuery
Query returns a query builder for Proxy.
func (*ProxyClient) QueryOrg ¶
func (c *ProxyClient) QueryOrg(_m *Proxy) *OrgQuery
QueryOrg queries the org edge of a Proxy.
func (*ProxyClient) QueryTraffic ¶
func (c *ProxyClient) QueryTraffic(_m *Proxy) *TrafficQuery
QueryTraffic queries the traffic edge of a Proxy.
func (*ProxyClient) Update ¶
func (c *ProxyClient) Update() *ProxyUpdate
Update returns an update builder for Proxy.
func (*ProxyClient) UpdateOne ¶
func (c *ProxyClient) UpdateOne(_m *Proxy) *ProxyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProxyClient) UpdateOneID ¶
func (c *ProxyClient) UpdateOneID(id int) *ProxyUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProxyClient) Use ¶
func (c *ProxyClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `proxy.Hooks(f(g(h())))`.
type ProxyCreate ¶
type ProxyCreate struct {
// contains filtered or unexported fields
}
ProxyCreate is the builder for creating a Proxy entity.
func (*ProxyCreate) AddTraffic ¶
func (_c *ProxyCreate) AddTraffic(v ...*Traffic) *ProxyCreate
AddTraffic adds the "traffic" edges to the Traffic entity.
func (*ProxyCreate) AddTrafficIDs ¶
func (_c *ProxyCreate) AddTrafficIDs(ids ...int) *ProxyCreate
AddTrafficIDs adds the "traffic" edge to the Traffic entity by IDs.
func (*ProxyCreate) Exec ¶
func (_c *ProxyCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProxyCreate) ExecX ¶
func (_c *ProxyCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProxyCreate) Mutation ¶
func (_c *ProxyCreate) Mutation() *ProxyMutation
Mutation returns the ProxyMutation object of the builder.
func (*ProxyCreate) Save ¶
func (_c *ProxyCreate) Save(ctx context.Context) (*Proxy, error)
Save creates the Proxy in the database.
func (*ProxyCreate) SaveX ¶
func (_c *ProxyCreate) SaveX(ctx context.Context) *Proxy
SaveX calls Save and panics if Save returns an error.
func (*ProxyCreate) SetActive ¶
func (_c *ProxyCreate) SetActive(v bool) *ProxyCreate
SetActive sets the "active" field.
func (*ProxyCreate) SetCreatedAt ¶
func (_c *ProxyCreate) SetCreatedAt(v time.Time) *ProxyCreate
SetCreatedAt sets the "created_at" field.
func (*ProxyCreate) SetExcludeHosts ¶
func (_c *ProxyCreate) SetExcludeHosts(v []string) *ProxyCreate
SetExcludeHosts sets the "exclude_hosts" field.
func (*ProxyCreate) SetExcludePaths ¶
func (_c *ProxyCreate) SetExcludePaths(v []string) *ProxyCreate
SetExcludePaths sets the "exclude_paths" field.
func (*ProxyCreate) SetHost ¶
func (_c *ProxyCreate) SetHost(v string) *ProxyCreate
SetHost sets the "host" field.
func (*ProxyCreate) SetIncludeHosts ¶
func (_c *ProxyCreate) SetIncludeHosts(v []string) *ProxyCreate
SetIncludeHosts sets the "include_hosts" field.
func (*ProxyCreate) SetIncludePaths ¶
func (_c *ProxyCreate) SetIncludePaths(v []string) *ProxyCreate
SetIncludePaths sets the "include_paths" field.
func (*ProxyCreate) SetLastStartedAt ¶
func (_c *ProxyCreate) SetLastStartedAt(v time.Time) *ProxyCreate
SetLastStartedAt sets the "last_started_at" field.
func (*ProxyCreate) SetMitmEnabled ¶
func (_c *ProxyCreate) SetMitmEnabled(v bool) *ProxyCreate
SetMitmEnabled sets the "mitm_enabled" field.
func (*ProxyCreate) SetMode ¶
func (_c *ProxyCreate) SetMode(v proxy.Mode) *ProxyCreate
SetMode sets the "mode" field.
func (*ProxyCreate) SetName ¶
func (_c *ProxyCreate) SetName(v string) *ProxyCreate
SetName sets the "name" field.
func (*ProxyCreate) SetNillableActive ¶
func (_c *ProxyCreate) SetNillableActive(v *bool) *ProxyCreate
SetNillableActive sets the "active" field if the given value is not nil.
func (*ProxyCreate) SetNillableCreatedAt ¶
func (_c *ProxyCreate) SetNillableCreatedAt(v *time.Time) *ProxyCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProxyCreate) SetNillableHost ¶
func (_c *ProxyCreate) SetNillableHost(v *string) *ProxyCreate
SetNillableHost sets the "host" field if the given value is not nil.
func (*ProxyCreate) SetNillableLastStartedAt ¶
func (_c *ProxyCreate) SetNillableLastStartedAt(v *time.Time) *ProxyCreate
SetNillableLastStartedAt sets the "last_started_at" field if the given value is not nil.
func (*ProxyCreate) SetNillableMitmEnabled ¶
func (_c *ProxyCreate) SetNillableMitmEnabled(v *bool) *ProxyCreate
SetNillableMitmEnabled sets the "mitm_enabled" field if the given value is not nil.
func (*ProxyCreate) SetNillableMode ¶
func (_c *ProxyCreate) SetNillableMode(v *proxy.Mode) *ProxyCreate
SetNillableMode sets the "mode" field if the given value is not nil.
func (*ProxyCreate) SetNillablePort ¶
func (_c *ProxyCreate) SetNillablePort(v *int) *ProxyCreate
SetNillablePort sets the "port" field if the given value is not nil.
func (*ProxyCreate) SetNillableSkipBinary ¶
func (_c *ProxyCreate) SetNillableSkipBinary(v *bool) *ProxyCreate
SetNillableSkipBinary sets the "skip_binary" field if the given value is not nil.
func (*ProxyCreate) SetNillableUpdatedAt ¶
func (_c *ProxyCreate) SetNillableUpdatedAt(v *time.Time) *ProxyCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProxyCreate) SetNillableUpstream ¶
func (_c *ProxyCreate) SetNillableUpstream(v *string) *ProxyCreate
SetNillableUpstream sets the "upstream" field if the given value is not nil.
func (*ProxyCreate) SetOrg ¶
func (_c *ProxyCreate) SetOrg(v *Org) *ProxyCreate
SetOrg sets the "org" edge to the Org entity.
func (*ProxyCreate) SetOrgID ¶
func (_c *ProxyCreate) SetOrgID(id int) *ProxyCreate
SetOrgID sets the "org" edge to the Org entity by ID.
func (*ProxyCreate) SetPort ¶
func (_c *ProxyCreate) SetPort(v int) *ProxyCreate
SetPort sets the "port" field.
func (*ProxyCreate) SetSkipBinary ¶
func (_c *ProxyCreate) SetSkipBinary(v bool) *ProxyCreate
SetSkipBinary sets the "skip_binary" field.
func (*ProxyCreate) SetSkipHosts ¶
func (_c *ProxyCreate) SetSkipHosts(v []string) *ProxyCreate
SetSkipHosts sets the "skip_hosts" field.
func (*ProxyCreate) SetSlug ¶
func (_c *ProxyCreate) SetSlug(v string) *ProxyCreate
SetSlug sets the "slug" field.
func (*ProxyCreate) SetUpdatedAt ¶
func (_c *ProxyCreate) SetUpdatedAt(v time.Time) *ProxyCreate
SetUpdatedAt sets the "updated_at" field.
func (*ProxyCreate) SetUpstream ¶
func (_c *ProxyCreate) SetUpstream(v string) *ProxyCreate
SetUpstream sets the "upstream" field.
type ProxyCreateBulk ¶
type ProxyCreateBulk struct {
// contains filtered or unexported fields
}
ProxyCreateBulk is the builder for creating many Proxy entities in bulk.
func (*ProxyCreateBulk) Exec ¶
func (_c *ProxyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProxyCreateBulk) ExecX ¶
func (_c *ProxyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProxyDelete ¶
type ProxyDelete struct {
// contains filtered or unexported fields
}
ProxyDelete is the builder for deleting a Proxy entity.
func (*ProxyDelete) Exec ¶
func (_d *ProxyDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProxyDelete) ExecX ¶
func (_d *ProxyDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProxyDelete) Where ¶
func (_d *ProxyDelete) Where(ps ...predicate.Proxy) *ProxyDelete
Where appends a list predicates to the ProxyDelete builder.
type ProxyDeleteOne ¶
type ProxyDeleteOne struct {
// contains filtered or unexported fields
}
ProxyDeleteOne is the builder for deleting a single Proxy entity.
func (*ProxyDeleteOne) Exec ¶
func (_d *ProxyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProxyDeleteOne) ExecX ¶
func (_d *ProxyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProxyDeleteOne) Where ¶
func (_d *ProxyDeleteOne) Where(ps ...predicate.Proxy) *ProxyDeleteOne
Where appends a list predicates to the ProxyDelete builder.
type ProxyEdges ¶
type ProxyEdges struct {
// Organization this proxy belongs to
Org *Org `json:"org,omitempty"`
// Traffic captured by this proxy
Traffic []*Traffic `json:"traffic,omitempty"`
// contains filtered or unexported fields
}
ProxyEdges holds the relations/edges for other nodes in the graph.
func (ProxyEdges) OrgOrErr ¶
func (e ProxyEdges) OrgOrErr() (*Org, error)
OrgOrErr returns the Org value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProxyEdges) TrafficOrErr ¶
func (e ProxyEdges) TrafficOrErr() ([]*Traffic, error)
TrafficOrErr returns the Traffic value or an error if the edge was not loaded in eager-loading.
type ProxyGroupBy ¶
type ProxyGroupBy struct {
// contains filtered or unexported fields
}
ProxyGroupBy is the group-by builder for Proxy entities.
func (*ProxyGroupBy) Aggregate ¶
func (_g *ProxyGroupBy) Aggregate(fns ...AggregateFunc) *ProxyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProxyGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProxyGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProxyGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProxyGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProxyGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProxyGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProxyGroupBy) Scan ¶
func (_g *ProxyGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProxyGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProxyMutation ¶
type ProxyMutation struct {
// contains filtered or unexported fields
}
ProxyMutation represents an operation that mutates the Proxy nodes in the graph.
func (*ProxyMutation) Active ¶
func (m *ProxyMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*ProxyMutation) AddField ¶
func (m *ProxyMutation) 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 (*ProxyMutation) AddPort ¶
func (m *ProxyMutation) AddPort(i int)
AddPort adds i to the "port" field.
func (*ProxyMutation) AddTrafficIDs ¶
func (m *ProxyMutation) AddTrafficIDs(ids ...int)
AddTrafficIDs adds the "traffic" edge to the Traffic entity by ids.
func (*ProxyMutation) AddedEdges ¶
func (m *ProxyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProxyMutation) AddedField ¶
func (m *ProxyMutation) 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 (*ProxyMutation) AddedFields ¶
func (m *ProxyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProxyMutation) AddedIDs ¶
func (m *ProxyMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProxyMutation) AddedPort ¶
func (m *ProxyMutation) AddedPort() (r int, exists bool)
AddedPort returns the value that was added to the "port" field in this mutation.
func (*ProxyMutation) AppendExcludeHosts ¶
func (m *ProxyMutation) AppendExcludeHosts(s []string)
AppendExcludeHosts adds s to the "exclude_hosts" field.
func (*ProxyMutation) AppendExcludePaths ¶
func (m *ProxyMutation) AppendExcludePaths(s []string)
AppendExcludePaths adds s to the "exclude_paths" field.
func (*ProxyMutation) AppendIncludeHosts ¶
func (m *ProxyMutation) AppendIncludeHosts(s []string)
AppendIncludeHosts adds s to the "include_hosts" field.
func (*ProxyMutation) AppendIncludePaths ¶
func (m *ProxyMutation) AppendIncludePaths(s []string)
AppendIncludePaths adds s to the "include_paths" field.
func (*ProxyMutation) AppendSkipHosts ¶
func (m *ProxyMutation) AppendSkipHosts(s []string)
AppendSkipHosts adds s to the "skip_hosts" field.
func (*ProxyMutation) AppendedExcludeHosts ¶
func (m *ProxyMutation) AppendedExcludeHosts() ([]string, bool)
AppendedExcludeHosts returns the list of values that were appended to the "exclude_hosts" field in this mutation.
func (*ProxyMutation) AppendedExcludePaths ¶
func (m *ProxyMutation) AppendedExcludePaths() ([]string, bool)
AppendedExcludePaths returns the list of values that were appended to the "exclude_paths" field in this mutation.
func (*ProxyMutation) AppendedIncludeHosts ¶
func (m *ProxyMutation) AppendedIncludeHosts() ([]string, bool)
AppendedIncludeHosts returns the list of values that were appended to the "include_hosts" field in this mutation.
func (*ProxyMutation) AppendedIncludePaths ¶
func (m *ProxyMutation) AppendedIncludePaths() ([]string, bool)
AppendedIncludePaths returns the list of values that were appended to the "include_paths" field in this mutation.
func (*ProxyMutation) AppendedSkipHosts ¶
func (m *ProxyMutation) AppendedSkipHosts() ([]string, bool)
AppendedSkipHosts returns the list of values that were appended to the "skip_hosts" field in this mutation.
func (*ProxyMutation) ClearEdge ¶
func (m *ProxyMutation) 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 (*ProxyMutation) ClearExcludeHosts ¶
func (m *ProxyMutation) ClearExcludeHosts()
ClearExcludeHosts clears the value of the "exclude_hosts" field.
func (*ProxyMutation) ClearExcludePaths ¶
func (m *ProxyMutation) ClearExcludePaths()
ClearExcludePaths clears the value of the "exclude_paths" field.
func (*ProxyMutation) ClearField ¶
func (m *ProxyMutation) 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 (*ProxyMutation) ClearIncludeHosts ¶
func (m *ProxyMutation) ClearIncludeHosts()
ClearIncludeHosts clears the value of the "include_hosts" field.
func (*ProxyMutation) ClearIncludePaths ¶
func (m *ProxyMutation) ClearIncludePaths()
ClearIncludePaths clears the value of the "include_paths" field.
func (*ProxyMutation) ClearLastStartedAt ¶
func (m *ProxyMutation) ClearLastStartedAt()
ClearLastStartedAt clears the value of the "last_started_at" field.
func (*ProxyMutation) ClearOrg ¶
func (m *ProxyMutation) ClearOrg()
ClearOrg clears the "org" edge to the Org entity.
func (*ProxyMutation) ClearSkipHosts ¶
func (m *ProxyMutation) ClearSkipHosts()
ClearSkipHosts clears the value of the "skip_hosts" field.
func (*ProxyMutation) ClearTraffic ¶
func (m *ProxyMutation) ClearTraffic()
ClearTraffic clears the "traffic" edge to the Traffic entity.
func (*ProxyMutation) ClearUpstream ¶
func (m *ProxyMutation) ClearUpstream()
ClearUpstream clears the value of the "upstream" field.
func (*ProxyMutation) ClearedEdges ¶
func (m *ProxyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProxyMutation) ClearedFields ¶
func (m *ProxyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProxyMutation) Client ¶
func (m ProxyMutation) 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 (*ProxyMutation) CreatedAt ¶
func (m *ProxyMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProxyMutation) EdgeCleared ¶
func (m *ProxyMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProxyMutation) ExcludeHosts ¶
func (m *ProxyMutation) ExcludeHosts() (r []string, exists bool)
ExcludeHosts returns the value of the "exclude_hosts" field in the mutation.
func (*ProxyMutation) ExcludeHostsCleared ¶
func (m *ProxyMutation) ExcludeHostsCleared() bool
ExcludeHostsCleared returns if the "exclude_hosts" field was cleared in this mutation.
func (*ProxyMutation) ExcludePaths ¶
func (m *ProxyMutation) ExcludePaths() (r []string, exists bool)
ExcludePaths returns the value of the "exclude_paths" field in the mutation.
func (*ProxyMutation) ExcludePathsCleared ¶
func (m *ProxyMutation) ExcludePathsCleared() bool
ExcludePathsCleared returns if the "exclude_paths" field was cleared in this mutation.
func (*ProxyMutation) Field ¶
func (m *ProxyMutation) 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 (*ProxyMutation) FieldCleared ¶
func (m *ProxyMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProxyMutation) Fields ¶
func (m *ProxyMutation) 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 (*ProxyMutation) Host ¶
func (m *ProxyMutation) Host() (r string, exists bool)
Host returns the value of the "host" field in the mutation.
func (*ProxyMutation) ID ¶
func (m *ProxyMutation) 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 (*ProxyMutation) IDs ¶
func (m *ProxyMutation) 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 (*ProxyMutation) IncludeHosts ¶
func (m *ProxyMutation) IncludeHosts() (r []string, exists bool)
IncludeHosts returns the value of the "include_hosts" field in the mutation.
func (*ProxyMutation) IncludeHostsCleared ¶
func (m *ProxyMutation) IncludeHostsCleared() bool
IncludeHostsCleared returns if the "include_hosts" field was cleared in this mutation.
func (*ProxyMutation) IncludePaths ¶
func (m *ProxyMutation) IncludePaths() (r []string, exists bool)
IncludePaths returns the value of the "include_paths" field in the mutation.
func (*ProxyMutation) IncludePathsCleared ¶
func (m *ProxyMutation) IncludePathsCleared() bool
IncludePathsCleared returns if the "include_paths" field was cleared in this mutation.
func (*ProxyMutation) LastStartedAt ¶
func (m *ProxyMutation) LastStartedAt() (r time.Time, exists bool)
LastStartedAt returns the value of the "last_started_at" field in the mutation.
func (*ProxyMutation) LastStartedAtCleared ¶
func (m *ProxyMutation) LastStartedAtCleared() bool
LastStartedAtCleared returns if the "last_started_at" field was cleared in this mutation.
func (*ProxyMutation) MitmEnabled ¶
func (m *ProxyMutation) MitmEnabled() (r bool, exists bool)
MitmEnabled returns the value of the "mitm_enabled" field in the mutation.
func (*ProxyMutation) Mode ¶
func (m *ProxyMutation) Mode() (r proxy.Mode, exists bool)
Mode returns the value of the "mode" field in the mutation.
func (*ProxyMutation) Name ¶
func (m *ProxyMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProxyMutation) OldActive ¶
func (m *ProxyMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldExcludeHosts ¶
func (m *ProxyMutation) OldExcludeHosts(ctx context.Context) (v []string, err error)
OldExcludeHosts returns the old "exclude_hosts" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldExcludePaths ¶
func (m *ProxyMutation) OldExcludePaths(ctx context.Context) (v []string, err error)
OldExcludePaths returns the old "exclude_paths" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) 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 (*ProxyMutation) OldHost ¶
func (m *ProxyMutation) OldHost(ctx context.Context) (v string, err error)
OldHost returns the old "host" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldIncludeHosts ¶
func (m *ProxyMutation) OldIncludeHosts(ctx context.Context) (v []string, err error)
OldIncludeHosts returns the old "include_hosts" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldIncludePaths ¶
func (m *ProxyMutation) OldIncludePaths(ctx context.Context) (v []string, err error)
OldIncludePaths returns the old "include_paths" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldLastStartedAt ¶
OldLastStartedAt returns the old "last_started_at" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldMitmEnabled ¶
func (m *ProxyMutation) OldMitmEnabled(ctx context.Context) (v bool, err error)
OldMitmEnabled returns the old "mitm_enabled" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldMode ¶
OldMode returns the old "mode" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldName ¶
func (m *ProxyMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldPort ¶
func (m *ProxyMutation) OldPort(ctx context.Context) (v int, err error)
OldPort returns the old "port" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldSkipBinary ¶
func (m *ProxyMutation) OldSkipBinary(ctx context.Context) (v bool, err error)
OldSkipBinary returns the old "skip_binary" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldSkipHosts ¶
func (m *ProxyMutation) OldSkipHosts(ctx context.Context) (v []string, err error)
OldSkipHosts returns the old "skip_hosts" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldSlug ¶
func (m *ProxyMutation) OldSlug(ctx context.Context) (v string, err error)
OldSlug returns the old "slug" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OldUpstream ¶
func (m *ProxyMutation) OldUpstream(ctx context.Context) (v string, err error)
OldUpstream returns the old "upstream" field's value of the Proxy entity. If the Proxy 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 (*ProxyMutation) OrgCleared ¶
func (m *ProxyMutation) OrgCleared() bool
OrgCleared reports if the "org" edge to the Org entity was cleared.
func (*ProxyMutation) OrgID ¶
func (m *ProxyMutation) OrgID() (id int, exists bool)
OrgID returns the "org" edge ID in the mutation.
func (*ProxyMutation) OrgIDs ¶
func (m *ProxyMutation) OrgIDs() (ids []int)
OrgIDs returns the "org" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrgID instead. It exists only for internal usage by the builders.
func (*ProxyMutation) Port ¶
func (m *ProxyMutation) Port() (r int, exists bool)
Port returns the value of the "port" field in the mutation.
func (*ProxyMutation) RemoveTrafficIDs ¶
func (m *ProxyMutation) RemoveTrafficIDs(ids ...int)
RemoveTrafficIDs removes the "traffic" edge to the Traffic entity by IDs.
func (*ProxyMutation) RemovedEdges ¶
func (m *ProxyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProxyMutation) RemovedIDs ¶
func (m *ProxyMutation) 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 (*ProxyMutation) RemovedTrafficIDs ¶
func (m *ProxyMutation) RemovedTrafficIDs() (ids []int)
RemovedTraffic returns the removed IDs of the "traffic" edge to the Traffic entity.
func (*ProxyMutation) ResetActive ¶
func (m *ProxyMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*ProxyMutation) ResetCreatedAt ¶
func (m *ProxyMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProxyMutation) ResetEdge ¶
func (m *ProxyMutation) 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 (*ProxyMutation) ResetExcludeHosts ¶
func (m *ProxyMutation) ResetExcludeHosts()
ResetExcludeHosts resets all changes to the "exclude_hosts" field.
func (*ProxyMutation) ResetExcludePaths ¶
func (m *ProxyMutation) ResetExcludePaths()
ResetExcludePaths resets all changes to the "exclude_paths" field.
func (*ProxyMutation) ResetField ¶
func (m *ProxyMutation) 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 (*ProxyMutation) ResetHost ¶
func (m *ProxyMutation) ResetHost()
ResetHost resets all changes to the "host" field.
func (*ProxyMutation) ResetIncludeHosts ¶
func (m *ProxyMutation) ResetIncludeHosts()
ResetIncludeHosts resets all changes to the "include_hosts" field.
func (*ProxyMutation) ResetIncludePaths ¶
func (m *ProxyMutation) ResetIncludePaths()
ResetIncludePaths resets all changes to the "include_paths" field.
func (*ProxyMutation) ResetLastStartedAt ¶
func (m *ProxyMutation) ResetLastStartedAt()
ResetLastStartedAt resets all changes to the "last_started_at" field.
func (*ProxyMutation) ResetMitmEnabled ¶
func (m *ProxyMutation) ResetMitmEnabled()
ResetMitmEnabled resets all changes to the "mitm_enabled" field.
func (*ProxyMutation) ResetMode ¶
func (m *ProxyMutation) ResetMode()
ResetMode resets all changes to the "mode" field.
func (*ProxyMutation) ResetName ¶
func (m *ProxyMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProxyMutation) ResetOrg ¶
func (m *ProxyMutation) ResetOrg()
ResetOrg resets all changes to the "org" edge.
func (*ProxyMutation) ResetPort ¶
func (m *ProxyMutation) ResetPort()
ResetPort resets all changes to the "port" field.
func (*ProxyMutation) ResetSkipBinary ¶
func (m *ProxyMutation) ResetSkipBinary()
ResetSkipBinary resets all changes to the "skip_binary" field.
func (*ProxyMutation) ResetSkipHosts ¶
func (m *ProxyMutation) ResetSkipHosts()
ResetSkipHosts resets all changes to the "skip_hosts" field.
func (*ProxyMutation) ResetSlug ¶
func (m *ProxyMutation) ResetSlug()
ResetSlug resets all changes to the "slug" field.
func (*ProxyMutation) ResetTraffic ¶
func (m *ProxyMutation) ResetTraffic()
ResetTraffic resets all changes to the "traffic" edge.
func (*ProxyMutation) ResetUpdatedAt ¶
func (m *ProxyMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProxyMutation) ResetUpstream ¶
func (m *ProxyMutation) ResetUpstream()
ResetUpstream resets all changes to the "upstream" field.
func (*ProxyMutation) SetActive ¶
func (m *ProxyMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*ProxyMutation) SetCreatedAt ¶
func (m *ProxyMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProxyMutation) SetExcludeHosts ¶
func (m *ProxyMutation) SetExcludeHosts(s []string)
SetExcludeHosts sets the "exclude_hosts" field.
func (*ProxyMutation) SetExcludePaths ¶
func (m *ProxyMutation) SetExcludePaths(s []string)
SetExcludePaths sets the "exclude_paths" field.
func (*ProxyMutation) SetField ¶
func (m *ProxyMutation) 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 (*ProxyMutation) SetHost ¶
func (m *ProxyMutation) SetHost(s string)
SetHost sets the "host" field.
func (*ProxyMutation) SetIncludeHosts ¶
func (m *ProxyMutation) SetIncludeHosts(s []string)
SetIncludeHosts sets the "include_hosts" field.
func (*ProxyMutation) SetIncludePaths ¶
func (m *ProxyMutation) SetIncludePaths(s []string)
SetIncludePaths sets the "include_paths" field.
func (*ProxyMutation) SetLastStartedAt ¶
func (m *ProxyMutation) SetLastStartedAt(t time.Time)
SetLastStartedAt sets the "last_started_at" field.
func (*ProxyMutation) SetMitmEnabled ¶
func (m *ProxyMutation) SetMitmEnabled(b bool)
SetMitmEnabled sets the "mitm_enabled" field.
func (*ProxyMutation) SetMode ¶
func (m *ProxyMutation) SetMode(pr proxy.Mode)
SetMode sets the "mode" field.
func (*ProxyMutation) SetName ¶
func (m *ProxyMutation) SetName(s string)
SetName sets the "name" field.
func (*ProxyMutation) SetOp ¶
func (m *ProxyMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProxyMutation) SetOrgID ¶
func (m *ProxyMutation) SetOrgID(id int)
SetOrgID sets the "org" edge to the Org entity by id.
func (*ProxyMutation) SetPort ¶
func (m *ProxyMutation) SetPort(i int)
SetPort sets the "port" field.
func (*ProxyMutation) SetSkipBinary ¶
func (m *ProxyMutation) SetSkipBinary(b bool)
SetSkipBinary sets the "skip_binary" field.
func (*ProxyMutation) SetSkipHosts ¶
func (m *ProxyMutation) SetSkipHosts(s []string)
SetSkipHosts sets the "skip_hosts" field.
func (*ProxyMutation) SetSlug ¶
func (m *ProxyMutation) SetSlug(s string)
SetSlug sets the "slug" field.
func (*ProxyMutation) SetUpdatedAt ¶
func (m *ProxyMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ProxyMutation) SetUpstream ¶
func (m *ProxyMutation) SetUpstream(s string)
SetUpstream sets the "upstream" field.
func (*ProxyMutation) SkipBinary ¶
func (m *ProxyMutation) SkipBinary() (r bool, exists bool)
SkipBinary returns the value of the "skip_binary" field in the mutation.
func (*ProxyMutation) SkipHosts ¶
func (m *ProxyMutation) SkipHosts() (r []string, exists bool)
SkipHosts returns the value of the "skip_hosts" field in the mutation.
func (*ProxyMutation) SkipHostsCleared ¶
func (m *ProxyMutation) SkipHostsCleared() bool
SkipHostsCleared returns if the "skip_hosts" field was cleared in this mutation.
func (*ProxyMutation) Slug ¶
func (m *ProxyMutation) Slug() (r string, exists bool)
Slug returns the value of the "slug" field in the mutation.
func (*ProxyMutation) TrafficCleared ¶
func (m *ProxyMutation) TrafficCleared() bool
TrafficCleared reports if the "traffic" edge to the Traffic entity was cleared.
func (*ProxyMutation) TrafficIDs ¶
func (m *ProxyMutation) TrafficIDs() (ids []int)
TrafficIDs returns the "traffic" edge IDs in the mutation.
func (ProxyMutation) Tx ¶
func (m ProxyMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProxyMutation) Type ¶
func (m *ProxyMutation) Type() string
Type returns the node type of this mutation (Proxy).
func (*ProxyMutation) UpdatedAt ¶
func (m *ProxyMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProxyMutation) Upstream ¶
func (m *ProxyMutation) Upstream() (r string, exists bool)
Upstream returns the value of the "upstream" field in the mutation.
func (*ProxyMutation) UpstreamCleared ¶
func (m *ProxyMutation) UpstreamCleared() bool
UpstreamCleared returns if the "upstream" field was cleared in this mutation.
func (*ProxyMutation) Where ¶
func (m *ProxyMutation) Where(ps ...predicate.Proxy)
Where appends a list predicates to the ProxyMutation builder.
func (*ProxyMutation) WhereP ¶
func (m *ProxyMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProxyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProxyQuery ¶
type ProxyQuery struct {
// contains filtered or unexported fields
}
ProxyQuery is the builder for querying Proxy entities.
func (*ProxyQuery) Aggregate ¶
func (_q *ProxyQuery) Aggregate(fns ...AggregateFunc) *ProxySelect
Aggregate returns a ProxySelect configured with the given aggregations.
func (*ProxyQuery) All ¶
func (_q *ProxyQuery) All(ctx context.Context) ([]*Proxy, error)
All executes the query and returns a list of Proxies.
func (*ProxyQuery) AllX ¶
func (_q *ProxyQuery) AllX(ctx context.Context) []*Proxy
AllX is like All, but panics if an error occurs.
func (*ProxyQuery) Clone ¶
func (_q *ProxyQuery) Clone() *ProxyQuery
Clone returns a duplicate of the ProxyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProxyQuery) Count ¶
func (_q *ProxyQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProxyQuery) CountX ¶
func (_q *ProxyQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProxyQuery) Exist ¶
func (_q *ProxyQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProxyQuery) ExistX ¶
func (_q *ProxyQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProxyQuery) First ¶
func (_q *ProxyQuery) First(ctx context.Context) (*Proxy, error)
First returns the first Proxy entity from the query. Returns a *NotFoundError when no Proxy was found.
func (*ProxyQuery) FirstID ¶
func (_q *ProxyQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Proxy ID from the query. Returns a *NotFoundError when no Proxy ID was found.
func (*ProxyQuery) FirstIDX ¶
func (_q *ProxyQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProxyQuery) FirstX ¶
func (_q *ProxyQuery) FirstX(ctx context.Context) *Proxy
FirstX is like First, but panics if an error occurs.
func (*ProxyQuery) GroupBy ¶
func (_q *ProxyQuery) GroupBy(field string, fields ...string) *ProxyGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
Name string `json:"name,omitempty"`
Count int `json:"count,omitempty"`
}
client.Proxy.Query().
GroupBy(proxy.FieldName).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*ProxyQuery) IDs ¶
func (_q *ProxyQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Proxy IDs.
func (*ProxyQuery) IDsX ¶
func (_q *ProxyQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProxyQuery) Limit ¶
func (_q *ProxyQuery) Limit(limit int) *ProxyQuery
Limit the number of records to be returned by this query.
func (*ProxyQuery) Offset ¶
func (_q *ProxyQuery) Offset(offset int) *ProxyQuery
Offset to start from.
func (*ProxyQuery) Only ¶
func (_q *ProxyQuery) Only(ctx context.Context) (*Proxy, error)
Only returns a single Proxy entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Proxy entity is found. Returns a *NotFoundError when no Proxy entities are found.
func (*ProxyQuery) OnlyID ¶
func (_q *ProxyQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Proxy ID in the query. Returns a *NotSingularError when more than one Proxy ID is found. Returns a *NotFoundError when no entities are found.
func (*ProxyQuery) OnlyIDX ¶
func (_q *ProxyQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProxyQuery) OnlyX ¶
func (_q *ProxyQuery) OnlyX(ctx context.Context) *Proxy
OnlyX is like Only, but panics if an error occurs.
func (*ProxyQuery) Order ¶
func (_q *ProxyQuery) Order(o ...proxy.OrderOption) *ProxyQuery
Order specifies how the records should be ordered.
func (*ProxyQuery) QueryOrg ¶
func (_q *ProxyQuery) QueryOrg() *OrgQuery
QueryOrg chains the current query on the "org" edge.
func (*ProxyQuery) QueryTraffic ¶
func (_q *ProxyQuery) QueryTraffic() *TrafficQuery
QueryTraffic chains the current query on the "traffic" edge.
func (*ProxyQuery) Select ¶
func (_q *ProxyQuery) Select(fields ...string) *ProxySelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
Name string `json:"name,omitempty"`
}
client.Proxy.Query().
Select(proxy.FieldName).
Scan(ctx, &v)
func (*ProxyQuery) Unique ¶
func (_q *ProxyQuery) Unique(unique bool) *ProxyQuery
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 (*ProxyQuery) Where ¶
func (_q *ProxyQuery) Where(ps ...predicate.Proxy) *ProxyQuery
Where adds a new predicate for the ProxyQuery builder.
func (*ProxyQuery) WithOrg ¶
func (_q *ProxyQuery) WithOrg(opts ...func(*OrgQuery)) *ProxyQuery
WithOrg tells the query-builder to eager-load the nodes that are connected to the "org" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProxyQuery) WithTraffic ¶
func (_q *ProxyQuery) WithTraffic(opts ...func(*TrafficQuery)) *ProxyQuery
WithTraffic tells the query-builder to eager-load the nodes that are connected to the "traffic" edge. The optional arguments are used to configure the query builder of the edge.
type ProxySelect ¶
type ProxySelect struct {
*ProxyQuery
// contains filtered or unexported fields
}
ProxySelect is the builder for selecting fields of Proxy entities.
func (*ProxySelect) Aggregate ¶
func (_s *ProxySelect) Aggregate(fns ...AggregateFunc) *ProxySelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProxySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProxySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProxySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProxySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProxySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProxySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProxySelect) Scan ¶
func (_s *ProxySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProxySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProxyUpdate ¶
type ProxyUpdate struct {
// contains filtered or unexported fields
}
ProxyUpdate is the builder for updating Proxy entities.
func (*ProxyUpdate) AddPort ¶
func (_u *ProxyUpdate) AddPort(v int) *ProxyUpdate
AddPort adds value to the "port" field.
func (*ProxyUpdate) AddTraffic ¶
func (_u *ProxyUpdate) AddTraffic(v ...*Traffic) *ProxyUpdate
AddTraffic adds the "traffic" edges to the Traffic entity.
func (*ProxyUpdate) AddTrafficIDs ¶
func (_u *ProxyUpdate) AddTrafficIDs(ids ...int) *ProxyUpdate
AddTrafficIDs adds the "traffic" edge to the Traffic entity by IDs.
func (*ProxyUpdate) AppendExcludeHosts ¶
func (_u *ProxyUpdate) AppendExcludeHosts(v []string) *ProxyUpdate
AppendExcludeHosts appends value to the "exclude_hosts" field.
func (*ProxyUpdate) AppendExcludePaths ¶
func (_u *ProxyUpdate) AppendExcludePaths(v []string) *ProxyUpdate
AppendExcludePaths appends value to the "exclude_paths" field.
func (*ProxyUpdate) AppendIncludeHosts ¶
func (_u *ProxyUpdate) AppendIncludeHosts(v []string) *ProxyUpdate
AppendIncludeHosts appends value to the "include_hosts" field.
func (*ProxyUpdate) AppendIncludePaths ¶
func (_u *ProxyUpdate) AppendIncludePaths(v []string) *ProxyUpdate
AppendIncludePaths appends value to the "include_paths" field.
func (*ProxyUpdate) AppendSkipHosts ¶
func (_u *ProxyUpdate) AppendSkipHosts(v []string) *ProxyUpdate
AppendSkipHosts appends value to the "skip_hosts" field.
func (*ProxyUpdate) ClearExcludeHosts ¶
func (_u *ProxyUpdate) ClearExcludeHosts() *ProxyUpdate
ClearExcludeHosts clears the value of the "exclude_hosts" field.
func (*ProxyUpdate) ClearExcludePaths ¶
func (_u *ProxyUpdate) ClearExcludePaths() *ProxyUpdate
ClearExcludePaths clears the value of the "exclude_paths" field.
func (*ProxyUpdate) ClearIncludeHosts ¶
func (_u *ProxyUpdate) ClearIncludeHosts() *ProxyUpdate
ClearIncludeHosts clears the value of the "include_hosts" field.
func (*ProxyUpdate) ClearIncludePaths ¶
func (_u *ProxyUpdate) ClearIncludePaths() *ProxyUpdate
ClearIncludePaths clears the value of the "include_paths" field.
func (*ProxyUpdate) ClearLastStartedAt ¶
func (_u *ProxyUpdate) ClearLastStartedAt() *ProxyUpdate
ClearLastStartedAt clears the value of the "last_started_at" field.
func (*ProxyUpdate) ClearOrg ¶
func (_u *ProxyUpdate) ClearOrg() *ProxyUpdate
ClearOrg clears the "org" edge to the Org entity.
func (*ProxyUpdate) ClearSkipHosts ¶
func (_u *ProxyUpdate) ClearSkipHosts() *ProxyUpdate
ClearSkipHosts clears the value of the "skip_hosts" field.
func (*ProxyUpdate) ClearTraffic ¶
func (_u *ProxyUpdate) ClearTraffic() *ProxyUpdate
ClearTraffic clears all "traffic" edges to the Traffic entity.
func (*ProxyUpdate) ClearUpstream ¶
func (_u *ProxyUpdate) ClearUpstream() *ProxyUpdate
ClearUpstream clears the value of the "upstream" field.
func (*ProxyUpdate) Exec ¶
func (_u *ProxyUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProxyUpdate) ExecX ¶
func (_u *ProxyUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProxyUpdate) Mutation ¶
func (_u *ProxyUpdate) Mutation() *ProxyMutation
Mutation returns the ProxyMutation object of the builder.
func (*ProxyUpdate) RemoveTraffic ¶
func (_u *ProxyUpdate) RemoveTraffic(v ...*Traffic) *ProxyUpdate
RemoveTraffic removes "traffic" edges to Traffic entities.
func (*ProxyUpdate) RemoveTrafficIDs ¶
func (_u *ProxyUpdate) RemoveTrafficIDs(ids ...int) *ProxyUpdate
RemoveTrafficIDs removes the "traffic" edge to Traffic entities by IDs.
func (*ProxyUpdate) Save ¶
func (_u *ProxyUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProxyUpdate) SaveX ¶
func (_u *ProxyUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProxyUpdate) SetActive ¶
func (_u *ProxyUpdate) SetActive(v bool) *ProxyUpdate
SetActive sets the "active" field.
func (*ProxyUpdate) SetExcludeHosts ¶
func (_u *ProxyUpdate) SetExcludeHosts(v []string) *ProxyUpdate
SetExcludeHosts sets the "exclude_hosts" field.
func (*ProxyUpdate) SetExcludePaths ¶
func (_u *ProxyUpdate) SetExcludePaths(v []string) *ProxyUpdate
SetExcludePaths sets the "exclude_paths" field.
func (*ProxyUpdate) SetHost ¶
func (_u *ProxyUpdate) SetHost(v string) *ProxyUpdate
SetHost sets the "host" field.
func (*ProxyUpdate) SetIncludeHosts ¶
func (_u *ProxyUpdate) SetIncludeHosts(v []string) *ProxyUpdate
SetIncludeHosts sets the "include_hosts" field.
func (*ProxyUpdate) SetIncludePaths ¶
func (_u *ProxyUpdate) SetIncludePaths(v []string) *ProxyUpdate
SetIncludePaths sets the "include_paths" field.
func (*ProxyUpdate) SetLastStartedAt ¶
func (_u *ProxyUpdate) SetLastStartedAt(v time.Time) *ProxyUpdate
SetLastStartedAt sets the "last_started_at" field.
func (*ProxyUpdate) SetMitmEnabled ¶
func (_u *ProxyUpdate) SetMitmEnabled(v bool) *ProxyUpdate
SetMitmEnabled sets the "mitm_enabled" field.
func (*ProxyUpdate) SetMode ¶
func (_u *ProxyUpdate) SetMode(v proxy.Mode) *ProxyUpdate
SetMode sets the "mode" field.
func (*ProxyUpdate) SetName ¶
func (_u *ProxyUpdate) SetName(v string) *ProxyUpdate
SetName sets the "name" field.
func (*ProxyUpdate) SetNillableActive ¶
func (_u *ProxyUpdate) SetNillableActive(v *bool) *ProxyUpdate
SetNillableActive sets the "active" field if the given value is not nil.
func (*ProxyUpdate) SetNillableHost ¶
func (_u *ProxyUpdate) SetNillableHost(v *string) *ProxyUpdate
SetNillableHost sets the "host" field if the given value is not nil.
func (*ProxyUpdate) SetNillableLastStartedAt ¶
func (_u *ProxyUpdate) SetNillableLastStartedAt(v *time.Time) *ProxyUpdate
SetNillableLastStartedAt sets the "last_started_at" field if the given value is not nil.
func (*ProxyUpdate) SetNillableMitmEnabled ¶
func (_u *ProxyUpdate) SetNillableMitmEnabled(v *bool) *ProxyUpdate
SetNillableMitmEnabled sets the "mitm_enabled" field if the given value is not nil.
func (*ProxyUpdate) SetNillableMode ¶
func (_u *ProxyUpdate) SetNillableMode(v *proxy.Mode) *ProxyUpdate
SetNillableMode sets the "mode" field if the given value is not nil.
func (*ProxyUpdate) SetNillableName ¶
func (_u *ProxyUpdate) SetNillableName(v *string) *ProxyUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProxyUpdate) SetNillablePort ¶
func (_u *ProxyUpdate) SetNillablePort(v *int) *ProxyUpdate
SetNillablePort sets the "port" field if the given value is not nil.
func (*ProxyUpdate) SetNillableSkipBinary ¶
func (_u *ProxyUpdate) SetNillableSkipBinary(v *bool) *ProxyUpdate
SetNillableSkipBinary sets the "skip_binary" field if the given value is not nil.
func (*ProxyUpdate) SetNillableSlug ¶
func (_u *ProxyUpdate) SetNillableSlug(v *string) *ProxyUpdate
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*ProxyUpdate) SetNillableUpstream ¶
func (_u *ProxyUpdate) SetNillableUpstream(v *string) *ProxyUpdate
SetNillableUpstream sets the "upstream" field if the given value is not nil.
func (*ProxyUpdate) SetOrg ¶
func (_u *ProxyUpdate) SetOrg(v *Org) *ProxyUpdate
SetOrg sets the "org" edge to the Org entity.
func (*ProxyUpdate) SetOrgID ¶
func (_u *ProxyUpdate) SetOrgID(id int) *ProxyUpdate
SetOrgID sets the "org" edge to the Org entity by ID.
func (*ProxyUpdate) SetPort ¶
func (_u *ProxyUpdate) SetPort(v int) *ProxyUpdate
SetPort sets the "port" field.
func (*ProxyUpdate) SetSkipBinary ¶
func (_u *ProxyUpdate) SetSkipBinary(v bool) *ProxyUpdate
SetSkipBinary sets the "skip_binary" field.
func (*ProxyUpdate) SetSkipHosts ¶
func (_u *ProxyUpdate) SetSkipHosts(v []string) *ProxyUpdate
SetSkipHosts sets the "skip_hosts" field.
func (*ProxyUpdate) SetSlug ¶
func (_u *ProxyUpdate) SetSlug(v string) *ProxyUpdate
SetSlug sets the "slug" field.
func (*ProxyUpdate) SetUpdatedAt ¶
func (_u *ProxyUpdate) SetUpdatedAt(v time.Time) *ProxyUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProxyUpdate) SetUpstream ¶
func (_u *ProxyUpdate) SetUpstream(v string) *ProxyUpdate
SetUpstream sets the "upstream" field.
func (*ProxyUpdate) Where ¶
func (_u *ProxyUpdate) Where(ps ...predicate.Proxy) *ProxyUpdate
Where appends a list predicates to the ProxyUpdate builder.
type ProxyUpdateOne ¶
type ProxyUpdateOne struct {
// contains filtered or unexported fields
}
ProxyUpdateOne is the builder for updating a single Proxy entity.
func (*ProxyUpdateOne) AddPort ¶
func (_u *ProxyUpdateOne) AddPort(v int) *ProxyUpdateOne
AddPort adds value to the "port" field.
func (*ProxyUpdateOne) AddTraffic ¶
func (_u *ProxyUpdateOne) AddTraffic(v ...*Traffic) *ProxyUpdateOne
AddTraffic adds the "traffic" edges to the Traffic entity.
func (*ProxyUpdateOne) AddTrafficIDs ¶
func (_u *ProxyUpdateOne) AddTrafficIDs(ids ...int) *ProxyUpdateOne
AddTrafficIDs adds the "traffic" edge to the Traffic entity by IDs.
func (*ProxyUpdateOne) AppendExcludeHosts ¶
func (_u *ProxyUpdateOne) AppendExcludeHosts(v []string) *ProxyUpdateOne
AppendExcludeHosts appends value to the "exclude_hosts" field.
func (*ProxyUpdateOne) AppendExcludePaths ¶
func (_u *ProxyUpdateOne) AppendExcludePaths(v []string) *ProxyUpdateOne
AppendExcludePaths appends value to the "exclude_paths" field.
func (*ProxyUpdateOne) AppendIncludeHosts ¶
func (_u *ProxyUpdateOne) AppendIncludeHosts(v []string) *ProxyUpdateOne
AppendIncludeHosts appends value to the "include_hosts" field.
func (*ProxyUpdateOne) AppendIncludePaths ¶
func (_u *ProxyUpdateOne) AppendIncludePaths(v []string) *ProxyUpdateOne
AppendIncludePaths appends value to the "include_paths" field.
func (*ProxyUpdateOne) AppendSkipHosts ¶
func (_u *ProxyUpdateOne) AppendSkipHosts(v []string) *ProxyUpdateOne
AppendSkipHosts appends value to the "skip_hosts" field.
func (*ProxyUpdateOne) ClearExcludeHosts ¶
func (_u *ProxyUpdateOne) ClearExcludeHosts() *ProxyUpdateOne
ClearExcludeHosts clears the value of the "exclude_hosts" field.
func (*ProxyUpdateOne) ClearExcludePaths ¶
func (_u *ProxyUpdateOne) ClearExcludePaths() *ProxyUpdateOne
ClearExcludePaths clears the value of the "exclude_paths" field.
func (*ProxyUpdateOne) ClearIncludeHosts ¶
func (_u *ProxyUpdateOne) ClearIncludeHosts() *ProxyUpdateOne
ClearIncludeHosts clears the value of the "include_hosts" field.
func (*ProxyUpdateOne) ClearIncludePaths ¶
func (_u *ProxyUpdateOne) ClearIncludePaths() *ProxyUpdateOne
ClearIncludePaths clears the value of the "include_paths" field.
func (*ProxyUpdateOne) ClearLastStartedAt ¶
func (_u *ProxyUpdateOne) ClearLastStartedAt() *ProxyUpdateOne
ClearLastStartedAt clears the value of the "last_started_at" field.
func (*ProxyUpdateOne) ClearOrg ¶
func (_u *ProxyUpdateOne) ClearOrg() *ProxyUpdateOne
ClearOrg clears the "org" edge to the Org entity.
func (*ProxyUpdateOne) ClearSkipHosts ¶
func (_u *ProxyUpdateOne) ClearSkipHosts() *ProxyUpdateOne
ClearSkipHosts clears the value of the "skip_hosts" field.
func (*ProxyUpdateOne) ClearTraffic ¶
func (_u *ProxyUpdateOne) ClearTraffic() *ProxyUpdateOne
ClearTraffic clears all "traffic" edges to the Traffic entity.
func (*ProxyUpdateOne) ClearUpstream ¶
func (_u *ProxyUpdateOne) ClearUpstream() *ProxyUpdateOne
ClearUpstream clears the value of the "upstream" field.
func (*ProxyUpdateOne) Exec ¶
func (_u *ProxyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProxyUpdateOne) ExecX ¶
func (_u *ProxyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProxyUpdateOne) Mutation ¶
func (_u *ProxyUpdateOne) Mutation() *ProxyMutation
Mutation returns the ProxyMutation object of the builder.
func (*ProxyUpdateOne) RemoveTraffic ¶
func (_u *ProxyUpdateOne) RemoveTraffic(v ...*Traffic) *ProxyUpdateOne
RemoveTraffic removes "traffic" edges to Traffic entities.
func (*ProxyUpdateOne) RemoveTrafficIDs ¶
func (_u *ProxyUpdateOne) RemoveTrafficIDs(ids ...int) *ProxyUpdateOne
RemoveTrafficIDs removes the "traffic" edge to Traffic entities by IDs.
func (*ProxyUpdateOne) Save ¶
func (_u *ProxyUpdateOne) Save(ctx context.Context) (*Proxy, error)
Save executes the query and returns the updated Proxy entity.
func (*ProxyUpdateOne) SaveX ¶
func (_u *ProxyUpdateOne) SaveX(ctx context.Context) *Proxy
SaveX is like Save, but panics if an error occurs.
func (*ProxyUpdateOne) Select ¶
func (_u *ProxyUpdateOne) Select(field string, fields ...string) *ProxyUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProxyUpdateOne) SetActive ¶
func (_u *ProxyUpdateOne) SetActive(v bool) *ProxyUpdateOne
SetActive sets the "active" field.
func (*ProxyUpdateOne) SetExcludeHosts ¶
func (_u *ProxyUpdateOne) SetExcludeHosts(v []string) *ProxyUpdateOne
SetExcludeHosts sets the "exclude_hosts" field.
func (*ProxyUpdateOne) SetExcludePaths ¶
func (_u *ProxyUpdateOne) SetExcludePaths(v []string) *ProxyUpdateOne
SetExcludePaths sets the "exclude_paths" field.
func (*ProxyUpdateOne) SetHost ¶
func (_u *ProxyUpdateOne) SetHost(v string) *ProxyUpdateOne
SetHost sets the "host" field.
func (*ProxyUpdateOne) SetIncludeHosts ¶
func (_u *ProxyUpdateOne) SetIncludeHosts(v []string) *ProxyUpdateOne
SetIncludeHosts sets the "include_hosts" field.
func (*ProxyUpdateOne) SetIncludePaths ¶
func (_u *ProxyUpdateOne) SetIncludePaths(v []string) *ProxyUpdateOne
SetIncludePaths sets the "include_paths" field.
func (*ProxyUpdateOne) SetLastStartedAt ¶
func (_u *ProxyUpdateOne) SetLastStartedAt(v time.Time) *ProxyUpdateOne
SetLastStartedAt sets the "last_started_at" field.
func (*ProxyUpdateOne) SetMitmEnabled ¶
func (_u *ProxyUpdateOne) SetMitmEnabled(v bool) *ProxyUpdateOne
SetMitmEnabled sets the "mitm_enabled" field.
func (*ProxyUpdateOne) SetMode ¶
func (_u *ProxyUpdateOne) SetMode(v proxy.Mode) *ProxyUpdateOne
SetMode sets the "mode" field.
func (*ProxyUpdateOne) SetName ¶
func (_u *ProxyUpdateOne) SetName(v string) *ProxyUpdateOne
SetName sets the "name" field.
func (*ProxyUpdateOne) SetNillableActive ¶
func (_u *ProxyUpdateOne) SetNillableActive(v *bool) *ProxyUpdateOne
SetNillableActive sets the "active" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableHost ¶
func (_u *ProxyUpdateOne) SetNillableHost(v *string) *ProxyUpdateOne
SetNillableHost sets the "host" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableLastStartedAt ¶
func (_u *ProxyUpdateOne) SetNillableLastStartedAt(v *time.Time) *ProxyUpdateOne
SetNillableLastStartedAt sets the "last_started_at" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableMitmEnabled ¶
func (_u *ProxyUpdateOne) SetNillableMitmEnabled(v *bool) *ProxyUpdateOne
SetNillableMitmEnabled sets the "mitm_enabled" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableMode ¶
func (_u *ProxyUpdateOne) SetNillableMode(v *proxy.Mode) *ProxyUpdateOne
SetNillableMode sets the "mode" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableName ¶
func (_u *ProxyUpdateOne) SetNillableName(v *string) *ProxyUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillablePort ¶
func (_u *ProxyUpdateOne) SetNillablePort(v *int) *ProxyUpdateOne
SetNillablePort sets the "port" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableSkipBinary ¶
func (_u *ProxyUpdateOne) SetNillableSkipBinary(v *bool) *ProxyUpdateOne
SetNillableSkipBinary sets the "skip_binary" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableSlug ¶
func (_u *ProxyUpdateOne) SetNillableSlug(v *string) *ProxyUpdateOne
SetNillableSlug sets the "slug" field if the given value is not nil.
func (*ProxyUpdateOne) SetNillableUpstream ¶
func (_u *ProxyUpdateOne) SetNillableUpstream(v *string) *ProxyUpdateOne
SetNillableUpstream sets the "upstream" field if the given value is not nil.
func (*ProxyUpdateOne) SetOrg ¶
func (_u *ProxyUpdateOne) SetOrg(v *Org) *ProxyUpdateOne
SetOrg sets the "org" edge to the Org entity.
func (*ProxyUpdateOne) SetOrgID ¶
func (_u *ProxyUpdateOne) SetOrgID(id int) *ProxyUpdateOne
SetOrgID sets the "org" edge to the Org entity by ID.
func (*ProxyUpdateOne) SetPort ¶
func (_u *ProxyUpdateOne) SetPort(v int) *ProxyUpdateOne
SetPort sets the "port" field.
func (*ProxyUpdateOne) SetSkipBinary ¶
func (_u *ProxyUpdateOne) SetSkipBinary(v bool) *ProxyUpdateOne
SetSkipBinary sets the "skip_binary" field.
func (*ProxyUpdateOne) SetSkipHosts ¶
func (_u *ProxyUpdateOne) SetSkipHosts(v []string) *ProxyUpdateOne
SetSkipHosts sets the "skip_hosts" field.
func (*ProxyUpdateOne) SetSlug ¶
func (_u *ProxyUpdateOne) SetSlug(v string) *ProxyUpdateOne
SetSlug sets the "slug" field.
func (*ProxyUpdateOne) SetUpdatedAt ¶
func (_u *ProxyUpdateOne) SetUpdatedAt(v time.Time) *ProxyUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProxyUpdateOne) SetUpstream ¶
func (_u *ProxyUpdateOne) SetUpstream(v string) *ProxyUpdateOne
SetUpstream sets the "upstream" field.
func (*ProxyUpdateOne) Where ¶
func (_u *ProxyUpdateOne) Where(ps ...predicate.Proxy) *ProxyUpdateOne
Where appends a list predicates to the ProxyUpdate builder.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type 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 Session ¶
type Session struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Session token (hashed)
Token string `json:"-"`
// IP address of the client
IPAddress string `json:"ip_address,omitempty"`
// User agent string
UserAgent string `json:"user_agent,omitempty"`
// When the session expires
ExpiresAt time.Time `json:"expires_at,omitempty"`
// Last activity time
LastActiveAt time.Time `json:"last_active_at,omitempty"`
// When the session was created
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the SessionQuery when eager-loading is set.
Edges SessionEdges `json:"edges"`
// contains filtered or unexported fields
}
Session is the model entity for the Session schema.
func (*Session) Unwrap ¶
Unwrap unwraps the Session 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 (*Session) Update ¶
func (_m *Session) Update() *SessionUpdateOne
Update returns a builder for updating this Session. Note that you need to call Session.Unwrap() before calling this method if this Session was returned from a transaction, and the transaction was committed or rolled back.
type SessionClient ¶
type SessionClient struct {
// contains filtered or unexported fields
}
SessionClient is a client for the Session schema.
func NewSessionClient ¶
func NewSessionClient(c config) *SessionClient
NewSessionClient returns a client for the Session from the given config.
func (*SessionClient) Create ¶
func (c *SessionClient) Create() *SessionCreate
Create returns a builder for creating a Session entity.
func (*SessionClient) CreateBulk ¶
func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk
CreateBulk returns a builder for creating a bulk of Session entities.
func (*SessionClient) Delete ¶
func (c *SessionClient) Delete() *SessionDelete
Delete returns a delete builder for Session.
func (*SessionClient) DeleteOne ¶
func (c *SessionClient) DeleteOne(_m *Session) *SessionDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SessionClient) DeleteOneID ¶
func (c *SessionClient) DeleteOneID(id int) *SessionDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SessionClient) GetX ¶
func (c *SessionClient) GetX(ctx context.Context, id int) *Session
GetX is like Get, but panics if an error occurs.
func (*SessionClient) Hooks ¶
func (c *SessionClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SessionClient) Intercept ¶
func (c *SessionClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `session.Intercept(f(g(h())))`.
func (*SessionClient) Interceptors ¶
func (c *SessionClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SessionClient) MapCreateBulk ¶
func (c *SessionClient) MapCreateBulk(slice any, setFunc func(*SessionCreate, int)) *SessionCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*SessionClient) Query ¶
func (c *SessionClient) Query() *SessionQuery
Query returns a query builder for Session.
func (*SessionClient) QueryUser ¶
func (c *SessionClient) QueryUser(_m *Session) *UserQuery
QueryUser queries the user edge of a Session.
func (*SessionClient) Update ¶
func (c *SessionClient) Update() *SessionUpdate
Update returns an update builder for Session.
func (*SessionClient) UpdateOne ¶
func (c *SessionClient) UpdateOne(_m *Session) *SessionUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SessionClient) UpdateOneID ¶
func (c *SessionClient) UpdateOneID(id int) *SessionUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SessionClient) Use ¶
func (c *SessionClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `session.Hooks(f(g(h())))`.
type SessionCreate ¶
type SessionCreate struct {
// contains filtered or unexported fields
}
SessionCreate is the builder for creating a Session entity.
func (*SessionCreate) Exec ¶
func (_c *SessionCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SessionCreate) ExecX ¶
func (_c *SessionCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SessionCreate) Mutation ¶
func (_c *SessionCreate) Mutation() *SessionMutation
Mutation returns the SessionMutation object of the builder.
func (*SessionCreate) Save ¶
func (_c *SessionCreate) Save(ctx context.Context) (*Session, error)
Save creates the Session in the database.
func (*SessionCreate) SaveX ¶
func (_c *SessionCreate) SaveX(ctx context.Context) *Session
SaveX calls Save and panics if Save returns an error.
func (*SessionCreate) SetCreatedAt ¶
func (_c *SessionCreate) SetCreatedAt(v time.Time) *SessionCreate
SetCreatedAt sets the "created_at" field.
func (*SessionCreate) SetExpiresAt ¶
func (_c *SessionCreate) SetExpiresAt(v time.Time) *SessionCreate
SetExpiresAt sets the "expires_at" field.
func (*SessionCreate) SetIPAddress ¶
func (_c *SessionCreate) SetIPAddress(v string) *SessionCreate
SetIPAddress sets the "ip_address" field.
func (*SessionCreate) SetLastActiveAt ¶
func (_c *SessionCreate) SetLastActiveAt(v time.Time) *SessionCreate
SetLastActiveAt sets the "last_active_at" field.
func (*SessionCreate) SetNillableCreatedAt ¶
func (_c *SessionCreate) SetNillableCreatedAt(v *time.Time) *SessionCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*SessionCreate) SetNillableIPAddress ¶
func (_c *SessionCreate) SetNillableIPAddress(v *string) *SessionCreate
SetNillableIPAddress sets the "ip_address" field if the given value is not nil.
func (*SessionCreate) SetNillableLastActiveAt ¶
func (_c *SessionCreate) SetNillableLastActiveAt(v *time.Time) *SessionCreate
SetNillableLastActiveAt sets the "last_active_at" field if the given value is not nil.
func (*SessionCreate) SetNillableUserAgent ¶
func (_c *SessionCreate) SetNillableUserAgent(v *string) *SessionCreate
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*SessionCreate) SetToken ¶
func (_c *SessionCreate) SetToken(v string) *SessionCreate
SetToken sets the "token" field.
func (*SessionCreate) SetUser ¶
func (_c *SessionCreate) SetUser(v *User) *SessionCreate
SetUser sets the "user" edge to the User entity.
func (*SessionCreate) SetUserAgent ¶
func (_c *SessionCreate) SetUserAgent(v string) *SessionCreate
SetUserAgent sets the "user_agent" field.
func (*SessionCreate) SetUserID ¶
func (_c *SessionCreate) SetUserID(id int) *SessionCreate
SetUserID sets the "user" edge to the User entity by ID.
type SessionCreateBulk ¶
type SessionCreateBulk struct {
// contains filtered or unexported fields
}
SessionCreateBulk is the builder for creating many Session entities in bulk.
func (*SessionCreateBulk) Exec ¶
func (_c *SessionCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SessionCreateBulk) ExecX ¶
func (_c *SessionCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SessionDelete ¶
type SessionDelete struct {
// contains filtered or unexported fields
}
SessionDelete is the builder for deleting a Session entity.
func (*SessionDelete) Exec ¶
func (_d *SessionDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SessionDelete) ExecX ¶
func (_d *SessionDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SessionDelete) Where ¶
func (_d *SessionDelete) Where(ps ...predicate.Session) *SessionDelete
Where appends a list predicates to the SessionDelete builder.
type SessionDeleteOne ¶
type SessionDeleteOne struct {
// contains filtered or unexported fields
}
SessionDeleteOne is the builder for deleting a single Session entity.
func (*SessionDeleteOne) Exec ¶
func (_d *SessionDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SessionDeleteOne) ExecX ¶
func (_d *SessionDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SessionDeleteOne) Where ¶
func (_d *SessionDeleteOne) Where(ps ...predicate.Session) *SessionDeleteOne
Where appends a list predicates to the SessionDelete builder.
type SessionEdges ¶
type SessionEdges struct {
// User who owns this session
User *User `json:"user,omitempty"`
// contains filtered or unexported fields
}
SessionEdges holds the relations/edges for other nodes in the graph.
func (SessionEdges) UserOrErr ¶
func (e SessionEdges) UserOrErr() (*User, error)
UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type SessionGroupBy ¶
type SessionGroupBy struct {
// contains filtered or unexported fields
}
SessionGroupBy is the group-by builder for Session entities.
func (*SessionGroupBy) Aggregate ¶
func (_g *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SessionGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SessionGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SessionGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SessionGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SessionGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SessionGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SessionGroupBy) Scan ¶
func (_g *SessionGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SessionGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SessionMutation ¶
type SessionMutation struct {
// contains filtered or unexported fields
}
SessionMutation represents an operation that mutates the Session nodes in the graph.
func (*SessionMutation) AddField ¶
func (m *SessionMutation) 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 (*SessionMutation) AddedEdges ¶
func (m *SessionMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SessionMutation) AddedField ¶
func (m *SessionMutation) 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 (*SessionMutation) AddedFields ¶
func (m *SessionMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SessionMutation) AddedIDs ¶
func (m *SessionMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SessionMutation) ClearEdge ¶
func (m *SessionMutation) 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 (*SessionMutation) ClearField ¶
func (m *SessionMutation) 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 (*SessionMutation) ClearIPAddress ¶
func (m *SessionMutation) ClearIPAddress()
ClearIPAddress clears the value of the "ip_address" field.
func (*SessionMutation) ClearUser ¶
func (m *SessionMutation) ClearUser()
ClearUser clears the "user" edge to the User entity.
func (*SessionMutation) ClearUserAgent ¶
func (m *SessionMutation) ClearUserAgent()
ClearUserAgent clears the value of the "user_agent" field.
func (*SessionMutation) ClearedEdges ¶
func (m *SessionMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SessionMutation) ClearedFields ¶
func (m *SessionMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SessionMutation) Client ¶
func (m SessionMutation) 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 (*SessionMutation) CreatedAt ¶
func (m *SessionMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*SessionMutation) EdgeCleared ¶
func (m *SessionMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SessionMutation) ExpiresAt ¶
func (m *SessionMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*SessionMutation) Field ¶
func (m *SessionMutation) 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 (*SessionMutation) FieldCleared ¶
func (m *SessionMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SessionMutation) Fields ¶
func (m *SessionMutation) 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 (*SessionMutation) ID ¶
func (m *SessionMutation) 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 (*SessionMutation) IDs ¶
func (m *SessionMutation) 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 (*SessionMutation) IPAddress ¶
func (m *SessionMutation) IPAddress() (r string, exists bool)
IPAddress returns the value of the "ip_address" field in the mutation.
func (*SessionMutation) IPAddressCleared ¶
func (m *SessionMutation) IPAddressCleared() bool
IPAddressCleared returns if the "ip_address" field was cleared in this mutation.
func (*SessionMutation) LastActiveAt ¶
func (m *SessionMutation) LastActiveAt() (r time.Time, exists bool)
LastActiveAt returns the value of the "last_active_at" field in the mutation.
func (*SessionMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Session entity. If the Session 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 (*SessionMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the Session entity. If the Session 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 (*SessionMutation) 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 (*SessionMutation) OldIPAddress ¶
func (m *SessionMutation) OldIPAddress(ctx context.Context) (v string, err error)
OldIPAddress returns the old "ip_address" field's value of the Session entity. If the Session 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 (*SessionMutation) OldLastActiveAt ¶
OldLastActiveAt returns the old "last_active_at" field's value of the Session entity. If the Session 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 (*SessionMutation) OldToken ¶
func (m *SessionMutation) OldToken(ctx context.Context) (v string, err error)
OldToken returns the old "token" field's value of the Session entity. If the Session 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 (*SessionMutation) OldUserAgent ¶
func (m *SessionMutation) OldUserAgent(ctx context.Context) (v string, err error)
OldUserAgent returns the old "user_agent" field's value of the Session entity. If the Session 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 (*SessionMutation) RemovedEdges ¶
func (m *SessionMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SessionMutation) RemovedIDs ¶
func (m *SessionMutation) 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 (*SessionMutation) ResetCreatedAt ¶
func (m *SessionMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*SessionMutation) ResetEdge ¶
func (m *SessionMutation) 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 (*SessionMutation) ResetExpiresAt ¶
func (m *SessionMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*SessionMutation) ResetField ¶
func (m *SessionMutation) 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 (*SessionMutation) ResetIPAddress ¶
func (m *SessionMutation) ResetIPAddress()
ResetIPAddress resets all changes to the "ip_address" field.
func (*SessionMutation) ResetLastActiveAt ¶
func (m *SessionMutation) ResetLastActiveAt()
ResetLastActiveAt resets all changes to the "last_active_at" field.
func (*SessionMutation) ResetToken ¶
func (m *SessionMutation) ResetToken()
ResetToken resets all changes to the "token" field.
func (*SessionMutation) ResetUser ¶
func (m *SessionMutation) ResetUser()
ResetUser resets all changes to the "user" edge.
func (*SessionMutation) ResetUserAgent ¶
func (m *SessionMutation) ResetUserAgent()
ResetUserAgent resets all changes to the "user_agent" field.
func (*SessionMutation) SetCreatedAt ¶
func (m *SessionMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*SessionMutation) SetExpiresAt ¶
func (m *SessionMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*SessionMutation) SetField ¶
func (m *SessionMutation) 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 (*SessionMutation) SetIPAddress ¶
func (m *SessionMutation) SetIPAddress(s string)
SetIPAddress sets the "ip_address" field.
func (*SessionMutation) SetLastActiveAt ¶
func (m *SessionMutation) SetLastActiveAt(t time.Time)
SetLastActiveAt sets the "last_active_at" field.
func (*SessionMutation) SetOp ¶
func (m *SessionMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SessionMutation) SetToken ¶
func (m *SessionMutation) SetToken(s string)
SetToken sets the "token" field.
func (*SessionMutation) SetUserAgent ¶
func (m *SessionMutation) SetUserAgent(s string)
SetUserAgent sets the "user_agent" field.
func (*SessionMutation) SetUserID ¶
func (m *SessionMutation) SetUserID(id int)
SetUserID sets the "user" edge to the User entity by id.
func (*SessionMutation) Token ¶
func (m *SessionMutation) Token() (r string, exists bool)
Token returns the value of the "token" field in the mutation.
func (SessionMutation) Tx ¶
func (m SessionMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SessionMutation) Type ¶
func (m *SessionMutation) Type() string
Type returns the node type of this mutation (Session).
func (*SessionMutation) UserAgent ¶
func (m *SessionMutation) UserAgent() (r string, exists bool)
UserAgent returns the value of the "user_agent" field in the mutation.
func (*SessionMutation) UserAgentCleared ¶
func (m *SessionMutation) UserAgentCleared() bool
UserAgentCleared returns if the "user_agent" field was cleared in this mutation.
func (*SessionMutation) UserCleared ¶
func (m *SessionMutation) UserCleared() bool
UserCleared reports if the "user" edge to the User entity was cleared.
func (*SessionMutation) UserID ¶
func (m *SessionMutation) UserID() (id int, exists bool)
UserID returns the "user" edge ID in the mutation.
func (*SessionMutation) UserIDs ¶
func (m *SessionMutation) UserIDs() (ids []int)
UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.
func (*SessionMutation) Where ¶
func (m *SessionMutation) Where(ps ...predicate.Session)
Where appends a list predicates to the SessionMutation builder.
func (*SessionMutation) WhereP ¶
func (m *SessionMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SessionQuery ¶
type SessionQuery struct {
// contains filtered or unexported fields
}
SessionQuery is the builder for querying Session entities.
func (*SessionQuery) Aggregate ¶
func (_q *SessionQuery) Aggregate(fns ...AggregateFunc) *SessionSelect
Aggregate returns a SessionSelect configured with the given aggregations.
func (*SessionQuery) All ¶
func (_q *SessionQuery) All(ctx context.Context) ([]*Session, error)
All executes the query and returns a list of Sessions.
func (*SessionQuery) AllX ¶
func (_q *SessionQuery) AllX(ctx context.Context) []*Session
AllX is like All, but panics if an error occurs.
func (*SessionQuery) Clone ¶
func (_q *SessionQuery) Clone() *SessionQuery
Clone returns a duplicate of the SessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SessionQuery) Count ¶
func (_q *SessionQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SessionQuery) CountX ¶
func (_q *SessionQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SessionQuery) Exist ¶
func (_q *SessionQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SessionQuery) ExistX ¶
func (_q *SessionQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SessionQuery) First ¶
func (_q *SessionQuery) First(ctx context.Context) (*Session, error)
First returns the first Session entity from the query. Returns a *NotFoundError when no Session was found.
func (*SessionQuery) FirstID ¶
func (_q *SessionQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Session ID from the query. Returns a *NotFoundError when no Session ID was found.
func (*SessionQuery) FirstIDX ¶
func (_q *SessionQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SessionQuery) FirstX ¶
func (_q *SessionQuery) FirstX(ctx context.Context) *Session
FirstX is like First, but panics if an error occurs.
func (*SessionQuery) GroupBy ¶
func (_q *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy
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 {
Token string `json:"token,omitempty"`
Count int `json:"count,omitempty"`
}
client.Session.Query().
GroupBy(session.FieldToken).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*SessionQuery) IDs ¶
func (_q *SessionQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Session IDs.
func (*SessionQuery) IDsX ¶
func (_q *SessionQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SessionQuery) Limit ¶
func (_q *SessionQuery) Limit(limit int) *SessionQuery
Limit the number of records to be returned by this query.
func (*SessionQuery) Offset ¶
func (_q *SessionQuery) Offset(offset int) *SessionQuery
Offset to start from.
func (*SessionQuery) Only ¶
func (_q *SessionQuery) Only(ctx context.Context) (*Session, error)
Only returns a single Session entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Session entity is found. Returns a *NotFoundError when no Session entities are found.
func (*SessionQuery) OnlyID ¶
func (_q *SessionQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Session ID in the query. Returns a *NotSingularError when more than one Session ID is found. Returns a *NotFoundError when no entities are found.
func (*SessionQuery) OnlyIDX ¶
func (_q *SessionQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SessionQuery) OnlyX ¶
func (_q *SessionQuery) OnlyX(ctx context.Context) *Session
OnlyX is like Only, but panics if an error occurs.
func (*SessionQuery) Order ¶
func (_q *SessionQuery) Order(o ...session.OrderOption) *SessionQuery
Order specifies how the records should be ordered.
func (*SessionQuery) QueryUser ¶
func (_q *SessionQuery) QueryUser() *UserQuery
QueryUser chains the current query on the "user" edge.
func (*SessionQuery) Select ¶
func (_q *SessionQuery) Select(fields ...string) *SessionSelect
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 {
Token string `json:"token,omitempty"`
}
client.Session.Query().
Select(session.FieldToken).
Scan(ctx, &v)
func (*SessionQuery) Unique ¶
func (_q *SessionQuery) Unique(unique bool) *SessionQuery
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 (*SessionQuery) Where ¶
func (_q *SessionQuery) Where(ps ...predicate.Session) *SessionQuery
Where adds a new predicate for the SessionQuery builder.
func (*SessionQuery) WithUser ¶
func (_q *SessionQuery) WithUser(opts ...func(*UserQuery)) *SessionQuery
WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.
type SessionSelect ¶
type SessionSelect struct {
*SessionQuery
// contains filtered or unexported fields
}
SessionSelect is the builder for selecting fields of Session entities.
func (*SessionSelect) Aggregate ¶
func (_s *SessionSelect) Aggregate(fns ...AggregateFunc) *SessionSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SessionSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SessionSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SessionSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SessionSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SessionSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SessionSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SessionSelect) Scan ¶
func (_s *SessionSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SessionSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SessionUpdate ¶
type SessionUpdate struct {
// contains filtered or unexported fields
}
SessionUpdate is the builder for updating Session entities.
func (*SessionUpdate) ClearIPAddress ¶
func (_u *SessionUpdate) ClearIPAddress() *SessionUpdate
ClearIPAddress clears the value of the "ip_address" field.
func (*SessionUpdate) ClearUser ¶
func (_u *SessionUpdate) ClearUser() *SessionUpdate
ClearUser clears the "user" edge to the User entity.
func (*SessionUpdate) ClearUserAgent ¶
func (_u *SessionUpdate) ClearUserAgent() *SessionUpdate
ClearUserAgent clears the value of the "user_agent" field.
func (*SessionUpdate) Exec ¶
func (_u *SessionUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SessionUpdate) ExecX ¶
func (_u *SessionUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SessionUpdate) Mutation ¶
func (_u *SessionUpdate) Mutation() *SessionMutation
Mutation returns the SessionMutation object of the builder.
func (*SessionUpdate) Save ¶
func (_u *SessionUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SessionUpdate) SaveX ¶
func (_u *SessionUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SessionUpdate) SetExpiresAt ¶
func (_u *SessionUpdate) SetExpiresAt(v time.Time) *SessionUpdate
SetExpiresAt sets the "expires_at" field.
func (*SessionUpdate) SetIPAddress ¶
func (_u *SessionUpdate) SetIPAddress(v string) *SessionUpdate
SetIPAddress sets the "ip_address" field.
func (*SessionUpdate) SetLastActiveAt ¶
func (_u *SessionUpdate) SetLastActiveAt(v time.Time) *SessionUpdate
SetLastActiveAt sets the "last_active_at" field.
func (*SessionUpdate) SetNillableExpiresAt ¶
func (_u *SessionUpdate) SetNillableExpiresAt(v *time.Time) *SessionUpdate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*SessionUpdate) SetNillableIPAddress ¶
func (_u *SessionUpdate) SetNillableIPAddress(v *string) *SessionUpdate
SetNillableIPAddress sets the "ip_address" field if the given value is not nil.
func (*SessionUpdate) SetNillableLastActiveAt ¶
func (_u *SessionUpdate) SetNillableLastActiveAt(v *time.Time) *SessionUpdate
SetNillableLastActiveAt sets the "last_active_at" field if the given value is not nil.
func (*SessionUpdate) SetNillableToken ¶
func (_u *SessionUpdate) SetNillableToken(v *string) *SessionUpdate
SetNillableToken sets the "token" field if the given value is not nil.
func (*SessionUpdate) SetNillableUserAgent ¶
func (_u *SessionUpdate) SetNillableUserAgent(v *string) *SessionUpdate
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*SessionUpdate) SetToken ¶
func (_u *SessionUpdate) SetToken(v string) *SessionUpdate
SetToken sets the "token" field.
func (*SessionUpdate) SetUser ¶
func (_u *SessionUpdate) SetUser(v *User) *SessionUpdate
SetUser sets the "user" edge to the User entity.
func (*SessionUpdate) SetUserAgent ¶
func (_u *SessionUpdate) SetUserAgent(v string) *SessionUpdate
SetUserAgent sets the "user_agent" field.
func (*SessionUpdate) SetUserID ¶
func (_u *SessionUpdate) SetUserID(id int) *SessionUpdate
SetUserID sets the "user" edge to the User entity by ID.
func (*SessionUpdate) Where ¶
func (_u *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate
Where appends a list predicates to the SessionUpdate builder.
type SessionUpdateOne ¶
type SessionUpdateOne struct {
// contains filtered or unexported fields
}
SessionUpdateOne is the builder for updating a single Session entity.
func (*SessionUpdateOne) ClearIPAddress ¶
func (_u *SessionUpdateOne) ClearIPAddress() *SessionUpdateOne
ClearIPAddress clears the value of the "ip_address" field.
func (*SessionUpdateOne) ClearUser ¶
func (_u *SessionUpdateOne) ClearUser() *SessionUpdateOne
ClearUser clears the "user" edge to the User entity.
func (*SessionUpdateOne) ClearUserAgent ¶
func (_u *SessionUpdateOne) ClearUserAgent() *SessionUpdateOne
ClearUserAgent clears the value of the "user_agent" field.
func (*SessionUpdateOne) Exec ¶
func (_u *SessionUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SessionUpdateOne) ExecX ¶
func (_u *SessionUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SessionUpdateOne) Mutation ¶
func (_u *SessionUpdateOne) Mutation() *SessionMutation
Mutation returns the SessionMutation object of the builder.
func (*SessionUpdateOne) Save ¶
func (_u *SessionUpdateOne) Save(ctx context.Context) (*Session, error)
Save executes the query and returns the updated Session entity.
func (*SessionUpdateOne) SaveX ¶
func (_u *SessionUpdateOne) SaveX(ctx context.Context) *Session
SaveX is like Save, but panics if an error occurs.
func (*SessionUpdateOne) Select ¶
func (_u *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SessionUpdateOne) SetExpiresAt ¶
func (_u *SessionUpdateOne) SetExpiresAt(v time.Time) *SessionUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*SessionUpdateOne) SetIPAddress ¶
func (_u *SessionUpdateOne) SetIPAddress(v string) *SessionUpdateOne
SetIPAddress sets the "ip_address" field.
func (*SessionUpdateOne) SetLastActiveAt ¶
func (_u *SessionUpdateOne) SetLastActiveAt(v time.Time) *SessionUpdateOne
SetLastActiveAt sets the "last_active_at" field.
func (*SessionUpdateOne) SetNillableExpiresAt ¶
func (_u *SessionUpdateOne) SetNillableExpiresAt(v *time.Time) *SessionUpdateOne
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*SessionUpdateOne) SetNillableIPAddress ¶
func (_u *SessionUpdateOne) SetNillableIPAddress(v *string) *SessionUpdateOne
SetNillableIPAddress sets the "ip_address" field if the given value is not nil.
func (*SessionUpdateOne) SetNillableLastActiveAt ¶
func (_u *SessionUpdateOne) SetNillableLastActiveAt(v *time.Time) *SessionUpdateOne
SetNillableLastActiveAt sets the "last_active_at" field if the given value is not nil.
func (*SessionUpdateOne) SetNillableToken ¶
func (_u *SessionUpdateOne) SetNillableToken(v *string) *SessionUpdateOne
SetNillableToken sets the "token" field if the given value is not nil.
func (*SessionUpdateOne) SetNillableUserAgent ¶
func (_u *SessionUpdateOne) SetNillableUserAgent(v *string) *SessionUpdateOne
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*SessionUpdateOne) SetToken ¶
func (_u *SessionUpdateOne) SetToken(v string) *SessionUpdateOne
SetToken sets the "token" field.
func (*SessionUpdateOne) SetUser ¶
func (_u *SessionUpdateOne) SetUser(v *User) *SessionUpdateOne
SetUser sets the "user" edge to the User entity.
func (*SessionUpdateOne) SetUserAgent ¶
func (_u *SessionUpdateOne) SetUserAgent(v string) *SessionUpdateOne
SetUserAgent sets the "user_agent" field.
func (*SessionUpdateOne) SetUserID ¶
func (_u *SessionUpdateOne) SetUserID(id int) *SessionUpdateOne
SetUserID sets the "user" edge to the User entity by ID.
func (*SessionUpdateOne) Where ¶
func (_u *SessionUpdateOne) Where(ps ...predicate.Session) *SessionUpdateOne
Where appends a list predicates to the SessionUpdate builder.
type Traffic ¶
type Traffic struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// HTTP method (GET, POST, etc.)
Method string `json:"method,omitempty"`
// Full request URL
URL string `json:"url,omitempty"`
// URL scheme (http/https)
Scheme string `json:"scheme,omitempty"`
// Request host
Host string `json:"host,omitempty"`
// Request path
Path string `json:"path,omitempty"`
// Query string
Query string `json:"query,omitempty"`
// Request headers
RequestHeaders map[string][]string `json:"request_headers,omitempty"`
// Request body (may be truncated)
RequestBody []byte `json:"request_body,omitempty"`
// Original request body size
RequestBodySize int64 `json:"request_body_size,omitempty"`
// Whether request body is binary
RequestIsBinary bool `json:"request_is_binary,omitempty"`
// Request Content-Type
ContentType string `json:"content_type,omitempty"`
// HTTP response status code
StatusCode int `json:"status_code,omitempty"`
// HTTP status text
StatusText string `json:"status_text,omitempty"`
// Response headers
ResponseHeaders map[string][]string `json:"response_headers,omitempty"`
// Response body (may be truncated)
ResponseBody []byte `json:"response_body,omitempty"`
// Original response body size
ResponseBodySize int64 `json:"response_body_size,omitempty"`
// Whether response body is binary
ResponseIsBinary bool `json:"response_is_binary,omitempty"`
// Response Content-Type
ResponseContentType string `json:"response_content_type,omitempty"`
// When the request started
StartedAt time.Time `json:"started_at,omitempty"`
// Total duration in milliseconds
DurationMs float64 `json:"duration_ms,omitempty"`
// Time to first byte in milliseconds
TtfbMs *float64 `json:"ttfb_ms,omitempty"`
// Client IP address
ClientIP string `json:"client_ip,omitempty"`
// Error message if request failed
Error string `json:"error,omitempty"`
// User-defined tags
Tags []string `json:"tags,omitempty"`
// When the record was created
CreatedAt time.Time `json:"created_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the TrafficQuery when eager-loading is set.
Edges TrafficEdges `json:"edges"`
// contains filtered or unexported fields
}
Traffic is the model entity for the Traffic schema.
func (*Traffic) QueryProxy ¶
func (_m *Traffic) QueryProxy() *ProxyQuery
QueryProxy queries the "proxy" edge of the Traffic entity.
func (*Traffic) Unwrap ¶
Unwrap unwraps the Traffic 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 (*Traffic) Update ¶
func (_m *Traffic) Update() *TrafficUpdateOne
Update returns a builder for updating this Traffic. Note that you need to call Traffic.Unwrap() before calling this method if this Traffic was returned from a transaction, and the transaction was committed or rolled back.
type TrafficClient ¶
type TrafficClient struct {
// contains filtered or unexported fields
}
TrafficClient is a client for the Traffic schema.
func NewTrafficClient ¶
func NewTrafficClient(c config) *TrafficClient
NewTrafficClient returns a client for the Traffic from the given config.
func (*TrafficClient) Create ¶
func (c *TrafficClient) Create() *TrafficCreate
Create returns a builder for creating a Traffic entity.
func (*TrafficClient) CreateBulk ¶
func (c *TrafficClient) CreateBulk(builders ...*TrafficCreate) *TrafficCreateBulk
CreateBulk returns a builder for creating a bulk of Traffic entities.
func (*TrafficClient) Delete ¶
func (c *TrafficClient) Delete() *TrafficDelete
Delete returns a delete builder for Traffic.
func (*TrafficClient) DeleteOne ¶
func (c *TrafficClient) DeleteOne(_m *Traffic) *TrafficDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*TrafficClient) DeleteOneID ¶
func (c *TrafficClient) DeleteOneID(id int) *TrafficDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*TrafficClient) GetX ¶
func (c *TrafficClient) GetX(ctx context.Context, id int) *Traffic
GetX is like Get, but panics if an error occurs.
func (*TrafficClient) Hooks ¶
func (c *TrafficClient) Hooks() []Hook
Hooks returns the client hooks.
func (*TrafficClient) Intercept ¶
func (c *TrafficClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `traffic.Intercept(f(g(h())))`.
func (*TrafficClient) Interceptors ¶
func (c *TrafficClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*TrafficClient) MapCreateBulk ¶
func (c *TrafficClient) MapCreateBulk(slice any, setFunc func(*TrafficCreate, int)) *TrafficCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*TrafficClient) Query ¶
func (c *TrafficClient) Query() *TrafficQuery
Query returns a query builder for Traffic.
func (*TrafficClient) QueryProxy ¶
func (c *TrafficClient) QueryProxy(_m *Traffic) *ProxyQuery
QueryProxy queries the proxy edge of a Traffic.
func (*TrafficClient) Update ¶
func (c *TrafficClient) Update() *TrafficUpdate
Update returns an update builder for Traffic.
func (*TrafficClient) UpdateOne ¶
func (c *TrafficClient) UpdateOne(_m *Traffic) *TrafficUpdateOne
UpdateOne returns an update builder for the given entity.
func (*TrafficClient) UpdateOneID ¶
func (c *TrafficClient) UpdateOneID(id int) *TrafficUpdateOne
UpdateOneID returns an update builder for the given id.
func (*TrafficClient) Use ¶
func (c *TrafficClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `traffic.Hooks(f(g(h())))`.
type TrafficCreate ¶
type TrafficCreate struct {
// contains filtered or unexported fields
}
TrafficCreate is the builder for creating a Traffic entity.
func (*TrafficCreate) Exec ¶
func (_c *TrafficCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*TrafficCreate) ExecX ¶
func (_c *TrafficCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TrafficCreate) Mutation ¶
func (_c *TrafficCreate) Mutation() *TrafficMutation
Mutation returns the TrafficMutation object of the builder.
func (*TrafficCreate) Save ¶
func (_c *TrafficCreate) Save(ctx context.Context) (*Traffic, error)
Save creates the Traffic in the database.
func (*TrafficCreate) SaveX ¶
func (_c *TrafficCreate) SaveX(ctx context.Context) *Traffic
SaveX calls Save and panics if Save returns an error.
func (*TrafficCreate) SetClientIP ¶
func (_c *TrafficCreate) SetClientIP(v string) *TrafficCreate
SetClientIP sets the "client_ip" field.
func (*TrafficCreate) SetContentType ¶
func (_c *TrafficCreate) SetContentType(v string) *TrafficCreate
SetContentType sets the "content_type" field.
func (*TrafficCreate) SetCreatedAt ¶
func (_c *TrafficCreate) SetCreatedAt(v time.Time) *TrafficCreate
SetCreatedAt sets the "created_at" field.
func (*TrafficCreate) SetDurationMs ¶
func (_c *TrafficCreate) SetDurationMs(v float64) *TrafficCreate
SetDurationMs sets the "duration_ms" field.
func (*TrafficCreate) SetError ¶
func (_c *TrafficCreate) SetError(v string) *TrafficCreate
SetError sets the "error" field.
func (*TrafficCreate) SetHost ¶
func (_c *TrafficCreate) SetHost(v string) *TrafficCreate
SetHost sets the "host" field.
func (*TrafficCreate) SetMethod ¶
func (_c *TrafficCreate) SetMethod(v string) *TrafficCreate
SetMethod sets the "method" field.
func (*TrafficCreate) SetNillableClientIP ¶
func (_c *TrafficCreate) SetNillableClientIP(v *string) *TrafficCreate
SetNillableClientIP sets the "client_ip" field if the given value is not nil.
func (*TrafficCreate) SetNillableContentType ¶
func (_c *TrafficCreate) SetNillableContentType(v *string) *TrafficCreate
SetNillableContentType sets the "content_type" field if the given value is not nil.
func (*TrafficCreate) SetNillableCreatedAt ¶
func (_c *TrafficCreate) SetNillableCreatedAt(v *time.Time) *TrafficCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*TrafficCreate) SetNillableError ¶
func (_c *TrafficCreate) SetNillableError(v *string) *TrafficCreate
SetNillableError sets the "error" field if the given value is not nil.
func (*TrafficCreate) SetNillableQuery ¶
func (_c *TrafficCreate) SetNillableQuery(v *string) *TrafficCreate
SetNillableQuery sets the "query" field if the given value is not nil.
func (*TrafficCreate) SetNillableRequestBodySize ¶
func (_c *TrafficCreate) SetNillableRequestBodySize(v *int64) *TrafficCreate
SetNillableRequestBodySize sets the "request_body_size" field if the given value is not nil.
func (*TrafficCreate) SetNillableRequestIsBinary ¶
func (_c *TrafficCreate) SetNillableRequestIsBinary(v *bool) *TrafficCreate
SetNillableRequestIsBinary sets the "request_is_binary" field if the given value is not nil.
func (*TrafficCreate) SetNillableResponseBodySize ¶
func (_c *TrafficCreate) SetNillableResponseBodySize(v *int64) *TrafficCreate
SetNillableResponseBodySize sets the "response_body_size" field if the given value is not nil.
func (*TrafficCreate) SetNillableResponseContentType ¶
func (_c *TrafficCreate) SetNillableResponseContentType(v *string) *TrafficCreate
SetNillableResponseContentType sets the "response_content_type" field if the given value is not nil.
func (*TrafficCreate) SetNillableResponseIsBinary ¶
func (_c *TrafficCreate) SetNillableResponseIsBinary(v *bool) *TrafficCreate
SetNillableResponseIsBinary sets the "response_is_binary" field if the given value is not nil.
func (*TrafficCreate) SetNillableStatusText ¶
func (_c *TrafficCreate) SetNillableStatusText(v *string) *TrafficCreate
SetNillableStatusText sets the "status_text" field if the given value is not nil.
func (*TrafficCreate) SetNillableTtfbMs ¶
func (_c *TrafficCreate) SetNillableTtfbMs(v *float64) *TrafficCreate
SetNillableTtfbMs sets the "ttfb_ms" field if the given value is not nil.
func (*TrafficCreate) SetPath ¶
func (_c *TrafficCreate) SetPath(v string) *TrafficCreate
SetPath sets the "path" field.
func (*TrafficCreate) SetProxy ¶
func (_c *TrafficCreate) SetProxy(v *Proxy) *TrafficCreate
SetProxy sets the "proxy" edge to the Proxy entity.
func (*TrafficCreate) SetProxyID ¶
func (_c *TrafficCreate) SetProxyID(id int) *TrafficCreate
SetProxyID sets the "proxy" edge to the Proxy entity by ID.
func (*TrafficCreate) SetQuery ¶
func (_c *TrafficCreate) SetQuery(v string) *TrafficCreate
SetQuery sets the "query" field.
func (*TrafficCreate) SetRequestBody ¶
func (_c *TrafficCreate) SetRequestBody(v []byte) *TrafficCreate
SetRequestBody sets the "request_body" field.
func (*TrafficCreate) SetRequestBodySize ¶
func (_c *TrafficCreate) SetRequestBodySize(v int64) *TrafficCreate
SetRequestBodySize sets the "request_body_size" field.
func (*TrafficCreate) SetRequestHeaders ¶
func (_c *TrafficCreate) SetRequestHeaders(v map[string][]string) *TrafficCreate
SetRequestHeaders sets the "request_headers" field.
func (*TrafficCreate) SetRequestIsBinary ¶
func (_c *TrafficCreate) SetRequestIsBinary(v bool) *TrafficCreate
SetRequestIsBinary sets the "request_is_binary" field.
func (*TrafficCreate) SetResponseBody ¶
func (_c *TrafficCreate) SetResponseBody(v []byte) *TrafficCreate
SetResponseBody sets the "response_body" field.
func (*TrafficCreate) SetResponseBodySize ¶
func (_c *TrafficCreate) SetResponseBodySize(v int64) *TrafficCreate
SetResponseBodySize sets the "response_body_size" field.
func (*TrafficCreate) SetResponseContentType ¶
func (_c *TrafficCreate) SetResponseContentType(v string) *TrafficCreate
SetResponseContentType sets the "response_content_type" field.
func (*TrafficCreate) SetResponseHeaders ¶
func (_c *TrafficCreate) SetResponseHeaders(v map[string][]string) *TrafficCreate
SetResponseHeaders sets the "response_headers" field.
func (*TrafficCreate) SetResponseIsBinary ¶
func (_c *TrafficCreate) SetResponseIsBinary(v bool) *TrafficCreate
SetResponseIsBinary sets the "response_is_binary" field.
func (*TrafficCreate) SetScheme ¶
func (_c *TrafficCreate) SetScheme(v string) *TrafficCreate
SetScheme sets the "scheme" field.
func (*TrafficCreate) SetStartedAt ¶
func (_c *TrafficCreate) SetStartedAt(v time.Time) *TrafficCreate
SetStartedAt sets the "started_at" field.
func (*TrafficCreate) SetStatusCode ¶
func (_c *TrafficCreate) SetStatusCode(v int) *TrafficCreate
SetStatusCode sets the "status_code" field.
func (*TrafficCreate) SetStatusText ¶
func (_c *TrafficCreate) SetStatusText(v string) *TrafficCreate
SetStatusText sets the "status_text" field.
func (*TrafficCreate) SetTags ¶
func (_c *TrafficCreate) SetTags(v []string) *TrafficCreate
SetTags sets the "tags" field.
func (*TrafficCreate) SetTtfbMs ¶
func (_c *TrafficCreate) SetTtfbMs(v float64) *TrafficCreate
SetTtfbMs sets the "ttfb_ms" field.
func (*TrafficCreate) SetURL ¶
func (_c *TrafficCreate) SetURL(v string) *TrafficCreate
SetURL sets the "url" field.
type TrafficCreateBulk ¶
type TrafficCreateBulk struct {
// contains filtered or unexported fields
}
TrafficCreateBulk is the builder for creating many Traffic entities in bulk.
func (*TrafficCreateBulk) Exec ¶
func (_c *TrafficCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*TrafficCreateBulk) ExecX ¶
func (_c *TrafficCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type TrafficDelete ¶
type TrafficDelete struct {
// contains filtered or unexported fields
}
TrafficDelete is the builder for deleting a Traffic entity.
func (*TrafficDelete) Exec ¶
func (_d *TrafficDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*TrafficDelete) ExecX ¶
func (_d *TrafficDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*TrafficDelete) Where ¶
func (_d *TrafficDelete) Where(ps ...predicate.Traffic) *TrafficDelete
Where appends a list predicates to the TrafficDelete builder.
type TrafficDeleteOne ¶
type TrafficDeleteOne struct {
// contains filtered or unexported fields
}
TrafficDeleteOne is the builder for deleting a single Traffic entity.
func (*TrafficDeleteOne) Exec ¶
func (_d *TrafficDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*TrafficDeleteOne) ExecX ¶
func (_d *TrafficDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TrafficDeleteOne) Where ¶
func (_d *TrafficDeleteOne) Where(ps ...predicate.Traffic) *TrafficDeleteOne
Where appends a list predicates to the TrafficDelete builder.
type TrafficEdges ¶
type TrafficEdges struct {
// Proxy that captured this traffic
Proxy *Proxy `json:"proxy,omitempty"`
// contains filtered or unexported fields
}
TrafficEdges holds the relations/edges for other nodes in the graph.
func (TrafficEdges) ProxyOrErr ¶
func (e TrafficEdges) ProxyOrErr() (*Proxy, error)
ProxyOrErr returns the Proxy value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type TrafficGroupBy ¶
type TrafficGroupBy struct {
// contains filtered or unexported fields
}
TrafficGroupBy is the group-by builder for Traffic entities.
func (*TrafficGroupBy) Aggregate ¶
func (_g *TrafficGroupBy) Aggregate(fns ...AggregateFunc) *TrafficGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*TrafficGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TrafficGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TrafficGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TrafficGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TrafficGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TrafficGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TrafficGroupBy) Scan ¶
func (_g *TrafficGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TrafficGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TrafficMutation ¶
type TrafficMutation struct {
// contains filtered or unexported fields
}
TrafficMutation represents an operation that mutates the Traffic nodes in the graph.
func (*TrafficMutation) AddDurationMs ¶
func (m *TrafficMutation) AddDurationMs(f float64)
AddDurationMs adds f to the "duration_ms" field.
func (*TrafficMutation) AddField ¶
func (m *TrafficMutation) 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 (*TrafficMutation) AddRequestBodySize ¶
func (m *TrafficMutation) AddRequestBodySize(i int64)
AddRequestBodySize adds i to the "request_body_size" field.
func (*TrafficMutation) AddResponseBodySize ¶
func (m *TrafficMutation) AddResponseBodySize(i int64)
AddResponseBodySize adds i to the "response_body_size" field.
func (*TrafficMutation) AddStatusCode ¶
func (m *TrafficMutation) AddStatusCode(i int)
AddStatusCode adds i to the "status_code" field.
func (*TrafficMutation) AddTtfbMs ¶
func (m *TrafficMutation) AddTtfbMs(f float64)
AddTtfbMs adds f to the "ttfb_ms" field.
func (*TrafficMutation) AddedDurationMs ¶
func (m *TrafficMutation) AddedDurationMs() (r float64, exists bool)
AddedDurationMs returns the value that was added to the "duration_ms" field in this mutation.
func (*TrafficMutation) AddedEdges ¶
func (m *TrafficMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*TrafficMutation) AddedField ¶
func (m *TrafficMutation) 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 (*TrafficMutation) AddedFields ¶
func (m *TrafficMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*TrafficMutation) AddedIDs ¶
func (m *TrafficMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*TrafficMutation) AddedRequestBodySize ¶
func (m *TrafficMutation) AddedRequestBodySize() (r int64, exists bool)
AddedRequestBodySize returns the value that was added to the "request_body_size" field in this mutation.
func (*TrafficMutation) AddedResponseBodySize ¶
func (m *TrafficMutation) AddedResponseBodySize() (r int64, exists bool)
AddedResponseBodySize returns the value that was added to the "response_body_size" field in this mutation.
func (*TrafficMutation) AddedStatusCode ¶
func (m *TrafficMutation) AddedStatusCode() (r int, exists bool)
AddedStatusCode returns the value that was added to the "status_code" field in this mutation.
func (*TrafficMutation) AddedTtfbMs ¶
func (m *TrafficMutation) AddedTtfbMs() (r float64, exists bool)
AddedTtfbMs returns the value that was added to the "ttfb_ms" field in this mutation.
func (*TrafficMutation) AppendTags ¶
func (m *TrafficMutation) AppendTags(s []string)
AppendTags adds s to the "tags" field.
func (*TrafficMutation) AppendedTags ¶
func (m *TrafficMutation) AppendedTags() ([]string, bool)
AppendedTags returns the list of values that were appended to the "tags" field in this mutation.
func (*TrafficMutation) ClearClientIP ¶
func (m *TrafficMutation) ClearClientIP()
ClearClientIP clears the value of the "client_ip" field.
func (*TrafficMutation) ClearContentType ¶
func (m *TrafficMutation) ClearContentType()
ClearContentType clears the value of the "content_type" field.
func (*TrafficMutation) ClearEdge ¶
func (m *TrafficMutation) 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 (*TrafficMutation) ClearError ¶
func (m *TrafficMutation) ClearError()
ClearError clears the value of the "error" field.
func (*TrafficMutation) ClearField ¶
func (m *TrafficMutation) 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 (*TrafficMutation) ClearProxy ¶
func (m *TrafficMutation) ClearProxy()
ClearProxy clears the "proxy" edge to the Proxy entity.
func (*TrafficMutation) ClearQuery ¶
func (m *TrafficMutation) ClearQuery()
ClearQuery clears the value of the "query" field.
func (*TrafficMutation) ClearRequestBody ¶
func (m *TrafficMutation) ClearRequestBody()
ClearRequestBody clears the value of the "request_body" field.
func (*TrafficMutation) ClearRequestHeaders ¶
func (m *TrafficMutation) ClearRequestHeaders()
ClearRequestHeaders clears the value of the "request_headers" field.
func (*TrafficMutation) ClearResponseBody ¶
func (m *TrafficMutation) ClearResponseBody()
ClearResponseBody clears the value of the "response_body" field.
func (*TrafficMutation) ClearResponseContentType ¶
func (m *TrafficMutation) ClearResponseContentType()
ClearResponseContentType clears the value of the "response_content_type" field.
func (*TrafficMutation) ClearResponseHeaders ¶
func (m *TrafficMutation) ClearResponseHeaders()
ClearResponseHeaders clears the value of the "response_headers" field.
func (*TrafficMutation) ClearStatusText ¶
func (m *TrafficMutation) ClearStatusText()
ClearStatusText clears the value of the "status_text" field.
func (*TrafficMutation) ClearTags ¶
func (m *TrafficMutation) ClearTags()
ClearTags clears the value of the "tags" field.
func (*TrafficMutation) ClearTtfbMs ¶
func (m *TrafficMutation) ClearTtfbMs()
ClearTtfbMs clears the value of the "ttfb_ms" field.
func (*TrafficMutation) ClearedEdges ¶
func (m *TrafficMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*TrafficMutation) ClearedFields ¶
func (m *TrafficMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (TrafficMutation) Client ¶
func (m TrafficMutation) 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 (*TrafficMutation) ClientIP ¶
func (m *TrafficMutation) ClientIP() (r string, exists bool)
ClientIP returns the value of the "client_ip" field in the mutation.
func (*TrafficMutation) ClientIPCleared ¶
func (m *TrafficMutation) ClientIPCleared() bool
ClientIPCleared returns if the "client_ip" field was cleared in this mutation.
func (*TrafficMutation) ContentType ¶
func (m *TrafficMutation) ContentType() (r string, exists bool)
ContentType returns the value of the "content_type" field in the mutation.
func (*TrafficMutation) ContentTypeCleared ¶
func (m *TrafficMutation) ContentTypeCleared() bool
ContentTypeCleared returns if the "content_type" field was cleared in this mutation.
func (*TrafficMutation) CreatedAt ¶
func (m *TrafficMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*TrafficMutation) DurationMs ¶
func (m *TrafficMutation) DurationMs() (r float64, exists bool)
DurationMs returns the value of the "duration_ms" field in the mutation.
func (*TrafficMutation) EdgeCleared ¶
func (m *TrafficMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*TrafficMutation) Error ¶
func (m *TrafficMutation) Error() (r string, exists bool)
Error returns the value of the "error" field in the mutation.
func (*TrafficMutation) ErrorCleared ¶
func (m *TrafficMutation) ErrorCleared() bool
ErrorCleared returns if the "error" field was cleared in this mutation.
func (*TrafficMutation) Field ¶
func (m *TrafficMutation) 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 (*TrafficMutation) FieldCleared ¶
func (m *TrafficMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*TrafficMutation) Fields ¶
func (m *TrafficMutation) 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 (*TrafficMutation) Host ¶
func (m *TrafficMutation) Host() (r string, exists bool)
Host returns the value of the "host" field in the mutation.
func (*TrafficMutation) ID ¶
func (m *TrafficMutation) 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 (*TrafficMutation) IDs ¶
func (m *TrafficMutation) 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 (*TrafficMutation) Method ¶
func (m *TrafficMutation) Method() (r string, exists bool)
Method returns the value of the "method" field in the mutation.
func (*TrafficMutation) OldClientIP ¶
func (m *TrafficMutation) OldClientIP(ctx context.Context) (v string, err error)
OldClientIP returns the old "client_ip" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldContentType ¶
func (m *TrafficMutation) OldContentType(ctx context.Context) (v string, err error)
OldContentType returns the old "content_type" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldDurationMs ¶
func (m *TrafficMutation) OldDurationMs(ctx context.Context) (v float64, err error)
OldDurationMs returns the old "duration_ms" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldError ¶
func (m *TrafficMutation) OldError(ctx context.Context) (v string, err error)
OldError returns the old "error" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) 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 (*TrafficMutation) OldHost ¶
func (m *TrafficMutation) OldHost(ctx context.Context) (v string, err error)
OldHost returns the old "host" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldMethod ¶
func (m *TrafficMutation) OldMethod(ctx context.Context) (v string, err error)
OldMethod returns the old "method" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldPath ¶
func (m *TrafficMutation) OldPath(ctx context.Context) (v string, err error)
OldPath returns the old "path" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldQuery ¶
func (m *TrafficMutation) OldQuery(ctx context.Context) (v string, err error)
OldQuery returns the old "query" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldRequestBody ¶
func (m *TrafficMutation) OldRequestBody(ctx context.Context) (v []byte, err error)
OldRequestBody returns the old "request_body" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldRequestBodySize ¶
func (m *TrafficMutation) OldRequestBodySize(ctx context.Context) (v int64, err error)
OldRequestBodySize returns the old "request_body_size" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldRequestHeaders ¶
OldRequestHeaders returns the old "request_headers" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldRequestIsBinary ¶
func (m *TrafficMutation) OldRequestIsBinary(ctx context.Context) (v bool, err error)
OldRequestIsBinary returns the old "request_is_binary" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldResponseBody ¶
func (m *TrafficMutation) OldResponseBody(ctx context.Context) (v []byte, err error)
OldResponseBody returns the old "response_body" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldResponseBodySize ¶
func (m *TrafficMutation) OldResponseBodySize(ctx context.Context) (v int64, err error)
OldResponseBodySize returns the old "response_body_size" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldResponseContentType ¶
func (m *TrafficMutation) OldResponseContentType(ctx context.Context) (v string, err error)
OldResponseContentType returns the old "response_content_type" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldResponseHeaders ¶
func (m *TrafficMutation) OldResponseHeaders(ctx context.Context) (v map[string][]string, err error)
OldResponseHeaders returns the old "response_headers" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldResponseIsBinary ¶
func (m *TrafficMutation) OldResponseIsBinary(ctx context.Context) (v bool, err error)
OldResponseIsBinary returns the old "response_is_binary" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldScheme ¶
func (m *TrafficMutation) OldScheme(ctx context.Context) (v string, err error)
OldScheme returns the old "scheme" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldStartedAt ¶
OldStartedAt returns the old "started_at" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldStatusCode ¶
func (m *TrafficMutation) OldStatusCode(ctx context.Context) (v int, err error)
OldStatusCode returns the old "status_code" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldStatusText ¶
func (m *TrafficMutation) OldStatusText(ctx context.Context) (v string, err error)
OldStatusText returns the old "status_text" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldTags ¶
func (m *TrafficMutation) OldTags(ctx context.Context) (v []string, err error)
OldTags returns the old "tags" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldTtfbMs ¶
func (m *TrafficMutation) OldTtfbMs(ctx context.Context) (v *float64, err error)
OldTtfbMs returns the old "ttfb_ms" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) OldURL ¶
func (m *TrafficMutation) OldURL(ctx context.Context) (v string, err error)
OldURL returns the old "url" field's value of the Traffic entity. If the Traffic 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 (*TrafficMutation) Path ¶
func (m *TrafficMutation) Path() (r string, exists bool)
Path returns the value of the "path" field in the mutation.
func (*TrafficMutation) ProxyCleared ¶
func (m *TrafficMutation) ProxyCleared() bool
ProxyCleared reports if the "proxy" edge to the Proxy entity was cleared.
func (*TrafficMutation) ProxyID ¶
func (m *TrafficMutation) ProxyID() (id int, exists bool)
ProxyID returns the "proxy" edge ID in the mutation.
func (*TrafficMutation) ProxyIDs ¶
func (m *TrafficMutation) ProxyIDs() (ids []int)
ProxyIDs returns the "proxy" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProxyID instead. It exists only for internal usage by the builders.
func (*TrafficMutation) Query ¶
func (m *TrafficMutation) Query() (r string, exists bool)
Query returns the value of the "query" field in the mutation.
func (*TrafficMutation) QueryCleared ¶
func (m *TrafficMutation) QueryCleared() bool
QueryCleared returns if the "query" field was cleared in this mutation.
func (*TrafficMutation) RemovedEdges ¶
func (m *TrafficMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*TrafficMutation) RemovedIDs ¶
func (m *TrafficMutation) 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 (*TrafficMutation) RequestBody ¶
func (m *TrafficMutation) RequestBody() (r []byte, exists bool)
RequestBody returns the value of the "request_body" field in the mutation.
func (*TrafficMutation) RequestBodyCleared ¶
func (m *TrafficMutation) RequestBodyCleared() bool
RequestBodyCleared returns if the "request_body" field was cleared in this mutation.
func (*TrafficMutation) RequestBodySize ¶
func (m *TrafficMutation) RequestBodySize() (r int64, exists bool)
RequestBodySize returns the value of the "request_body_size" field in the mutation.
func (*TrafficMutation) RequestHeaders ¶
func (m *TrafficMutation) RequestHeaders() (r map[string][]string, exists bool)
RequestHeaders returns the value of the "request_headers" field in the mutation.
func (*TrafficMutation) RequestHeadersCleared ¶
func (m *TrafficMutation) RequestHeadersCleared() bool
RequestHeadersCleared returns if the "request_headers" field was cleared in this mutation.
func (*TrafficMutation) RequestIsBinary ¶
func (m *TrafficMutation) RequestIsBinary() (r bool, exists bool)
RequestIsBinary returns the value of the "request_is_binary" field in the mutation.
func (*TrafficMutation) ResetClientIP ¶
func (m *TrafficMutation) ResetClientIP()
ResetClientIP resets all changes to the "client_ip" field.
func (*TrafficMutation) ResetContentType ¶
func (m *TrafficMutation) ResetContentType()
ResetContentType resets all changes to the "content_type" field.
func (*TrafficMutation) ResetCreatedAt ¶
func (m *TrafficMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*TrafficMutation) ResetDurationMs ¶
func (m *TrafficMutation) ResetDurationMs()
ResetDurationMs resets all changes to the "duration_ms" field.
func (*TrafficMutation) ResetEdge ¶
func (m *TrafficMutation) 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 (*TrafficMutation) ResetError ¶
func (m *TrafficMutation) ResetError()
ResetError resets all changes to the "error" field.
func (*TrafficMutation) ResetField ¶
func (m *TrafficMutation) 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 (*TrafficMutation) ResetHost ¶
func (m *TrafficMutation) ResetHost()
ResetHost resets all changes to the "host" field.
func (*TrafficMutation) ResetMethod ¶
func (m *TrafficMutation) ResetMethod()
ResetMethod resets all changes to the "method" field.
func (*TrafficMutation) ResetPath ¶
func (m *TrafficMutation) ResetPath()
ResetPath resets all changes to the "path" field.
func (*TrafficMutation) ResetProxy ¶
func (m *TrafficMutation) ResetProxy()
ResetProxy resets all changes to the "proxy" edge.
func (*TrafficMutation) ResetQuery ¶
func (m *TrafficMutation) ResetQuery()
ResetQuery resets all changes to the "query" field.
func (*TrafficMutation) ResetRequestBody ¶
func (m *TrafficMutation) ResetRequestBody()
ResetRequestBody resets all changes to the "request_body" field.
func (*TrafficMutation) ResetRequestBodySize ¶
func (m *TrafficMutation) ResetRequestBodySize()
ResetRequestBodySize resets all changes to the "request_body_size" field.
func (*TrafficMutation) ResetRequestHeaders ¶
func (m *TrafficMutation) ResetRequestHeaders()
ResetRequestHeaders resets all changes to the "request_headers" field.
func (*TrafficMutation) ResetRequestIsBinary ¶
func (m *TrafficMutation) ResetRequestIsBinary()
ResetRequestIsBinary resets all changes to the "request_is_binary" field.
func (*TrafficMutation) ResetResponseBody ¶
func (m *TrafficMutation) ResetResponseBody()
ResetResponseBody resets all changes to the "response_body" field.
func (*TrafficMutation) ResetResponseBodySize ¶
func (m *TrafficMutation) ResetResponseBodySize()
ResetResponseBodySize resets all changes to the "response_body_size" field.
func (*TrafficMutation) ResetResponseContentType ¶
func (m *TrafficMutation) ResetResponseContentType()
ResetResponseContentType resets all changes to the "response_content_type" field.
func (*TrafficMutation) ResetResponseHeaders ¶
func (m *TrafficMutation) ResetResponseHeaders()
ResetResponseHeaders resets all changes to the "response_headers" field.
func (*TrafficMutation) ResetResponseIsBinary ¶
func (m *TrafficMutation) ResetResponseIsBinary()
ResetResponseIsBinary resets all changes to the "response_is_binary" field.
func (*TrafficMutation) ResetScheme ¶
func (m *TrafficMutation) ResetScheme()
ResetScheme resets all changes to the "scheme" field.
func (*TrafficMutation) ResetStartedAt ¶
func (m *TrafficMutation) ResetStartedAt()
ResetStartedAt resets all changes to the "started_at" field.
func (*TrafficMutation) ResetStatusCode ¶
func (m *TrafficMutation) ResetStatusCode()
ResetStatusCode resets all changes to the "status_code" field.
func (*TrafficMutation) ResetStatusText ¶
func (m *TrafficMutation) ResetStatusText()
ResetStatusText resets all changes to the "status_text" field.
func (*TrafficMutation) ResetTags ¶
func (m *TrafficMutation) ResetTags()
ResetTags resets all changes to the "tags" field.
func (*TrafficMutation) ResetTtfbMs ¶
func (m *TrafficMutation) ResetTtfbMs()
ResetTtfbMs resets all changes to the "ttfb_ms" field.
func (*TrafficMutation) ResetURL ¶
func (m *TrafficMutation) ResetURL()
ResetURL resets all changes to the "url" field.
func (*TrafficMutation) ResponseBody ¶
func (m *TrafficMutation) ResponseBody() (r []byte, exists bool)
ResponseBody returns the value of the "response_body" field in the mutation.
func (*TrafficMutation) ResponseBodyCleared ¶
func (m *TrafficMutation) ResponseBodyCleared() bool
ResponseBodyCleared returns if the "response_body" field was cleared in this mutation.
func (*TrafficMutation) ResponseBodySize ¶
func (m *TrafficMutation) ResponseBodySize() (r int64, exists bool)
ResponseBodySize returns the value of the "response_body_size" field in the mutation.
func (*TrafficMutation) ResponseContentType ¶
func (m *TrafficMutation) ResponseContentType() (r string, exists bool)
ResponseContentType returns the value of the "response_content_type" field in the mutation.
func (*TrafficMutation) ResponseContentTypeCleared ¶
func (m *TrafficMutation) ResponseContentTypeCleared() bool
ResponseContentTypeCleared returns if the "response_content_type" field was cleared in this mutation.
func (*TrafficMutation) ResponseHeaders ¶
func (m *TrafficMutation) ResponseHeaders() (r map[string][]string, exists bool)
ResponseHeaders returns the value of the "response_headers" field in the mutation.
func (*TrafficMutation) ResponseHeadersCleared ¶
func (m *TrafficMutation) ResponseHeadersCleared() bool
ResponseHeadersCleared returns if the "response_headers" field was cleared in this mutation.
func (*TrafficMutation) ResponseIsBinary ¶
func (m *TrafficMutation) ResponseIsBinary() (r bool, exists bool)
ResponseIsBinary returns the value of the "response_is_binary" field in the mutation.
func (*TrafficMutation) Scheme ¶
func (m *TrafficMutation) Scheme() (r string, exists bool)
Scheme returns the value of the "scheme" field in the mutation.
func (*TrafficMutation) SetClientIP ¶
func (m *TrafficMutation) SetClientIP(s string)
SetClientIP sets the "client_ip" field.
func (*TrafficMutation) SetContentType ¶
func (m *TrafficMutation) SetContentType(s string)
SetContentType sets the "content_type" field.
func (*TrafficMutation) SetCreatedAt ¶
func (m *TrafficMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*TrafficMutation) SetDurationMs ¶
func (m *TrafficMutation) SetDurationMs(f float64)
SetDurationMs sets the "duration_ms" field.
func (*TrafficMutation) SetError ¶
func (m *TrafficMutation) SetError(s string)
SetError sets the "error" field.
func (*TrafficMutation) SetField ¶
func (m *TrafficMutation) 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 (*TrafficMutation) SetHost ¶
func (m *TrafficMutation) SetHost(s string)
SetHost sets the "host" field.
func (*TrafficMutation) SetMethod ¶
func (m *TrafficMutation) SetMethod(s string)
SetMethod sets the "method" field.
func (*TrafficMutation) SetOp ¶
func (m *TrafficMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*TrafficMutation) SetPath ¶
func (m *TrafficMutation) SetPath(s string)
SetPath sets the "path" field.
func (*TrafficMutation) SetProxyID ¶
func (m *TrafficMutation) SetProxyID(id int)
SetProxyID sets the "proxy" edge to the Proxy entity by id.
func (*TrafficMutation) SetQuery ¶
func (m *TrafficMutation) SetQuery(s string)
SetQuery sets the "query" field.
func (*TrafficMutation) SetRequestBody ¶
func (m *TrafficMutation) SetRequestBody(b []byte)
SetRequestBody sets the "request_body" field.
func (*TrafficMutation) SetRequestBodySize ¶
func (m *TrafficMutation) SetRequestBodySize(i int64)
SetRequestBodySize sets the "request_body_size" field.
func (*TrafficMutation) SetRequestHeaders ¶
func (m *TrafficMutation) SetRequestHeaders(value map[string][]string)
SetRequestHeaders sets the "request_headers" field.
func (*TrafficMutation) SetRequestIsBinary ¶
func (m *TrafficMutation) SetRequestIsBinary(b bool)
SetRequestIsBinary sets the "request_is_binary" field.
func (*TrafficMutation) SetResponseBody ¶
func (m *TrafficMutation) SetResponseBody(b []byte)
SetResponseBody sets the "response_body" field.
func (*TrafficMutation) SetResponseBodySize ¶
func (m *TrafficMutation) SetResponseBodySize(i int64)
SetResponseBodySize sets the "response_body_size" field.
func (*TrafficMutation) SetResponseContentType ¶
func (m *TrafficMutation) SetResponseContentType(s string)
SetResponseContentType sets the "response_content_type" field.
func (*TrafficMutation) SetResponseHeaders ¶
func (m *TrafficMutation) SetResponseHeaders(value map[string][]string)
SetResponseHeaders sets the "response_headers" field.
func (*TrafficMutation) SetResponseIsBinary ¶
func (m *TrafficMutation) SetResponseIsBinary(b bool)
SetResponseIsBinary sets the "response_is_binary" field.
func (*TrafficMutation) SetScheme ¶
func (m *TrafficMutation) SetScheme(s string)
SetScheme sets the "scheme" field.
func (*TrafficMutation) SetStartedAt ¶
func (m *TrafficMutation) SetStartedAt(t time.Time)
SetStartedAt sets the "started_at" field.
func (*TrafficMutation) SetStatusCode ¶
func (m *TrafficMutation) SetStatusCode(i int)
SetStatusCode sets the "status_code" field.
func (*TrafficMutation) SetStatusText ¶
func (m *TrafficMutation) SetStatusText(s string)
SetStatusText sets the "status_text" field.
func (*TrafficMutation) SetTags ¶
func (m *TrafficMutation) SetTags(s []string)
SetTags sets the "tags" field.
func (*TrafficMutation) SetTtfbMs ¶
func (m *TrafficMutation) SetTtfbMs(f float64)
SetTtfbMs sets the "ttfb_ms" field.
func (*TrafficMutation) SetURL ¶
func (m *TrafficMutation) SetURL(s string)
SetURL sets the "url" field.
func (*TrafficMutation) StartedAt ¶
func (m *TrafficMutation) StartedAt() (r time.Time, exists bool)
StartedAt returns the value of the "started_at" field in the mutation.
func (*TrafficMutation) StatusCode ¶
func (m *TrafficMutation) StatusCode() (r int, exists bool)
StatusCode returns the value of the "status_code" field in the mutation.
func (*TrafficMutation) StatusText ¶
func (m *TrafficMutation) StatusText() (r string, exists bool)
StatusText returns the value of the "status_text" field in the mutation.
func (*TrafficMutation) StatusTextCleared ¶
func (m *TrafficMutation) StatusTextCleared() bool
StatusTextCleared returns if the "status_text" field was cleared in this mutation.
func (*TrafficMutation) Tags ¶
func (m *TrafficMutation) Tags() (r []string, exists bool)
Tags returns the value of the "tags" field in the mutation.
func (*TrafficMutation) TagsCleared ¶
func (m *TrafficMutation) TagsCleared() bool
TagsCleared returns if the "tags" field was cleared in this mutation.
func (*TrafficMutation) TtfbMs ¶
func (m *TrafficMutation) TtfbMs() (r float64, exists bool)
TtfbMs returns the value of the "ttfb_ms" field in the mutation.
func (*TrafficMutation) TtfbMsCleared ¶
func (m *TrafficMutation) TtfbMsCleared() bool
TtfbMsCleared returns if the "ttfb_ms" field was cleared in this mutation.
func (TrafficMutation) Tx ¶
func (m TrafficMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*TrafficMutation) Type ¶
func (m *TrafficMutation) Type() string
Type returns the node type of this mutation (Traffic).
func (*TrafficMutation) URL ¶
func (m *TrafficMutation) URL() (r string, exists bool)
URL returns the value of the "url" field in the mutation.
func (*TrafficMutation) Where ¶
func (m *TrafficMutation) Where(ps ...predicate.Traffic)
Where appends a list predicates to the TrafficMutation builder.
func (*TrafficMutation) WhereP ¶
func (m *TrafficMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the TrafficMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type TrafficQuery ¶
type TrafficQuery struct {
// contains filtered or unexported fields
}
TrafficQuery is the builder for querying Traffic entities.
func (*TrafficQuery) Aggregate ¶
func (_q *TrafficQuery) Aggregate(fns ...AggregateFunc) *TrafficSelect
Aggregate returns a TrafficSelect configured with the given aggregations.
func (*TrafficQuery) All ¶
func (_q *TrafficQuery) All(ctx context.Context) ([]*Traffic, error)
All executes the query and returns a list of Traffics.
func (*TrafficQuery) AllX ¶
func (_q *TrafficQuery) AllX(ctx context.Context) []*Traffic
AllX is like All, but panics if an error occurs.
func (*TrafficQuery) Clone ¶
func (_q *TrafficQuery) Clone() *TrafficQuery
Clone returns a duplicate of the TrafficQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*TrafficQuery) Count ¶
func (_q *TrafficQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*TrafficQuery) CountX ¶
func (_q *TrafficQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*TrafficQuery) Exist ¶
func (_q *TrafficQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*TrafficQuery) ExistX ¶
func (_q *TrafficQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*TrafficQuery) First ¶
func (_q *TrafficQuery) First(ctx context.Context) (*Traffic, error)
First returns the first Traffic entity from the query. Returns a *NotFoundError when no Traffic was found.
func (*TrafficQuery) FirstID ¶
func (_q *TrafficQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Traffic ID from the query. Returns a *NotFoundError when no Traffic ID was found.
func (*TrafficQuery) FirstIDX ¶
func (_q *TrafficQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*TrafficQuery) FirstX ¶
func (_q *TrafficQuery) FirstX(ctx context.Context) *Traffic
FirstX is like First, but panics if an error occurs.
func (*TrafficQuery) GroupBy ¶
func (_q *TrafficQuery) GroupBy(field string, fields ...string) *TrafficGroupBy
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 {
Method string `json:"method,omitempty"`
Count int `json:"count,omitempty"`
}
client.Traffic.Query().
GroupBy(traffic.FieldMethod).
Aggregate(ent.Count()).
Scan(ctx, &v)
func (*TrafficQuery) IDs ¶
func (_q *TrafficQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Traffic IDs.
func (*TrafficQuery) IDsX ¶
func (_q *TrafficQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*TrafficQuery) Limit ¶
func (_q *TrafficQuery) Limit(limit int) *TrafficQuery
Limit the number of records to be returned by this query.
func (*TrafficQuery) Offset ¶
func (_q *TrafficQuery) Offset(offset int) *TrafficQuery
Offset to start from.
func (*TrafficQuery) Only ¶
func (_q *TrafficQuery) Only(ctx context.Context) (*Traffic, error)
Only returns a single Traffic entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Traffic entity is found. Returns a *NotFoundError when no Traffic entities are found.
func (*TrafficQuery) OnlyID ¶
func (_q *TrafficQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Traffic ID in the query. Returns a *NotSingularError when more than one Traffic ID is found. Returns a *NotFoundError when no entities are found.
func (*TrafficQuery) OnlyIDX ¶
func (_q *TrafficQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*TrafficQuery) OnlyX ¶
func (_q *TrafficQuery) OnlyX(ctx context.Context) *Traffic
OnlyX is like Only, but panics if an error occurs.
func (*TrafficQuery) Order ¶
func (_q *TrafficQuery) Order(o ...traffic.OrderOption) *TrafficQuery
Order specifies how the records should be ordered.
func (*TrafficQuery) QueryProxy ¶
func (_q *TrafficQuery) QueryProxy() *ProxyQuery
QueryProxy chains the current query on the "proxy" edge.
func (*TrafficQuery) Select ¶
func (_q *TrafficQuery) Select(fields ...string) *TrafficSelect
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 {
Method string `json:"method,omitempty"`
}
client.Traffic.Query().
Select(traffic.FieldMethod).
Scan(ctx, &v)
func (*TrafficQuery) Unique ¶
func (_q *TrafficQuery) Unique(unique bool) *TrafficQuery
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 (*TrafficQuery) Where ¶
func (_q *TrafficQuery) Where(ps ...predicate.Traffic) *TrafficQuery
Where adds a new predicate for the TrafficQuery builder.
func (*TrafficQuery) WithProxy ¶
func (_q *TrafficQuery) WithProxy(opts ...func(*ProxyQuery)) *TrafficQuery
WithProxy tells the query-builder to eager-load the nodes that are connected to the "proxy" edge. The optional arguments are used to configure the query builder of the edge.
type TrafficSelect ¶
type TrafficSelect struct {
*TrafficQuery
// contains filtered or unexported fields
}
TrafficSelect is the builder for selecting fields of Traffic entities.
func (*TrafficSelect) Aggregate ¶
func (_s *TrafficSelect) Aggregate(fns ...AggregateFunc) *TrafficSelect
Aggregate adds the given aggregation functions to the selector query.
func (*TrafficSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TrafficSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TrafficSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TrafficSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TrafficSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TrafficSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TrafficSelect) Scan ¶
func (_s *TrafficSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*TrafficSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type TrafficUpdate ¶
type TrafficUpdate struct {
// contains filtered or unexported fields
}
TrafficUpdate is the builder for updating Traffic entities.
func (*TrafficUpdate) AddDurationMs ¶
func (_u *TrafficUpdate) AddDurationMs(v float64) *TrafficUpdate
AddDurationMs adds value to the "duration_ms" field.
func (*TrafficUpdate) AddRequestBodySize ¶
func (_u *TrafficUpdate) AddRequestBodySize(v int64) *TrafficUpdate
AddRequestBodySize adds value to the "request_body_size" field.
func (*TrafficUpdate) AddResponseBodySize ¶
func (_u *TrafficUpdate) AddResponseBodySize(v int64) *TrafficUpdate
AddResponseBodySize adds value to the "response_body_size" field.
func (*TrafficUpdate) AddStatusCode ¶
func (_u *TrafficUpdate) AddStatusCode(v int) *TrafficUpdate
AddStatusCode adds value to the "status_code" field.
func (*TrafficUpdate) AddTtfbMs ¶
func (_u *TrafficUpdate) AddTtfbMs(v float64) *TrafficUpdate
AddTtfbMs adds value to the "ttfb_ms" field.
func (*TrafficUpdate) AppendTags ¶
func (_u *TrafficUpdate) AppendTags(v []string) *TrafficUpdate
AppendTags appends value to the "tags" field.
func (*TrafficUpdate) ClearClientIP ¶
func (_u *TrafficUpdate) ClearClientIP() *TrafficUpdate
ClearClientIP clears the value of the "client_ip" field.
func (*TrafficUpdate) ClearContentType ¶
func (_u *TrafficUpdate) ClearContentType() *TrafficUpdate
ClearContentType clears the value of the "content_type" field.
func (*TrafficUpdate) ClearError ¶
func (_u *TrafficUpdate) ClearError() *TrafficUpdate
ClearError clears the value of the "error" field.
func (*TrafficUpdate) ClearProxy ¶
func (_u *TrafficUpdate) ClearProxy() *TrafficUpdate
ClearProxy clears the "proxy" edge to the Proxy entity.
func (*TrafficUpdate) ClearQuery ¶
func (_u *TrafficUpdate) ClearQuery() *TrafficUpdate
ClearQuery clears the value of the "query" field.
func (*TrafficUpdate) ClearRequestBody ¶
func (_u *TrafficUpdate) ClearRequestBody() *TrafficUpdate
ClearRequestBody clears the value of the "request_body" field.
func (*TrafficUpdate) ClearRequestHeaders ¶
func (_u *TrafficUpdate) ClearRequestHeaders() *TrafficUpdate
ClearRequestHeaders clears the value of the "request_headers" field.
func (*TrafficUpdate) ClearResponseBody ¶
func (_u *TrafficUpdate) ClearResponseBody() *TrafficUpdate
ClearResponseBody clears the value of the "response_body" field.
func (*TrafficUpdate) ClearResponseContentType ¶
func (_u *TrafficUpdate) ClearResponseContentType() *TrafficUpdate
ClearResponseContentType clears the value of the "response_content_type" field.
func (*TrafficUpdate) ClearResponseHeaders ¶
func (_u *TrafficUpdate) ClearResponseHeaders() *TrafficUpdate
ClearResponseHeaders clears the value of the "response_headers" field.
func (*TrafficUpdate) ClearStatusText ¶
func (_u *TrafficUpdate) ClearStatusText() *TrafficUpdate
ClearStatusText clears the value of the "status_text" field.
func (*TrafficUpdate) ClearTags ¶
func (_u *TrafficUpdate) ClearTags() *TrafficUpdate
ClearTags clears the value of the "tags" field.
func (*TrafficUpdate) ClearTtfbMs ¶
func (_u *TrafficUpdate) ClearTtfbMs() *TrafficUpdate
ClearTtfbMs clears the value of the "ttfb_ms" field.
func (*TrafficUpdate) Exec ¶
func (_u *TrafficUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*TrafficUpdate) ExecX ¶
func (_u *TrafficUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TrafficUpdate) Mutation ¶
func (_u *TrafficUpdate) Mutation() *TrafficMutation
Mutation returns the TrafficMutation object of the builder.
func (*TrafficUpdate) Save ¶
func (_u *TrafficUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*TrafficUpdate) SaveX ¶
func (_u *TrafficUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*TrafficUpdate) SetClientIP ¶
func (_u *TrafficUpdate) SetClientIP(v string) *TrafficUpdate
SetClientIP sets the "client_ip" field.
func (*TrafficUpdate) SetContentType ¶
func (_u *TrafficUpdate) SetContentType(v string) *TrafficUpdate
SetContentType sets the "content_type" field.
func (*TrafficUpdate) SetDurationMs ¶
func (_u *TrafficUpdate) SetDurationMs(v float64) *TrafficUpdate
SetDurationMs sets the "duration_ms" field.
func (*TrafficUpdate) SetError ¶
func (_u *TrafficUpdate) SetError(v string) *TrafficUpdate
SetError sets the "error" field.
func (*TrafficUpdate) SetHost ¶
func (_u *TrafficUpdate) SetHost(v string) *TrafficUpdate
SetHost sets the "host" field.
func (*TrafficUpdate) SetMethod ¶
func (_u *TrafficUpdate) SetMethod(v string) *TrafficUpdate
SetMethod sets the "method" field.
func (*TrafficUpdate) SetNillableClientIP ¶
func (_u *TrafficUpdate) SetNillableClientIP(v *string) *TrafficUpdate
SetNillableClientIP sets the "client_ip" field if the given value is not nil.
func (*TrafficUpdate) SetNillableContentType ¶
func (_u *TrafficUpdate) SetNillableContentType(v *string) *TrafficUpdate
SetNillableContentType sets the "content_type" field if the given value is not nil.
func (*TrafficUpdate) SetNillableDurationMs ¶
func (_u *TrafficUpdate) SetNillableDurationMs(v *float64) *TrafficUpdate
SetNillableDurationMs sets the "duration_ms" field if the given value is not nil.
func (*TrafficUpdate) SetNillableError ¶
func (_u *TrafficUpdate) SetNillableError(v *string) *TrafficUpdate
SetNillableError sets the "error" field if the given value is not nil.
func (*TrafficUpdate) SetNillableHost ¶
func (_u *TrafficUpdate) SetNillableHost(v *string) *TrafficUpdate
SetNillableHost sets the "host" field if the given value is not nil.
func (*TrafficUpdate) SetNillableMethod ¶
func (_u *TrafficUpdate) SetNillableMethod(v *string) *TrafficUpdate
SetNillableMethod sets the "method" field if the given value is not nil.
func (*TrafficUpdate) SetNillablePath ¶
func (_u *TrafficUpdate) SetNillablePath(v *string) *TrafficUpdate
SetNillablePath sets the "path" field if the given value is not nil.
func (*TrafficUpdate) SetNillableQuery ¶
func (_u *TrafficUpdate) SetNillableQuery(v *string) *TrafficUpdate
SetNillableQuery sets the "query" field if the given value is not nil.
func (*TrafficUpdate) SetNillableRequestBodySize ¶
func (_u *TrafficUpdate) SetNillableRequestBodySize(v *int64) *TrafficUpdate
SetNillableRequestBodySize sets the "request_body_size" field if the given value is not nil.
func (*TrafficUpdate) SetNillableRequestIsBinary ¶
func (_u *TrafficUpdate) SetNillableRequestIsBinary(v *bool) *TrafficUpdate
SetNillableRequestIsBinary sets the "request_is_binary" field if the given value is not nil.
func (*TrafficUpdate) SetNillableResponseBodySize ¶
func (_u *TrafficUpdate) SetNillableResponseBodySize(v *int64) *TrafficUpdate
SetNillableResponseBodySize sets the "response_body_size" field if the given value is not nil.
func (*TrafficUpdate) SetNillableResponseContentType ¶
func (_u *TrafficUpdate) SetNillableResponseContentType(v *string) *TrafficUpdate
SetNillableResponseContentType sets the "response_content_type" field if the given value is not nil.
func (*TrafficUpdate) SetNillableResponseIsBinary ¶
func (_u *TrafficUpdate) SetNillableResponseIsBinary(v *bool) *TrafficUpdate
SetNillableResponseIsBinary sets the "response_is_binary" field if the given value is not nil.
func (*TrafficUpdate) SetNillableScheme ¶
func (_u *TrafficUpdate) SetNillableScheme(v *string) *TrafficUpdate
SetNillableScheme sets the "scheme" field if the given value is not nil.
func (*TrafficUpdate) SetNillableStartedAt ¶
func (_u *TrafficUpdate) SetNillableStartedAt(v *time.Time) *TrafficUpdate
SetNillableStartedAt sets the "started_at" field if the given value is not nil.
func (*TrafficUpdate) SetNillableStatusCode ¶
func (_u *TrafficUpdate) SetNillableStatusCode(v *int) *TrafficUpdate
SetNillableStatusCode sets the "status_code" field if the given value is not nil.
func (*TrafficUpdate) SetNillableStatusText ¶
func (_u *TrafficUpdate) SetNillableStatusText(v *string) *TrafficUpdate
SetNillableStatusText sets the "status_text" field if the given value is not nil.
func (*TrafficUpdate) SetNillableTtfbMs ¶
func (_u *TrafficUpdate) SetNillableTtfbMs(v *float64) *TrafficUpdate
SetNillableTtfbMs sets the "ttfb_ms" field if the given value is not nil.
func (*TrafficUpdate) SetNillableURL ¶
func (_u *TrafficUpdate) SetNillableURL(v *string) *TrafficUpdate
SetNillableURL sets the "url" field if the given value is not nil.
func (*TrafficUpdate) SetPath ¶
func (_u *TrafficUpdate) SetPath(v string) *TrafficUpdate
SetPath sets the "path" field.
func (*TrafficUpdate) SetProxy ¶
func (_u *TrafficUpdate) SetProxy(v *Proxy) *TrafficUpdate
SetProxy sets the "proxy" edge to the Proxy entity.
func (*TrafficUpdate) SetProxyID ¶
func (_u *TrafficUpdate) SetProxyID(id int) *TrafficUpdate
SetProxyID sets the "proxy" edge to the Proxy entity by ID.
func (*TrafficUpdate) SetQuery ¶
func (_u *TrafficUpdate) SetQuery(v string) *TrafficUpdate
SetQuery sets the "query" field.
func (*TrafficUpdate) SetRequestBody ¶
func (_u *TrafficUpdate) SetRequestBody(v []byte) *TrafficUpdate
SetRequestBody sets the "request_body" field.
func (*TrafficUpdate) SetRequestBodySize ¶
func (_u *TrafficUpdate) SetRequestBodySize(v int64) *TrafficUpdate
SetRequestBodySize sets the "request_body_size" field.
func (*TrafficUpdate) SetRequestHeaders ¶
func (_u *TrafficUpdate) SetRequestHeaders(v map[string][]string) *TrafficUpdate
SetRequestHeaders sets the "request_headers" field.
func (*TrafficUpdate) SetRequestIsBinary ¶
func (_u *TrafficUpdate) SetRequestIsBinary(v bool) *TrafficUpdate
SetRequestIsBinary sets the "request_is_binary" field.
func (*TrafficUpdate) SetResponseBody ¶
func (_u *TrafficUpdate) SetResponseBody(v []byte) *TrafficUpdate
SetResponseBody sets the "response_body" field.
func (*TrafficUpdate) SetResponseBodySize ¶
func (_u *TrafficUpdate) SetResponseBodySize(v int64) *TrafficUpdate
SetResponseBodySize sets the "response_body_size" field.
func (*TrafficUpdate) SetResponseContentType ¶
func (_u *TrafficUpdate) SetResponseContentType(v string) *TrafficUpdate
SetResponseContentType sets the "response_content_type" field.
func (*TrafficUpdate) SetResponseHeaders ¶
func (_u *TrafficUpdate) SetResponseHeaders(v map[string][]string) *TrafficUpdate
SetResponseHeaders sets the "response_headers" field.
func (*TrafficUpdate) SetResponseIsBinary ¶
func (_u *TrafficUpdate) SetResponseIsBinary(v bool) *TrafficUpdate
SetResponseIsBinary sets the "response_is_binary" field.
func (*TrafficUpdate) SetScheme ¶
func (_u *TrafficUpdate) SetScheme(v string) *TrafficUpdate
SetScheme sets the "scheme" field.
func (*TrafficUpdate) SetStartedAt ¶
func (_u *TrafficUpdate) SetStartedAt(v time.Time) *TrafficUpdate
SetStartedAt sets the "started_at" field.
func (*TrafficUpdate) SetStatusCode ¶
func (_u *TrafficUpdate) SetStatusCode(v int) *TrafficUpdate
SetStatusCode sets the "status_code" field.
func (*TrafficUpdate) SetStatusText ¶
func (_u *TrafficUpdate) SetStatusText(v string) *TrafficUpdate
SetStatusText sets the "status_text" field.
func (*TrafficUpdate) SetTags ¶
func (_u *TrafficUpdate) SetTags(v []string) *TrafficUpdate
SetTags sets the "tags" field.
func (*TrafficUpdate) SetTtfbMs ¶
func (_u *TrafficUpdate) SetTtfbMs(v float64) *TrafficUpdate
SetTtfbMs sets the "ttfb_ms" field.
func (*TrafficUpdate) SetURL ¶
func (_u *TrafficUpdate) SetURL(v string) *TrafficUpdate
SetURL sets the "url" field.
func (*TrafficUpdate) Where ¶
func (_u *TrafficUpdate) Where(ps ...predicate.Traffic) *TrafficUpdate
Where appends a list predicates to the TrafficUpdate builder.
type TrafficUpdateOne ¶
type TrafficUpdateOne struct {
// contains filtered or unexported fields
}
TrafficUpdateOne is the builder for updating a single Traffic entity.
func (*TrafficUpdateOne) AddDurationMs ¶
func (_u *TrafficUpdateOne) AddDurationMs(v float64) *TrafficUpdateOne
AddDurationMs adds value to the "duration_ms" field.
func (*TrafficUpdateOne) AddRequestBodySize ¶
func (_u *TrafficUpdateOne) AddRequestBodySize(v int64) *TrafficUpdateOne
AddRequestBodySize adds value to the "request_body_size" field.
func (*TrafficUpdateOne) AddResponseBodySize ¶
func (_u *TrafficUpdateOne) AddResponseBodySize(v int64) *TrafficUpdateOne
AddResponseBodySize adds value to the "response_body_size" field.
func (*TrafficUpdateOne) AddStatusCode ¶
func (_u *TrafficUpdateOne) AddStatusCode(v int) *TrafficUpdateOne
AddStatusCode adds value to the "status_code" field.
func (*TrafficUpdateOne) AddTtfbMs ¶
func (_u *TrafficUpdateOne) AddTtfbMs(v float64) *TrafficUpdateOne
AddTtfbMs adds value to the "ttfb_ms" field.
func (*TrafficUpdateOne) AppendTags ¶
func (_u *TrafficUpdateOne) AppendTags(v []string) *TrafficUpdateOne
AppendTags appends value to the "tags" field.
func (*TrafficUpdateOne) ClearClientIP ¶
func (_u *TrafficUpdateOne) ClearClientIP() *TrafficUpdateOne
ClearClientIP clears the value of the "client_ip" field.
func (*TrafficUpdateOne) ClearContentType ¶
func (_u *TrafficUpdateOne) ClearContentType() *TrafficUpdateOne
ClearContentType clears the value of the "content_type" field.
func (*TrafficUpdateOne) ClearError ¶
func (_u *TrafficUpdateOne) ClearError() *TrafficUpdateOne
ClearError clears the value of the "error" field.
func (*TrafficUpdateOne) ClearProxy ¶
func (_u *TrafficUpdateOne) ClearProxy() *TrafficUpdateOne
ClearProxy clears the "proxy" edge to the Proxy entity.
func (*TrafficUpdateOne) ClearQuery ¶
func (_u *TrafficUpdateOne) ClearQuery() *TrafficUpdateOne
ClearQuery clears the value of the "query" field.
func (*TrafficUpdateOne) ClearRequestBody ¶
func (_u *TrafficUpdateOne) ClearRequestBody() *TrafficUpdateOne
ClearRequestBody clears the value of the "request_body" field.
func (*TrafficUpdateOne) ClearRequestHeaders ¶
func (_u *TrafficUpdateOne) ClearRequestHeaders() *TrafficUpdateOne
ClearRequestHeaders clears the value of the "request_headers" field.
func (*TrafficUpdateOne) ClearResponseBody ¶
func (_u *TrafficUpdateOne) ClearResponseBody() *TrafficUpdateOne
ClearResponseBody clears the value of the "response_body" field.
func (*TrafficUpdateOne) ClearResponseContentType ¶
func (_u *TrafficUpdateOne) ClearResponseContentType() *TrafficUpdateOne
ClearResponseContentType clears the value of the "response_content_type" field.
func (*TrafficUpdateOne) ClearResponseHeaders ¶
func (_u *TrafficUpdateOne) ClearResponseHeaders() *TrafficUpdateOne
ClearResponseHeaders clears the value of the "response_headers" field.
func (*TrafficUpdateOne) ClearStatusText ¶
func (_u *TrafficUpdateOne) ClearStatusText() *TrafficUpdateOne
ClearStatusText clears the value of the "status_text" field.
func (*TrafficUpdateOne) ClearTags ¶
func (_u *TrafficUpdateOne) ClearTags() *TrafficUpdateOne
ClearTags clears the value of the "tags" field.
func (*TrafficUpdateOne) ClearTtfbMs ¶
func (_u *TrafficUpdateOne) ClearTtfbMs() *TrafficUpdateOne
ClearTtfbMs clears the value of the "ttfb_ms" field.
func (*TrafficUpdateOne) Exec ¶
func (_u *TrafficUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*TrafficUpdateOne) ExecX ¶
func (_u *TrafficUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*TrafficUpdateOne) Mutation ¶
func (_u *TrafficUpdateOne) Mutation() *TrafficMutation
Mutation returns the TrafficMutation object of the builder.
func (*TrafficUpdateOne) Save ¶
func (_u *TrafficUpdateOne) Save(ctx context.Context) (*Traffic, error)
Save executes the query and returns the updated Traffic entity.
func (*TrafficUpdateOne) SaveX ¶
func (_u *TrafficUpdateOne) SaveX(ctx context.Context) *Traffic
SaveX is like Save, but panics if an error occurs.
func (*TrafficUpdateOne) Select ¶
func (_u *TrafficUpdateOne) Select(field string, fields ...string) *TrafficUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*TrafficUpdateOne) SetClientIP ¶
func (_u *TrafficUpdateOne) SetClientIP(v string) *TrafficUpdateOne
SetClientIP sets the "client_ip" field.
func (*TrafficUpdateOne) SetContentType ¶
func (_u *TrafficUpdateOne) SetContentType(v string) *TrafficUpdateOne
SetContentType sets the "content_type" field.
func (*TrafficUpdateOne) SetDurationMs ¶
func (_u *TrafficUpdateOne) SetDurationMs(v float64) *TrafficUpdateOne
SetDurationMs sets the "duration_ms" field.
func (*TrafficUpdateOne) SetError ¶
func (_u *TrafficUpdateOne) SetError(v string) *TrafficUpdateOne
SetError sets the "error" field.
func (*TrafficUpdateOne) SetHost ¶
func (_u *TrafficUpdateOne) SetHost(v string) *TrafficUpdateOne
SetHost sets the "host" field.
func (*TrafficUpdateOne) SetMethod ¶
func (_u *TrafficUpdateOne) SetMethod(v string) *TrafficUpdateOne
SetMethod sets the "method" field.
func (*TrafficUpdateOne) SetNillableClientIP ¶
func (_u *TrafficUpdateOne) SetNillableClientIP(v *string) *TrafficUpdateOne
SetNillableClientIP sets the "client_ip" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableContentType ¶
func (_u *TrafficUpdateOne) SetNillableContentType(v *string) *TrafficUpdateOne
SetNillableContentType sets the "content_type" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableDurationMs ¶
func (_u *TrafficUpdateOne) SetNillableDurationMs(v *float64) *TrafficUpdateOne
SetNillableDurationMs sets the "duration_ms" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableError ¶
func (_u *TrafficUpdateOne) SetNillableError(v *string) *TrafficUpdateOne
SetNillableError sets the "error" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableHost ¶
func (_u *TrafficUpdateOne) SetNillableHost(v *string) *TrafficUpdateOne
SetNillableHost sets the "host" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableMethod ¶
func (_u *TrafficUpdateOne) SetNillableMethod(v *string) *TrafficUpdateOne
SetNillableMethod sets the "method" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillablePath ¶
func (_u *TrafficUpdateOne) SetNillablePath(v *string) *TrafficUpdateOne
SetNillablePath sets the "path" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableQuery ¶
func (_u *TrafficUpdateOne) SetNillableQuery(v *string) *TrafficUpdateOne
SetNillableQuery sets the "query" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableRequestBodySize ¶
func (_u *TrafficUpdateOne) SetNillableRequestBodySize(v *int64) *TrafficUpdateOne
SetNillableRequestBodySize sets the "request_body_size" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableRequestIsBinary ¶
func (_u *TrafficUpdateOne) SetNillableRequestIsBinary(v *bool) *TrafficUpdateOne
SetNillableRequestIsBinary sets the "request_is_binary" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableResponseBodySize ¶
func (_u *TrafficUpdateOne) SetNillableResponseBodySize(v *int64) *TrafficUpdateOne
SetNillableResponseBodySize sets the "response_body_size" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableResponseContentType ¶
func (_u *TrafficUpdateOne) SetNillableResponseContentType(v *string) *TrafficUpdateOne
SetNillableResponseContentType sets the "response_content_type" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableResponseIsBinary ¶
func (_u *TrafficUpdateOne) SetNillableResponseIsBinary(v *bool) *TrafficUpdateOne
SetNillableResponseIsBinary sets the "response_is_binary" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableScheme ¶
func (_u *TrafficUpdateOne) SetNillableScheme(v *string) *TrafficUpdateOne
SetNillableScheme sets the "scheme" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableStartedAt ¶
func (_u *TrafficUpdateOne) SetNillableStartedAt(v *time.Time) *TrafficUpdateOne
SetNillableStartedAt sets the "started_at" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableStatusCode ¶
func (_u *TrafficUpdateOne) SetNillableStatusCode(v *int) *TrafficUpdateOne
SetNillableStatusCode sets the "status_code" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableStatusText ¶
func (_u *TrafficUpdateOne) SetNillableStatusText(v *string) *TrafficUpdateOne
SetNillableStatusText sets the "status_text" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableTtfbMs ¶
func (_u *TrafficUpdateOne) SetNillableTtfbMs(v *float64) *TrafficUpdateOne
SetNillableTtfbMs sets the "ttfb_ms" field if the given value is not nil.
func (*TrafficUpdateOne) SetNillableURL ¶
func (_u *TrafficUpdateOne) SetNillableURL(v *string) *TrafficUpdateOne
SetNillableURL sets the "url" field if the given value is not nil.
func (*TrafficUpdateOne) SetPath ¶
func (_u *TrafficUpdateOne) SetPath(v string) *TrafficUpdateOne
SetPath sets the "path" field.
func (*TrafficUpdateOne) SetProxy ¶
func (_u *TrafficUpdateOne) SetProxy(v *Proxy) *TrafficUpdateOne
SetProxy sets the "proxy" edge to the Proxy entity.
func (*TrafficUpdateOne) SetProxyID ¶
func (_u *TrafficUpdateOne) SetProxyID(id int) *TrafficUpdateOne
SetProxyID sets the "proxy" edge to the Proxy entity by ID.
func (*TrafficUpdateOne) SetQuery ¶
func (_u *TrafficUpdateOne) SetQuery(v string) *TrafficUpdateOne
SetQuery sets the "query" field.
func (*TrafficUpdateOne) SetRequestBody ¶
func (_u *TrafficUpdateOne) SetRequestBody(v []byte) *TrafficUpdateOne
SetRequestBody sets the "request_body" field.
func (*TrafficUpdateOne) SetRequestBodySize ¶
func (_u *TrafficUpdateOne) SetRequestBodySize(v int64) *TrafficUpdateOne
SetRequestBodySize sets the "request_body_size" field.
func (*TrafficUpdateOne) SetRequestHeaders ¶
func (_u *TrafficUpdateOne) SetRequestHeaders(v map[string][]string) *TrafficUpdateOne
SetRequestHeaders sets the "request_headers" field.
func (*TrafficUpdateOne) SetRequestIsBinary ¶
func (_u *TrafficUpdateOne) SetRequestIsBinary(v bool) *TrafficUpdateOne
SetRequestIsBinary sets the "request_is_binary" field.
func (*TrafficUpdateOne) SetResponseBody ¶
func (_u *TrafficUpdateOne) SetResponseBody(v []byte) *TrafficUpdateOne
SetResponseBody sets the "response_body" field.
func (*TrafficUpdateOne) SetResponseBodySize ¶
func (_u *TrafficUpdateOne) SetResponseBodySize(v int64) *TrafficUpdateOne
SetResponseBodySize sets the "response_body_size" field.
func (*TrafficUpdateOne) SetResponseContentType ¶
func (_u *TrafficUpdateOne) SetResponseContentType(v string) *TrafficUpdateOne
SetResponseContentType sets the "response_content_type" field.
func (*TrafficUpdateOne) SetResponseHeaders ¶
func (_u *TrafficUpdateOne) SetResponseHeaders(v map[string][]string) *TrafficUpdateOne
SetResponseHeaders sets the "response_headers" field.
func (*TrafficUpdateOne) SetResponseIsBinary ¶
func (_u *TrafficUpdateOne) SetResponseIsBinary(v bool) *TrafficUpdateOne
SetResponseIsBinary sets the "response_is_binary" field.
func (*TrafficUpdateOne) SetScheme ¶
func (_u *TrafficUpdateOne) SetScheme(v string) *TrafficUpdateOne
SetScheme sets the "scheme" field.
func (*TrafficUpdateOne) SetStartedAt ¶
func (_u *TrafficUpdateOne) SetStartedAt(v time.Time) *TrafficUpdateOne
SetStartedAt sets the "started_at" field.
func (*TrafficUpdateOne) SetStatusCode ¶
func (_u *TrafficUpdateOne) SetStatusCode(v int) *TrafficUpdateOne
SetStatusCode sets the "status_code" field.
func (*TrafficUpdateOne) SetStatusText ¶
func (_u *TrafficUpdateOne) SetStatusText(v string) *TrafficUpdateOne
SetStatusText sets the "status_text" field.
func (*TrafficUpdateOne) SetTags ¶
func (_u *TrafficUpdateOne) SetTags(v []string) *TrafficUpdateOne
SetTags sets the "tags" field.
func (*TrafficUpdateOne) SetTtfbMs ¶
func (_u *TrafficUpdateOne) SetTtfbMs(v float64) *TrafficUpdateOne
SetTtfbMs sets the "ttfb_ms" field.
func (*TrafficUpdateOne) SetURL ¶
func (_u *TrafficUpdateOne) SetURL(v string) *TrafficUpdateOne
SetURL sets the "url" field.
func (*TrafficUpdateOne) Where ¶
func (_u *TrafficUpdateOne) Where(ps ...predicate.Traffic) *TrafficUpdateOne
Where appends a list predicates to the TrafficUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// Org is the client for interacting with the Org builders.
Org *OrgClient
// Proxy is the client for interacting with the Proxy builders.
Proxy *ProxyClient
// Session is the client for interacting with the Session builders.
Session *SessionClient
// Traffic is the client for interacting with the Traffic builders.
Traffic *TrafficClient
// User is the client for interacting with the User builders.
User *UserClient
// contains filtered or unexported fields
}
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// User's email address
Email string `json:"email,omitempty"`
// User's display name
Name string `json:"name,omitempty"`
// Bcrypt password hash (empty for OAuth users)
PasswordHash string `json:"-"`
// User's role within the org
Role user.Role `json:"role,omitempty"`
// Authentication provider
AuthProvider user.AuthProvider `json:"auth_provider,omitempty"`
// ID from OAuth provider
AuthProviderID string `json:"auth_provider_id,omitempty"`
// URL to user's avatar
AvatarURL string `json:"avatar_url,omitempty"`
// Whether the user is active
Active bool `json:"active,omitempty"`
// Last successful login
LastLoginAt *time.Time `json:"last_login_at,omitempty"`
// When the user was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the user was last updated
UpdatedAt time.Time `json:"updated_at,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) QuerySessions ¶
func (_m *User) QuerySessions() *SessionQuery
QuerySessions queries the "sessions" 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 (_m *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(_m *User) *UserDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserClient) GetX ¶
func (c *UserClient) GetX(ctx context.Context, id int) *User
GetX is like Get, but panics if an error occurs.
func (*UserClient) Intercept ¶
func (c *UserClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.
func (*UserClient) Interceptors ¶
func (c *UserClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserClient) MapCreateBulk ¶
func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UserClient) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) QueryOrg ¶
func (c *UserClient) QueryOrg(_m *User) *OrgQuery
QueryOrg queries the org edge of a User.
func (*UserClient) QuerySessions ¶
func (c *UserClient) QuerySessions(_m *User) *SessionQuery
QuerySessions queries the sessions 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(_m *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) AddSessionIDs ¶
func (_c *UserCreate) AddSessionIDs(ids ...int) *UserCreate
AddSessionIDs adds the "sessions" edge to the Session entity by IDs.
func (*UserCreate) AddSessions ¶
func (_c *UserCreate) AddSessions(v ...*Session) *UserCreate
AddSessions adds the "sessions" edges to the Session entity.
func (*UserCreate) Exec ¶
func (_c *UserCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreate) ExecX ¶
func (_c *UserCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserCreate) Mutation ¶
func (_c *UserCreate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserCreate) Save ¶
func (_c *UserCreate) Save(ctx context.Context) (*User, error)
Save creates the User in the database.
func (*UserCreate) SaveX ¶
func (_c *UserCreate) SaveX(ctx context.Context) *User
SaveX calls Save and panics if Save returns an error.
func (*UserCreate) SetActive ¶
func (_c *UserCreate) SetActive(v bool) *UserCreate
SetActive sets the "active" field.
func (*UserCreate) SetAuthProvider ¶
func (_c *UserCreate) SetAuthProvider(v user.AuthProvider) *UserCreate
SetAuthProvider sets the "auth_provider" field.
func (*UserCreate) SetAuthProviderID ¶
func (_c *UserCreate) SetAuthProviderID(v string) *UserCreate
SetAuthProviderID sets the "auth_provider_id" field.
func (*UserCreate) SetAvatarURL ¶
func (_c *UserCreate) SetAvatarURL(v string) *UserCreate
SetAvatarURL sets the "avatar_url" field.
func (*UserCreate) SetCreatedAt ¶
func (_c *UserCreate) SetCreatedAt(v time.Time) *UserCreate
SetCreatedAt sets the "created_at" field.
func (*UserCreate) SetEmail ¶
func (_c *UserCreate) SetEmail(v string) *UserCreate
SetEmail sets the "email" field.
func (*UserCreate) SetLastLoginAt ¶
func (_c *UserCreate) SetLastLoginAt(v time.Time) *UserCreate
SetLastLoginAt sets the "last_login_at" field.
func (*UserCreate) SetName ¶
func (_c *UserCreate) SetName(v string) *UserCreate
SetName sets the "name" field.
func (*UserCreate) SetNillableActive ¶
func (_c *UserCreate) SetNillableActive(v *bool) *UserCreate
SetNillableActive sets the "active" field if the given value is not nil.
func (*UserCreate) SetNillableAuthProvider ¶
func (_c *UserCreate) SetNillableAuthProvider(v *user.AuthProvider) *UserCreate
SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil.
func (*UserCreate) SetNillableAuthProviderID ¶
func (_c *UserCreate) SetNillableAuthProviderID(v *string) *UserCreate
SetNillableAuthProviderID sets the "auth_provider_id" field if the given value is not nil.
func (*UserCreate) SetNillableAvatarURL ¶
func (_c *UserCreate) SetNillableAvatarURL(v *string) *UserCreate
SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.
func (*UserCreate) SetNillableCreatedAt ¶
func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableLastLoginAt ¶
func (_c *UserCreate) SetNillableLastLoginAt(v *time.Time) *UserCreate
SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.
func (*UserCreate) SetNillableName ¶
func (_c *UserCreate) SetNillableName(v *string) *UserCreate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserCreate) SetNillableOrgID ¶
func (_c *UserCreate) SetNillableOrgID(id *int) *UserCreate
SetNillableOrgID sets the "org" edge to the Org entity by ID if the given value is not nil.
func (*UserCreate) SetNillablePasswordHash ¶
func (_c *UserCreate) SetNillablePasswordHash(v *string) *UserCreate
SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
func (*UserCreate) SetNillableRole ¶
func (_c *UserCreate) SetNillableRole(v *user.Role) *UserCreate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserCreate) SetNillableUpdatedAt ¶
func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*UserCreate) SetOrg ¶
func (_c *UserCreate) SetOrg(v *Org) *UserCreate
SetOrg sets the "org" edge to the Org entity.
func (*UserCreate) SetOrgID ¶
func (_c *UserCreate) SetOrgID(id int) *UserCreate
SetOrgID sets the "org" edge to the Org entity by ID.
func (*UserCreate) SetPasswordHash ¶
func (_c *UserCreate) SetPasswordHash(v string) *UserCreate
SetPasswordHash sets the "password_hash" field.
func (*UserCreate) SetRole ¶
func (_c *UserCreate) SetRole(v user.Role) *UserCreate
SetRole sets the "role" field.
func (*UserCreate) SetUpdatedAt ¶
func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" 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 (_c *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (_c *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 (_d *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (_d *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (_d *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 (_d *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (_d *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserDeleteOne) Where ¶
func (_d *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne
Where appends a list predicates to the UserDelete builder.
type UserEdges ¶
type UserEdges struct {
// Organization the user belongs to
Org *Org `json:"org,omitempty"`
// Active sessions for this user
Sessions []*Session `json:"sessions,omitempty"`
// contains filtered or unexported fields
}
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) OrgOrErr ¶
OrgOrErr returns the Org value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (UserEdges) SessionsOrErr ¶
SessionsOrErr returns the Sessions 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 (_g *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 (_g *UserGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) Active ¶
func (m *UserMutation) Active() (r bool, exists bool)
Active returns the value of the "active" field in the mutation.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddSessionIDs ¶
func (m *UserMutation) AddSessionIDs(ids ...int)
AddSessionIDs adds the "sessions" edge to the Session 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) AuthProvider ¶
func (m *UserMutation) AuthProvider() (r user.AuthProvider, exists bool)
AuthProvider returns the value of the "auth_provider" field in the mutation.
func (*UserMutation) AuthProviderID ¶
func (m *UserMutation) AuthProviderID() (r string, exists bool)
AuthProviderID returns the value of the "auth_provider_id" field in the mutation.
func (*UserMutation) AuthProviderIDCleared ¶
func (m *UserMutation) AuthProviderIDCleared() bool
AuthProviderIDCleared returns if the "auth_provider_id" field was cleared in this mutation.
func (*UserMutation) AvatarURL ¶
func (m *UserMutation) AvatarURL() (r string, exists bool)
AvatarURL returns the value of the "avatar_url" field in the mutation.
func (*UserMutation) AvatarURLCleared ¶
func (m *UserMutation) AvatarURLCleared() bool
AvatarURLCleared returns if the "avatar_url" field was cleared in this mutation.
func (*UserMutation) ClearAuthProviderID ¶
func (m *UserMutation) ClearAuthProviderID()
ClearAuthProviderID clears the value of the "auth_provider_id" field.
func (*UserMutation) ClearAvatarURL ¶
func (m *UserMutation) ClearAvatarURL()
ClearAvatarURL clears the value of the "avatar_url" field.
func (*UserMutation) ClearEdge ¶
func (m *UserMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*UserMutation) 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) ClearLastLoginAt ¶
func (m *UserMutation) ClearLastLoginAt()
ClearLastLoginAt clears the value of the "last_login_at" field.
func (*UserMutation) ClearName ¶
func (m *UserMutation) ClearName()
ClearName clears the value of the "name" field.
func (*UserMutation) ClearOrg ¶
func (m *UserMutation) ClearOrg()
ClearOrg clears the "org" edge to the Org entity.
func (*UserMutation) ClearPasswordHash ¶
func (m *UserMutation) ClearPasswordHash()
ClearPasswordHash clears the value of the "password_hash" field.
func (*UserMutation) ClearSessions ¶
func (m *UserMutation) ClearSessions()
ClearSessions clears the "sessions" edge to the Session 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) CreatedAt ¶
func (m *UserMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserMutation) EdgeCleared ¶
func (m *UserMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserMutation) Email ¶
func (m *UserMutation) Email() (r string, exists bool)
Email returns the value of the "email" field in the mutation.
func (*UserMutation) Field ¶
func (m *UserMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*UserMutation) FieldCleared ¶
func (m *UserMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserMutation) Fields ¶
func (m *UserMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*UserMutation) 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) LastLoginAt ¶
func (m *UserMutation) LastLoginAt() (r time.Time, exists bool)
LastLoginAt returns the value of the "last_login_at" field in the mutation.
func (*UserMutation) LastLoginAtCleared ¶
func (m *UserMutation) LastLoginAtCleared() bool
LastLoginAtCleared returns if the "last_login_at" field was cleared in this mutation.
func (*UserMutation) Name ¶
func (m *UserMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*UserMutation) NameCleared ¶
func (m *UserMutation) NameCleared() bool
NameCleared returns if the "name" field was cleared in this mutation.
func (*UserMutation) OldActive ¶
func (m *UserMutation) OldActive(ctx context.Context) (v bool, err error)
OldActive returns the old "active" 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) OldAuthProvider ¶
func (m *UserMutation) OldAuthProvider(ctx context.Context) (v user.AuthProvider, err error)
OldAuthProvider returns the old "auth_provider" 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) OldAuthProviderID ¶
func (m *UserMutation) OldAuthProviderID(ctx context.Context) (v string, err error)
OldAuthProviderID returns the old "auth_provider_id" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldAvatarURL ¶
func (m *UserMutation) OldAvatarURL(ctx context.Context) (v string, err error)
OldAvatarURL returns the old "avatar_url" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldEmail ¶
func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)
OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*UserMutation) OldLastLoginAt ¶
OldLastLoginAt returns the old "last_login_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldName ¶
func (m *UserMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldPasswordHash ¶
func (m *UserMutation) OldPasswordHash(ctx context.Context) (v string, err error)
OldPasswordHash returns the old "password_hash" 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) OldRole ¶
OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OrgCleared ¶
func (m *UserMutation) OrgCleared() bool
OrgCleared reports if the "org" edge to the Org entity was cleared.
func (*UserMutation) OrgID ¶
func (m *UserMutation) OrgID() (id int, exists bool)
OrgID returns the "org" edge ID in the mutation.
func (*UserMutation) OrgIDs ¶
func (m *UserMutation) OrgIDs() (ids []int)
OrgIDs returns the "org" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OrgID instead. It exists only for internal usage by the builders.
func (*UserMutation) PasswordHash ¶
func (m *UserMutation) PasswordHash() (r string, exists bool)
PasswordHash returns the value of the "password_hash" field in the mutation.
func (*UserMutation) PasswordHashCleared ¶
func (m *UserMutation) PasswordHashCleared() bool
PasswordHashCleared returns if the "password_hash" field was cleared in this mutation.
func (*UserMutation) RemoveSessionIDs ¶
func (m *UserMutation) RemoveSessionIDs(ids ...int)
RemoveSessionIDs removes the "sessions" edge to the Session 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) RemovedSessionsIDs ¶
func (m *UserMutation) RemovedSessionsIDs() (ids []int)
RemovedSessions returns the removed IDs of the "sessions" edge to the Session entity.
func (*UserMutation) ResetActive ¶
func (m *UserMutation) ResetActive()
ResetActive resets all changes to the "active" field.
func (*UserMutation) ResetAuthProvider ¶
func (m *UserMutation) ResetAuthProvider()
ResetAuthProvider resets all changes to the "auth_provider" field.
func (*UserMutation) ResetAuthProviderID ¶
func (m *UserMutation) ResetAuthProviderID()
ResetAuthProviderID resets all changes to the "auth_provider_id" field.
func (*UserMutation) ResetAvatarURL ¶
func (m *UserMutation) ResetAvatarURL()
ResetAvatarURL resets all changes to the "avatar_url" field.
func (*UserMutation) ResetCreatedAt ¶
func (m *UserMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) ResetEmail ¶
func (m *UserMutation) ResetEmail()
ResetEmail resets all changes to the "email" field.
func (*UserMutation) ResetField ¶
func (m *UserMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*UserMutation) ResetLastLoginAt ¶
func (m *UserMutation) ResetLastLoginAt()
ResetLastLoginAt resets all changes to the "last_login_at" field.
func (*UserMutation) ResetName ¶
func (m *UserMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*UserMutation) ResetOrg ¶
func (m *UserMutation) ResetOrg()
ResetOrg resets all changes to the "org" edge.
func (*UserMutation) ResetPasswordHash ¶
func (m *UserMutation) ResetPasswordHash()
ResetPasswordHash resets all changes to the "password_hash" field.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*UserMutation) ResetSessions ¶
func (m *UserMutation) ResetSessions()
ResetSessions resets all changes to the "sessions" edge.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) Role ¶
func (m *UserMutation) Role() (r user.Role, exists bool)
Role returns the value of the "role" field in the mutation.
func (*UserMutation) SessionsCleared ¶
func (m *UserMutation) SessionsCleared() bool
SessionsCleared reports if the "sessions" edge to the Session entity was cleared.
func (*UserMutation) SessionsIDs ¶
func (m *UserMutation) SessionsIDs() (ids []int)
SessionsIDs returns the "sessions" edge IDs in the mutation.
func (*UserMutation) SetActive ¶
func (m *UserMutation) SetActive(b bool)
SetActive sets the "active" field.
func (*UserMutation) SetAuthProvider ¶
func (m *UserMutation) SetAuthProvider(up user.AuthProvider)
SetAuthProvider sets the "auth_provider" field.
func (*UserMutation) SetAuthProviderID ¶
func (m *UserMutation) SetAuthProviderID(s string)
SetAuthProviderID sets the "auth_provider_id" field.
func (*UserMutation) SetAvatarURL ¶
func (m *UserMutation) SetAvatarURL(s string)
SetAvatarURL sets the "avatar_url" field.
func (*UserMutation) SetCreatedAt ¶
func (m *UserMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserMutation) SetEmail ¶
func (m *UserMutation) SetEmail(s string)
SetEmail sets the "email" field.
func (*UserMutation) SetField ¶
func (m *UserMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) SetLastLoginAt ¶
func (m *UserMutation) SetLastLoginAt(t time.Time)
SetLastLoginAt sets the "last_login_at" field.
func (*UserMutation) SetName ¶
func (m *UserMutation) SetName(s string)
SetName sets the "name" field.
func (*UserMutation) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetOrgID ¶
func (m *UserMutation) SetOrgID(id int)
SetOrgID sets the "org" edge to the Org entity by id.
func (*UserMutation) SetPasswordHash ¶
func (m *UserMutation) SetPasswordHash(s string)
SetPasswordHash sets the "password_hash" field.
func (*UserMutation) SetRole ¶
func (m *UserMutation) SetRole(u user.Role)
SetRole sets the "role" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (UserMutation) Tx ¶
func (m UserMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserMutation) Type ¶
func (m *UserMutation) Type() string
Type returns the node type of this mutation (User).
func (*UserMutation) UpdatedAt ¶
func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
func (*UserMutation) WhereP ¶
func (m *UserMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Aggregate ¶
func (_q *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 (_q *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) Order ¶
func (_q *UserQuery) Order(o ...user.OrderOption) *UserQuery
Order specifies how the records should be ordered.
func (*UserQuery) QuerySessions ¶
func (_q *UserQuery) QuerySessions() *SessionQuery
QuerySessions chains the current query on the "sessions" edge.
func (*UserQuery) Select ¶
func (_q *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.
func (*UserQuery) WithOrg ¶
WithOrg tells the query-builder to eager-load the nodes that are connected to the "org" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithSessions ¶
func (_q *UserQuery) WithSessions(opts ...func(*SessionQuery)) *UserQuery
WithSessions tells the query-builder to eager-load the nodes that are connected to the "sessions" edge. The optional arguments are used to configure the query builder of the edge.
type UserSelect ¶
type UserSelect struct {
*UserQuery
// contains filtered or unexported fields
}
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Aggregate ¶
func (_s *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 (_s *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) AddSessionIDs ¶
func (_u *UserUpdate) AddSessionIDs(ids ...int) *UserUpdate
AddSessionIDs adds the "sessions" edge to the Session entity by IDs.
func (*UserUpdate) AddSessions ¶
func (_u *UserUpdate) AddSessions(v ...*Session) *UserUpdate
AddSessions adds the "sessions" edges to the Session entity.
func (*UserUpdate) ClearAuthProviderID ¶
func (_u *UserUpdate) ClearAuthProviderID() *UserUpdate
ClearAuthProviderID clears the value of the "auth_provider_id" field.
func (*UserUpdate) ClearAvatarURL ¶
func (_u *UserUpdate) ClearAvatarURL() *UserUpdate
ClearAvatarURL clears the value of the "avatar_url" field.
func (*UserUpdate) ClearLastLoginAt ¶
func (_u *UserUpdate) ClearLastLoginAt() *UserUpdate
ClearLastLoginAt clears the value of the "last_login_at" field.
func (*UserUpdate) ClearName ¶
func (_u *UserUpdate) ClearName() *UserUpdate
ClearName clears the value of the "name" field.
func (*UserUpdate) ClearOrg ¶
func (_u *UserUpdate) ClearOrg() *UserUpdate
ClearOrg clears the "org" edge to the Org entity.
func (*UserUpdate) ClearPasswordHash ¶
func (_u *UserUpdate) ClearPasswordHash() *UserUpdate
ClearPasswordHash clears the value of the "password_hash" field.
func (*UserUpdate) ClearSessions ¶
func (_u *UserUpdate) ClearSessions() *UserUpdate
ClearSessions clears all "sessions" edges to the Session entity.
func (*UserUpdate) Exec ¶
func (_u *UserUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserUpdate) ExecX ¶
func (_u *UserUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdate) Mutation ¶
func (_u *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdate) RemoveSessionIDs ¶
func (_u *UserUpdate) RemoveSessionIDs(ids ...int) *UserUpdate
RemoveSessionIDs removes the "sessions" edge to Session entities by IDs.
func (*UserUpdate) RemoveSessions ¶
func (_u *UserUpdate) RemoveSessions(v ...*Session) *UserUpdate
RemoveSessions removes "sessions" edges to Session entities.
func (*UserUpdate) Save ¶
func (_u *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 (_u *UserUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserUpdate) SetActive ¶
func (_u *UserUpdate) SetActive(v bool) *UserUpdate
SetActive sets the "active" field.
func (*UserUpdate) SetAuthProvider ¶
func (_u *UserUpdate) SetAuthProvider(v user.AuthProvider) *UserUpdate
SetAuthProvider sets the "auth_provider" field.
func (*UserUpdate) SetAuthProviderID ¶
func (_u *UserUpdate) SetAuthProviderID(v string) *UserUpdate
SetAuthProviderID sets the "auth_provider_id" field.
func (*UserUpdate) SetAvatarURL ¶
func (_u *UserUpdate) SetAvatarURL(v string) *UserUpdate
SetAvatarURL sets the "avatar_url" field.
func (*UserUpdate) SetEmail ¶
func (_u *UserUpdate) SetEmail(v string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetLastLoginAt ¶
func (_u *UserUpdate) SetLastLoginAt(v time.Time) *UserUpdate
SetLastLoginAt sets the "last_login_at" field.
func (*UserUpdate) SetName ¶
func (_u *UserUpdate) SetName(v string) *UserUpdate
SetName sets the "name" field.
func (*UserUpdate) SetNillableActive ¶
func (_u *UserUpdate) SetNillableActive(v *bool) *UserUpdate
SetNillableActive sets the "active" field if the given value is not nil.
func (*UserUpdate) SetNillableAuthProvider ¶
func (_u *UserUpdate) SetNillableAuthProvider(v *user.AuthProvider) *UserUpdate
SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil.
func (*UserUpdate) SetNillableAuthProviderID ¶
func (_u *UserUpdate) SetNillableAuthProviderID(v *string) *UserUpdate
SetNillableAuthProviderID sets the "auth_provider_id" field if the given value is not nil.
func (*UserUpdate) SetNillableAvatarURL ¶
func (_u *UserUpdate) SetNillableAvatarURL(v *string) *UserUpdate
SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.
func (*UserUpdate) SetNillableEmail ¶
func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdate) SetNillableLastLoginAt ¶
func (_u *UserUpdate) SetNillableLastLoginAt(v *time.Time) *UserUpdate
SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.
func (*UserUpdate) SetNillableName ¶
func (_u *UserUpdate) SetNillableName(v *string) *UserUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdate) SetNillableOrgID ¶
func (_u *UserUpdate) SetNillableOrgID(id *int) *UserUpdate
SetNillableOrgID sets the "org" edge to the Org entity by ID if the given value is not nil.
func (*UserUpdate) SetNillablePasswordHash ¶
func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate
SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
func (*UserUpdate) SetNillableRole ¶
func (_u *UserUpdate) SetNillableRole(v *user.Role) *UserUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdate) SetOrg ¶
func (_u *UserUpdate) SetOrg(v *Org) *UserUpdate
SetOrg sets the "org" edge to the Org entity.
func (*UserUpdate) SetOrgID ¶
func (_u *UserUpdate) SetOrgID(id int) *UserUpdate
SetOrgID sets the "org" edge to the Org entity by ID.
func (*UserUpdate) SetPasswordHash ¶
func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate
SetPasswordHash sets the "password_hash" field.
func (*UserUpdate) SetRole ¶
func (_u *UserUpdate) SetRole(v user.Role) *UserUpdate
SetRole sets the "role" field.
func (*UserUpdate) SetUpdatedAt ¶
func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdate) Where ¶
func (_u *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) AddSessionIDs ¶
func (_u *UserUpdateOne) AddSessionIDs(ids ...int) *UserUpdateOne
AddSessionIDs adds the "sessions" edge to the Session entity by IDs.
func (*UserUpdateOne) AddSessions ¶
func (_u *UserUpdateOne) AddSessions(v ...*Session) *UserUpdateOne
AddSessions adds the "sessions" edges to the Session entity.
func (*UserUpdateOne) ClearAuthProviderID ¶
func (_u *UserUpdateOne) ClearAuthProviderID() *UserUpdateOne
ClearAuthProviderID clears the value of the "auth_provider_id" field.
func (*UserUpdateOne) ClearAvatarURL ¶
func (_u *UserUpdateOne) ClearAvatarURL() *UserUpdateOne
ClearAvatarURL clears the value of the "avatar_url" field.
func (*UserUpdateOne) ClearLastLoginAt ¶
func (_u *UserUpdateOne) ClearLastLoginAt() *UserUpdateOne
ClearLastLoginAt clears the value of the "last_login_at" field.
func (*UserUpdateOne) ClearName ¶
func (_u *UserUpdateOne) ClearName() *UserUpdateOne
ClearName clears the value of the "name" field.
func (*UserUpdateOne) ClearOrg ¶
func (_u *UserUpdateOne) ClearOrg() *UserUpdateOne
ClearOrg clears the "org" edge to the Org entity.
func (*UserUpdateOne) ClearPasswordHash ¶
func (_u *UserUpdateOne) ClearPasswordHash() *UserUpdateOne
ClearPasswordHash clears the value of the "password_hash" field.
func (*UserUpdateOne) ClearSessions ¶
func (_u *UserUpdateOne) ClearSessions() *UserUpdateOne
ClearSessions clears all "sessions" edges to the Session entity.
func (*UserUpdateOne) Exec ¶
func (_u *UserUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserUpdateOne) ExecX ¶
func (_u *UserUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserUpdateOne) Mutation ¶
func (_u *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
func (*UserUpdateOne) RemoveSessionIDs ¶
func (_u *UserUpdateOne) RemoveSessionIDs(ids ...int) *UserUpdateOne
RemoveSessionIDs removes the "sessions" edge to Session entities by IDs.
func (*UserUpdateOne) RemoveSessions ¶
func (_u *UserUpdateOne) RemoveSessions(v ...*Session) *UserUpdateOne
RemoveSessions removes "sessions" edges to Session entities.
func (*UserUpdateOne) Save ¶
func (_u *UserUpdateOne) Save(ctx context.Context) (*User, error)
Save executes the query and returns the updated User entity.
func (*UserUpdateOne) SaveX ¶
func (_u *UserUpdateOne) SaveX(ctx context.Context) *User
SaveX is like Save, but panics if an error occurs.
func (*UserUpdateOne) Select ¶
func (_u *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) SetActive ¶
func (_u *UserUpdateOne) SetActive(v bool) *UserUpdateOne
SetActive sets the "active" field.
func (*UserUpdateOne) SetAuthProvider ¶
func (_u *UserUpdateOne) SetAuthProvider(v user.AuthProvider) *UserUpdateOne
SetAuthProvider sets the "auth_provider" field.
func (*UserUpdateOne) SetAuthProviderID ¶
func (_u *UserUpdateOne) SetAuthProviderID(v string) *UserUpdateOne
SetAuthProviderID sets the "auth_provider_id" field.
func (*UserUpdateOne) SetAvatarURL ¶
func (_u *UserUpdateOne) SetAvatarURL(v string) *UserUpdateOne
SetAvatarURL sets the "avatar_url" field.
func (*UserUpdateOne) SetEmail ¶
func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetLastLoginAt ¶
func (_u *UserUpdateOne) SetLastLoginAt(v time.Time) *UserUpdateOne
SetLastLoginAt sets the "last_login_at" field.
func (*UserUpdateOne) SetName ¶
func (_u *UserUpdateOne) SetName(v string) *UserUpdateOne
SetName sets the "name" field.
func (*UserUpdateOne) SetNillableActive ¶
func (_u *UserUpdateOne) SetNillableActive(v *bool) *UserUpdateOne
SetNillableActive sets the "active" field if the given value is not nil.
func (*UserUpdateOne) SetNillableAuthProvider ¶
func (_u *UserUpdateOne) SetNillableAuthProvider(v *user.AuthProvider) *UserUpdateOne
SetNillableAuthProvider sets the "auth_provider" field if the given value is not nil.
func (*UserUpdateOne) SetNillableAuthProviderID ¶
func (_u *UserUpdateOne) SetNillableAuthProviderID(v *string) *UserUpdateOne
SetNillableAuthProviderID sets the "auth_provider_id" field if the given value is not nil.
func (*UserUpdateOne) SetNillableAvatarURL ¶
func (_u *UserUpdateOne) SetNillableAvatarURL(v *string) *UserUpdateOne
SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.
func (*UserUpdateOne) SetNillableEmail ¶
func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne
SetNillableEmail sets the "email" field if the given value is not nil.
func (*UserUpdateOne) SetNillableLastLoginAt ¶
func (_u *UserUpdateOne) SetNillableLastLoginAt(v *time.Time) *UserUpdateOne
SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.
func (*UserUpdateOne) SetNillableName ¶
func (_u *UserUpdateOne) SetNillableName(v *string) *UserUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*UserUpdateOne) SetNillableOrgID ¶
func (_u *UserUpdateOne) SetNillableOrgID(id *int) *UserUpdateOne
SetNillableOrgID sets the "org" edge to the Org entity by ID if the given value is not nil.
func (*UserUpdateOne) SetNillablePasswordHash ¶
func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne
SetNillablePasswordHash sets the "password_hash" field if the given value is not nil.
func (*UserUpdateOne) SetNillableRole ¶
func (_u *UserUpdateOne) SetNillableRole(v *user.Role) *UserUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdateOne) SetOrg ¶
func (_u *UserUpdateOne) SetOrg(v *Org) *UserUpdateOne
SetOrg sets the "org" edge to the Org entity.
func (*UserUpdateOne) SetOrgID ¶
func (_u *UserUpdateOne) SetOrgID(id int) *UserUpdateOne
SetOrgID sets the "org" edge to the Org entity by ID.
func (*UserUpdateOne) SetPasswordHash ¶
func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne
SetPasswordHash sets the "password_hash" field.
func (*UserUpdateOne) SetRole ¶
func (_u *UserUpdateOne) SetRole(v user.Role) *UserUpdateOne
SetRole sets the "role" field.
func (*UserUpdateOne) SetUpdatedAt ¶
func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*UserUpdateOne) Where ¶
func (_u *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne
Where appends a list predicates to the UserUpdate builder.
type ValidationError ¶
type ValidationError struct {
Name string // Field or edge name.
// contains filtered or unexported fields
}
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
Source Files
¶
- client.go
- ent.go
- generate.go
- mutation.go
- org.go
- org_create.go
- org_delete.go
- org_query.go
- org_update.go
- proxy.go
- proxy_create.go
- proxy_delete.go
- proxy_query.go
- proxy_update.go
- runtime.go
- session.go
- session_create.go
- session_delete.go
- session_query.go
- session_update.go
- traffic.go
- traffic_create.go
- traffic_delete.go
- traffic_query.go
- traffic_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go