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 APIKey
- type APIKeyClient
- func (c *APIKeyClient) Create() *APIKeyCreate
- func (c *APIKeyClient) CreateBulk(builders ...*APIKeyCreate) *APIKeyCreateBulk
- func (c *APIKeyClient) Delete() *APIKeyDelete
- func (c *APIKeyClient) DeleteOne(_m *APIKey) *APIKeyDeleteOne
- func (c *APIKeyClient) DeleteOneID(id int) *APIKeyDeleteOne
- func (c *APIKeyClient) Get(ctx context.Context, id int) (*APIKey, error)
- func (c *APIKeyClient) GetX(ctx context.Context, id int) *APIKey
- func (c *APIKeyClient) Hooks() []Hook
- func (c *APIKeyClient) Intercept(interceptors ...Interceptor)
- func (c *APIKeyClient) Interceptors() []Interceptor
- func (c *APIKeyClient) MapCreateBulk(slice any, setFunc func(*APIKeyCreate, int)) *APIKeyCreateBulk
- func (c *APIKeyClient) Query() *APIKeyQuery
- func (c *APIKeyClient) QueryCreatedBy(_m *APIKey) *UserQuery
- func (c *APIKeyClient) QueryProject(_m *APIKey) *ProjectQuery
- func (c *APIKeyClient) Update() *APIKeyUpdate
- func (c *APIKeyClient) UpdateOne(_m *APIKey) *APIKeyUpdateOne
- func (c *APIKeyClient) UpdateOneID(id int) *APIKeyUpdateOne
- func (c *APIKeyClient) Use(hooks ...Hook)
- type APIKeyCreate
- func (_c *APIKeyCreate) Exec(ctx context.Context) error
- func (_c *APIKeyCreate) ExecX(ctx context.Context)
- func (_c *APIKeyCreate) Mutation() *APIKeyMutation
- func (_c *APIKeyCreate) Save(ctx context.Context) (*APIKey, error)
- func (_c *APIKeyCreate) SaveX(ctx context.Context) *APIKey
- func (_c *APIKeyCreate) SetCreatedAt(v time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetCreatedBy(v *User) *APIKeyCreate
- func (_c *APIKeyCreate) SetCreatedByID(id int) *APIKeyCreate
- func (_c *APIKeyCreate) SetExpiresAt(v time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetHashedKey(v string) *APIKeyCreate
- func (_c *APIKeyCreate) SetIsActive(v bool) *APIKeyCreate
- func (_c *APIKeyCreate) SetLastUsedAt(v time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetName(v string) *APIKeyCreate
- func (_c *APIKeyCreate) SetNillableCreatedAt(v *time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetNillableExpiresAt(v *time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetNillableIsActive(v *bool) *APIKeyCreate
- func (_c *APIKeyCreate) SetNillableLastUsedAt(v *time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetNillablePermissions(v *string) *APIKeyCreate
- func (_c *APIKeyCreate) SetNillableUpdatedAt(v *time.Time) *APIKeyCreate
- func (_c *APIKeyCreate) SetPermissions(v string) *APIKeyCreate
- func (_c *APIKeyCreate) SetProject(v *Project) *APIKeyCreate
- func (_c *APIKeyCreate) SetProjectID(id int) *APIKeyCreate
- func (_c *APIKeyCreate) SetUpdatedAt(v time.Time) *APIKeyCreate
- type APIKeyCreateBulk
- type APIKeyDelete
- type APIKeyDeleteOne
- type APIKeyEdges
- type APIKeyGroupBy
- func (_g *APIKeyGroupBy) Aggregate(fns ...AggregateFunc) *APIKeyGroupBy
- func (s *APIKeyGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *APIKeyGroupBy) BoolX(ctx context.Context) bool
- func (s *APIKeyGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *APIKeyGroupBy) BoolsX(ctx context.Context) []bool
- func (s *APIKeyGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *APIKeyGroupBy) Float64X(ctx context.Context) float64
- func (s *APIKeyGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *APIKeyGroupBy) Float64sX(ctx context.Context) []float64
- func (s *APIKeyGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *APIKeyGroupBy) IntX(ctx context.Context) int
- func (s *APIKeyGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *APIKeyGroupBy) IntsX(ctx context.Context) []int
- func (_g *APIKeyGroupBy) Scan(ctx context.Context, v any) error
- func (s *APIKeyGroupBy) ScanX(ctx context.Context, v any)
- func (s *APIKeyGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *APIKeyGroupBy) StringX(ctx context.Context) string
- func (s *APIKeyGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *APIKeyGroupBy) StringsX(ctx context.Context) []string
- type APIKeyMutation
- func (m *APIKeyMutation) AddField(name string, value ent.Value) error
- func (m *APIKeyMutation) AddedEdges() []string
- func (m *APIKeyMutation) AddedField(name string) (ent.Value, bool)
- func (m *APIKeyMutation) AddedFields() []string
- func (m *APIKeyMutation) AddedIDs(name string) []ent.Value
- func (m *APIKeyMutation) ClearCreatedBy()
- func (m *APIKeyMutation) ClearEdge(name string) error
- func (m *APIKeyMutation) ClearExpiresAt()
- func (m *APIKeyMutation) ClearField(name string) error
- func (m *APIKeyMutation) ClearLastUsedAt()
- func (m *APIKeyMutation) ClearProject()
- func (m *APIKeyMutation) ClearedEdges() []string
- func (m *APIKeyMutation) ClearedFields() []string
- func (m APIKeyMutation) Client() *Client
- func (m *APIKeyMutation) CreatedAt() (r time.Time, exists bool)
- func (m *APIKeyMutation) CreatedByCleared() bool
- func (m *APIKeyMutation) CreatedByID() (id int, exists bool)
- func (m *APIKeyMutation) CreatedByIDs() (ids []int)
- func (m *APIKeyMutation) EdgeCleared(name string) bool
- func (m *APIKeyMutation) ExpiresAt() (r time.Time, exists bool)
- func (m *APIKeyMutation) ExpiresAtCleared() bool
- func (m *APIKeyMutation) Field(name string) (ent.Value, bool)
- func (m *APIKeyMutation) FieldCleared(name string) bool
- func (m *APIKeyMutation) Fields() []string
- func (m *APIKeyMutation) HashedKey() (r string, exists bool)
- func (m *APIKeyMutation) ID() (id int, exists bool)
- func (m *APIKeyMutation) IDs(ctx context.Context) ([]int, error)
- func (m *APIKeyMutation) IsActive() (r bool, exists bool)
- func (m *APIKeyMutation) LastUsedAt() (r time.Time, exists bool)
- func (m *APIKeyMutation) LastUsedAtCleared() bool
- func (m *APIKeyMutation) Name() (r string, exists bool)
- func (m *APIKeyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *APIKeyMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)
- func (m *APIKeyMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *APIKeyMutation) OldHashedKey(ctx context.Context) (v string, err error)
- func (m *APIKeyMutation) OldIsActive(ctx context.Context) (v bool, err error)
- func (m *APIKeyMutation) OldLastUsedAt(ctx context.Context) (v time.Time, err error)
- func (m *APIKeyMutation) OldName(ctx context.Context) (v string, err error)
- func (m *APIKeyMutation) OldPermissions(ctx context.Context) (v string, err error)
- func (m *APIKeyMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *APIKeyMutation) Op() Op
- func (m *APIKeyMutation) Permissions() (r string, exists bool)
- func (m *APIKeyMutation) ProjectCleared() bool
- func (m *APIKeyMutation) ProjectID() (id int, exists bool)
- func (m *APIKeyMutation) ProjectIDs() (ids []int)
- func (m *APIKeyMutation) RemovedEdges() []string
- func (m *APIKeyMutation) RemovedIDs(name string) []ent.Value
- func (m *APIKeyMutation) ResetCreatedAt()
- func (m *APIKeyMutation) ResetCreatedBy()
- func (m *APIKeyMutation) ResetEdge(name string) error
- func (m *APIKeyMutation) ResetExpiresAt()
- func (m *APIKeyMutation) ResetField(name string) error
- func (m *APIKeyMutation) ResetHashedKey()
- func (m *APIKeyMutation) ResetIsActive()
- func (m *APIKeyMutation) ResetLastUsedAt()
- func (m *APIKeyMutation) ResetName()
- func (m *APIKeyMutation) ResetPermissions()
- func (m *APIKeyMutation) ResetProject()
- func (m *APIKeyMutation) ResetUpdatedAt()
- func (m *APIKeyMutation) SetCreatedAt(t time.Time)
- func (m *APIKeyMutation) SetCreatedByID(id int)
- func (m *APIKeyMutation) SetExpiresAt(t time.Time)
- func (m *APIKeyMutation) SetField(name string, value ent.Value) error
- func (m *APIKeyMutation) SetHashedKey(s string)
- func (m *APIKeyMutation) SetIsActive(b bool)
- func (m *APIKeyMutation) SetLastUsedAt(t time.Time)
- func (m *APIKeyMutation) SetName(s string)
- func (m *APIKeyMutation) SetOp(op Op)
- func (m *APIKeyMutation) SetPermissions(s string)
- func (m *APIKeyMutation) SetProjectID(id int)
- func (m *APIKeyMutation) SetUpdatedAt(t time.Time)
- func (m APIKeyMutation) Tx() (*Tx, error)
- func (m *APIKeyMutation) Type() string
- func (m *APIKeyMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *APIKeyMutation) Where(ps ...predicate.APIKey)
- func (m *APIKeyMutation) WhereP(ps ...func(*sql.Selector))
- type APIKeyQuery
- func (_q *APIKeyQuery) Aggregate(fns ...AggregateFunc) *APIKeySelect
- func (_q *APIKeyQuery) All(ctx context.Context) ([]*APIKey, error)
- func (_q *APIKeyQuery) AllX(ctx context.Context) []*APIKey
- func (_q *APIKeyQuery) Clone() *APIKeyQuery
- func (_q *APIKeyQuery) Count(ctx context.Context) (int, error)
- func (_q *APIKeyQuery) CountX(ctx context.Context) int
- func (_q *APIKeyQuery) Exist(ctx context.Context) (bool, error)
- func (_q *APIKeyQuery) ExistX(ctx context.Context) bool
- func (_q *APIKeyQuery) First(ctx context.Context) (*APIKey, error)
- func (_q *APIKeyQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *APIKeyQuery) FirstIDX(ctx context.Context) int
- func (_q *APIKeyQuery) FirstX(ctx context.Context) *APIKey
- func (_q *APIKeyQuery) GroupBy(field string, fields ...string) *APIKeyGroupBy
- func (_q *APIKeyQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *APIKeyQuery) IDsX(ctx context.Context) []int
- func (_q *APIKeyQuery) Limit(limit int) *APIKeyQuery
- func (_q *APIKeyQuery) Offset(offset int) *APIKeyQuery
- func (_q *APIKeyQuery) Only(ctx context.Context) (*APIKey, error)
- func (_q *APIKeyQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *APIKeyQuery) OnlyIDX(ctx context.Context) int
- func (_q *APIKeyQuery) OnlyX(ctx context.Context) *APIKey
- func (_q *APIKeyQuery) Order(o ...apikey.OrderOption) *APIKeyQuery
- func (_q *APIKeyQuery) QueryCreatedBy() *UserQuery
- func (_q *APIKeyQuery) QueryProject() *ProjectQuery
- func (_q *APIKeyQuery) Select(fields ...string) *APIKeySelect
- func (_q *APIKeyQuery) Unique(unique bool) *APIKeyQuery
- func (_q *APIKeyQuery) Where(ps ...predicate.APIKey) *APIKeyQuery
- func (_q *APIKeyQuery) WithCreatedBy(opts ...func(*UserQuery)) *APIKeyQuery
- func (_q *APIKeyQuery) WithProject(opts ...func(*ProjectQuery)) *APIKeyQuery
- type APIKeySelect
- func (_s *APIKeySelect) Aggregate(fns ...AggregateFunc) *APIKeySelect
- func (s *APIKeySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *APIKeySelect) BoolX(ctx context.Context) bool
- func (s *APIKeySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *APIKeySelect) BoolsX(ctx context.Context) []bool
- func (s *APIKeySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *APIKeySelect) Float64X(ctx context.Context) float64
- func (s *APIKeySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *APIKeySelect) Float64sX(ctx context.Context) []float64
- func (s *APIKeySelect) Int(ctx context.Context) (_ int, err error)
- func (s *APIKeySelect) IntX(ctx context.Context) int
- func (s *APIKeySelect) Ints(ctx context.Context) ([]int, error)
- func (s *APIKeySelect) IntsX(ctx context.Context) []int
- func (_s *APIKeySelect) Scan(ctx context.Context, v any) error
- func (s *APIKeySelect) ScanX(ctx context.Context, v any)
- func (s *APIKeySelect) String(ctx context.Context) (_ string, err error)
- func (s *APIKeySelect) StringX(ctx context.Context) string
- func (s *APIKeySelect) Strings(ctx context.Context) ([]string, error)
- func (s *APIKeySelect) StringsX(ctx context.Context) []string
- type APIKeyUpdate
- func (_u *APIKeyUpdate) ClearCreatedBy() *APIKeyUpdate
- func (_u *APIKeyUpdate) ClearExpiresAt() *APIKeyUpdate
- func (_u *APIKeyUpdate) ClearLastUsedAt() *APIKeyUpdate
- func (_u *APIKeyUpdate) ClearProject() *APIKeyUpdate
- func (_u *APIKeyUpdate) Exec(ctx context.Context) error
- func (_u *APIKeyUpdate) ExecX(ctx context.Context)
- func (_u *APIKeyUpdate) Mutation() *APIKeyMutation
- func (_u *APIKeyUpdate) Save(ctx context.Context) (int, error)
- func (_u *APIKeyUpdate) SaveX(ctx context.Context) int
- func (_u *APIKeyUpdate) SetCreatedBy(v *User) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetCreatedByID(id int) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetExpiresAt(v time.Time) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetHashedKey(v string) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetIsActive(v bool) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetLastUsedAt(v time.Time) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetName(v string) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetNillableExpiresAt(v *time.Time) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetNillableHashedKey(v *string) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetNillableIsActive(v *bool) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetNillableLastUsedAt(v *time.Time) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetNillableName(v *string) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetNillablePermissions(v *string) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetPermissions(v string) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetProject(v *Project) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetProjectID(id int) *APIKeyUpdate
- func (_u *APIKeyUpdate) SetUpdatedAt(v time.Time) *APIKeyUpdate
- func (_u *APIKeyUpdate) Where(ps ...predicate.APIKey) *APIKeyUpdate
- type APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) ClearCreatedBy() *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) ClearExpiresAt() *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) ClearLastUsedAt() *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) ClearProject() *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) Exec(ctx context.Context) error
- func (_u *APIKeyUpdateOne) ExecX(ctx context.Context)
- func (_u *APIKeyUpdateOne) Mutation() *APIKeyMutation
- func (_u *APIKeyUpdateOne) Save(ctx context.Context) (*APIKey, error)
- func (_u *APIKeyUpdateOne) SaveX(ctx context.Context) *APIKey
- func (_u *APIKeyUpdateOne) Select(field string, fields ...string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetCreatedBy(v *User) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetCreatedByID(id int) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetExpiresAt(v time.Time) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetHashedKey(v string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetIsActive(v bool) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetLastUsedAt(v time.Time) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetName(v string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetNillableExpiresAt(v *time.Time) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetNillableHashedKey(v *string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetNillableIsActive(v *bool) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetNillableLastUsedAt(v *time.Time) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetNillableName(v *string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetNillablePermissions(v *string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetPermissions(v string) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetProject(v *Project) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetProjectID(id int) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) SetUpdatedAt(v time.Time) *APIKeyUpdateOne
- func (_u *APIKeyUpdateOne) Where(ps ...predicate.APIKey) *APIKeyUpdateOne
- type APIKeys
- 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 Policy
- type Project
- func (_m *Project) QueryAPIKeys() *APIKeyQuery
- func (_m *Project) QueryOwner() *UserQuery
- func (_m *Project) QueryRetentionPolicies() *RetentionPolicyQuery
- func (_m *Project) String() string
- func (_m *Project) Unwrap() *Project
- func (_m *Project) Update() *ProjectUpdateOne
- func (_m *Project) Value(name string) (ent.Value, error)
- type ProjectClient
- func (c *ProjectClient) Create() *ProjectCreate
- func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk
- func (c *ProjectClient) Delete() *ProjectDelete
- func (c *ProjectClient) DeleteOne(_m *Project) *ProjectDeleteOne
- func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne
- func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)
- func (c *ProjectClient) GetX(ctx context.Context, id int) *Project
- func (c *ProjectClient) Hooks() []Hook
- func (c *ProjectClient) Intercept(interceptors ...Interceptor)
- func (c *ProjectClient) Interceptors() []Interceptor
- func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk
- func (c *ProjectClient) Query() *ProjectQuery
- func (c *ProjectClient) QueryAPIKeys(_m *Project) *APIKeyQuery
- func (c *ProjectClient) QueryOwner(_m *Project) *UserQuery
- func (c *ProjectClient) QueryRetentionPolicies(_m *Project) *RetentionPolicyQuery
- func (c *ProjectClient) Update() *ProjectUpdate
- func (c *ProjectClient) UpdateOne(_m *Project) *ProjectUpdateOne
- func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne
- func (c *ProjectClient) Use(hooks ...Hook)
- type ProjectCreate
- func (_c *ProjectCreate) AddAPIKeyIDs(ids ...int) *ProjectCreate
- func (_c *ProjectCreate) AddAPIKeys(v ...*APIKey) *ProjectCreate
- func (_c *ProjectCreate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectCreate
- func (_c *ProjectCreate) AddRetentionPolicyIDs(ids ...int) *ProjectCreate
- func (_c *ProjectCreate) Exec(ctx context.Context) error
- func (_c *ProjectCreate) ExecX(ctx context.Context)
- func (_c *ProjectCreate) Mutation() *ProjectMutation
- func (_c *ProjectCreate) Save(ctx context.Context) (*Project, error)
- func (_c *ProjectCreate) SaveX(ctx context.Context) *Project
- func (_c *ProjectCreate) SetCreatedAt(v time.Time) *ProjectCreate
- func (_c *ProjectCreate) SetDescription(v string) *ProjectCreate
- func (_c *ProjectCreate) SetDsn(v string) *ProjectCreate
- func (_c *ProjectCreate) SetName(v string) *ProjectCreate
- func (_c *ProjectCreate) SetNillableCreatedAt(v *time.Time) *ProjectCreate
- func (_c *ProjectCreate) SetNillableDescription(v *string) *ProjectCreate
- func (_c *ProjectCreate) SetNillableStatus(v *string) *ProjectCreate
- func (_c *ProjectCreate) SetNillableUpdatedAt(v *time.Time) *ProjectCreate
- func (_c *ProjectCreate) SetOwner(v *User) *ProjectCreate
- func (_c *ProjectCreate) SetOwnerID(id int) *ProjectCreate
- func (_c *ProjectCreate) SetStatus(v string) *ProjectCreate
- func (_c *ProjectCreate) SetUpdatedAt(v time.Time) *ProjectCreate
- type ProjectCreateBulk
- type ProjectDelete
- type ProjectDeleteOne
- type ProjectEdges
- type ProjectGroupBy
- func (_g *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy
- func (s *ProjectGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProjectGroupBy) BoolX(ctx context.Context) bool
- func (s *ProjectGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ProjectGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ProjectGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProjectGroupBy) Float64X(ctx context.Context) float64
- func (s *ProjectGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProjectGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ProjectGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ProjectGroupBy) IntX(ctx context.Context) int
- func (s *ProjectGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ProjectGroupBy) IntsX(ctx context.Context) []int
- func (_g *ProjectGroupBy) Scan(ctx context.Context, v any) error
- func (s *ProjectGroupBy) ScanX(ctx context.Context, v any)
- func (s *ProjectGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ProjectGroupBy) StringX(ctx context.Context) string
- func (s *ProjectGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ProjectGroupBy) StringsX(ctx context.Context) []string
- type ProjectMutation
- func (m *ProjectMutation) APIKeysCleared() bool
- func (m *ProjectMutation) APIKeysIDs() (ids []int)
- func (m *ProjectMutation) AddAPIKeyIDs(ids ...int)
- func (m *ProjectMutation) AddField(name string, value ent.Value) error
- func (m *ProjectMutation) AddRetentionPolicyIDs(ids ...int)
- func (m *ProjectMutation) AddedEdges() []string
- func (m *ProjectMutation) AddedField(name string) (ent.Value, bool)
- func (m *ProjectMutation) AddedFields() []string
- func (m *ProjectMutation) AddedIDs(name string) []ent.Value
- func (m *ProjectMutation) ClearAPIKeys()
- func (m *ProjectMutation) ClearDescription()
- func (m *ProjectMutation) ClearEdge(name string) error
- func (m *ProjectMutation) ClearField(name string) error
- func (m *ProjectMutation) ClearOwner()
- func (m *ProjectMutation) ClearRetentionPolicies()
- func (m *ProjectMutation) ClearedEdges() []string
- func (m *ProjectMutation) ClearedFields() []string
- func (m ProjectMutation) Client() *Client
- func (m *ProjectMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ProjectMutation) Description() (r string, exists bool)
- func (m *ProjectMutation) DescriptionCleared() bool
- func (m *ProjectMutation) Dsn() (r string, exists bool)
- func (m *ProjectMutation) EdgeCleared(name string) bool
- func (m *ProjectMutation) Field(name string) (ent.Value, bool)
- func (m *ProjectMutation) FieldCleared(name string) bool
- func (m *ProjectMutation) Fields() []string
- func (m *ProjectMutation) ID() (id int, exists bool)
- func (m *ProjectMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ProjectMutation) Name() (r string, exists bool)
- func (m *ProjectMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldDsn(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ProjectMutation) OldName(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldStatus(ctx context.Context) (v string, err error)
- func (m *ProjectMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ProjectMutation) Op() Op
- func (m *ProjectMutation) OwnerCleared() bool
- func (m *ProjectMutation) OwnerID() (id int, exists bool)
- func (m *ProjectMutation) OwnerIDs() (ids []int)
- func (m *ProjectMutation) RemoveAPIKeyIDs(ids ...int)
- func (m *ProjectMutation) RemoveRetentionPolicyIDs(ids ...int)
- func (m *ProjectMutation) RemovedAPIKeysIDs() (ids []int)
- func (m *ProjectMutation) RemovedEdges() []string
- func (m *ProjectMutation) RemovedIDs(name string) []ent.Value
- func (m *ProjectMutation) RemovedRetentionPoliciesIDs() (ids []int)
- func (m *ProjectMutation) ResetAPIKeys()
- func (m *ProjectMutation) ResetCreatedAt()
- func (m *ProjectMutation) ResetDescription()
- func (m *ProjectMutation) ResetDsn()
- func (m *ProjectMutation) ResetEdge(name string) error
- func (m *ProjectMutation) ResetField(name string) error
- func (m *ProjectMutation) ResetName()
- func (m *ProjectMutation) ResetOwner()
- func (m *ProjectMutation) ResetRetentionPolicies()
- func (m *ProjectMutation) ResetStatus()
- func (m *ProjectMutation) ResetUpdatedAt()
- func (m *ProjectMutation) RetentionPoliciesCleared() bool
- func (m *ProjectMutation) RetentionPoliciesIDs() (ids []int)
- func (m *ProjectMutation) SetCreatedAt(t time.Time)
- func (m *ProjectMutation) SetDescription(s string)
- func (m *ProjectMutation) SetDsn(s string)
- func (m *ProjectMutation) SetField(name string, value ent.Value) error
- func (m *ProjectMutation) SetName(s string)
- func (m *ProjectMutation) SetOp(op Op)
- func (m *ProjectMutation) SetOwnerID(id int)
- func (m *ProjectMutation) SetStatus(s string)
- func (m *ProjectMutation) SetUpdatedAt(t time.Time)
- func (m *ProjectMutation) Status() (r string, exists bool)
- func (m ProjectMutation) Tx() (*Tx, error)
- func (m *ProjectMutation) Type() string
- func (m *ProjectMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *ProjectMutation) Where(ps ...predicate.Project)
- func (m *ProjectMutation) WhereP(ps ...func(*sql.Selector))
- type ProjectQuery
- func (_q *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect
- func (_q *ProjectQuery) All(ctx context.Context) ([]*Project, error)
- func (_q *ProjectQuery) AllX(ctx context.Context) []*Project
- func (_q *ProjectQuery) Clone() *ProjectQuery
- func (_q *ProjectQuery) Count(ctx context.Context) (int, error)
- func (_q *ProjectQuery) CountX(ctx context.Context) int
- func (_q *ProjectQuery) Exist(ctx context.Context) (bool, error)
- func (_q *ProjectQuery) ExistX(ctx context.Context) bool
- func (_q *ProjectQuery) First(ctx context.Context) (*Project, error)
- func (_q *ProjectQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *ProjectQuery) FirstIDX(ctx context.Context) int
- func (_q *ProjectQuery) FirstX(ctx context.Context) *Project
- func (_q *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy
- func (_q *ProjectQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *ProjectQuery) IDsX(ctx context.Context) []int
- func (_q *ProjectQuery) Limit(limit int) *ProjectQuery
- func (_q *ProjectQuery) Offset(offset int) *ProjectQuery
- func (_q *ProjectQuery) Only(ctx context.Context) (*Project, error)
- func (_q *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *ProjectQuery) OnlyIDX(ctx context.Context) int
- func (_q *ProjectQuery) OnlyX(ctx context.Context) *Project
- func (_q *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery
- func (_q *ProjectQuery) QueryAPIKeys() *APIKeyQuery
- func (_q *ProjectQuery) QueryOwner() *UserQuery
- func (_q *ProjectQuery) QueryRetentionPolicies() *RetentionPolicyQuery
- func (_q *ProjectQuery) Select(fields ...string) *ProjectSelect
- func (_q *ProjectQuery) Unique(unique bool) *ProjectQuery
- func (_q *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery
- func (_q *ProjectQuery) WithAPIKeys(opts ...func(*APIKeyQuery)) *ProjectQuery
- func (_q *ProjectQuery) WithOwner(opts ...func(*UserQuery)) *ProjectQuery
- func (_q *ProjectQuery) WithRetentionPolicies(opts ...func(*RetentionPolicyQuery)) *ProjectQuery
- type ProjectSelect
- func (_s *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect
- func (s *ProjectSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ProjectSelect) BoolX(ctx context.Context) bool
- func (s *ProjectSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ProjectSelect) BoolsX(ctx context.Context) []bool
- func (s *ProjectSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ProjectSelect) Float64X(ctx context.Context) float64
- func (s *ProjectSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ProjectSelect) Float64sX(ctx context.Context) []float64
- func (s *ProjectSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ProjectSelect) IntX(ctx context.Context) int
- func (s *ProjectSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ProjectSelect) IntsX(ctx context.Context) []int
- func (_s *ProjectSelect) Scan(ctx context.Context, v any) error
- func (s *ProjectSelect) ScanX(ctx context.Context, v any)
- func (s *ProjectSelect) String(ctx context.Context) (_ string, err error)
- func (s *ProjectSelect) StringX(ctx context.Context) string
- func (s *ProjectSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ProjectSelect) StringsX(ctx context.Context) []string
- type ProjectUpdate
- func (_u *ProjectUpdate) AddAPIKeyIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) AddAPIKeys(v ...*APIKey) *ProjectUpdate
- func (_u *ProjectUpdate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
- func (_u *ProjectUpdate) AddRetentionPolicyIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) ClearAPIKeys() *ProjectUpdate
- func (_u *ProjectUpdate) ClearDescription() *ProjectUpdate
- func (_u *ProjectUpdate) ClearOwner() *ProjectUpdate
- func (_u *ProjectUpdate) ClearRetentionPolicies() *ProjectUpdate
- func (_u *ProjectUpdate) Exec(ctx context.Context) error
- func (_u *ProjectUpdate) ExecX(ctx context.Context)
- func (_u *ProjectUpdate) Mutation() *ProjectMutation
- func (_u *ProjectUpdate) RemoveAPIKeyIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) RemoveAPIKeys(v ...*APIKey) *ProjectUpdate
- func (_u *ProjectUpdate) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
- func (_u *ProjectUpdate) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdate
- func (_u *ProjectUpdate) Save(ctx context.Context) (int, error)
- func (_u *ProjectUpdate) SaveX(ctx context.Context) int
- func (_u *ProjectUpdate) SetDescription(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetDsn(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetName(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableDescription(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableDsn(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableName(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetNillableStatus(v *string) *ProjectUpdate
- func (_u *ProjectUpdate) SetOwner(v *User) *ProjectUpdate
- func (_u *ProjectUpdate) SetOwnerID(id int) *ProjectUpdate
- func (_u *ProjectUpdate) SetStatus(v string) *ProjectUpdate
- func (_u *ProjectUpdate) SetUpdatedAt(v time.Time) *ProjectUpdate
- func (_u *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate
- type ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddAPIKeyIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddAPIKeys(v ...*APIKey) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) AddRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearAPIKeys() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearDescription() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearOwner() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) ClearRetentionPolicies() *ProjectUpdateOne
- func (_u *ProjectUpdateOne) Exec(ctx context.Context) error
- func (_u *ProjectUpdateOne) ExecX(ctx context.Context)
- func (_u *ProjectUpdateOne) Mutation() *ProjectMutation
- func (_u *ProjectUpdateOne) RemoveAPIKeyIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) RemoveAPIKeys(v ...*APIKey) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)
- func (_u *ProjectUpdateOne) SaveX(ctx context.Context) *Project
- func (_u *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetDescription(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetDsn(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetName(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableDescription(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableDsn(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableName(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetNillableStatus(v *string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetOwner(v *User) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetOwnerID(id int) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetStatus(v string) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) SetUpdatedAt(v time.Time) *ProjectUpdateOne
- func (_u *ProjectUpdateOne) Where(ps ...predicate.Project) *ProjectUpdateOne
- type Projects
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RetentionPolicies
- type RetentionPolicy
- type RetentionPolicyClient
- func (c *RetentionPolicyClient) Create() *RetentionPolicyCreate
- func (c *RetentionPolicyClient) CreateBulk(builders ...*RetentionPolicyCreate) *RetentionPolicyCreateBulk
- func (c *RetentionPolicyClient) Delete() *RetentionPolicyDelete
- func (c *RetentionPolicyClient) DeleteOne(_m *RetentionPolicy) *RetentionPolicyDeleteOne
- func (c *RetentionPolicyClient) DeleteOneID(id int) *RetentionPolicyDeleteOne
- func (c *RetentionPolicyClient) Get(ctx context.Context, id int) (*RetentionPolicy, error)
- func (c *RetentionPolicyClient) GetX(ctx context.Context, id int) *RetentionPolicy
- func (c *RetentionPolicyClient) Hooks() []Hook
- func (c *RetentionPolicyClient) Intercept(interceptors ...Interceptor)
- func (c *RetentionPolicyClient) Interceptors() []Interceptor
- func (c *RetentionPolicyClient) MapCreateBulk(slice any, setFunc func(*RetentionPolicyCreate, int)) *RetentionPolicyCreateBulk
- func (c *RetentionPolicyClient) Query() *RetentionPolicyQuery
- func (c *RetentionPolicyClient) QueryProject(_m *RetentionPolicy) *ProjectQuery
- func (c *RetentionPolicyClient) Update() *RetentionPolicyUpdate
- func (c *RetentionPolicyClient) UpdateOne(_m *RetentionPolicy) *RetentionPolicyUpdateOne
- func (c *RetentionPolicyClient) UpdateOneID(id int) *RetentionPolicyUpdateOne
- func (c *RetentionPolicyClient) Use(hooks ...Hook)
- type RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) Exec(ctx context.Context) error
- func (_c *RetentionPolicyCreate) ExecX(ctx context.Context)
- func (_c *RetentionPolicyCreate) Mutation() *RetentionPolicyMutation
- func (_c *RetentionPolicyCreate) Save(ctx context.Context) (*RetentionPolicy, error)
- func (_c *RetentionPolicyCreate) SaveX(ctx context.Context) *RetentionPolicy
- func (_c *RetentionPolicyCreate) SetCreatedAt(v time.Time) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetDescription(v string) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetDurationDays(v int) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetIsActive(v bool) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetName(v string) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableCreatedAt(v *time.Time) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableDescription(v *string) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableDurationDays(v *int) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableIsActive(v *bool) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetNillableUpdatedAt(v *time.Time) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetProject(v *Project) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetProjectID(id int) *RetentionPolicyCreate
- func (_c *RetentionPolicyCreate) SetUpdatedAt(v time.Time) *RetentionPolicyCreate
- type RetentionPolicyCreateBulk
- func (_c *RetentionPolicyCreateBulk) Exec(ctx context.Context) error
- func (_c *RetentionPolicyCreateBulk) ExecX(ctx context.Context)
- func (_c *RetentionPolicyCreateBulk) Save(ctx context.Context) ([]*RetentionPolicy, error)
- func (_c *RetentionPolicyCreateBulk) SaveX(ctx context.Context) []*RetentionPolicy
- type RetentionPolicyDelete
- type RetentionPolicyDeleteOne
- type RetentionPolicyEdges
- type RetentionPolicyGroupBy
- func (_g *RetentionPolicyGroupBy) Aggregate(fns ...AggregateFunc) *RetentionPolicyGroupBy
- func (s *RetentionPolicyGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *RetentionPolicyGroupBy) BoolX(ctx context.Context) bool
- func (s *RetentionPolicyGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *RetentionPolicyGroupBy) BoolsX(ctx context.Context) []bool
- func (s *RetentionPolicyGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *RetentionPolicyGroupBy) Float64X(ctx context.Context) float64
- func (s *RetentionPolicyGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *RetentionPolicyGroupBy) Float64sX(ctx context.Context) []float64
- func (s *RetentionPolicyGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *RetentionPolicyGroupBy) IntX(ctx context.Context) int
- func (s *RetentionPolicyGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *RetentionPolicyGroupBy) IntsX(ctx context.Context) []int
- func (_g *RetentionPolicyGroupBy) Scan(ctx context.Context, v any) error
- func (s *RetentionPolicyGroupBy) ScanX(ctx context.Context, v any)
- func (s *RetentionPolicyGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *RetentionPolicyGroupBy) StringX(ctx context.Context) string
- func (s *RetentionPolicyGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *RetentionPolicyGroupBy) StringsX(ctx context.Context) []string
- type RetentionPolicyMutation
- func (m *RetentionPolicyMutation) AddDurationDays(i int)
- func (m *RetentionPolicyMutation) AddField(name string, value ent.Value) error
- func (m *RetentionPolicyMutation) AddedDurationDays() (r int, exists bool)
- func (m *RetentionPolicyMutation) AddedEdges() []string
- func (m *RetentionPolicyMutation) AddedField(name string) (ent.Value, bool)
- func (m *RetentionPolicyMutation) AddedFields() []string
- func (m *RetentionPolicyMutation) AddedIDs(name string) []ent.Value
- func (m *RetentionPolicyMutation) ClearDescription()
- func (m *RetentionPolicyMutation) ClearEdge(name string) error
- func (m *RetentionPolicyMutation) ClearField(name string) error
- func (m *RetentionPolicyMutation) ClearProject()
- func (m *RetentionPolicyMutation) ClearedEdges() []string
- func (m *RetentionPolicyMutation) ClearedFields() []string
- func (m RetentionPolicyMutation) Client() *Client
- func (m *RetentionPolicyMutation) CreatedAt() (r time.Time, exists bool)
- func (m *RetentionPolicyMutation) Description() (r string, exists bool)
- func (m *RetentionPolicyMutation) DescriptionCleared() bool
- func (m *RetentionPolicyMutation) DurationDays() (r int, exists bool)
- func (m *RetentionPolicyMutation) EdgeCleared(name string) bool
- func (m *RetentionPolicyMutation) Field(name string) (ent.Value, bool)
- func (m *RetentionPolicyMutation) FieldCleared(name string) bool
- func (m *RetentionPolicyMutation) Fields() []string
- func (m *RetentionPolicyMutation) ID() (id int, exists bool)
- func (m *RetentionPolicyMutation) IDs(ctx context.Context) ([]int, error)
- func (m *RetentionPolicyMutation) IsActive() (r bool, exists bool)
- func (m *RetentionPolicyMutation) Name() (r string, exists bool)
- func (m *RetentionPolicyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RetentionPolicyMutation) OldDescription(ctx context.Context) (v string, err error)
- func (m *RetentionPolicyMutation) OldDurationDays(ctx context.Context) (v int, err error)
- func (m *RetentionPolicyMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *RetentionPolicyMutation) OldIsActive(ctx context.Context) (v bool, err error)
- func (m *RetentionPolicyMutation) OldName(ctx context.Context) (v string, err error)
- func (m *RetentionPolicyMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *RetentionPolicyMutation) Op() Op
- func (m *RetentionPolicyMutation) ProjectCleared() bool
- func (m *RetentionPolicyMutation) ProjectID() (id int, exists bool)
- func (m *RetentionPolicyMutation) ProjectIDs() (ids []int)
- func (m *RetentionPolicyMutation) RemovedEdges() []string
- func (m *RetentionPolicyMutation) RemovedIDs(name string) []ent.Value
- func (m *RetentionPolicyMutation) ResetCreatedAt()
- func (m *RetentionPolicyMutation) ResetDescription()
- func (m *RetentionPolicyMutation) ResetDurationDays()
- func (m *RetentionPolicyMutation) ResetEdge(name string) error
- func (m *RetentionPolicyMutation) ResetField(name string) error
- func (m *RetentionPolicyMutation) ResetIsActive()
- func (m *RetentionPolicyMutation) ResetName()
- func (m *RetentionPolicyMutation) ResetProject()
- func (m *RetentionPolicyMutation) ResetUpdatedAt()
- func (m *RetentionPolicyMutation) SetCreatedAt(t time.Time)
- func (m *RetentionPolicyMutation) SetDescription(s string)
- func (m *RetentionPolicyMutation) SetDurationDays(i int)
- func (m *RetentionPolicyMutation) SetField(name string, value ent.Value) error
- func (m *RetentionPolicyMutation) SetIsActive(b bool)
- func (m *RetentionPolicyMutation) SetName(s string)
- func (m *RetentionPolicyMutation) SetOp(op Op)
- func (m *RetentionPolicyMutation) SetProjectID(id int)
- func (m *RetentionPolicyMutation) SetUpdatedAt(t time.Time)
- func (m RetentionPolicyMutation) Tx() (*Tx, error)
- func (m *RetentionPolicyMutation) Type() string
- func (m *RetentionPolicyMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *RetentionPolicyMutation) Where(ps ...predicate.RetentionPolicy)
- func (m *RetentionPolicyMutation) WhereP(ps ...func(*sql.Selector))
- type RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
- func (_q *RetentionPolicyQuery) All(ctx context.Context) ([]*RetentionPolicy, error)
- func (_q *RetentionPolicyQuery) AllX(ctx context.Context) []*RetentionPolicy
- func (_q *RetentionPolicyQuery) Clone() *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Count(ctx context.Context) (int, error)
- func (_q *RetentionPolicyQuery) CountX(ctx context.Context) int
- func (_q *RetentionPolicyQuery) Exist(ctx context.Context) (bool, error)
- func (_q *RetentionPolicyQuery) ExistX(ctx context.Context) bool
- func (_q *RetentionPolicyQuery) First(ctx context.Context) (*RetentionPolicy, error)
- func (_q *RetentionPolicyQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *RetentionPolicyQuery) FirstIDX(ctx context.Context) int
- func (_q *RetentionPolicyQuery) FirstX(ctx context.Context) *RetentionPolicy
- func (_q *RetentionPolicyQuery) GroupBy(field string, fields ...string) *RetentionPolicyGroupBy
- func (_q *RetentionPolicyQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *RetentionPolicyQuery) IDsX(ctx context.Context) []int
- func (_q *RetentionPolicyQuery) Limit(limit int) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Offset(offset int) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Only(ctx context.Context) (*RetentionPolicy, error)
- func (_q *RetentionPolicyQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *RetentionPolicyQuery) OnlyIDX(ctx context.Context) int
- func (_q *RetentionPolicyQuery) OnlyX(ctx context.Context) *RetentionPolicy
- func (_q *RetentionPolicyQuery) Order(o ...retentionpolicy.OrderOption) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) QueryProject() *ProjectQuery
- func (_q *RetentionPolicyQuery) Select(fields ...string) *RetentionPolicySelect
- func (_q *RetentionPolicyQuery) Unique(unique bool) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyQuery
- func (_q *RetentionPolicyQuery) WithProject(opts ...func(*ProjectQuery)) *RetentionPolicyQuery
- type RetentionPolicySelect
- func (_s *RetentionPolicySelect) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
- func (s *RetentionPolicySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *RetentionPolicySelect) BoolX(ctx context.Context) bool
- func (s *RetentionPolicySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *RetentionPolicySelect) BoolsX(ctx context.Context) []bool
- func (s *RetentionPolicySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *RetentionPolicySelect) Float64X(ctx context.Context) float64
- func (s *RetentionPolicySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *RetentionPolicySelect) Float64sX(ctx context.Context) []float64
- func (s *RetentionPolicySelect) Int(ctx context.Context) (_ int, err error)
- func (s *RetentionPolicySelect) IntX(ctx context.Context) int
- func (s *RetentionPolicySelect) Ints(ctx context.Context) ([]int, error)
- func (s *RetentionPolicySelect) IntsX(ctx context.Context) []int
- func (_s *RetentionPolicySelect) Scan(ctx context.Context, v any) error
- func (s *RetentionPolicySelect) ScanX(ctx context.Context, v any)
- func (s *RetentionPolicySelect) String(ctx context.Context) (_ string, err error)
- func (s *RetentionPolicySelect) StringX(ctx context.Context) string
- func (s *RetentionPolicySelect) Strings(ctx context.Context) ([]string, error)
- func (s *RetentionPolicySelect) StringsX(ctx context.Context) []string
- type RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) AddDurationDays(v int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) ClearDescription() *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) ClearProject() *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) Exec(ctx context.Context) error
- func (_u *RetentionPolicyUpdate) ExecX(ctx context.Context)
- func (_u *RetentionPolicyUpdate) Mutation() *RetentionPolicyMutation
- func (_u *RetentionPolicyUpdate) Save(ctx context.Context) (int, error)
- func (_u *RetentionPolicyUpdate) SaveX(ctx context.Context) int
- func (_u *RetentionPolicyUpdate) SetDescription(v string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetDurationDays(v int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetIsActive(v bool) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetName(v string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableDescription(v *string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableDurationDays(v *int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableIsActive(v *bool) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetNillableName(v *string) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetProject(v *Project) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetProjectID(id int) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) SetUpdatedAt(v time.Time) *RetentionPolicyUpdate
- func (_u *RetentionPolicyUpdate) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdate
- type RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) AddDurationDays(v int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) ClearDescription() *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) ClearProject() *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) Exec(ctx context.Context) error
- func (_u *RetentionPolicyUpdateOne) ExecX(ctx context.Context)
- func (_u *RetentionPolicyUpdateOne) Mutation() *RetentionPolicyMutation
- func (_u *RetentionPolicyUpdateOne) Save(ctx context.Context) (*RetentionPolicy, error)
- func (_u *RetentionPolicyUpdateOne) SaveX(ctx context.Context) *RetentionPolicy
- func (_u *RetentionPolicyUpdateOne) Select(field string, fields ...string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetDescription(v string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetDurationDays(v int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetIsActive(v bool) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetName(v string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableDescription(v *string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableDurationDays(v *int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableIsActive(v *bool) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetNillableName(v *string) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetProject(v *Project) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetProjectID(id int) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) SetUpdatedAt(v time.Time) *RetentionPolicyUpdateOne
- func (_u *RetentionPolicyUpdateOne) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdateOne
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- 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) QueryAPIKeys(_m *User) *APIKeyQuery
- func (c *UserClient) QueryProjects(_m *User) *ProjectQuery
- 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) AddAPIKeyIDs(ids ...int) *UserCreate
- func (_c *UserCreate) AddAPIKeys(v ...*APIKey) *UserCreate
- func (_c *UserCreate) AddProjectIDs(ids ...int) *UserCreate
- func (_c *UserCreate) AddProjects(v ...*Project) *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) SetCreatedAt(v time.Time) *UserCreate
- func (_c *UserCreate) SetEmail(v string) *UserCreate
- func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetNillableRole(v *string) *UserCreate
- func (_c *UserCreate) SetNillableUpdatedAt(v *time.Time) *UserCreate
- func (_c *UserCreate) SetPasswordHash(v string) *UserCreate
- func (_c *UserCreate) SetRole(v string) *UserCreate
- func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate
- func (_c *UserCreate) SetUsername(v string) *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) APIKeysCleared() bool
- func (m *UserMutation) APIKeysIDs() (ids []int)
- func (m *UserMutation) AddAPIKeyIDs(ids ...int)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddProjectIDs(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) ClearAPIKeys()
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearProjects()
- 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) 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) OldPasswordHash(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)
- func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) PasswordHash() (r string, exists bool)
- func (m *UserMutation) ProjectsCleared() bool
- func (m *UserMutation) ProjectsIDs() (ids []int)
- func (m *UserMutation) RemoveAPIKeyIDs(ids ...int)
- func (m *UserMutation) RemoveProjectIDs(ids ...int)
- func (m *UserMutation) RemovedAPIKeysIDs() (ids []int)
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) RemovedProjectsIDs() (ids []int)
- func (m *UserMutation) ResetAPIKeys()
- 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) ResetPasswordHash()
- func (m *UserMutation) ResetProjects()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetUpdatedAt()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) Role() (r string, exists bool)
- 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) SetOp(op Op)
- func (m *UserMutation) SetPasswordHash(s string)
- func (m *UserMutation) SetRole(s string)
- func (m *UserMutation) SetUpdatedAt(t time.Time)
- func (m *UserMutation) SetUsername(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *UserMutation) Username() (r string, 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) QueryAPIKeys() *APIKeyQuery
- func (_q *UserQuery) QueryProjects() *ProjectQuery
- 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) WithAPIKeys(opts ...func(*APIKeyQuery)) *UserQuery
- func (_q *UserQuery) WithProjects(opts ...func(*ProjectQuery)) *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) AddAPIKeyIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) AddAPIKeys(v ...*APIKey) *UserUpdate
- func (_u *UserUpdate) AddProjectIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) AddProjects(v ...*Project) *UserUpdate
- func (_u *UserUpdate) ClearAPIKeys() *UserUpdate
- func (_u *UserUpdate) ClearProjects() *UserUpdate
- func (_u *UserUpdate) Exec(ctx context.Context) error
- func (_u *UserUpdate) ExecX(ctx context.Context)
- func (_u *UserUpdate) Mutation() *UserMutation
- func (_u *UserUpdate) RemoveAPIKeyIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) RemoveAPIKeys(v ...*APIKey) *UserUpdate
- func (_u *UserUpdate) RemoveProjectIDs(ids ...int) *UserUpdate
- func (_u *UserUpdate) RemoveProjects(v ...*Project) *UserUpdate
- func (_u *UserUpdate) Save(ctx context.Context) (int, error)
- func (_u *UserUpdate) SaveX(ctx context.Context) int
- func (_u *UserUpdate) SetEmail(v string) *UserUpdate
- func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillablePasswordHash(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableRole(v *string) *UserUpdate
- func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate
- func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate
- func (_u *UserUpdate) SetRole(v string) *UserUpdate
- func (_u *UserUpdate) SetUpdatedAt(v time.Time) *UserUpdate
- func (_u *UserUpdate) SetUsername(v string) *UserUpdate
- func (_u *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (_u *UserUpdateOne) AddAPIKeyIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) AddAPIKeys(v ...*APIKey) *UserUpdateOne
- func (_u *UserUpdateOne) AddProjectIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) AddProjects(v ...*Project) *UserUpdateOne
- func (_u *UserUpdateOne) ClearAPIKeys() *UserUpdateOne
- func (_u *UserUpdateOne) ClearProjects() *UserUpdateOne
- func (_u *UserUpdateOne) Exec(ctx context.Context) error
- func (_u *UserUpdateOne) ExecX(ctx context.Context)
- func (_u *UserUpdateOne) Mutation() *UserMutation
- func (_u *UserUpdateOne) RemoveAPIKeyIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveAPIKeys(v ...*APIKey) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveProjectIDs(ids ...int) *UserUpdateOne
- func (_u *UserUpdateOne) RemoveProjects(v ...*Project) *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) SetEmail(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillablePasswordHash(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableRole(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne
- func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetRole(v string) *UserUpdateOne
- func (_u *UserUpdateOne) SetUpdatedAt(v time.Time) *UserUpdateOne
- func (_u *UserUpdateOne) SetUsername(v string) *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. TypeAPIKey = "APIKey" TypeProject = "Project" TypeRetentionPolicy = "RetentionPolicy" TypeUser = "User" )
Variables ¶
var ErrTxStarted = errors.New("data: 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 APIKey ¶
type APIKey struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// API key name for identification
Name string `json:"name,omitempty"`
// Hashed API key for authentication
HashedKey string `json:"-"`
// API key permissions: read, write, admin
Permissions string `json:"permissions,omitempty"`
// Whether the API key is active
IsActive bool `json:"is_active,omitempty"`
// When the API key was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the API key was last updated
UpdatedAt time.Time `json:"updated_at,omitempty"`
// When the API key was last used
LastUsedAt time.Time `json:"last_used_at,omitempty"`
// When the API key expires
ExpiresAt time.Time `json:"expires_at,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the APIKeyQuery when eager-loading is set.
Edges APIKeyEdges `json:"edges"`
// contains filtered or unexported fields
}
APIKey is the model entity for the APIKey schema.
func (*APIKey) QueryCreatedBy ¶
QueryCreatedBy queries the "created_by" edge of the APIKey entity.
func (*APIKey) QueryProject ¶
func (_m *APIKey) QueryProject() *ProjectQuery
QueryProject queries the "project" edge of the APIKey entity.
func (*APIKey) Unwrap ¶
Unwrap unwraps the APIKey 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 (*APIKey) Update ¶
func (_m *APIKey) Update() *APIKeyUpdateOne
Update returns a builder for updating this APIKey. Note that you need to call APIKey.Unwrap() before calling this method if this APIKey was returned from a transaction, and the transaction was committed or rolled back.
type APIKeyClient ¶
type APIKeyClient struct {
// contains filtered or unexported fields
}
APIKeyClient is a client for the APIKey schema.
func NewAPIKeyClient ¶
func NewAPIKeyClient(c config) *APIKeyClient
NewAPIKeyClient returns a client for the APIKey from the given config.
func (*APIKeyClient) Create ¶
func (c *APIKeyClient) Create() *APIKeyCreate
Create returns a builder for creating a APIKey entity.
func (*APIKeyClient) CreateBulk ¶
func (c *APIKeyClient) CreateBulk(builders ...*APIKeyCreate) *APIKeyCreateBulk
CreateBulk returns a builder for creating a bulk of APIKey entities.
func (*APIKeyClient) Delete ¶
func (c *APIKeyClient) Delete() *APIKeyDelete
Delete returns a delete builder for APIKey.
func (*APIKeyClient) DeleteOne ¶
func (c *APIKeyClient) DeleteOne(_m *APIKey) *APIKeyDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*APIKeyClient) DeleteOneID ¶
func (c *APIKeyClient) DeleteOneID(id int) *APIKeyDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*APIKeyClient) GetX ¶
func (c *APIKeyClient) GetX(ctx context.Context, id int) *APIKey
GetX is like Get, but panics if an error occurs.
func (*APIKeyClient) Intercept ¶
func (c *APIKeyClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `apikey.Intercept(f(g(h())))`.
func (*APIKeyClient) Interceptors ¶
func (c *APIKeyClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*APIKeyClient) MapCreateBulk ¶
func (c *APIKeyClient) MapCreateBulk(slice any, setFunc func(*APIKeyCreate, int)) *APIKeyCreateBulk
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 (*APIKeyClient) Query ¶
func (c *APIKeyClient) Query() *APIKeyQuery
Query returns a query builder for APIKey.
func (*APIKeyClient) QueryCreatedBy ¶
func (c *APIKeyClient) QueryCreatedBy(_m *APIKey) *UserQuery
QueryCreatedBy queries the created_by edge of a APIKey.
func (*APIKeyClient) QueryProject ¶
func (c *APIKeyClient) QueryProject(_m *APIKey) *ProjectQuery
QueryProject queries the project edge of a APIKey.
func (*APIKeyClient) Update ¶
func (c *APIKeyClient) Update() *APIKeyUpdate
Update returns an update builder for APIKey.
func (*APIKeyClient) UpdateOne ¶
func (c *APIKeyClient) UpdateOne(_m *APIKey) *APIKeyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*APIKeyClient) UpdateOneID ¶
func (c *APIKeyClient) UpdateOneID(id int) *APIKeyUpdateOne
UpdateOneID returns an update builder for the given id.
func (*APIKeyClient) Use ¶
func (c *APIKeyClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `apikey.Hooks(f(g(h())))`.
type APIKeyCreate ¶
type APIKeyCreate struct {
// contains filtered or unexported fields
}
APIKeyCreate is the builder for creating a APIKey entity.
func (*APIKeyCreate) Exec ¶
func (_c *APIKeyCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*APIKeyCreate) ExecX ¶
func (_c *APIKeyCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*APIKeyCreate) Mutation ¶
func (_c *APIKeyCreate) Mutation() *APIKeyMutation
Mutation returns the APIKeyMutation object of the builder.
func (*APIKeyCreate) Save ¶
func (_c *APIKeyCreate) Save(ctx context.Context) (*APIKey, error)
Save creates the APIKey in the database.
func (*APIKeyCreate) SaveX ¶
func (_c *APIKeyCreate) SaveX(ctx context.Context) *APIKey
SaveX calls Save and panics if Save returns an error.
func (*APIKeyCreate) SetCreatedAt ¶
func (_c *APIKeyCreate) SetCreatedAt(v time.Time) *APIKeyCreate
SetCreatedAt sets the "created_at" field.
func (*APIKeyCreate) SetCreatedBy ¶
func (_c *APIKeyCreate) SetCreatedBy(v *User) *APIKeyCreate
SetCreatedBy sets the "created_by" edge to the User entity.
func (*APIKeyCreate) SetCreatedByID ¶
func (_c *APIKeyCreate) SetCreatedByID(id int) *APIKeyCreate
SetCreatedByID sets the "created_by" edge to the User entity by ID.
func (*APIKeyCreate) SetExpiresAt ¶
func (_c *APIKeyCreate) SetExpiresAt(v time.Time) *APIKeyCreate
SetExpiresAt sets the "expires_at" field.
func (*APIKeyCreate) SetHashedKey ¶
func (_c *APIKeyCreate) SetHashedKey(v string) *APIKeyCreate
SetHashedKey sets the "hashed_key" field.
func (*APIKeyCreate) SetIsActive ¶
func (_c *APIKeyCreate) SetIsActive(v bool) *APIKeyCreate
SetIsActive sets the "is_active" field.
func (*APIKeyCreate) SetLastUsedAt ¶
func (_c *APIKeyCreate) SetLastUsedAt(v time.Time) *APIKeyCreate
SetLastUsedAt sets the "last_used_at" field.
func (*APIKeyCreate) SetName ¶
func (_c *APIKeyCreate) SetName(v string) *APIKeyCreate
SetName sets the "name" field.
func (*APIKeyCreate) SetNillableCreatedAt ¶
func (_c *APIKeyCreate) SetNillableCreatedAt(v *time.Time) *APIKeyCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*APIKeyCreate) SetNillableExpiresAt ¶
func (_c *APIKeyCreate) SetNillableExpiresAt(v *time.Time) *APIKeyCreate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*APIKeyCreate) SetNillableIsActive ¶
func (_c *APIKeyCreate) SetNillableIsActive(v *bool) *APIKeyCreate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*APIKeyCreate) SetNillableLastUsedAt ¶
func (_c *APIKeyCreate) SetNillableLastUsedAt(v *time.Time) *APIKeyCreate
SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.
func (*APIKeyCreate) SetNillablePermissions ¶
func (_c *APIKeyCreate) SetNillablePermissions(v *string) *APIKeyCreate
SetNillablePermissions sets the "permissions" field if the given value is not nil.
func (*APIKeyCreate) SetNillableUpdatedAt ¶
func (_c *APIKeyCreate) SetNillableUpdatedAt(v *time.Time) *APIKeyCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*APIKeyCreate) SetPermissions ¶
func (_c *APIKeyCreate) SetPermissions(v string) *APIKeyCreate
SetPermissions sets the "permissions" field.
func (*APIKeyCreate) SetProject ¶
func (_c *APIKeyCreate) SetProject(v *Project) *APIKeyCreate
SetProject sets the "project" edge to the Project entity.
func (*APIKeyCreate) SetProjectID ¶
func (_c *APIKeyCreate) SetProjectID(id int) *APIKeyCreate
SetProjectID sets the "project" edge to the Project entity by ID.
func (*APIKeyCreate) SetUpdatedAt ¶
func (_c *APIKeyCreate) SetUpdatedAt(v time.Time) *APIKeyCreate
SetUpdatedAt sets the "updated_at" field.
type APIKeyCreateBulk ¶
type APIKeyCreateBulk struct {
// contains filtered or unexported fields
}
APIKeyCreateBulk is the builder for creating many APIKey entities in bulk.
func (*APIKeyCreateBulk) Exec ¶
func (_c *APIKeyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*APIKeyCreateBulk) ExecX ¶
func (_c *APIKeyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type APIKeyDelete ¶
type APIKeyDelete struct {
// contains filtered or unexported fields
}
APIKeyDelete is the builder for deleting a APIKey entity.
func (*APIKeyDelete) Exec ¶
func (_d *APIKeyDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*APIKeyDelete) ExecX ¶
func (_d *APIKeyDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*APIKeyDelete) Where ¶
func (_d *APIKeyDelete) Where(ps ...predicate.APIKey) *APIKeyDelete
Where appends a list predicates to the APIKeyDelete builder.
type APIKeyDeleteOne ¶
type APIKeyDeleteOne struct {
// contains filtered or unexported fields
}
APIKeyDeleteOne is the builder for deleting a single APIKey entity.
func (*APIKeyDeleteOne) Exec ¶
func (_d *APIKeyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*APIKeyDeleteOne) ExecX ¶
func (_d *APIKeyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*APIKeyDeleteOne) Where ¶
func (_d *APIKeyDeleteOne) Where(ps ...predicate.APIKey) *APIKeyDeleteOne
Where appends a list predicates to the APIKeyDelete builder.
type APIKeyEdges ¶
type APIKeyEdges struct {
// Project this API key belongs to
Project *Project `json:"project,omitempty"`
// User who created this API key
CreatedBy *User `json:"created_by,omitempty"`
// contains filtered or unexported fields
}
APIKeyEdges holds the relations/edges for other nodes in the graph.
func (APIKeyEdges) CreatedByOrErr ¶
func (e APIKeyEdges) CreatedByOrErr() (*User, error)
CreatedByOrErr returns the CreatedBy value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (APIKeyEdges) ProjectOrErr ¶
func (e APIKeyEdges) ProjectOrErr() (*Project, error)
ProjectOrErr returns the Project value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type APIKeyGroupBy ¶
type APIKeyGroupBy struct {
// contains filtered or unexported fields
}
APIKeyGroupBy is the group-by builder for APIKey entities.
func (*APIKeyGroupBy) Aggregate ¶
func (_g *APIKeyGroupBy) Aggregate(fns ...AggregateFunc) *APIKeyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*APIKeyGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*APIKeyGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*APIKeyGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*APIKeyGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*APIKeyGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*APIKeyGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*APIKeyGroupBy) Scan ¶
func (_g *APIKeyGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*APIKeyGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type APIKeyMutation ¶
type APIKeyMutation struct {
// contains filtered or unexported fields
}
APIKeyMutation represents an operation that mutates the APIKey nodes in the graph.
func (*APIKeyMutation) AddField ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) AddedEdges ¶
func (m *APIKeyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*APIKeyMutation) AddedField ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) AddedFields ¶
func (m *APIKeyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*APIKeyMutation) AddedIDs ¶
func (m *APIKeyMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*APIKeyMutation) ClearCreatedBy ¶
func (m *APIKeyMutation) ClearCreatedBy()
ClearCreatedBy clears the "created_by" edge to the User entity.
func (*APIKeyMutation) ClearEdge ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) ClearExpiresAt ¶
func (m *APIKeyMutation) ClearExpiresAt()
ClearExpiresAt clears the value of the "expires_at" field.
func (*APIKeyMutation) ClearField ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) ClearLastUsedAt ¶
func (m *APIKeyMutation) ClearLastUsedAt()
ClearLastUsedAt clears the value of the "last_used_at" field.
func (*APIKeyMutation) ClearProject ¶
func (m *APIKeyMutation) ClearProject()
ClearProject clears the "project" edge to the Project entity.
func (*APIKeyMutation) ClearedEdges ¶
func (m *APIKeyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*APIKeyMutation) ClearedFields ¶
func (m *APIKeyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (APIKeyMutation) Client ¶
func (m APIKeyMutation) 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 (*APIKeyMutation) CreatedAt ¶
func (m *APIKeyMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*APIKeyMutation) CreatedByCleared ¶
func (m *APIKeyMutation) CreatedByCleared() bool
CreatedByCleared reports if the "created_by" edge to the User entity was cleared.
func (*APIKeyMutation) CreatedByID ¶
func (m *APIKeyMutation) CreatedByID() (id int, exists bool)
CreatedByID returns the "created_by" edge ID in the mutation.
func (*APIKeyMutation) CreatedByIDs ¶
func (m *APIKeyMutation) CreatedByIDs() (ids []int)
CreatedByIDs returns the "created_by" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CreatedByID instead. It exists only for internal usage by the builders.
func (*APIKeyMutation) EdgeCleared ¶
func (m *APIKeyMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*APIKeyMutation) ExpiresAt ¶
func (m *APIKeyMutation) ExpiresAt() (r time.Time, exists bool)
ExpiresAt returns the value of the "expires_at" field in the mutation.
func (*APIKeyMutation) ExpiresAtCleared ¶
func (m *APIKeyMutation) ExpiresAtCleared() bool
ExpiresAtCleared returns if the "expires_at" field was cleared in this mutation.
func (*APIKeyMutation) Field ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) FieldCleared ¶
func (m *APIKeyMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*APIKeyMutation) Fields ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) HashedKey ¶
func (m *APIKeyMutation) HashedKey() (r string, exists bool)
HashedKey returns the value of the "hashed_key" field in the mutation.
func (*APIKeyMutation) ID ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) IDs ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) IsActive ¶
func (m *APIKeyMutation) IsActive() (r bool, exists bool)
IsActive returns the value of the "is_active" field in the mutation.
func (*APIKeyMutation) LastUsedAt ¶
func (m *APIKeyMutation) LastUsedAt() (r time.Time, exists bool)
LastUsedAt returns the value of the "last_used_at" field in the mutation.
func (*APIKeyMutation) LastUsedAtCleared ¶
func (m *APIKeyMutation) LastUsedAtCleared() bool
LastUsedAtCleared returns if the "last_used_at" field was cleared in this mutation.
func (*APIKeyMutation) Name ¶
func (m *APIKeyMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*APIKeyMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) OldExpiresAt ¶
OldExpiresAt returns the old "expires_at" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) 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 (*APIKeyMutation) OldHashedKey ¶
func (m *APIKeyMutation) OldHashedKey(ctx context.Context) (v string, err error)
OldHashedKey returns the old "hashed_key" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) OldIsActive ¶
func (m *APIKeyMutation) OldIsActive(ctx context.Context) (v bool, err error)
OldIsActive returns the old "is_active" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) OldLastUsedAt ¶
OldLastUsedAt returns the old "last_used_at" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) OldName ¶
func (m *APIKeyMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) OldPermissions ¶
func (m *APIKeyMutation) OldPermissions(ctx context.Context) (v string, err error)
OldPermissions returns the old "permissions" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the APIKey entity. If the APIKey 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 (*APIKeyMutation) Permissions ¶
func (m *APIKeyMutation) Permissions() (r string, exists bool)
Permissions returns the value of the "permissions" field in the mutation.
func (*APIKeyMutation) ProjectCleared ¶
func (m *APIKeyMutation) ProjectCleared() bool
ProjectCleared reports if the "project" edge to the Project entity was cleared.
func (*APIKeyMutation) ProjectID ¶
func (m *APIKeyMutation) ProjectID() (id int, exists bool)
ProjectID returns the "project" edge ID in the mutation.
func (*APIKeyMutation) ProjectIDs ¶
func (m *APIKeyMutation) ProjectIDs() (ids []int)
ProjectIDs returns the "project" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProjectID instead. It exists only for internal usage by the builders.
func (*APIKeyMutation) RemovedEdges ¶
func (m *APIKeyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*APIKeyMutation) RemovedIDs ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) ResetCreatedAt ¶
func (m *APIKeyMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*APIKeyMutation) ResetCreatedBy ¶
func (m *APIKeyMutation) ResetCreatedBy()
ResetCreatedBy resets all changes to the "created_by" edge.
func (*APIKeyMutation) ResetEdge ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) ResetExpiresAt ¶
func (m *APIKeyMutation) ResetExpiresAt()
ResetExpiresAt resets all changes to the "expires_at" field.
func (*APIKeyMutation) ResetField ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) ResetHashedKey ¶
func (m *APIKeyMutation) ResetHashedKey()
ResetHashedKey resets all changes to the "hashed_key" field.
func (*APIKeyMutation) ResetIsActive ¶
func (m *APIKeyMutation) ResetIsActive()
ResetIsActive resets all changes to the "is_active" field.
func (*APIKeyMutation) ResetLastUsedAt ¶
func (m *APIKeyMutation) ResetLastUsedAt()
ResetLastUsedAt resets all changes to the "last_used_at" field.
func (*APIKeyMutation) ResetName ¶
func (m *APIKeyMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*APIKeyMutation) ResetPermissions ¶
func (m *APIKeyMutation) ResetPermissions()
ResetPermissions resets all changes to the "permissions" field.
func (*APIKeyMutation) ResetProject ¶
func (m *APIKeyMutation) ResetProject()
ResetProject resets all changes to the "project" edge.
func (*APIKeyMutation) ResetUpdatedAt ¶
func (m *APIKeyMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*APIKeyMutation) SetCreatedAt ¶
func (m *APIKeyMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*APIKeyMutation) SetCreatedByID ¶
func (m *APIKeyMutation) SetCreatedByID(id int)
SetCreatedByID sets the "created_by" edge to the User entity by id.
func (*APIKeyMutation) SetExpiresAt ¶
func (m *APIKeyMutation) SetExpiresAt(t time.Time)
SetExpiresAt sets the "expires_at" field.
func (*APIKeyMutation) SetField ¶
func (m *APIKeyMutation) 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 (*APIKeyMutation) SetHashedKey ¶
func (m *APIKeyMutation) SetHashedKey(s string)
SetHashedKey sets the "hashed_key" field.
func (*APIKeyMutation) SetIsActive ¶
func (m *APIKeyMutation) SetIsActive(b bool)
SetIsActive sets the "is_active" field.
func (*APIKeyMutation) SetLastUsedAt ¶
func (m *APIKeyMutation) SetLastUsedAt(t time.Time)
SetLastUsedAt sets the "last_used_at" field.
func (*APIKeyMutation) SetName ¶
func (m *APIKeyMutation) SetName(s string)
SetName sets the "name" field.
func (*APIKeyMutation) SetOp ¶
func (m *APIKeyMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*APIKeyMutation) SetPermissions ¶
func (m *APIKeyMutation) SetPermissions(s string)
SetPermissions sets the "permissions" field.
func (*APIKeyMutation) SetProjectID ¶
func (m *APIKeyMutation) SetProjectID(id int)
SetProjectID sets the "project" edge to the Project entity by id.
func (*APIKeyMutation) SetUpdatedAt ¶
func (m *APIKeyMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (APIKeyMutation) Tx ¶
func (m APIKeyMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*APIKeyMutation) Type ¶
func (m *APIKeyMutation) Type() string
Type returns the node type of this mutation (APIKey).
func (*APIKeyMutation) UpdatedAt ¶
func (m *APIKeyMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*APIKeyMutation) Where ¶
func (m *APIKeyMutation) Where(ps ...predicate.APIKey)
Where appends a list predicates to the APIKeyMutation builder.
func (*APIKeyMutation) WhereP ¶
func (m *APIKeyMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the APIKeyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type APIKeyQuery ¶
type APIKeyQuery struct {
// contains filtered or unexported fields
}
APIKeyQuery is the builder for querying APIKey entities.
func (*APIKeyQuery) Aggregate ¶
func (_q *APIKeyQuery) Aggregate(fns ...AggregateFunc) *APIKeySelect
Aggregate returns a APIKeySelect configured with the given aggregations.
func (*APIKeyQuery) All ¶
func (_q *APIKeyQuery) All(ctx context.Context) ([]*APIKey, error)
All executes the query and returns a list of APIKeys.
func (*APIKeyQuery) AllX ¶
func (_q *APIKeyQuery) AllX(ctx context.Context) []*APIKey
AllX is like All, but panics if an error occurs.
func (*APIKeyQuery) Clone ¶
func (_q *APIKeyQuery) Clone() *APIKeyQuery
Clone returns a duplicate of the APIKeyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*APIKeyQuery) Count ¶
func (_q *APIKeyQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*APIKeyQuery) CountX ¶
func (_q *APIKeyQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*APIKeyQuery) Exist ¶
func (_q *APIKeyQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*APIKeyQuery) ExistX ¶
func (_q *APIKeyQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*APIKeyQuery) First ¶
func (_q *APIKeyQuery) First(ctx context.Context) (*APIKey, error)
First returns the first APIKey entity from the query. Returns a *NotFoundError when no APIKey was found.
func (*APIKeyQuery) FirstID ¶
func (_q *APIKeyQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first APIKey ID from the query. Returns a *NotFoundError when no APIKey ID was found.
func (*APIKeyQuery) FirstIDX ¶
func (_q *APIKeyQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*APIKeyQuery) FirstX ¶
func (_q *APIKeyQuery) FirstX(ctx context.Context) *APIKey
FirstX is like First, but panics if an error occurs.
func (*APIKeyQuery) GroupBy ¶
func (_q *APIKeyQuery) GroupBy(field string, fields ...string) *APIKeyGroupBy
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.APIKey.Query().
GroupBy(apikey.FieldName).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*APIKeyQuery) IDs ¶
func (_q *APIKeyQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of APIKey IDs.
func (*APIKeyQuery) IDsX ¶
func (_q *APIKeyQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*APIKeyQuery) Limit ¶
func (_q *APIKeyQuery) Limit(limit int) *APIKeyQuery
Limit the number of records to be returned by this query.
func (*APIKeyQuery) Offset ¶
func (_q *APIKeyQuery) Offset(offset int) *APIKeyQuery
Offset to start from.
func (*APIKeyQuery) Only ¶
func (_q *APIKeyQuery) Only(ctx context.Context) (*APIKey, error)
Only returns a single APIKey entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one APIKey entity is found. Returns a *NotFoundError when no APIKey entities are found.
func (*APIKeyQuery) OnlyID ¶
func (_q *APIKeyQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only APIKey ID in the query. Returns a *NotSingularError when more than one APIKey ID is found. Returns a *NotFoundError when no entities are found.
func (*APIKeyQuery) OnlyIDX ¶
func (_q *APIKeyQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*APIKeyQuery) OnlyX ¶
func (_q *APIKeyQuery) OnlyX(ctx context.Context) *APIKey
OnlyX is like Only, but panics if an error occurs.
func (*APIKeyQuery) Order ¶
func (_q *APIKeyQuery) Order(o ...apikey.OrderOption) *APIKeyQuery
Order specifies how the records should be ordered.
func (*APIKeyQuery) QueryCreatedBy ¶
func (_q *APIKeyQuery) QueryCreatedBy() *UserQuery
QueryCreatedBy chains the current query on the "created_by" edge.
func (*APIKeyQuery) QueryProject ¶
func (_q *APIKeyQuery) QueryProject() *ProjectQuery
QueryProject chains the current query on the "project" edge.
func (*APIKeyQuery) Select ¶
func (_q *APIKeyQuery) Select(fields ...string) *APIKeySelect
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.APIKey.Query().
Select(apikey.FieldName).
Scan(ctx, &v)
func (*APIKeyQuery) Unique ¶
func (_q *APIKeyQuery) Unique(unique bool) *APIKeyQuery
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 (*APIKeyQuery) Where ¶
func (_q *APIKeyQuery) Where(ps ...predicate.APIKey) *APIKeyQuery
Where adds a new predicate for the APIKeyQuery builder.
func (*APIKeyQuery) WithCreatedBy ¶
func (_q *APIKeyQuery) WithCreatedBy(opts ...func(*UserQuery)) *APIKeyQuery
WithCreatedBy tells the query-builder to eager-load the nodes that are connected to the "created_by" edge. The optional arguments are used to configure the query builder of the edge.
func (*APIKeyQuery) WithProject ¶
func (_q *APIKeyQuery) WithProject(opts ...func(*ProjectQuery)) *APIKeyQuery
WithProject tells the query-builder to eager-load the nodes that are connected to the "project" edge. The optional arguments are used to configure the query builder of the edge.
type APIKeySelect ¶
type APIKeySelect struct {
*APIKeyQuery
// contains filtered or unexported fields
}
APIKeySelect is the builder for selecting fields of APIKey entities.
func (*APIKeySelect) Aggregate ¶
func (_s *APIKeySelect) Aggregate(fns ...AggregateFunc) *APIKeySelect
Aggregate adds the given aggregation functions to the selector query.
func (*APIKeySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*APIKeySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*APIKeySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*APIKeySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*APIKeySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*APIKeySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*APIKeySelect) Scan ¶
func (_s *APIKeySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*APIKeySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type APIKeyUpdate ¶
type APIKeyUpdate struct {
// contains filtered or unexported fields
}
APIKeyUpdate is the builder for updating APIKey entities.
func (*APIKeyUpdate) ClearCreatedBy ¶
func (_u *APIKeyUpdate) ClearCreatedBy() *APIKeyUpdate
ClearCreatedBy clears the "created_by" edge to the User entity.
func (*APIKeyUpdate) ClearExpiresAt ¶
func (_u *APIKeyUpdate) ClearExpiresAt() *APIKeyUpdate
ClearExpiresAt clears the value of the "expires_at" field.
func (*APIKeyUpdate) ClearLastUsedAt ¶
func (_u *APIKeyUpdate) ClearLastUsedAt() *APIKeyUpdate
ClearLastUsedAt clears the value of the "last_used_at" field.
func (*APIKeyUpdate) ClearProject ¶
func (_u *APIKeyUpdate) ClearProject() *APIKeyUpdate
ClearProject clears the "project" edge to the Project entity.
func (*APIKeyUpdate) Exec ¶
func (_u *APIKeyUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*APIKeyUpdate) ExecX ¶
func (_u *APIKeyUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*APIKeyUpdate) Mutation ¶
func (_u *APIKeyUpdate) Mutation() *APIKeyMutation
Mutation returns the APIKeyMutation object of the builder.
func (*APIKeyUpdate) Save ¶
func (_u *APIKeyUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*APIKeyUpdate) SaveX ¶
func (_u *APIKeyUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*APIKeyUpdate) SetCreatedBy ¶
func (_u *APIKeyUpdate) SetCreatedBy(v *User) *APIKeyUpdate
SetCreatedBy sets the "created_by" edge to the User entity.
func (*APIKeyUpdate) SetCreatedByID ¶
func (_u *APIKeyUpdate) SetCreatedByID(id int) *APIKeyUpdate
SetCreatedByID sets the "created_by" edge to the User entity by ID.
func (*APIKeyUpdate) SetExpiresAt ¶
func (_u *APIKeyUpdate) SetExpiresAt(v time.Time) *APIKeyUpdate
SetExpiresAt sets the "expires_at" field.
func (*APIKeyUpdate) SetHashedKey ¶
func (_u *APIKeyUpdate) SetHashedKey(v string) *APIKeyUpdate
SetHashedKey sets the "hashed_key" field.
func (*APIKeyUpdate) SetIsActive ¶
func (_u *APIKeyUpdate) SetIsActive(v bool) *APIKeyUpdate
SetIsActive sets the "is_active" field.
func (*APIKeyUpdate) SetLastUsedAt ¶
func (_u *APIKeyUpdate) SetLastUsedAt(v time.Time) *APIKeyUpdate
SetLastUsedAt sets the "last_used_at" field.
func (*APIKeyUpdate) SetName ¶
func (_u *APIKeyUpdate) SetName(v string) *APIKeyUpdate
SetName sets the "name" field.
func (*APIKeyUpdate) SetNillableExpiresAt ¶
func (_u *APIKeyUpdate) SetNillableExpiresAt(v *time.Time) *APIKeyUpdate
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*APIKeyUpdate) SetNillableHashedKey ¶
func (_u *APIKeyUpdate) SetNillableHashedKey(v *string) *APIKeyUpdate
SetNillableHashedKey sets the "hashed_key" field if the given value is not nil.
func (*APIKeyUpdate) SetNillableIsActive ¶
func (_u *APIKeyUpdate) SetNillableIsActive(v *bool) *APIKeyUpdate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*APIKeyUpdate) SetNillableLastUsedAt ¶
func (_u *APIKeyUpdate) SetNillableLastUsedAt(v *time.Time) *APIKeyUpdate
SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.
func (*APIKeyUpdate) SetNillableName ¶
func (_u *APIKeyUpdate) SetNillableName(v *string) *APIKeyUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*APIKeyUpdate) SetNillablePermissions ¶
func (_u *APIKeyUpdate) SetNillablePermissions(v *string) *APIKeyUpdate
SetNillablePermissions sets the "permissions" field if the given value is not nil.
func (*APIKeyUpdate) SetPermissions ¶
func (_u *APIKeyUpdate) SetPermissions(v string) *APIKeyUpdate
SetPermissions sets the "permissions" field.
func (*APIKeyUpdate) SetProject ¶
func (_u *APIKeyUpdate) SetProject(v *Project) *APIKeyUpdate
SetProject sets the "project" edge to the Project entity.
func (*APIKeyUpdate) SetProjectID ¶
func (_u *APIKeyUpdate) SetProjectID(id int) *APIKeyUpdate
SetProjectID sets the "project" edge to the Project entity by ID.
func (*APIKeyUpdate) SetUpdatedAt ¶
func (_u *APIKeyUpdate) SetUpdatedAt(v time.Time) *APIKeyUpdate
SetUpdatedAt sets the "updated_at" field.
func (*APIKeyUpdate) Where ¶
func (_u *APIKeyUpdate) Where(ps ...predicate.APIKey) *APIKeyUpdate
Where appends a list predicates to the APIKeyUpdate builder.
type APIKeyUpdateOne ¶
type APIKeyUpdateOne struct {
// contains filtered or unexported fields
}
APIKeyUpdateOne is the builder for updating a single APIKey entity.
func (*APIKeyUpdateOne) ClearCreatedBy ¶
func (_u *APIKeyUpdateOne) ClearCreatedBy() *APIKeyUpdateOne
ClearCreatedBy clears the "created_by" edge to the User entity.
func (*APIKeyUpdateOne) ClearExpiresAt ¶
func (_u *APIKeyUpdateOne) ClearExpiresAt() *APIKeyUpdateOne
ClearExpiresAt clears the value of the "expires_at" field.
func (*APIKeyUpdateOne) ClearLastUsedAt ¶
func (_u *APIKeyUpdateOne) ClearLastUsedAt() *APIKeyUpdateOne
ClearLastUsedAt clears the value of the "last_used_at" field.
func (*APIKeyUpdateOne) ClearProject ¶
func (_u *APIKeyUpdateOne) ClearProject() *APIKeyUpdateOne
ClearProject clears the "project" edge to the Project entity.
func (*APIKeyUpdateOne) Exec ¶
func (_u *APIKeyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*APIKeyUpdateOne) ExecX ¶
func (_u *APIKeyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*APIKeyUpdateOne) Mutation ¶
func (_u *APIKeyUpdateOne) Mutation() *APIKeyMutation
Mutation returns the APIKeyMutation object of the builder.
func (*APIKeyUpdateOne) Save ¶
func (_u *APIKeyUpdateOne) Save(ctx context.Context) (*APIKey, error)
Save executes the query and returns the updated APIKey entity.
func (*APIKeyUpdateOne) SaveX ¶
func (_u *APIKeyUpdateOne) SaveX(ctx context.Context) *APIKey
SaveX is like Save, but panics if an error occurs.
func (*APIKeyUpdateOne) Select ¶
func (_u *APIKeyUpdateOne) Select(field string, fields ...string) *APIKeyUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*APIKeyUpdateOne) SetCreatedBy ¶
func (_u *APIKeyUpdateOne) SetCreatedBy(v *User) *APIKeyUpdateOne
SetCreatedBy sets the "created_by" edge to the User entity.
func (*APIKeyUpdateOne) SetCreatedByID ¶
func (_u *APIKeyUpdateOne) SetCreatedByID(id int) *APIKeyUpdateOne
SetCreatedByID sets the "created_by" edge to the User entity by ID.
func (*APIKeyUpdateOne) SetExpiresAt ¶
func (_u *APIKeyUpdateOne) SetExpiresAt(v time.Time) *APIKeyUpdateOne
SetExpiresAt sets the "expires_at" field.
func (*APIKeyUpdateOne) SetHashedKey ¶
func (_u *APIKeyUpdateOne) SetHashedKey(v string) *APIKeyUpdateOne
SetHashedKey sets the "hashed_key" field.
func (*APIKeyUpdateOne) SetIsActive ¶
func (_u *APIKeyUpdateOne) SetIsActive(v bool) *APIKeyUpdateOne
SetIsActive sets the "is_active" field.
func (*APIKeyUpdateOne) SetLastUsedAt ¶
func (_u *APIKeyUpdateOne) SetLastUsedAt(v time.Time) *APIKeyUpdateOne
SetLastUsedAt sets the "last_used_at" field.
func (*APIKeyUpdateOne) SetName ¶
func (_u *APIKeyUpdateOne) SetName(v string) *APIKeyUpdateOne
SetName sets the "name" field.
func (*APIKeyUpdateOne) SetNillableExpiresAt ¶
func (_u *APIKeyUpdateOne) SetNillableExpiresAt(v *time.Time) *APIKeyUpdateOne
SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.
func (*APIKeyUpdateOne) SetNillableHashedKey ¶
func (_u *APIKeyUpdateOne) SetNillableHashedKey(v *string) *APIKeyUpdateOne
SetNillableHashedKey sets the "hashed_key" field if the given value is not nil.
func (*APIKeyUpdateOne) SetNillableIsActive ¶
func (_u *APIKeyUpdateOne) SetNillableIsActive(v *bool) *APIKeyUpdateOne
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*APIKeyUpdateOne) SetNillableLastUsedAt ¶
func (_u *APIKeyUpdateOne) SetNillableLastUsedAt(v *time.Time) *APIKeyUpdateOne
SetNillableLastUsedAt sets the "last_used_at" field if the given value is not nil.
func (*APIKeyUpdateOne) SetNillableName ¶
func (_u *APIKeyUpdateOne) SetNillableName(v *string) *APIKeyUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*APIKeyUpdateOne) SetNillablePermissions ¶
func (_u *APIKeyUpdateOne) SetNillablePermissions(v *string) *APIKeyUpdateOne
SetNillablePermissions sets the "permissions" field if the given value is not nil.
func (*APIKeyUpdateOne) SetPermissions ¶
func (_u *APIKeyUpdateOne) SetPermissions(v string) *APIKeyUpdateOne
SetPermissions sets the "permissions" field.
func (*APIKeyUpdateOne) SetProject ¶
func (_u *APIKeyUpdateOne) SetProject(v *Project) *APIKeyUpdateOne
SetProject sets the "project" edge to the Project entity.
func (*APIKeyUpdateOne) SetProjectID ¶
func (_u *APIKeyUpdateOne) SetProjectID(id int) *APIKeyUpdateOne
SetProjectID sets the "project" edge to the Project entity by ID.
func (*APIKeyUpdateOne) SetUpdatedAt ¶
func (_u *APIKeyUpdateOne) SetUpdatedAt(v time.Time) *APIKeyUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*APIKeyUpdateOne) Where ¶
func (_u *APIKeyUpdateOne) Where(ps ...predicate.APIKey) *APIKeyUpdateOne
Where appends a list predicates to the APIKeyUpdate builder.
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(data.As(data.Sum(field1), "sum_field1"), (data.As(data.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
// APIKey is the client for interacting with the APIKey builders.
APIKey *APIKeyClient
// Project is the client for interacting with the Project builders.
Project *ProjectClient
// RetentionPolicy is the client for interacting with the RetentionPolicy builders.
RetentionPolicy *RetentionPolicyClient
// 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(). APIKey. 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 Project ¶
type Project struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Project name
Name string `json:"name,omitempty"`
// Project description
Description string `json:"description,omitempty"`
// Data Source Name for the project
Dsn string `json:"dsn,omitempty"`
// Project status: active, inactive, archived
Status string `json:"status,omitempty"`
// When the project was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the project 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 ProjectQuery when eager-loading is set.
Edges ProjectEdges `json:"edges"`
// contains filtered or unexported fields
}
Project is the model entity for the Project schema.
func (*Project) QueryAPIKeys ¶
func (_m *Project) QueryAPIKeys() *APIKeyQuery
QueryAPIKeys queries the "api_keys" edge of the Project entity.
func (*Project) QueryOwner ¶
QueryOwner queries the "owner" edge of the Project entity.
func (*Project) QueryRetentionPolicies ¶
func (_m *Project) QueryRetentionPolicies() *RetentionPolicyQuery
QueryRetentionPolicies queries the "retention_policies" edge of the Project entity.
func (*Project) Unwrap ¶
Unwrap unwraps the Project 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 (*Project) Update ¶
func (_m *Project) Update() *ProjectUpdateOne
Update returns a builder for updating this Project. Note that you need to call Project.Unwrap() before calling this method if this Project was returned from a transaction, and the transaction was committed or rolled back.
type ProjectClient ¶
type ProjectClient struct {
// contains filtered or unexported fields
}
ProjectClient is a client for the Project schema.
func NewProjectClient ¶
func NewProjectClient(c config) *ProjectClient
NewProjectClient returns a client for the Project from the given config.
func (*ProjectClient) Create ¶
func (c *ProjectClient) Create() *ProjectCreate
Create returns a builder for creating a Project entity.
func (*ProjectClient) CreateBulk ¶
func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk
CreateBulk returns a builder for creating a bulk of Project entities.
func (*ProjectClient) Delete ¶
func (c *ProjectClient) Delete() *ProjectDelete
Delete returns a delete builder for Project.
func (*ProjectClient) DeleteOne ¶
func (c *ProjectClient) DeleteOne(_m *Project) *ProjectDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ProjectClient) DeleteOneID ¶
func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ProjectClient) GetX ¶
func (c *ProjectClient) GetX(ctx context.Context, id int) *Project
GetX is like Get, but panics if an error occurs.
func (*ProjectClient) Hooks ¶
func (c *ProjectClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ProjectClient) Intercept ¶
func (c *ProjectClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `project.Intercept(f(g(h())))`.
func (*ProjectClient) Interceptors ¶
func (c *ProjectClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ProjectClient) MapCreateBulk ¶
func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk
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 (*ProjectClient) Query ¶
func (c *ProjectClient) Query() *ProjectQuery
Query returns a query builder for Project.
func (*ProjectClient) QueryAPIKeys ¶
func (c *ProjectClient) QueryAPIKeys(_m *Project) *APIKeyQuery
QueryAPIKeys queries the api_keys edge of a Project.
func (*ProjectClient) QueryOwner ¶
func (c *ProjectClient) QueryOwner(_m *Project) *UserQuery
QueryOwner queries the owner edge of a Project.
func (*ProjectClient) QueryRetentionPolicies ¶
func (c *ProjectClient) QueryRetentionPolicies(_m *Project) *RetentionPolicyQuery
QueryRetentionPolicies queries the retention_policies edge of a Project.
func (*ProjectClient) Update ¶
func (c *ProjectClient) Update() *ProjectUpdate
Update returns an update builder for Project.
func (*ProjectClient) UpdateOne ¶
func (c *ProjectClient) UpdateOne(_m *Project) *ProjectUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ProjectClient) UpdateOneID ¶
func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ProjectClient) Use ¶
func (c *ProjectClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `project.Hooks(f(g(h())))`.
type ProjectCreate ¶
type ProjectCreate struct {
// contains filtered or unexported fields
}
ProjectCreate is the builder for creating a Project entity.
func (*ProjectCreate) AddAPIKeyIDs ¶
func (_c *ProjectCreate) AddAPIKeyIDs(ids ...int) *ProjectCreate
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (*ProjectCreate) AddAPIKeys ¶
func (_c *ProjectCreate) AddAPIKeys(v ...*APIKey) *ProjectCreate
AddAPIKeys adds the "api_keys" edges to the APIKey entity.
func (*ProjectCreate) AddRetentionPolicies ¶
func (_c *ProjectCreate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectCreate
AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectCreate) AddRetentionPolicyIDs ¶
func (_c *ProjectCreate) AddRetentionPolicyIDs(ids ...int) *ProjectCreate
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectCreate) Exec ¶
func (_c *ProjectCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectCreate) ExecX ¶
func (_c *ProjectCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectCreate) Mutation ¶
func (_c *ProjectCreate) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectCreate) Save ¶
func (_c *ProjectCreate) Save(ctx context.Context) (*Project, error)
Save creates the Project in the database.
func (*ProjectCreate) SaveX ¶
func (_c *ProjectCreate) SaveX(ctx context.Context) *Project
SaveX calls Save and panics if Save returns an error.
func (*ProjectCreate) SetCreatedAt ¶
func (_c *ProjectCreate) SetCreatedAt(v time.Time) *ProjectCreate
SetCreatedAt sets the "created_at" field.
func (*ProjectCreate) SetDescription ¶
func (_c *ProjectCreate) SetDescription(v string) *ProjectCreate
SetDescription sets the "description" field.
func (*ProjectCreate) SetDsn ¶
func (_c *ProjectCreate) SetDsn(v string) *ProjectCreate
SetDsn sets the "dsn" field.
func (*ProjectCreate) SetName ¶
func (_c *ProjectCreate) SetName(v string) *ProjectCreate
SetName sets the "name" field.
func (*ProjectCreate) SetNillableCreatedAt ¶
func (_c *ProjectCreate) SetNillableCreatedAt(v *time.Time) *ProjectCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ProjectCreate) SetNillableDescription ¶
func (_c *ProjectCreate) SetNillableDescription(v *string) *ProjectCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProjectCreate) SetNillableStatus ¶
func (_c *ProjectCreate) SetNillableStatus(v *string) *ProjectCreate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*ProjectCreate) SetNillableUpdatedAt ¶
func (_c *ProjectCreate) SetNillableUpdatedAt(v *time.Time) *ProjectCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*ProjectCreate) SetOwner ¶
func (_c *ProjectCreate) SetOwner(v *User) *ProjectCreate
SetOwner sets the "owner" edge to the User entity.
func (*ProjectCreate) SetOwnerID ¶
func (_c *ProjectCreate) SetOwnerID(id int) *ProjectCreate
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*ProjectCreate) SetStatus ¶
func (_c *ProjectCreate) SetStatus(v string) *ProjectCreate
SetStatus sets the "status" field.
func (*ProjectCreate) SetUpdatedAt ¶
func (_c *ProjectCreate) SetUpdatedAt(v time.Time) *ProjectCreate
SetUpdatedAt sets the "updated_at" field.
type ProjectCreateBulk ¶
type ProjectCreateBulk struct {
// contains filtered or unexported fields
}
ProjectCreateBulk is the builder for creating many Project entities in bulk.
func (*ProjectCreateBulk) Exec ¶
func (_c *ProjectCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectCreateBulk) ExecX ¶
func (_c *ProjectCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ProjectDelete ¶
type ProjectDelete struct {
// contains filtered or unexported fields
}
ProjectDelete is the builder for deleting a Project entity.
func (*ProjectDelete) Exec ¶
func (_d *ProjectDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ProjectDelete) ExecX ¶
func (_d *ProjectDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ProjectDelete) Where ¶
func (_d *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete
Where appends a list predicates to the ProjectDelete builder.
type ProjectDeleteOne ¶
type ProjectDeleteOne struct {
// contains filtered or unexported fields
}
ProjectDeleteOne is the builder for deleting a single Project entity.
func (*ProjectDeleteOne) Exec ¶
func (_d *ProjectDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ProjectDeleteOne) ExecX ¶
func (_d *ProjectDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectDeleteOne) Where ¶
func (_d *ProjectDeleteOne) Where(ps ...predicate.Project) *ProjectDeleteOne
Where appends a list predicates to the ProjectDelete builder.
type ProjectEdges ¶
type ProjectEdges struct {
// User who owns this project
Owner *User `json:"owner,omitempty"`
// API keys associated with this project
APIKeys []*APIKey `json:"api_keys,omitempty"`
// Retention policies for this project
RetentionPolicies []*RetentionPolicy `json:"retention_policies,omitempty"`
// contains filtered or unexported fields
}
ProjectEdges holds the relations/edges for other nodes in the graph.
func (ProjectEdges) APIKeysOrErr ¶
func (e ProjectEdges) APIKeysOrErr() ([]*APIKey, error)
APIKeysOrErr returns the APIKeys value or an error if the edge was not loaded in eager-loading.
func (ProjectEdges) OwnerOrErr ¶
func (e ProjectEdges) OwnerOrErr() (*User, error)
OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (ProjectEdges) RetentionPoliciesOrErr ¶
func (e ProjectEdges) RetentionPoliciesOrErr() ([]*RetentionPolicy, error)
RetentionPoliciesOrErr returns the RetentionPolicies value or an error if the edge was not loaded in eager-loading.
type ProjectGroupBy ¶
type ProjectGroupBy struct {
// contains filtered or unexported fields
}
ProjectGroupBy is the group-by builder for Project entities.
func (*ProjectGroupBy) Aggregate ¶
func (_g *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ProjectGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProjectGroupBy) Scan ¶
func (_g *ProjectGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProjectGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProjectMutation ¶
type ProjectMutation struct {
// contains filtered or unexported fields
}
ProjectMutation represents an operation that mutates the Project nodes in the graph.
func (*ProjectMutation) APIKeysCleared ¶
func (m *ProjectMutation) APIKeysCleared() bool
APIKeysCleared reports if the "api_keys" edge to the APIKey entity was cleared.
func (*ProjectMutation) APIKeysIDs ¶
func (m *ProjectMutation) APIKeysIDs() (ids []int)
APIKeysIDs returns the "api_keys" edge IDs in the mutation.
func (*ProjectMutation) AddAPIKeyIDs ¶
func (m *ProjectMutation) AddAPIKeyIDs(ids ...int)
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by ids.
func (*ProjectMutation) AddField ¶
func (m *ProjectMutation) 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 (*ProjectMutation) AddRetentionPolicyIDs ¶
func (m *ProjectMutation) AddRetentionPolicyIDs(ids ...int)
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by ids.
func (*ProjectMutation) AddedEdges ¶
func (m *ProjectMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ProjectMutation) AddedField ¶
func (m *ProjectMutation) 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 (*ProjectMutation) AddedFields ¶
func (m *ProjectMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ProjectMutation) AddedIDs ¶
func (m *ProjectMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ProjectMutation) ClearAPIKeys ¶
func (m *ProjectMutation) ClearAPIKeys()
ClearAPIKeys clears the "api_keys" edge to the APIKey entity.
func (*ProjectMutation) ClearDescription ¶
func (m *ProjectMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*ProjectMutation) ClearEdge ¶
func (m *ProjectMutation) 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 (*ProjectMutation) ClearField ¶
func (m *ProjectMutation) 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 (*ProjectMutation) ClearOwner ¶
func (m *ProjectMutation) ClearOwner()
ClearOwner clears the "owner" edge to the User entity.
func (*ProjectMutation) ClearRetentionPolicies ¶
func (m *ProjectMutation) ClearRetentionPolicies()
ClearRetentionPolicies clears the "retention_policies" edge to the RetentionPolicy entity.
func (*ProjectMutation) ClearedEdges ¶
func (m *ProjectMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ProjectMutation) ClearedFields ¶
func (m *ProjectMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ProjectMutation) Client ¶
func (m ProjectMutation) 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 (*ProjectMutation) CreatedAt ¶
func (m *ProjectMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ProjectMutation) Description ¶
func (m *ProjectMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*ProjectMutation) DescriptionCleared ¶
func (m *ProjectMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*ProjectMutation) Dsn ¶
func (m *ProjectMutation) Dsn() (r string, exists bool)
Dsn returns the value of the "dsn" field in the mutation.
func (*ProjectMutation) EdgeCleared ¶
func (m *ProjectMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ProjectMutation) Field ¶
func (m *ProjectMutation) 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 (*ProjectMutation) FieldCleared ¶
func (m *ProjectMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ProjectMutation) Fields ¶
func (m *ProjectMutation) 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 (*ProjectMutation) ID ¶
func (m *ProjectMutation) 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 (*ProjectMutation) IDs ¶
func (m *ProjectMutation) 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 (*ProjectMutation) Name ¶
func (m *ProjectMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*ProjectMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldDescription ¶
func (m *ProjectMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldDsn ¶
func (m *ProjectMutation) OldDsn(ctx context.Context) (v string, err error)
OldDsn returns the old "dsn" field's value of the Project entity. If the Project 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 (*ProjectMutation) 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 (*ProjectMutation) OldName ¶
func (m *ProjectMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldStatus ¶
func (m *ProjectMutation) OldStatus(ctx context.Context) (v string, err error)
OldStatus returns the old "status" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Project entity. If the Project 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 (*ProjectMutation) OwnerCleared ¶
func (m *ProjectMutation) OwnerCleared() bool
OwnerCleared reports if the "owner" edge to the User entity was cleared.
func (*ProjectMutation) OwnerID ¶
func (m *ProjectMutation) OwnerID() (id int, exists bool)
OwnerID returns the "owner" edge ID in the mutation.
func (*ProjectMutation) OwnerIDs ¶
func (m *ProjectMutation) OwnerIDs() (ids []int)
OwnerIDs returns the "owner" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.
func (*ProjectMutation) RemoveAPIKeyIDs ¶
func (m *ProjectMutation) RemoveAPIKeyIDs(ids ...int)
RemoveAPIKeyIDs removes the "api_keys" edge to the APIKey entity by IDs.
func (*ProjectMutation) RemoveRetentionPolicyIDs ¶
func (m *ProjectMutation) RemoveRetentionPolicyIDs(ids ...int)
RemoveRetentionPolicyIDs removes the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectMutation) RemovedAPIKeysIDs ¶
func (m *ProjectMutation) RemovedAPIKeysIDs() (ids []int)
RemovedAPIKeys returns the removed IDs of the "api_keys" edge to the APIKey entity.
func (*ProjectMutation) RemovedEdges ¶
func (m *ProjectMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ProjectMutation) RemovedIDs ¶
func (m *ProjectMutation) 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 (*ProjectMutation) RemovedRetentionPoliciesIDs ¶
func (m *ProjectMutation) RemovedRetentionPoliciesIDs() (ids []int)
RemovedRetentionPolicies returns the removed IDs of the "retention_policies" edge to the RetentionPolicy entity.
func (*ProjectMutation) ResetAPIKeys ¶
func (m *ProjectMutation) ResetAPIKeys()
ResetAPIKeys resets all changes to the "api_keys" edge.
func (*ProjectMutation) ResetCreatedAt ¶
func (m *ProjectMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ProjectMutation) ResetDescription ¶
func (m *ProjectMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*ProjectMutation) ResetDsn ¶
func (m *ProjectMutation) ResetDsn()
ResetDsn resets all changes to the "dsn" field.
func (*ProjectMutation) ResetEdge ¶
func (m *ProjectMutation) 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 (*ProjectMutation) ResetField ¶
func (m *ProjectMutation) 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 (*ProjectMutation) ResetName ¶
func (m *ProjectMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*ProjectMutation) ResetOwner ¶
func (m *ProjectMutation) ResetOwner()
ResetOwner resets all changes to the "owner" edge.
func (*ProjectMutation) ResetRetentionPolicies ¶
func (m *ProjectMutation) ResetRetentionPolicies()
ResetRetentionPolicies resets all changes to the "retention_policies" edge.
func (*ProjectMutation) ResetStatus ¶
func (m *ProjectMutation) ResetStatus()
ResetStatus resets all changes to the "status" field.
func (*ProjectMutation) ResetUpdatedAt ¶
func (m *ProjectMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*ProjectMutation) RetentionPoliciesCleared ¶
func (m *ProjectMutation) RetentionPoliciesCleared() bool
RetentionPoliciesCleared reports if the "retention_policies" edge to the RetentionPolicy entity was cleared.
func (*ProjectMutation) RetentionPoliciesIDs ¶
func (m *ProjectMutation) RetentionPoliciesIDs() (ids []int)
RetentionPoliciesIDs returns the "retention_policies" edge IDs in the mutation.
func (*ProjectMutation) SetCreatedAt ¶
func (m *ProjectMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ProjectMutation) SetDescription ¶
func (m *ProjectMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*ProjectMutation) SetDsn ¶
func (m *ProjectMutation) SetDsn(s string)
SetDsn sets the "dsn" field.
func (*ProjectMutation) SetField ¶
func (m *ProjectMutation) 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 (*ProjectMutation) SetName ¶
func (m *ProjectMutation) SetName(s string)
SetName sets the "name" field.
func (*ProjectMutation) SetOp ¶
func (m *ProjectMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ProjectMutation) SetOwnerID ¶
func (m *ProjectMutation) SetOwnerID(id int)
SetOwnerID sets the "owner" edge to the User entity by id.
func (*ProjectMutation) SetStatus ¶
func (m *ProjectMutation) SetStatus(s string)
SetStatus sets the "status" field.
func (*ProjectMutation) SetUpdatedAt ¶
func (m *ProjectMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*ProjectMutation) Status ¶
func (m *ProjectMutation) Status() (r string, exists bool)
Status returns the value of the "status" field in the mutation.
func (ProjectMutation) Tx ¶
func (m ProjectMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ProjectMutation) Type ¶
func (m *ProjectMutation) Type() string
Type returns the node type of this mutation (Project).
func (*ProjectMutation) UpdatedAt ¶
func (m *ProjectMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*ProjectMutation) Where ¶
func (m *ProjectMutation) Where(ps ...predicate.Project)
Where appends a list predicates to the ProjectMutation builder.
func (*ProjectMutation) WhereP ¶
func (m *ProjectMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ProjectMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ProjectQuery ¶
type ProjectQuery struct {
// contains filtered or unexported fields
}
ProjectQuery is the builder for querying Project entities.
func (*ProjectQuery) Aggregate ¶
func (_q *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect
Aggregate returns a ProjectSelect configured with the given aggregations.
func (*ProjectQuery) All ¶
func (_q *ProjectQuery) All(ctx context.Context) ([]*Project, error)
All executes the query and returns a list of Projects.
func (*ProjectQuery) AllX ¶
func (_q *ProjectQuery) AllX(ctx context.Context) []*Project
AllX is like All, but panics if an error occurs.
func (*ProjectQuery) Clone ¶
func (_q *ProjectQuery) Clone() *ProjectQuery
Clone returns a duplicate of the ProjectQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ProjectQuery) Count ¶
func (_q *ProjectQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ProjectQuery) CountX ¶
func (_q *ProjectQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ProjectQuery) Exist ¶
func (_q *ProjectQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ProjectQuery) ExistX ¶
func (_q *ProjectQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ProjectQuery) First ¶
func (_q *ProjectQuery) First(ctx context.Context) (*Project, error)
First returns the first Project entity from the query. Returns a *NotFoundError when no Project was found.
func (*ProjectQuery) FirstID ¶
func (_q *ProjectQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Project ID from the query. Returns a *NotFoundError when no Project ID was found.
func (*ProjectQuery) FirstIDX ¶
func (_q *ProjectQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ProjectQuery) FirstX ¶
func (_q *ProjectQuery) FirstX(ctx context.Context) *Project
FirstX is like First, but panics if an error occurs.
func (*ProjectQuery) GroupBy ¶
func (_q *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy
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.Project.Query().
GroupBy(project.FieldName).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*ProjectQuery) IDs ¶
func (_q *ProjectQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Project IDs.
func (*ProjectQuery) IDsX ¶
func (_q *ProjectQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ProjectQuery) Limit ¶
func (_q *ProjectQuery) Limit(limit int) *ProjectQuery
Limit the number of records to be returned by this query.
func (*ProjectQuery) Offset ¶
func (_q *ProjectQuery) Offset(offset int) *ProjectQuery
Offset to start from.
func (*ProjectQuery) Only ¶
func (_q *ProjectQuery) Only(ctx context.Context) (*Project, error)
Only returns a single Project entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Project entity is found. Returns a *NotFoundError when no Project entities are found.
func (*ProjectQuery) OnlyID ¶
func (_q *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Project ID in the query. Returns a *NotSingularError when more than one Project ID is found. Returns a *NotFoundError when no entities are found.
func (*ProjectQuery) OnlyIDX ¶
func (_q *ProjectQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ProjectQuery) OnlyX ¶
func (_q *ProjectQuery) OnlyX(ctx context.Context) *Project
OnlyX is like Only, but panics if an error occurs.
func (*ProjectQuery) Order ¶
func (_q *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery
Order specifies how the records should be ordered.
func (*ProjectQuery) QueryAPIKeys ¶
func (_q *ProjectQuery) QueryAPIKeys() *APIKeyQuery
QueryAPIKeys chains the current query on the "api_keys" edge.
func (*ProjectQuery) QueryOwner ¶
func (_q *ProjectQuery) QueryOwner() *UserQuery
QueryOwner chains the current query on the "owner" edge.
func (*ProjectQuery) QueryRetentionPolicies ¶
func (_q *ProjectQuery) QueryRetentionPolicies() *RetentionPolicyQuery
QueryRetentionPolicies chains the current query on the "retention_policies" edge.
func (*ProjectQuery) Select ¶
func (_q *ProjectQuery) Select(fields ...string) *ProjectSelect
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.Project.Query().
Select(project.FieldName).
Scan(ctx, &v)
func (*ProjectQuery) Unique ¶
func (_q *ProjectQuery) Unique(unique bool) *ProjectQuery
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 (*ProjectQuery) Where ¶
func (_q *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery
Where adds a new predicate for the ProjectQuery builder.
func (*ProjectQuery) WithAPIKeys ¶
func (_q *ProjectQuery) WithAPIKeys(opts ...func(*APIKeyQuery)) *ProjectQuery
WithAPIKeys tells the query-builder to eager-load the nodes that are connected to the "api_keys" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProjectQuery) WithOwner ¶
func (_q *ProjectQuery) WithOwner(opts ...func(*UserQuery)) *ProjectQuery
WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.
func (*ProjectQuery) WithRetentionPolicies ¶
func (_q *ProjectQuery) WithRetentionPolicies(opts ...func(*RetentionPolicyQuery)) *ProjectQuery
WithRetentionPolicies tells the query-builder to eager-load the nodes that are connected to the "retention_policies" edge. The optional arguments are used to configure the query builder of the edge.
type ProjectSelect ¶
type ProjectSelect struct {
*ProjectQuery
// contains filtered or unexported fields
}
ProjectSelect is the builder for selecting fields of Project entities.
func (*ProjectSelect) Aggregate ¶
func (_s *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ProjectSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ProjectSelect) Scan ¶
func (_s *ProjectSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ProjectSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ProjectUpdate ¶
type ProjectUpdate struct {
// contains filtered or unexported fields
}
ProjectUpdate is the builder for updating Project entities.
func (*ProjectUpdate) AddAPIKeyIDs ¶
func (_u *ProjectUpdate) AddAPIKeyIDs(ids ...int) *ProjectUpdate
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (*ProjectUpdate) AddAPIKeys ¶
func (_u *ProjectUpdate) AddAPIKeys(v ...*APIKey) *ProjectUpdate
AddAPIKeys adds the "api_keys" edges to the APIKey entity.
func (*ProjectUpdate) AddRetentionPolicies ¶
func (_u *ProjectUpdate) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdate) AddRetentionPolicyIDs ¶
func (_u *ProjectUpdate) AddRetentionPolicyIDs(ids ...int) *ProjectUpdate
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectUpdate) ClearAPIKeys ¶
func (_u *ProjectUpdate) ClearAPIKeys() *ProjectUpdate
ClearAPIKeys clears all "api_keys" edges to the APIKey entity.
func (*ProjectUpdate) ClearDescription ¶
func (_u *ProjectUpdate) ClearDescription() *ProjectUpdate
ClearDescription clears the value of the "description" field.
func (*ProjectUpdate) ClearOwner ¶
func (_u *ProjectUpdate) ClearOwner() *ProjectUpdate
ClearOwner clears the "owner" edge to the User entity.
func (*ProjectUpdate) ClearRetentionPolicies ¶
func (_u *ProjectUpdate) ClearRetentionPolicies() *ProjectUpdate
ClearRetentionPolicies clears all "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdate) Exec ¶
func (_u *ProjectUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ProjectUpdate) ExecX ¶
func (_u *ProjectUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectUpdate) Mutation ¶
func (_u *ProjectUpdate) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectUpdate) RemoveAPIKeyIDs ¶
func (_u *ProjectUpdate) RemoveAPIKeyIDs(ids ...int) *ProjectUpdate
RemoveAPIKeyIDs removes the "api_keys" edge to APIKey entities by IDs.
func (*ProjectUpdate) RemoveAPIKeys ¶
func (_u *ProjectUpdate) RemoveAPIKeys(v ...*APIKey) *ProjectUpdate
RemoveAPIKeys removes "api_keys" edges to APIKey entities.
func (*ProjectUpdate) RemoveRetentionPolicies ¶
func (_u *ProjectUpdate) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdate
RemoveRetentionPolicies removes "retention_policies" edges to RetentionPolicy entities.
func (*ProjectUpdate) RemoveRetentionPolicyIDs ¶
func (_u *ProjectUpdate) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdate
RemoveRetentionPolicyIDs removes the "retention_policies" edge to RetentionPolicy entities by IDs.
func (*ProjectUpdate) Save ¶
func (_u *ProjectUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ProjectUpdate) SaveX ¶
func (_u *ProjectUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ProjectUpdate) SetDescription ¶
func (_u *ProjectUpdate) SetDescription(v string) *ProjectUpdate
SetDescription sets the "description" field.
func (*ProjectUpdate) SetDsn ¶
func (_u *ProjectUpdate) SetDsn(v string) *ProjectUpdate
SetDsn sets the "dsn" field.
func (*ProjectUpdate) SetName ¶
func (_u *ProjectUpdate) SetName(v string) *ProjectUpdate
SetName sets the "name" field.
func (*ProjectUpdate) SetNillableDescription ¶
func (_u *ProjectUpdate) SetNillableDescription(v *string) *ProjectUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProjectUpdate) SetNillableDsn ¶
func (_u *ProjectUpdate) SetNillableDsn(v *string) *ProjectUpdate
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*ProjectUpdate) SetNillableName ¶
func (_u *ProjectUpdate) SetNillableName(v *string) *ProjectUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*ProjectUpdate) SetNillableStatus ¶
func (_u *ProjectUpdate) SetNillableStatus(v *string) *ProjectUpdate
SetNillableStatus sets the "status" field if the given value is not nil.
func (*ProjectUpdate) SetOwner ¶
func (_u *ProjectUpdate) SetOwner(v *User) *ProjectUpdate
SetOwner sets the "owner" edge to the User entity.
func (*ProjectUpdate) SetOwnerID ¶
func (_u *ProjectUpdate) SetOwnerID(id int) *ProjectUpdate
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*ProjectUpdate) SetStatus ¶
func (_u *ProjectUpdate) SetStatus(v string) *ProjectUpdate
SetStatus sets the "status" field.
func (*ProjectUpdate) SetUpdatedAt ¶
func (_u *ProjectUpdate) SetUpdatedAt(v time.Time) *ProjectUpdate
SetUpdatedAt sets the "updated_at" field.
func (*ProjectUpdate) Where ¶
func (_u *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate
Where appends a list predicates to the ProjectUpdate builder.
type ProjectUpdateOne ¶
type ProjectUpdateOne struct {
// contains filtered or unexported fields
}
ProjectUpdateOne is the builder for updating a single Project entity.
func (*ProjectUpdateOne) AddAPIKeyIDs ¶
func (_u *ProjectUpdateOne) AddAPIKeyIDs(ids ...int) *ProjectUpdateOne
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (*ProjectUpdateOne) AddAPIKeys ¶
func (_u *ProjectUpdateOne) AddAPIKeys(v ...*APIKey) *ProjectUpdateOne
AddAPIKeys adds the "api_keys" edges to the APIKey entity.
func (*ProjectUpdateOne) AddRetentionPolicies ¶
func (_u *ProjectUpdateOne) AddRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
AddRetentionPolicies adds the "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdateOne) AddRetentionPolicyIDs ¶
func (_u *ProjectUpdateOne) AddRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
AddRetentionPolicyIDs adds the "retention_policies" edge to the RetentionPolicy entity by IDs.
func (*ProjectUpdateOne) ClearAPIKeys ¶
func (_u *ProjectUpdateOne) ClearAPIKeys() *ProjectUpdateOne
ClearAPIKeys clears all "api_keys" edges to the APIKey entity.
func (*ProjectUpdateOne) ClearDescription ¶
func (_u *ProjectUpdateOne) ClearDescription() *ProjectUpdateOne
ClearDescription clears the value of the "description" field.
func (*ProjectUpdateOne) ClearOwner ¶
func (_u *ProjectUpdateOne) ClearOwner() *ProjectUpdateOne
ClearOwner clears the "owner" edge to the User entity.
func (*ProjectUpdateOne) ClearRetentionPolicies ¶
func (_u *ProjectUpdateOne) ClearRetentionPolicies() *ProjectUpdateOne
ClearRetentionPolicies clears all "retention_policies" edges to the RetentionPolicy entity.
func (*ProjectUpdateOne) Exec ¶
func (_u *ProjectUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ProjectUpdateOne) ExecX ¶
func (_u *ProjectUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ProjectUpdateOne) Mutation ¶
func (_u *ProjectUpdateOne) Mutation() *ProjectMutation
Mutation returns the ProjectMutation object of the builder.
func (*ProjectUpdateOne) RemoveAPIKeyIDs ¶
func (_u *ProjectUpdateOne) RemoveAPIKeyIDs(ids ...int) *ProjectUpdateOne
RemoveAPIKeyIDs removes the "api_keys" edge to APIKey entities by IDs.
func (*ProjectUpdateOne) RemoveAPIKeys ¶
func (_u *ProjectUpdateOne) RemoveAPIKeys(v ...*APIKey) *ProjectUpdateOne
RemoveAPIKeys removes "api_keys" edges to APIKey entities.
func (*ProjectUpdateOne) RemoveRetentionPolicies ¶
func (_u *ProjectUpdateOne) RemoveRetentionPolicies(v ...*RetentionPolicy) *ProjectUpdateOne
RemoveRetentionPolicies removes "retention_policies" edges to RetentionPolicy entities.
func (*ProjectUpdateOne) RemoveRetentionPolicyIDs ¶
func (_u *ProjectUpdateOne) RemoveRetentionPolicyIDs(ids ...int) *ProjectUpdateOne
RemoveRetentionPolicyIDs removes the "retention_policies" edge to RetentionPolicy entities by IDs.
func (*ProjectUpdateOne) Save ¶
func (_u *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)
Save executes the query and returns the updated Project entity.
func (*ProjectUpdateOne) SaveX ¶
func (_u *ProjectUpdateOne) SaveX(ctx context.Context) *Project
SaveX is like Save, but panics if an error occurs.
func (*ProjectUpdateOne) Select ¶
func (_u *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ProjectUpdateOne) SetDescription ¶
func (_u *ProjectUpdateOne) SetDescription(v string) *ProjectUpdateOne
SetDescription sets the "description" field.
func (*ProjectUpdateOne) SetDsn ¶
func (_u *ProjectUpdateOne) SetDsn(v string) *ProjectUpdateOne
SetDsn sets the "dsn" field.
func (*ProjectUpdateOne) SetName ¶
func (_u *ProjectUpdateOne) SetName(v string) *ProjectUpdateOne
SetName sets the "name" field.
func (*ProjectUpdateOne) SetNillableDescription ¶
func (_u *ProjectUpdateOne) SetNillableDescription(v *string) *ProjectUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*ProjectUpdateOne) SetNillableDsn ¶
func (_u *ProjectUpdateOne) SetNillableDsn(v *string) *ProjectUpdateOne
SetNillableDsn sets the "dsn" field if the given value is not nil.
func (*ProjectUpdateOne) SetNillableName ¶
func (_u *ProjectUpdateOne) SetNillableName(v *string) *ProjectUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*ProjectUpdateOne) SetNillableStatus ¶
func (_u *ProjectUpdateOne) SetNillableStatus(v *string) *ProjectUpdateOne
SetNillableStatus sets the "status" field if the given value is not nil.
func (*ProjectUpdateOne) SetOwner ¶
func (_u *ProjectUpdateOne) SetOwner(v *User) *ProjectUpdateOne
SetOwner sets the "owner" edge to the User entity.
func (*ProjectUpdateOne) SetOwnerID ¶
func (_u *ProjectUpdateOne) SetOwnerID(id int) *ProjectUpdateOne
SetOwnerID sets the "owner" edge to the User entity by ID.
func (*ProjectUpdateOne) SetStatus ¶
func (_u *ProjectUpdateOne) SetStatus(v string) *ProjectUpdateOne
SetStatus sets the "status" field.
func (*ProjectUpdateOne) SetUpdatedAt ¶
func (_u *ProjectUpdateOne) SetUpdatedAt(v time.Time) *ProjectUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*ProjectUpdateOne) Where ¶
func (_u *ProjectUpdateOne) Where(ps ...predicate.Project) *ProjectUpdateOne
Where appends a list predicates to the ProjectUpdate 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 RetentionPolicies ¶
type RetentionPolicies []*RetentionPolicy
RetentionPolicies is a parsable slice of RetentionPolicy.
type RetentionPolicy ¶
type RetentionPolicy struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// Retention policy name
Name string `json:"name,omitempty"`
// Number of days to retain logs
DurationDays int `json:"duration_days,omitempty"`
// Description of the retention policy
Description string `json:"description,omitempty"`
// Whether the retention policy is active
IsActive bool `json:"is_active,omitempty"`
// When the retention policy was created
CreatedAt time.Time `json:"created_at,omitempty"`
// When the retention policy 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 RetentionPolicyQuery when eager-loading is set.
Edges RetentionPolicyEdges `json:"edges"`
// contains filtered or unexported fields
}
RetentionPolicy is the model entity for the RetentionPolicy schema.
func (*RetentionPolicy) QueryProject ¶
func (_m *RetentionPolicy) QueryProject() *ProjectQuery
QueryProject queries the "project" edge of the RetentionPolicy entity.
func (*RetentionPolicy) String ¶
func (_m *RetentionPolicy) String() string
String implements the fmt.Stringer.
func (*RetentionPolicy) Unwrap ¶
func (_m *RetentionPolicy) Unwrap() *RetentionPolicy
Unwrap unwraps the RetentionPolicy 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 (*RetentionPolicy) Update ¶
func (_m *RetentionPolicy) Update() *RetentionPolicyUpdateOne
Update returns a builder for updating this RetentionPolicy. Note that you need to call RetentionPolicy.Unwrap() before calling this method if this RetentionPolicy was returned from a transaction, and the transaction was committed or rolled back.
type RetentionPolicyClient ¶
type RetentionPolicyClient struct {
// contains filtered or unexported fields
}
RetentionPolicyClient is a client for the RetentionPolicy schema.
func NewRetentionPolicyClient ¶
func NewRetentionPolicyClient(c config) *RetentionPolicyClient
NewRetentionPolicyClient returns a client for the RetentionPolicy from the given config.
func (*RetentionPolicyClient) Create ¶
func (c *RetentionPolicyClient) Create() *RetentionPolicyCreate
Create returns a builder for creating a RetentionPolicy entity.
func (*RetentionPolicyClient) CreateBulk ¶
func (c *RetentionPolicyClient) CreateBulk(builders ...*RetentionPolicyCreate) *RetentionPolicyCreateBulk
CreateBulk returns a builder for creating a bulk of RetentionPolicy entities.
func (*RetentionPolicyClient) Delete ¶
func (c *RetentionPolicyClient) Delete() *RetentionPolicyDelete
Delete returns a delete builder for RetentionPolicy.
func (*RetentionPolicyClient) DeleteOne ¶
func (c *RetentionPolicyClient) DeleteOne(_m *RetentionPolicy) *RetentionPolicyDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*RetentionPolicyClient) DeleteOneID ¶
func (c *RetentionPolicyClient) DeleteOneID(id int) *RetentionPolicyDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*RetentionPolicyClient) Get ¶
func (c *RetentionPolicyClient) Get(ctx context.Context, id int) (*RetentionPolicy, error)
Get returns a RetentionPolicy entity by its id.
func (*RetentionPolicyClient) GetX ¶
func (c *RetentionPolicyClient) GetX(ctx context.Context, id int) *RetentionPolicy
GetX is like Get, but panics if an error occurs.
func (*RetentionPolicyClient) Hooks ¶
func (c *RetentionPolicyClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RetentionPolicyClient) Intercept ¶
func (c *RetentionPolicyClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `retentionpolicy.Intercept(f(g(h())))`.
func (*RetentionPolicyClient) Interceptors ¶
func (c *RetentionPolicyClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*RetentionPolicyClient) MapCreateBulk ¶
func (c *RetentionPolicyClient) MapCreateBulk(slice any, setFunc func(*RetentionPolicyCreate, int)) *RetentionPolicyCreateBulk
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 (*RetentionPolicyClient) Query ¶
func (c *RetentionPolicyClient) Query() *RetentionPolicyQuery
Query returns a query builder for RetentionPolicy.
func (*RetentionPolicyClient) QueryProject ¶
func (c *RetentionPolicyClient) QueryProject(_m *RetentionPolicy) *ProjectQuery
QueryProject queries the project edge of a RetentionPolicy.
func (*RetentionPolicyClient) Update ¶
func (c *RetentionPolicyClient) Update() *RetentionPolicyUpdate
Update returns an update builder for RetentionPolicy.
func (*RetentionPolicyClient) UpdateOne ¶
func (c *RetentionPolicyClient) UpdateOne(_m *RetentionPolicy) *RetentionPolicyUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RetentionPolicyClient) UpdateOneID ¶
func (c *RetentionPolicyClient) UpdateOneID(id int) *RetentionPolicyUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RetentionPolicyClient) Use ¶
func (c *RetentionPolicyClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `retentionpolicy.Hooks(f(g(h())))`.
type RetentionPolicyCreate ¶
type RetentionPolicyCreate struct {
// contains filtered or unexported fields
}
RetentionPolicyCreate is the builder for creating a RetentionPolicy entity.
func (*RetentionPolicyCreate) Exec ¶
func (_c *RetentionPolicyCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*RetentionPolicyCreate) ExecX ¶
func (_c *RetentionPolicyCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyCreate) Mutation ¶
func (_c *RetentionPolicyCreate) Mutation() *RetentionPolicyMutation
Mutation returns the RetentionPolicyMutation object of the builder.
func (*RetentionPolicyCreate) Save ¶
func (_c *RetentionPolicyCreate) Save(ctx context.Context) (*RetentionPolicy, error)
Save creates the RetentionPolicy in the database.
func (*RetentionPolicyCreate) SaveX ¶
func (_c *RetentionPolicyCreate) SaveX(ctx context.Context) *RetentionPolicy
SaveX calls Save and panics if Save returns an error.
func (*RetentionPolicyCreate) SetCreatedAt ¶
func (_c *RetentionPolicyCreate) SetCreatedAt(v time.Time) *RetentionPolicyCreate
SetCreatedAt sets the "created_at" field.
func (*RetentionPolicyCreate) SetDescription ¶
func (_c *RetentionPolicyCreate) SetDescription(v string) *RetentionPolicyCreate
SetDescription sets the "description" field.
func (*RetentionPolicyCreate) SetDurationDays ¶
func (_c *RetentionPolicyCreate) SetDurationDays(v int) *RetentionPolicyCreate
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyCreate) SetIsActive ¶
func (_c *RetentionPolicyCreate) SetIsActive(v bool) *RetentionPolicyCreate
SetIsActive sets the "is_active" field.
func (*RetentionPolicyCreate) SetName ¶
func (_c *RetentionPolicyCreate) SetName(v string) *RetentionPolicyCreate
SetName sets the "name" field.
func (*RetentionPolicyCreate) SetNillableCreatedAt ¶
func (_c *RetentionPolicyCreate) SetNillableCreatedAt(v *time.Time) *RetentionPolicyCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableDescription ¶
func (_c *RetentionPolicyCreate) SetNillableDescription(v *string) *RetentionPolicyCreate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableDurationDays ¶
func (_c *RetentionPolicyCreate) SetNillableDurationDays(v *int) *RetentionPolicyCreate
SetNillableDurationDays sets the "duration_days" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableIsActive ¶
func (_c *RetentionPolicyCreate) SetNillableIsActive(v *bool) *RetentionPolicyCreate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*RetentionPolicyCreate) SetNillableUpdatedAt ¶
func (_c *RetentionPolicyCreate) SetNillableUpdatedAt(v *time.Time) *RetentionPolicyCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*RetentionPolicyCreate) SetProject ¶
func (_c *RetentionPolicyCreate) SetProject(v *Project) *RetentionPolicyCreate
SetProject sets the "project" edge to the Project entity.
func (*RetentionPolicyCreate) SetProjectID ¶
func (_c *RetentionPolicyCreate) SetProjectID(id int) *RetentionPolicyCreate
SetProjectID sets the "project" edge to the Project entity by ID.
func (*RetentionPolicyCreate) SetUpdatedAt ¶
func (_c *RetentionPolicyCreate) SetUpdatedAt(v time.Time) *RetentionPolicyCreate
SetUpdatedAt sets the "updated_at" field.
type RetentionPolicyCreateBulk ¶
type RetentionPolicyCreateBulk struct {
// contains filtered or unexported fields
}
RetentionPolicyCreateBulk is the builder for creating many RetentionPolicy entities in bulk.
func (*RetentionPolicyCreateBulk) Exec ¶
func (_c *RetentionPolicyCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*RetentionPolicyCreateBulk) ExecX ¶
func (_c *RetentionPolicyCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyCreateBulk) Save ¶
func (_c *RetentionPolicyCreateBulk) Save(ctx context.Context) ([]*RetentionPolicy, error)
Save creates the RetentionPolicy entities in the database.
func (*RetentionPolicyCreateBulk) SaveX ¶
func (_c *RetentionPolicyCreateBulk) SaveX(ctx context.Context) []*RetentionPolicy
SaveX is like Save, but panics if an error occurs.
type RetentionPolicyDelete ¶
type RetentionPolicyDelete struct {
// contains filtered or unexported fields
}
RetentionPolicyDelete is the builder for deleting a RetentionPolicy entity.
func (*RetentionPolicyDelete) Exec ¶
func (_d *RetentionPolicyDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RetentionPolicyDelete) ExecX ¶
func (_d *RetentionPolicyDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyDelete) Where ¶
func (_d *RetentionPolicyDelete) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyDelete
Where appends a list predicates to the RetentionPolicyDelete builder.
type RetentionPolicyDeleteOne ¶
type RetentionPolicyDeleteOne struct {
// contains filtered or unexported fields
}
RetentionPolicyDeleteOne is the builder for deleting a single RetentionPolicy entity.
func (*RetentionPolicyDeleteOne) Exec ¶
func (_d *RetentionPolicyDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RetentionPolicyDeleteOne) ExecX ¶
func (_d *RetentionPolicyDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyDeleteOne) Where ¶
func (_d *RetentionPolicyDeleteOne) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyDeleteOne
Where appends a list predicates to the RetentionPolicyDelete builder.
type RetentionPolicyEdges ¶
type RetentionPolicyEdges struct {
// Project this retention policy belongs to
Project *Project `json:"project,omitempty"`
// contains filtered or unexported fields
}
RetentionPolicyEdges holds the relations/edges for other nodes in the graph.
func (RetentionPolicyEdges) ProjectOrErr ¶
func (e RetentionPolicyEdges) ProjectOrErr() (*Project, error)
ProjectOrErr returns the Project value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type RetentionPolicyGroupBy ¶
type RetentionPolicyGroupBy struct {
// contains filtered or unexported fields
}
RetentionPolicyGroupBy is the group-by builder for RetentionPolicy entities.
func (*RetentionPolicyGroupBy) Aggregate ¶
func (_g *RetentionPolicyGroupBy) Aggregate(fns ...AggregateFunc) *RetentionPolicyGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RetentionPolicyGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*RetentionPolicyGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RetentionPolicyGroupBy) Scan ¶
func (_g *RetentionPolicyGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RetentionPolicyGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RetentionPolicyMutation ¶
type RetentionPolicyMutation struct {
// contains filtered or unexported fields
}
RetentionPolicyMutation represents an operation that mutates the RetentionPolicy nodes in the graph.
func (*RetentionPolicyMutation) AddDurationDays ¶
func (m *RetentionPolicyMutation) AddDurationDays(i int)
AddDurationDays adds i to the "duration_days" field.
func (*RetentionPolicyMutation) AddField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) AddedDurationDays ¶
func (m *RetentionPolicyMutation) AddedDurationDays() (r int, exists bool)
AddedDurationDays returns the value that was added to the "duration_days" field in this mutation.
func (*RetentionPolicyMutation) AddedEdges ¶
func (m *RetentionPolicyMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RetentionPolicyMutation) AddedField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) AddedFields ¶
func (m *RetentionPolicyMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*RetentionPolicyMutation) AddedIDs ¶
func (m *RetentionPolicyMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*RetentionPolicyMutation) ClearDescription ¶
func (m *RetentionPolicyMutation) ClearDescription()
ClearDescription clears the value of the "description" field.
func (*RetentionPolicyMutation) ClearEdge ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ClearField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ClearProject ¶
func (m *RetentionPolicyMutation) ClearProject()
ClearProject clears the "project" edge to the Project entity.
func (*RetentionPolicyMutation) ClearedEdges ¶
func (m *RetentionPolicyMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RetentionPolicyMutation) ClearedFields ¶
func (m *RetentionPolicyMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RetentionPolicyMutation) Client ¶
func (m RetentionPolicyMutation) 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 (*RetentionPolicyMutation) CreatedAt ¶
func (m *RetentionPolicyMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*RetentionPolicyMutation) Description ¶
func (m *RetentionPolicyMutation) Description() (r string, exists bool)
Description returns the value of the "description" field in the mutation.
func (*RetentionPolicyMutation) DescriptionCleared ¶
func (m *RetentionPolicyMutation) DescriptionCleared() bool
DescriptionCleared returns if the "description" field was cleared in this mutation.
func (*RetentionPolicyMutation) DurationDays ¶
func (m *RetentionPolicyMutation) DurationDays() (r int, exists bool)
DurationDays returns the value of the "duration_days" field in the mutation.
func (*RetentionPolicyMutation) EdgeCleared ¶
func (m *RetentionPolicyMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*RetentionPolicyMutation) Field ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) FieldCleared ¶
func (m *RetentionPolicyMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*RetentionPolicyMutation) Fields ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ID ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) IDs ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) IsActive ¶
func (m *RetentionPolicyMutation) IsActive() (r bool, exists bool)
IsActive returns the value of the "is_active" field in the mutation.
func (*RetentionPolicyMutation) Name ¶
func (m *RetentionPolicyMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*RetentionPolicyMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldDescription ¶
func (m *RetentionPolicyMutation) OldDescription(ctx context.Context) (v string, err error)
OldDescription returns the old "description" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldDurationDays ¶
func (m *RetentionPolicyMutation) OldDurationDays(ctx context.Context) (v int, err error)
OldDurationDays returns the old "duration_days" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) 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 (*RetentionPolicyMutation) OldIsActive ¶
func (m *RetentionPolicyMutation) OldIsActive(ctx context.Context) (v bool, err error)
OldIsActive returns the old "is_active" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldName ¶
func (m *RetentionPolicyMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the RetentionPolicy entity. If the RetentionPolicy 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 (*RetentionPolicyMutation) Op ¶
func (m *RetentionPolicyMutation) Op() Op
Op returns the operation name.
func (*RetentionPolicyMutation) ProjectCleared ¶
func (m *RetentionPolicyMutation) ProjectCleared() bool
ProjectCleared reports if the "project" edge to the Project entity was cleared.
func (*RetentionPolicyMutation) ProjectID ¶
func (m *RetentionPolicyMutation) ProjectID() (id int, exists bool)
ProjectID returns the "project" edge ID in the mutation.
func (*RetentionPolicyMutation) ProjectIDs ¶
func (m *RetentionPolicyMutation) ProjectIDs() (ids []int)
ProjectIDs returns the "project" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ProjectID instead. It exists only for internal usage by the builders.
func (*RetentionPolicyMutation) RemovedEdges ¶
func (m *RetentionPolicyMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RetentionPolicyMutation) RemovedIDs ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetCreatedAt ¶
func (m *RetentionPolicyMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*RetentionPolicyMutation) ResetDescription ¶
func (m *RetentionPolicyMutation) ResetDescription()
ResetDescription resets all changes to the "description" field.
func (*RetentionPolicyMutation) ResetDurationDays ¶
func (m *RetentionPolicyMutation) ResetDurationDays()
ResetDurationDays resets all changes to the "duration_days" field.
func (*RetentionPolicyMutation) ResetEdge ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) ResetIsActive ¶
func (m *RetentionPolicyMutation) ResetIsActive()
ResetIsActive resets all changes to the "is_active" field.
func (*RetentionPolicyMutation) ResetName ¶
func (m *RetentionPolicyMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*RetentionPolicyMutation) ResetProject ¶
func (m *RetentionPolicyMutation) ResetProject()
ResetProject resets all changes to the "project" edge.
func (*RetentionPolicyMutation) ResetUpdatedAt ¶
func (m *RetentionPolicyMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*RetentionPolicyMutation) SetCreatedAt ¶
func (m *RetentionPolicyMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*RetentionPolicyMutation) SetDescription ¶
func (m *RetentionPolicyMutation) SetDescription(s string)
SetDescription sets the "description" field.
func (*RetentionPolicyMutation) SetDurationDays ¶
func (m *RetentionPolicyMutation) SetDurationDays(i int)
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyMutation) SetField ¶
func (m *RetentionPolicyMutation) 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 (*RetentionPolicyMutation) SetIsActive ¶
func (m *RetentionPolicyMutation) SetIsActive(b bool)
SetIsActive sets the "is_active" field.
func (*RetentionPolicyMutation) SetName ¶
func (m *RetentionPolicyMutation) SetName(s string)
SetName sets the "name" field.
func (*RetentionPolicyMutation) SetOp ¶
func (m *RetentionPolicyMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*RetentionPolicyMutation) SetProjectID ¶
func (m *RetentionPolicyMutation) SetProjectID(id int)
SetProjectID sets the "project" edge to the Project entity by id.
func (*RetentionPolicyMutation) SetUpdatedAt ¶
func (m *RetentionPolicyMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (RetentionPolicyMutation) Tx ¶
func (m RetentionPolicyMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RetentionPolicyMutation) Type ¶
func (m *RetentionPolicyMutation) Type() string
Type returns the node type of this mutation (RetentionPolicy).
func (*RetentionPolicyMutation) UpdatedAt ¶
func (m *RetentionPolicyMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*RetentionPolicyMutation) Where ¶
func (m *RetentionPolicyMutation) Where(ps ...predicate.RetentionPolicy)
Where appends a list predicates to the RetentionPolicyMutation builder.
func (*RetentionPolicyMutation) WhereP ¶
func (m *RetentionPolicyMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the RetentionPolicyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type RetentionPolicyQuery ¶
type RetentionPolicyQuery struct {
// contains filtered or unexported fields
}
RetentionPolicyQuery is the builder for querying RetentionPolicy entities.
func (*RetentionPolicyQuery) Aggregate ¶
func (_q *RetentionPolicyQuery) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
Aggregate returns a RetentionPolicySelect configured with the given aggregations.
func (*RetentionPolicyQuery) All ¶
func (_q *RetentionPolicyQuery) All(ctx context.Context) ([]*RetentionPolicy, error)
All executes the query and returns a list of RetentionPolicies.
func (*RetentionPolicyQuery) AllX ¶
func (_q *RetentionPolicyQuery) AllX(ctx context.Context) []*RetentionPolicy
AllX is like All, but panics if an error occurs.
func (*RetentionPolicyQuery) Clone ¶
func (_q *RetentionPolicyQuery) Clone() *RetentionPolicyQuery
Clone returns a duplicate of the RetentionPolicyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*RetentionPolicyQuery) Count ¶
func (_q *RetentionPolicyQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RetentionPolicyQuery) CountX ¶
func (_q *RetentionPolicyQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RetentionPolicyQuery) Exist ¶
func (_q *RetentionPolicyQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RetentionPolicyQuery) ExistX ¶
func (_q *RetentionPolicyQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RetentionPolicyQuery) First ¶
func (_q *RetentionPolicyQuery) First(ctx context.Context) (*RetentionPolicy, error)
First returns the first RetentionPolicy entity from the query. Returns a *NotFoundError when no RetentionPolicy was found.
func (*RetentionPolicyQuery) FirstID ¶
func (_q *RetentionPolicyQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first RetentionPolicy ID from the query. Returns a *NotFoundError when no RetentionPolicy ID was found.
func (*RetentionPolicyQuery) FirstIDX ¶
func (_q *RetentionPolicyQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*RetentionPolicyQuery) FirstX ¶
func (_q *RetentionPolicyQuery) FirstX(ctx context.Context) *RetentionPolicy
FirstX is like First, but panics if an error occurs.
func (*RetentionPolicyQuery) GroupBy ¶
func (_q *RetentionPolicyQuery) GroupBy(field string, fields ...string) *RetentionPolicyGroupBy
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.RetentionPolicy.Query().
GroupBy(retentionpolicy.FieldName).
Aggregate(data.Count()).
Scan(ctx, &v)
func (*RetentionPolicyQuery) IDs ¶
func (_q *RetentionPolicyQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of RetentionPolicy IDs.
func (*RetentionPolicyQuery) IDsX ¶
func (_q *RetentionPolicyQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RetentionPolicyQuery) Limit ¶
func (_q *RetentionPolicyQuery) Limit(limit int) *RetentionPolicyQuery
Limit the number of records to be returned by this query.
func (*RetentionPolicyQuery) Offset ¶
func (_q *RetentionPolicyQuery) Offset(offset int) *RetentionPolicyQuery
Offset to start from.
func (*RetentionPolicyQuery) Only ¶
func (_q *RetentionPolicyQuery) Only(ctx context.Context) (*RetentionPolicy, error)
Only returns a single RetentionPolicy entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RetentionPolicy entity is found. Returns a *NotFoundError when no RetentionPolicy entities are found.
func (*RetentionPolicyQuery) OnlyID ¶
func (_q *RetentionPolicyQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only RetentionPolicy ID in the query. Returns a *NotSingularError when more than one RetentionPolicy ID is found. Returns a *NotFoundError when no entities are found.
func (*RetentionPolicyQuery) OnlyIDX ¶
func (_q *RetentionPolicyQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*RetentionPolicyQuery) OnlyX ¶
func (_q *RetentionPolicyQuery) OnlyX(ctx context.Context) *RetentionPolicy
OnlyX is like Only, but panics if an error occurs.
func (*RetentionPolicyQuery) Order ¶
func (_q *RetentionPolicyQuery) Order(o ...retentionpolicy.OrderOption) *RetentionPolicyQuery
Order specifies how the records should be ordered.
func (*RetentionPolicyQuery) QueryProject ¶
func (_q *RetentionPolicyQuery) QueryProject() *ProjectQuery
QueryProject chains the current query on the "project" edge.
func (*RetentionPolicyQuery) Select ¶
func (_q *RetentionPolicyQuery) Select(fields ...string) *RetentionPolicySelect
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.RetentionPolicy.Query().
Select(retentionpolicy.FieldName).
Scan(ctx, &v)
func (*RetentionPolicyQuery) Unique ¶
func (_q *RetentionPolicyQuery) Unique(unique bool) *RetentionPolicyQuery
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 (*RetentionPolicyQuery) Where ¶
func (_q *RetentionPolicyQuery) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyQuery
Where adds a new predicate for the RetentionPolicyQuery builder.
func (*RetentionPolicyQuery) WithProject ¶
func (_q *RetentionPolicyQuery) WithProject(opts ...func(*ProjectQuery)) *RetentionPolicyQuery
WithProject tells the query-builder to eager-load the nodes that are connected to the "project" edge. The optional arguments are used to configure the query builder of the edge.
type RetentionPolicySelect ¶
type RetentionPolicySelect struct {
*RetentionPolicyQuery
// contains filtered or unexported fields
}
RetentionPolicySelect is the builder for selecting fields of RetentionPolicy entities.
func (*RetentionPolicySelect) Aggregate ¶
func (_s *RetentionPolicySelect) Aggregate(fns ...AggregateFunc) *RetentionPolicySelect
Aggregate adds the given aggregation functions to the selector query.
func (*RetentionPolicySelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*RetentionPolicySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*RetentionPolicySelect) Scan ¶
func (_s *RetentionPolicySelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*RetentionPolicySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type RetentionPolicyUpdate ¶
type RetentionPolicyUpdate struct {
// contains filtered or unexported fields
}
RetentionPolicyUpdate is the builder for updating RetentionPolicy entities.
func (*RetentionPolicyUpdate) AddDurationDays ¶
func (_u *RetentionPolicyUpdate) AddDurationDays(v int) *RetentionPolicyUpdate
AddDurationDays adds value to the "duration_days" field.
func (*RetentionPolicyUpdate) ClearDescription ¶
func (_u *RetentionPolicyUpdate) ClearDescription() *RetentionPolicyUpdate
ClearDescription clears the value of the "description" field.
func (*RetentionPolicyUpdate) ClearProject ¶
func (_u *RetentionPolicyUpdate) ClearProject() *RetentionPolicyUpdate
ClearProject clears the "project" edge to the Project entity.
func (*RetentionPolicyUpdate) Exec ¶
func (_u *RetentionPolicyUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RetentionPolicyUpdate) ExecX ¶
func (_u *RetentionPolicyUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyUpdate) Mutation ¶
func (_u *RetentionPolicyUpdate) Mutation() *RetentionPolicyMutation
Mutation returns the RetentionPolicyMutation object of the builder.
func (*RetentionPolicyUpdate) Save ¶
func (_u *RetentionPolicyUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*RetentionPolicyUpdate) SaveX ¶
func (_u *RetentionPolicyUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RetentionPolicyUpdate) SetDescription ¶
func (_u *RetentionPolicyUpdate) SetDescription(v string) *RetentionPolicyUpdate
SetDescription sets the "description" field.
func (*RetentionPolicyUpdate) SetDurationDays ¶
func (_u *RetentionPolicyUpdate) SetDurationDays(v int) *RetentionPolicyUpdate
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyUpdate) SetIsActive ¶
func (_u *RetentionPolicyUpdate) SetIsActive(v bool) *RetentionPolicyUpdate
SetIsActive sets the "is_active" field.
func (*RetentionPolicyUpdate) SetName ¶
func (_u *RetentionPolicyUpdate) SetName(v string) *RetentionPolicyUpdate
SetName sets the "name" field.
func (*RetentionPolicyUpdate) SetNillableDescription ¶
func (_u *RetentionPolicyUpdate) SetNillableDescription(v *string) *RetentionPolicyUpdate
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetNillableDurationDays ¶
func (_u *RetentionPolicyUpdate) SetNillableDurationDays(v *int) *RetentionPolicyUpdate
SetNillableDurationDays sets the "duration_days" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetNillableIsActive ¶
func (_u *RetentionPolicyUpdate) SetNillableIsActive(v *bool) *RetentionPolicyUpdate
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetNillableName ¶
func (_u *RetentionPolicyUpdate) SetNillableName(v *string) *RetentionPolicyUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*RetentionPolicyUpdate) SetProject ¶
func (_u *RetentionPolicyUpdate) SetProject(v *Project) *RetentionPolicyUpdate
SetProject sets the "project" edge to the Project entity.
func (*RetentionPolicyUpdate) SetProjectID ¶
func (_u *RetentionPolicyUpdate) SetProjectID(id int) *RetentionPolicyUpdate
SetProjectID sets the "project" edge to the Project entity by ID.
func (*RetentionPolicyUpdate) SetUpdatedAt ¶
func (_u *RetentionPolicyUpdate) SetUpdatedAt(v time.Time) *RetentionPolicyUpdate
SetUpdatedAt sets the "updated_at" field.
func (*RetentionPolicyUpdate) Where ¶
func (_u *RetentionPolicyUpdate) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdate
Where appends a list predicates to the RetentionPolicyUpdate builder.
type RetentionPolicyUpdateOne ¶
type RetentionPolicyUpdateOne struct {
// contains filtered or unexported fields
}
RetentionPolicyUpdateOne is the builder for updating a single RetentionPolicy entity.
func (*RetentionPolicyUpdateOne) AddDurationDays ¶
func (_u *RetentionPolicyUpdateOne) AddDurationDays(v int) *RetentionPolicyUpdateOne
AddDurationDays adds value to the "duration_days" field.
func (*RetentionPolicyUpdateOne) ClearDescription ¶
func (_u *RetentionPolicyUpdateOne) ClearDescription() *RetentionPolicyUpdateOne
ClearDescription clears the value of the "description" field.
func (*RetentionPolicyUpdateOne) ClearProject ¶
func (_u *RetentionPolicyUpdateOne) ClearProject() *RetentionPolicyUpdateOne
ClearProject clears the "project" edge to the Project entity.
func (*RetentionPolicyUpdateOne) Exec ¶
func (_u *RetentionPolicyUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RetentionPolicyUpdateOne) ExecX ¶
func (_u *RetentionPolicyUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RetentionPolicyUpdateOne) Mutation ¶
func (_u *RetentionPolicyUpdateOne) Mutation() *RetentionPolicyMutation
Mutation returns the RetentionPolicyMutation object of the builder.
func (*RetentionPolicyUpdateOne) Save ¶
func (_u *RetentionPolicyUpdateOne) Save(ctx context.Context) (*RetentionPolicy, error)
Save executes the query and returns the updated RetentionPolicy entity.
func (*RetentionPolicyUpdateOne) SaveX ¶
func (_u *RetentionPolicyUpdateOne) SaveX(ctx context.Context) *RetentionPolicy
SaveX is like Save, but panics if an error occurs.
func (*RetentionPolicyUpdateOne) Select ¶
func (_u *RetentionPolicyUpdateOne) Select(field string, fields ...string) *RetentionPolicyUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*RetentionPolicyUpdateOne) SetDescription ¶
func (_u *RetentionPolicyUpdateOne) SetDescription(v string) *RetentionPolicyUpdateOne
SetDescription sets the "description" field.
func (*RetentionPolicyUpdateOne) SetDurationDays ¶
func (_u *RetentionPolicyUpdateOne) SetDurationDays(v int) *RetentionPolicyUpdateOne
SetDurationDays sets the "duration_days" field.
func (*RetentionPolicyUpdateOne) SetIsActive ¶
func (_u *RetentionPolicyUpdateOne) SetIsActive(v bool) *RetentionPolicyUpdateOne
SetIsActive sets the "is_active" field.
func (*RetentionPolicyUpdateOne) SetName ¶
func (_u *RetentionPolicyUpdateOne) SetName(v string) *RetentionPolicyUpdateOne
SetName sets the "name" field.
func (*RetentionPolicyUpdateOne) SetNillableDescription ¶
func (_u *RetentionPolicyUpdateOne) SetNillableDescription(v *string) *RetentionPolicyUpdateOne
SetNillableDescription sets the "description" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetNillableDurationDays ¶
func (_u *RetentionPolicyUpdateOne) SetNillableDurationDays(v *int) *RetentionPolicyUpdateOne
SetNillableDurationDays sets the "duration_days" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetNillableIsActive ¶
func (_u *RetentionPolicyUpdateOne) SetNillableIsActive(v *bool) *RetentionPolicyUpdateOne
SetNillableIsActive sets the "is_active" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetNillableName ¶
func (_u *RetentionPolicyUpdateOne) SetNillableName(v *string) *RetentionPolicyUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*RetentionPolicyUpdateOne) SetProject ¶
func (_u *RetentionPolicyUpdateOne) SetProject(v *Project) *RetentionPolicyUpdateOne
SetProject sets the "project" edge to the Project entity.
func (*RetentionPolicyUpdateOne) SetProjectID ¶
func (_u *RetentionPolicyUpdateOne) SetProjectID(id int) *RetentionPolicyUpdateOne
SetProjectID sets the "project" edge to the Project entity by ID.
func (*RetentionPolicyUpdateOne) SetUpdatedAt ¶
func (_u *RetentionPolicyUpdateOne) SetUpdatedAt(v time.Time) *RetentionPolicyUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*RetentionPolicyUpdateOne) Where ¶
func (_u *RetentionPolicyUpdateOne) Where(ps ...predicate.RetentionPolicy) *RetentionPolicyUpdateOne
Where appends a list predicates to the RetentionPolicyUpdate builder.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker {
return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
// Do some stuff before.
if err := next.Rollback(ctx, tx); err != nil {
return err
}
// Do some stuff after.
return nil
})
}
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct {
// APIKey is the client for interacting with the APIKey builders.
APIKey *APIKeyClient
// Project is the client for interacting with the Project builders.
Project *ProjectClient
// RetentionPolicy is the client for interacting with the RetentionPolicy builders.
RetentionPolicy *RetentionPolicyClient
// 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"`
// Unique username for the user
Username string `json:"username,omitempty"`
// Email address of the user
Email string `json:"email,omitempty"`
// Hashed password for authentication
PasswordHash string `json:"-"`
// User role: admin, user, etc.
Role string `json:"role,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) QueryAPIKeys ¶
func (_m *User) QueryAPIKeys() *APIKeyQuery
QueryAPIKeys queries the "api_keys" edge of the User entity.
func (*User) QueryProjects ¶
func (_m *User) QueryProjects() *ProjectQuery
QueryProjects queries the "projects" 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) QueryAPIKeys ¶
func (c *UserClient) QueryAPIKeys(_m *User) *APIKeyQuery
QueryAPIKeys queries the api_keys edge of a User.
func (*UserClient) QueryProjects ¶
func (c *UserClient) QueryProjects(_m *User) *ProjectQuery
QueryProjects queries the projects 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) AddAPIKeyIDs ¶
func (_c *UserCreate) AddAPIKeyIDs(ids ...int) *UserCreate
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (*UserCreate) AddAPIKeys ¶
func (_c *UserCreate) AddAPIKeys(v ...*APIKey) *UserCreate
AddAPIKeys adds the "api_keys" edges to the APIKey entity.
func (*UserCreate) AddProjectIDs ¶
func (_c *UserCreate) AddProjectIDs(ids ...int) *UserCreate
AddProjectIDs adds the "projects" edge to the Project entity by IDs.
func (*UserCreate) AddProjects ¶
func (_c *UserCreate) AddProjects(v ...*Project) *UserCreate
AddProjects adds the "projects" edges to the Project 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) 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) SetNillableCreatedAt ¶
func (_c *UserCreate) SetNillableCreatedAt(v *time.Time) *UserCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*UserCreate) SetNillableRole ¶
func (_c *UserCreate) SetNillableRole(v *string) *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) SetPasswordHash ¶
func (_c *UserCreate) SetPasswordHash(v string) *UserCreate
SetPasswordHash sets the "password_hash" field.
func (*UserCreate) SetRole ¶
func (_c *UserCreate) SetRole(v string) *UserCreate
SetRole sets the "role" field.
func (*UserCreate) SetUpdatedAt ¶
func (_c *UserCreate) SetUpdatedAt(v time.Time) *UserCreate
SetUpdatedAt sets the "updated_at" field.
func (*UserCreate) SetUsername ¶
func (_c *UserCreate) SetUsername(v string) *UserCreate
SetUsername sets the "username" 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 {
// Projects owned by this user
Projects []*Project `json:"projects,omitempty"`
// API keys created by this user
APIKeys []*APIKey `json:"api_keys,omitempty"`
// contains filtered or unexported fields
}
UserEdges holds the relations/edges for other nodes in the graph.
func (UserEdges) APIKeysOrErr ¶
APIKeysOrErr returns the APIKeys value or an error if the edge was not loaded in eager-loading.
func (UserEdges) ProjectsOrErr ¶
ProjectsOrErr returns the Projects 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) APIKeysCleared ¶
func (m *UserMutation) APIKeysCleared() bool
APIKeysCleared reports if the "api_keys" edge to the APIKey entity was cleared.
func (*UserMutation) APIKeysIDs ¶
func (m *UserMutation) APIKeysIDs() (ids []int)
APIKeysIDs returns the "api_keys" edge IDs in the mutation.
func (*UserMutation) AddAPIKeyIDs ¶
func (m *UserMutation) AddAPIKeyIDs(ids ...int)
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by ids.
func (*UserMutation) AddField ¶
func (m *UserMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*UserMutation) AddProjectIDs ¶
func (m *UserMutation) AddProjectIDs(ids ...int)
AddProjectIDs adds the "projects" edge to the Project 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) ClearAPIKeys ¶
func (m *UserMutation) ClearAPIKeys()
ClearAPIKeys clears the "api_keys" edge to the APIKey entity.
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) ClearProjects ¶
func (m *UserMutation) ClearProjects()
ClearProjects clears the "projects" edge to the Project 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) 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) 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 ¶
func (m *UserMutation) OldRole(ctx context.Context) (v string, err error)
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) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" 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) PasswordHash ¶
func (m *UserMutation) PasswordHash() (r string, exists bool)
PasswordHash returns the value of the "password_hash" field in the mutation.
func (*UserMutation) ProjectsCleared ¶
func (m *UserMutation) ProjectsCleared() bool
ProjectsCleared reports if the "projects" edge to the Project entity was cleared.
func (*UserMutation) ProjectsIDs ¶
func (m *UserMutation) ProjectsIDs() (ids []int)
ProjectsIDs returns the "projects" edge IDs in the mutation.
func (*UserMutation) RemoveAPIKeyIDs ¶
func (m *UserMutation) RemoveAPIKeyIDs(ids ...int)
RemoveAPIKeyIDs removes the "api_keys" edge to the APIKey entity by IDs.
func (*UserMutation) RemoveProjectIDs ¶
func (m *UserMutation) RemoveProjectIDs(ids ...int)
RemoveProjectIDs removes the "projects" edge to the Project entity by IDs.
func (*UserMutation) RemovedAPIKeysIDs ¶
func (m *UserMutation) RemovedAPIKeysIDs() (ids []int)
RemovedAPIKeys returns the removed IDs of the "api_keys" edge to the APIKey entity.
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) RemovedProjectsIDs ¶
func (m *UserMutation) RemovedProjectsIDs() (ids []int)
RemovedProjects returns the removed IDs of the "projects" edge to the Project entity.
func (*UserMutation) ResetAPIKeys ¶
func (m *UserMutation) ResetAPIKeys()
ResetAPIKeys resets all changes to the "api_keys" edge.
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) ResetPasswordHash ¶
func (m *UserMutation) ResetPasswordHash()
ResetPasswordHash resets all changes to the "password_hash" field.
func (*UserMutation) ResetProjects ¶
func (m *UserMutation) ResetProjects()
ResetProjects resets all changes to the "projects" edge.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*UserMutation) ResetUpdatedAt ¶
func (m *UserMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) Role ¶
func (m *UserMutation) Role() (r string, exists bool)
Role returns the value of the "role" field in the mutation.
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) SetOp ¶
func (m *UserMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UserMutation) SetPasswordHash ¶
func (m *UserMutation) SetPasswordHash(s string)
SetPasswordHash sets the "password_hash" field.
func (*UserMutation) SetRole ¶
func (m *UserMutation) SetRole(s string)
SetRole sets the "role" field.
func (*UserMutation) SetUpdatedAt ¶
func (m *UserMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
SetUsername sets the "username" 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) Username ¶
func (m *UserMutation) Username() (r string, exists bool)
Username returns the value of the "username" 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 {
Username string `json:"username,omitempty"`
Count int `json:"count,omitempty"`
}
client.User.Query().
GroupBy(user.FieldUsername).
Aggregate(data.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) QueryAPIKeys ¶
func (_q *UserQuery) QueryAPIKeys() *APIKeyQuery
QueryAPIKeys chains the current query on the "api_keys" edge.
func (*UserQuery) QueryProjects ¶
func (_q *UserQuery) QueryProjects() *ProjectQuery
QueryProjects chains the current query on the "projects" 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 {
Username string `json:"username,omitempty"`
}
client.User.Query().
Select(user.FieldUsername).
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) WithAPIKeys ¶
func (_q *UserQuery) WithAPIKeys(opts ...func(*APIKeyQuery)) *UserQuery
WithAPIKeys tells the query-builder to eager-load the nodes that are connected to the "api_keys" edge. The optional arguments are used to configure the query builder of the edge.
func (*UserQuery) WithProjects ¶
func (_q *UserQuery) WithProjects(opts ...func(*ProjectQuery)) *UserQuery
WithProjects tells the query-builder to eager-load the nodes that are connected to the "projects" 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) AddAPIKeyIDs ¶
func (_u *UserUpdate) AddAPIKeyIDs(ids ...int) *UserUpdate
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (*UserUpdate) AddAPIKeys ¶
func (_u *UserUpdate) AddAPIKeys(v ...*APIKey) *UserUpdate
AddAPIKeys adds the "api_keys" edges to the APIKey entity.
func (*UserUpdate) AddProjectIDs ¶
func (_u *UserUpdate) AddProjectIDs(ids ...int) *UserUpdate
AddProjectIDs adds the "projects" edge to the Project entity by IDs.
func (*UserUpdate) AddProjects ¶
func (_u *UserUpdate) AddProjects(v ...*Project) *UserUpdate
AddProjects adds the "projects" edges to the Project entity.
func (*UserUpdate) ClearAPIKeys ¶
func (_u *UserUpdate) ClearAPIKeys() *UserUpdate
ClearAPIKeys clears all "api_keys" edges to the APIKey entity.
func (*UserUpdate) ClearProjects ¶
func (_u *UserUpdate) ClearProjects() *UserUpdate
ClearProjects clears all "projects" edges to the Project 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) RemoveAPIKeyIDs ¶
func (_u *UserUpdate) RemoveAPIKeyIDs(ids ...int) *UserUpdate
RemoveAPIKeyIDs removes the "api_keys" edge to APIKey entities by IDs.
func (*UserUpdate) RemoveAPIKeys ¶
func (_u *UserUpdate) RemoveAPIKeys(v ...*APIKey) *UserUpdate
RemoveAPIKeys removes "api_keys" edges to APIKey entities.
func (*UserUpdate) RemoveProjectIDs ¶
func (_u *UserUpdate) RemoveProjectIDs(ids ...int) *UserUpdate
RemoveProjectIDs removes the "projects" edge to Project entities by IDs.
func (*UserUpdate) RemoveProjects ¶
func (_u *UserUpdate) RemoveProjects(v ...*Project) *UserUpdate
RemoveProjects removes "projects" edges to Project 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) SetEmail ¶
func (_u *UserUpdate) SetEmail(v string) *UserUpdate
SetEmail sets the "email" field.
func (*UserUpdate) SetNillableEmail ¶
func (_u *UserUpdate) SetNillableEmail(v *string) *UserUpdate
SetNillableEmail sets the "email" field 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 *string) *UserUpdate
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdate) SetNillableUsername ¶
func (_u *UserUpdate) SetNillableUsername(v *string) *UserUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdate) SetPasswordHash ¶
func (_u *UserUpdate) SetPasswordHash(v string) *UserUpdate
SetPasswordHash sets the "password_hash" field.
func (*UserUpdate) SetRole ¶
func (_u *UserUpdate) SetRole(v string) *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) SetUsername ¶
func (_u *UserUpdate) SetUsername(v string) *UserUpdate
SetUsername sets the "username" 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) AddAPIKeyIDs ¶
func (_u *UserUpdateOne) AddAPIKeyIDs(ids ...int) *UserUpdateOne
AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
func (*UserUpdateOne) AddAPIKeys ¶
func (_u *UserUpdateOne) AddAPIKeys(v ...*APIKey) *UserUpdateOne
AddAPIKeys adds the "api_keys" edges to the APIKey entity.
func (*UserUpdateOne) AddProjectIDs ¶
func (_u *UserUpdateOne) AddProjectIDs(ids ...int) *UserUpdateOne
AddProjectIDs adds the "projects" edge to the Project entity by IDs.
func (*UserUpdateOne) AddProjects ¶
func (_u *UserUpdateOne) AddProjects(v ...*Project) *UserUpdateOne
AddProjects adds the "projects" edges to the Project entity.
func (*UserUpdateOne) ClearAPIKeys ¶
func (_u *UserUpdateOne) ClearAPIKeys() *UserUpdateOne
ClearAPIKeys clears all "api_keys" edges to the APIKey entity.
func (*UserUpdateOne) ClearProjects ¶
func (_u *UserUpdateOne) ClearProjects() *UserUpdateOne
ClearProjects clears all "projects" edges to the Project 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) RemoveAPIKeyIDs ¶
func (_u *UserUpdateOne) RemoveAPIKeyIDs(ids ...int) *UserUpdateOne
RemoveAPIKeyIDs removes the "api_keys" edge to APIKey entities by IDs.
func (*UserUpdateOne) RemoveAPIKeys ¶
func (_u *UserUpdateOne) RemoveAPIKeys(v ...*APIKey) *UserUpdateOne
RemoveAPIKeys removes "api_keys" edges to APIKey entities.
func (*UserUpdateOne) RemoveProjectIDs ¶
func (_u *UserUpdateOne) RemoveProjectIDs(ids ...int) *UserUpdateOne
RemoveProjectIDs removes the "projects" edge to Project entities by IDs.
func (*UserUpdateOne) RemoveProjects ¶
func (_u *UserUpdateOne) RemoveProjects(v ...*Project) *UserUpdateOne
RemoveProjects removes "projects" edges to Project 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) SetEmail ¶
func (_u *UserUpdateOne) SetEmail(v string) *UserUpdateOne
SetEmail sets the "email" field.
func (*UserUpdateOne) SetNillableEmail ¶
func (_u *UserUpdateOne) SetNillableEmail(v *string) *UserUpdateOne
SetNillableEmail sets the "email" field 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 *string) *UserUpdateOne
SetNillableRole sets the "role" field if the given value is not nil.
func (*UserUpdateOne) SetNillableUsername ¶
func (_u *UserUpdateOne) SetNillableUsername(v *string) *UserUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UserUpdateOne) SetPasswordHash ¶
func (_u *UserUpdateOne) SetPasswordHash(v string) *UserUpdateOne
SetPasswordHash sets the "password_hash" field.
func (*UserUpdateOne) SetRole ¶
func (_u *UserUpdateOne) SetRole(v string) *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) SetUsername ¶
func (_u *UserUpdateOne) SetUsername(v string) *UserUpdateOne
SetUsername sets the "username" 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
¶
- apikey.go
- apikey_create.go
- apikey_delete.go
- apikey_query.go
- apikey_update.go
- client.go
- ent.go
- mutation.go
- project.go
- project_create.go
- project_delete.go
- project_query.go
- project_update.go
- retentionpolicy.go
- retentionpolicy_create.go
- retentionpolicy_delete.go
- retentionpolicy_query.go
- retentionpolicy_update.go
- runtime.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go