ent

package
v0.0.0-...-4d10510 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2023 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAgeKey          = "AgeKey"
	TypeHIBP            = "HIBP"
	TypeLocalBreach     = "LocalBreach"
	TypeSearchQuery     = "SearchQuery"
	TypeSettings        = "Settings"
	TypeSetup           = "Setup"
	TypeTrackedBreaches = "TrackedBreaches"
	TypeUser            = "User"
)

Variables

This section is empty.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AgeKey

type AgeKey struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// age ed25519 identity stored encrypted using AES256
	Key *[]byte `json:"key,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// Updated holds the value of the "updated" field.
	Updated time.Time `json:"updated,omitempty"`
	// id of the key owner
	Owner uuid.UUID `json:"owner,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AgeKeyQuery when eager-loading is set.
	Edges AgeKeyEdges `json:"edges"`
	// contains filtered or unexported fields
}

AgeKey is the model entity for the AgeKey schema.

func (*AgeKey) QueryUser

func (ak *AgeKey) QueryUser() *UserQuery

QueryUser queries the "user" edge of the AgeKey entity.

func (*AgeKey) String

func (ak *AgeKey) String() string

String implements the fmt.Stringer.

func (*AgeKey) Unwrap

func (ak *AgeKey) Unwrap() *AgeKey

Unwrap unwraps the AgeKey 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 (*AgeKey) Update

func (ak *AgeKey) Update() *AgeKeyUpdateOne

Update returns a builder for updating this AgeKey. Note that you need to call AgeKey.Unwrap() before calling this method if this AgeKey was returned from a transaction, and the transaction was committed or rolled back.

func (*AgeKey) Value

func (ak *AgeKey) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the AgeKey. This includes values selected through modifiers, order, etc.

type AgeKeyClient

type AgeKeyClient struct {
	// contains filtered or unexported fields
}

AgeKeyClient is a client for the AgeKey schema.

func NewAgeKeyClient

func NewAgeKeyClient(c config) *AgeKeyClient

NewAgeKeyClient returns a client for the AgeKey from the given config.

func (*AgeKeyClient) Create

func (c *AgeKeyClient) Create() *AgeKeyCreate

Create returns a builder for creating a AgeKey entity.

func (*AgeKeyClient) CreateBulk

func (c *AgeKeyClient) CreateBulk(builders ...*AgeKeyCreate) *AgeKeyCreateBulk

CreateBulk returns a builder for creating a bulk of AgeKey entities.

func (*AgeKeyClient) Delete

func (c *AgeKeyClient) Delete() *AgeKeyDelete

Delete returns a delete builder for AgeKey.

func (*AgeKeyClient) DeleteOne

func (c *AgeKeyClient) DeleteOne(ak *AgeKey) *AgeKeyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AgeKeyClient) DeleteOneID

func (c *AgeKeyClient) DeleteOneID(id uuid.UUID) *AgeKeyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*AgeKeyClient) Get

func (c *AgeKeyClient) Get(ctx context.Context, id uuid.UUID) (*AgeKey, error)

Get returns a AgeKey entity by its id.

func (*AgeKeyClient) GetX

func (c *AgeKeyClient) GetX(ctx context.Context, id uuid.UUID) *AgeKey

GetX is like Get, but panics if an error occurs.

func (*AgeKeyClient) Hooks

func (c *AgeKeyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*AgeKeyClient) Intercept

func (c *AgeKeyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `agekey.Intercept(f(g(h())))`.

func (*AgeKeyClient) Interceptors

func (c *AgeKeyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AgeKeyClient) Query

func (c *AgeKeyClient) Query() *AgeKeyQuery

Query returns a query builder for AgeKey.

func (*AgeKeyClient) QueryUser

func (c *AgeKeyClient) QueryUser(ak *AgeKey) *UserQuery

QueryUser queries the user edge of a AgeKey.

func (*AgeKeyClient) Update

func (c *AgeKeyClient) Update() *AgeKeyUpdate

Update returns an update builder for AgeKey.

func (*AgeKeyClient) UpdateOne

func (c *AgeKeyClient) UpdateOne(ak *AgeKey) *AgeKeyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AgeKeyClient) UpdateOneID

func (c *AgeKeyClient) UpdateOneID(id uuid.UUID) *AgeKeyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AgeKeyClient) Use

func (c *AgeKeyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `agekey.Hooks(f(g(h())))`.

type AgeKeyCreate

type AgeKeyCreate struct {
	// contains filtered or unexported fields
}

AgeKeyCreate is the builder for creating a AgeKey entity.

func (*AgeKeyCreate) Exec

func (akc *AgeKeyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgeKeyCreate) ExecX

func (akc *AgeKeyCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgeKeyCreate) Mutation

func (akc *AgeKeyCreate) Mutation() *AgeKeyMutation

Mutation returns the AgeKeyMutation object of the builder.

func (*AgeKeyCreate) Save

func (akc *AgeKeyCreate) Save(ctx context.Context) (*AgeKey, error)

Save creates the AgeKey in the database.

func (*AgeKeyCreate) SaveX

func (akc *AgeKeyCreate) SaveX(ctx context.Context) *AgeKey

SaveX calls Save and panics if Save returns an error.

func (*AgeKeyCreate) SetCreated

func (akc *AgeKeyCreate) SetCreated(t time.Time) *AgeKeyCreate

SetCreated sets the "created" field.

func (*AgeKeyCreate) SetID

func (akc *AgeKeyCreate) SetID(u uuid.UUID) *AgeKeyCreate

SetID sets the "id" field.

func (*AgeKeyCreate) SetKey

func (akc *AgeKeyCreate) SetKey(b []byte) *AgeKeyCreate

SetKey sets the "key" field.

func (*AgeKeyCreate) SetNillableCreated

func (akc *AgeKeyCreate) SetNillableCreated(t *time.Time) *AgeKeyCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*AgeKeyCreate) SetNillableID

func (akc *AgeKeyCreate) SetNillableID(u *uuid.UUID) *AgeKeyCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AgeKeyCreate) SetNillableUpdated

func (akc *AgeKeyCreate) SetNillableUpdated(t *time.Time) *AgeKeyCreate

SetNillableUpdated sets the "updated" field if the given value is not nil.

func (*AgeKeyCreate) SetOwner

func (akc *AgeKeyCreate) SetOwner(u uuid.UUID) *AgeKeyCreate

SetOwner sets the "owner" field.

func (*AgeKeyCreate) SetUpdated

func (akc *AgeKeyCreate) SetUpdated(t time.Time) *AgeKeyCreate

SetUpdated sets the "updated" field.

func (*AgeKeyCreate) SetUser

func (akc *AgeKeyCreate) SetUser(u *User) *AgeKeyCreate

SetUser sets the "user" edge to the User entity.

func (*AgeKeyCreate) SetUserID

func (akc *AgeKeyCreate) SetUserID(id uuid.UUID) *AgeKeyCreate

SetUserID sets the "user" edge to the User entity by ID.

type AgeKeyCreateBulk

type AgeKeyCreateBulk struct {
	// contains filtered or unexported fields
}

AgeKeyCreateBulk is the builder for creating many AgeKey entities in bulk.

func (*AgeKeyCreateBulk) Exec

func (akcb *AgeKeyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AgeKeyCreateBulk) ExecX

func (akcb *AgeKeyCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgeKeyCreateBulk) Save

func (akcb *AgeKeyCreateBulk) Save(ctx context.Context) ([]*AgeKey, error)

Save creates the AgeKey entities in the database.

func (*AgeKeyCreateBulk) SaveX

func (akcb *AgeKeyCreateBulk) SaveX(ctx context.Context) []*AgeKey

SaveX is like Save, but panics if an error occurs.

type AgeKeyDelete

type AgeKeyDelete struct {
	// contains filtered or unexported fields
}

AgeKeyDelete is the builder for deleting a AgeKey entity.

func (*AgeKeyDelete) Exec

func (akd *AgeKeyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*AgeKeyDelete) ExecX

func (akd *AgeKeyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*AgeKeyDelete) Where

func (akd *AgeKeyDelete) Where(ps ...predicate.AgeKey) *AgeKeyDelete

Where appends a list predicates to the AgeKeyDelete builder.

type AgeKeyDeleteOne

type AgeKeyDeleteOne struct {
	// contains filtered or unexported fields
}

AgeKeyDeleteOne is the builder for deleting a single AgeKey entity.

func (*AgeKeyDeleteOne) Exec

func (akdo *AgeKeyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AgeKeyDeleteOne) ExecX

func (akdo *AgeKeyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgeKeyDeleteOne) Where

func (akdo *AgeKeyDeleteOne) Where(ps ...predicate.AgeKey) *AgeKeyDeleteOne

Where appends a list predicates to the AgeKeyDelete builder.

type AgeKeyEdges

type AgeKeyEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

AgeKeyEdges holds the relations/edges for other nodes in the graph.

func (AgeKeyEdges) UserOrErr

func (e AgeKeyEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type AgeKeyGroupBy

type AgeKeyGroupBy struct {
	// contains filtered or unexported fields
}

AgeKeyGroupBy is the group-by builder for AgeKey entities.

func (*AgeKeyGroupBy) Aggregate

func (akgb *AgeKeyGroupBy) Aggregate(fns ...AggregateFunc) *AgeKeyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*AgeKeyGroupBy) Bool

func (s *AgeKeyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) BoolX

func (s *AgeKeyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AgeKeyGroupBy) Bools

func (s *AgeKeyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) BoolsX

func (s *AgeKeyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AgeKeyGroupBy) Float64

func (s *AgeKeyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) Float64X

func (s *AgeKeyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AgeKeyGroupBy) Float64s

func (s *AgeKeyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) Float64sX

func (s *AgeKeyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AgeKeyGroupBy) Int

func (s *AgeKeyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) IntX

func (s *AgeKeyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AgeKeyGroupBy) Ints

func (s *AgeKeyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) IntsX

func (s *AgeKeyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AgeKeyGroupBy) Scan

func (akgb *AgeKeyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*AgeKeyGroupBy) ScanX

func (s *AgeKeyGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*AgeKeyGroupBy) String

func (s *AgeKeyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) StringX

func (s *AgeKeyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AgeKeyGroupBy) Strings

func (s *AgeKeyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AgeKeyGroupBy) StringsX

func (s *AgeKeyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AgeKeyMutation

type AgeKeyMutation struct {
	// contains filtered or unexported fields
}

AgeKeyMutation represents an operation that mutates the AgeKey nodes in the graph.

func (*AgeKeyMutation) AddField

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) AddedEdges

func (m *AgeKeyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*AgeKeyMutation) AddedField

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) AddedFields

func (m *AgeKeyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*AgeKeyMutation) AddedIDs

func (m *AgeKeyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*AgeKeyMutation) ClearEdge

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) ClearField

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) ClearUser

func (m *AgeKeyMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AgeKeyMutation) ClearedEdges

func (m *AgeKeyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*AgeKeyMutation) ClearedFields

func (m *AgeKeyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (AgeKeyMutation) Client

func (m AgeKeyMutation) 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 (*AgeKeyMutation) Created

func (m *AgeKeyMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*AgeKeyMutation) EdgeCleared

func (m *AgeKeyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*AgeKeyMutation) Field

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) FieldCleared

func (m *AgeKeyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*AgeKeyMutation) Fields

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) ID

func (m *AgeKeyMutation) ID() (id uuid.UUID, 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 (*AgeKeyMutation) IDs

func (m *AgeKeyMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*AgeKeyMutation) Key

func (m *AgeKeyMutation) Key() (r []byte, exists bool)

Key returns the value of the "key" field in the mutation.

func (*AgeKeyMutation) OldCreated

func (m *AgeKeyMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the AgeKey entity. If the AgeKey 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 (*AgeKeyMutation) OldField

func (m *AgeKeyMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*AgeKeyMutation) OldKey

func (m *AgeKeyMutation) OldKey(ctx context.Context) (v *[]byte, err error)

OldKey returns the old "key" field's value of the AgeKey entity. If the AgeKey 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 (*AgeKeyMutation) OldOwner

func (m *AgeKeyMutation) OldOwner(ctx context.Context) (v uuid.UUID, err error)

OldOwner returns the old "owner" field's value of the AgeKey entity. If the AgeKey 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 (*AgeKeyMutation) OldUpdated

func (m *AgeKeyMutation) OldUpdated(ctx context.Context) (v time.Time, err error)

OldUpdated returns the old "updated" field's value of the AgeKey entity. If the AgeKey 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 (*AgeKeyMutation) Op

func (m *AgeKeyMutation) Op() Op

Op returns the operation name.

func (*AgeKeyMutation) Owner

func (m *AgeKeyMutation) Owner() (r uuid.UUID, exists bool)

Owner returns the value of the "owner" field in the mutation.

func (*AgeKeyMutation) RemovedEdges

func (m *AgeKeyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*AgeKeyMutation) RemovedIDs

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) ResetCreated

func (m *AgeKeyMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*AgeKeyMutation) ResetEdge

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) ResetField

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) ResetKey

func (m *AgeKeyMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*AgeKeyMutation) ResetOwner

func (m *AgeKeyMutation) ResetOwner()

ResetOwner resets all changes to the "owner" field.

func (*AgeKeyMutation) ResetUpdated

func (m *AgeKeyMutation) ResetUpdated()

ResetUpdated resets all changes to the "updated" field.

func (*AgeKeyMutation) ResetUser

func (m *AgeKeyMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AgeKeyMutation) SetCreated

func (m *AgeKeyMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*AgeKeyMutation) SetField

func (m *AgeKeyMutation) 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 (*AgeKeyMutation) SetID

func (m *AgeKeyMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of AgeKey entities.

func (*AgeKeyMutation) SetKey

func (m *AgeKeyMutation) SetKey(b []byte)

SetKey sets the "key" field.

func (*AgeKeyMutation) SetOp

func (m *AgeKeyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AgeKeyMutation) SetOwner

func (m *AgeKeyMutation) SetOwner(u uuid.UUID)

SetOwner sets the "owner" field.

func (*AgeKeyMutation) SetUpdated

func (m *AgeKeyMutation) SetUpdated(t time.Time)

SetUpdated sets the "updated" field.

func (*AgeKeyMutation) SetUserID

func (m *AgeKeyMutation) SetUserID(id uuid.UUID)

SetUserID sets the "user" edge to the User entity by id.

func (AgeKeyMutation) Tx

func (m AgeKeyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*AgeKeyMutation) Type

func (m *AgeKeyMutation) Type() string

Type returns the node type of this mutation (AgeKey).

func (*AgeKeyMutation) Updated

func (m *AgeKeyMutation) Updated() (r time.Time, exists bool)

Updated returns the value of the "updated" field in the mutation.

func (*AgeKeyMutation) UserCleared

func (m *AgeKeyMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AgeKeyMutation) UserID

func (m *AgeKeyMutation) UserID() (id uuid.UUID, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*AgeKeyMutation) UserIDs

func (m *AgeKeyMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*AgeKeyMutation) Where

func (m *AgeKeyMutation) Where(ps ...predicate.AgeKey)

Where appends a list predicates to the AgeKeyMutation builder.

func (*AgeKeyMutation) WhereP

func (m *AgeKeyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AgeKeyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type AgeKeyQuery

type AgeKeyQuery struct {
	// contains filtered or unexported fields
}

AgeKeyQuery is the builder for querying AgeKey entities.

func (*AgeKeyQuery) Aggregate

func (akq *AgeKeyQuery) Aggregate(fns ...AggregateFunc) *AgeKeySelect

Aggregate returns a AgeKeySelect configured with the given aggregations.

func (*AgeKeyQuery) All

func (akq *AgeKeyQuery) All(ctx context.Context) ([]*AgeKey, error)

All executes the query and returns a list of AgeKeys.

func (*AgeKeyQuery) AllX

func (akq *AgeKeyQuery) AllX(ctx context.Context) []*AgeKey

AllX is like All, but panics if an error occurs.

func (*AgeKeyQuery) Clone

func (akq *AgeKeyQuery) Clone() *AgeKeyQuery

Clone returns a duplicate of the AgeKeyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*AgeKeyQuery) Count

func (akq *AgeKeyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AgeKeyQuery) CountX

func (akq *AgeKeyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*AgeKeyQuery) Exist

func (akq *AgeKeyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*AgeKeyQuery) ExistX

func (akq *AgeKeyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*AgeKeyQuery) First

func (akq *AgeKeyQuery) First(ctx context.Context) (*AgeKey, error)

First returns the first AgeKey entity from the query. Returns a *NotFoundError when no AgeKey was found.

func (*AgeKeyQuery) FirstID

func (akq *AgeKeyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first AgeKey ID from the query. Returns a *NotFoundError when no AgeKey ID was found.

func (*AgeKeyQuery) FirstIDX

func (akq *AgeKeyQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*AgeKeyQuery) FirstX

func (akq *AgeKeyQuery) FirstX(ctx context.Context) *AgeKey

FirstX is like First, but panics if an error occurs.

func (*AgeKeyQuery) GroupBy

func (akq *AgeKeyQuery) GroupBy(field string, fields ...string) *AgeKeyGroupBy

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 {
	Key []byte `json:"key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AgeKey.Query().
	GroupBy(agekey.FieldKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AgeKeyQuery) IDs

func (akq *AgeKeyQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of AgeKey IDs.

func (*AgeKeyQuery) IDsX

func (akq *AgeKeyQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*AgeKeyQuery) Limit

func (akq *AgeKeyQuery) Limit(limit int) *AgeKeyQuery

Limit the number of records to be returned by this query.

func (*AgeKeyQuery) Offset

func (akq *AgeKeyQuery) Offset(offset int) *AgeKeyQuery

Offset to start from.

func (*AgeKeyQuery) Only

func (akq *AgeKeyQuery) Only(ctx context.Context) (*AgeKey, error)

Only returns a single AgeKey entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one AgeKey entity is found. Returns a *NotFoundError when no AgeKey entities are found.

func (*AgeKeyQuery) OnlyID

func (akq *AgeKeyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only AgeKey ID in the query. Returns a *NotSingularError when more than one AgeKey ID is found. Returns a *NotFoundError when no entities are found.

func (*AgeKeyQuery) OnlyIDX

func (akq *AgeKeyQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*AgeKeyQuery) OnlyX

func (akq *AgeKeyQuery) OnlyX(ctx context.Context) *AgeKey

OnlyX is like Only, but panics if an error occurs.

func (*AgeKeyQuery) Order

func (akq *AgeKeyQuery) Order(o ...agekey.OrderOption) *AgeKeyQuery

Order specifies how the records should be ordered.

func (*AgeKeyQuery) QueryUser

func (akq *AgeKeyQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AgeKeyQuery) Select

func (akq *AgeKeyQuery) Select(fields ...string) *AgeKeySelect

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 {
	Key []byte `json:"key,omitempty"`
}

client.AgeKey.Query().
	Select(agekey.FieldKey).
	Scan(ctx, &v)

func (*AgeKeyQuery) Unique

func (akq *AgeKeyQuery) Unique(unique bool) *AgeKeyQuery

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 (*AgeKeyQuery) Where

func (akq *AgeKeyQuery) Where(ps ...predicate.AgeKey) *AgeKeyQuery

Where adds a new predicate for the AgeKeyQuery builder.

func (*AgeKeyQuery) WithUser

func (akq *AgeKeyQuery) WithUser(opts ...func(*UserQuery)) *AgeKeyQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type AgeKeySelect

type AgeKeySelect struct {
	*AgeKeyQuery
	// contains filtered or unexported fields
}

AgeKeySelect is the builder for selecting fields of AgeKey entities.

func (*AgeKeySelect) Aggregate

func (aks *AgeKeySelect) Aggregate(fns ...AggregateFunc) *AgeKeySelect

Aggregate adds the given aggregation functions to the selector query.

func (*AgeKeySelect) Bool

func (s *AgeKeySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) BoolX

func (s *AgeKeySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*AgeKeySelect) Bools

func (s *AgeKeySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) BoolsX

func (s *AgeKeySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*AgeKeySelect) Float64

func (s *AgeKeySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) Float64X

func (s *AgeKeySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*AgeKeySelect) Float64s

func (s *AgeKeySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) Float64sX

func (s *AgeKeySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*AgeKeySelect) Int

func (s *AgeKeySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) IntX

func (s *AgeKeySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*AgeKeySelect) Ints

func (s *AgeKeySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) IntsX

func (s *AgeKeySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*AgeKeySelect) Scan

func (aks *AgeKeySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*AgeKeySelect) ScanX

func (s *AgeKeySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*AgeKeySelect) String

func (s *AgeKeySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) StringX

func (s *AgeKeySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*AgeKeySelect) Strings

func (s *AgeKeySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*AgeKeySelect) StringsX

func (s *AgeKeySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type AgeKeyUpdate

type AgeKeyUpdate struct {
	// contains filtered or unexported fields
}

AgeKeyUpdate is the builder for updating AgeKey entities.

func (*AgeKeyUpdate) Exec

func (aku *AgeKeyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AgeKeyUpdate) ExecX

func (aku *AgeKeyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgeKeyUpdate) Mutation

func (aku *AgeKeyUpdate) Mutation() *AgeKeyMutation

Mutation returns the AgeKeyMutation object of the builder.

func (*AgeKeyUpdate) Save

func (aku *AgeKeyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*AgeKeyUpdate) SaveX

func (aku *AgeKeyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*AgeKeyUpdate) SetKey

func (aku *AgeKeyUpdate) SetKey(b []byte) *AgeKeyUpdate

SetKey sets the "key" field.

func (*AgeKeyUpdate) SetNillableUpdated

func (aku *AgeKeyUpdate) SetNillableUpdated(t *time.Time) *AgeKeyUpdate

SetNillableUpdated sets the "updated" field if the given value is not nil.

func (*AgeKeyUpdate) SetUpdated

func (aku *AgeKeyUpdate) SetUpdated(t time.Time) *AgeKeyUpdate

SetUpdated sets the "updated" field.

func (*AgeKeyUpdate) Where

func (aku *AgeKeyUpdate) Where(ps ...predicate.AgeKey) *AgeKeyUpdate

Where appends a list predicates to the AgeKeyUpdate builder.

type AgeKeyUpdateOne

type AgeKeyUpdateOne struct {
	// contains filtered or unexported fields
}

AgeKeyUpdateOne is the builder for updating a single AgeKey entity.

func (*AgeKeyUpdateOne) Exec

func (akuo *AgeKeyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AgeKeyUpdateOne) ExecX

func (akuo *AgeKeyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*AgeKeyUpdateOne) Mutation

func (akuo *AgeKeyUpdateOne) Mutation() *AgeKeyMutation

Mutation returns the AgeKeyMutation object of the builder.

func (*AgeKeyUpdateOne) Save

func (akuo *AgeKeyUpdateOne) Save(ctx context.Context) (*AgeKey, error)

Save executes the query and returns the updated AgeKey entity.

func (*AgeKeyUpdateOne) SaveX

func (akuo *AgeKeyUpdateOne) SaveX(ctx context.Context) *AgeKey

SaveX is like Save, but panics if an error occurs.

func (*AgeKeyUpdateOne) Select

func (akuo *AgeKeyUpdateOne) Select(field string, fields ...string) *AgeKeyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*AgeKeyUpdateOne) SetKey

func (akuo *AgeKeyUpdateOne) SetKey(b []byte) *AgeKeyUpdateOne

SetKey sets the "key" field.

func (*AgeKeyUpdateOne) SetNillableUpdated

func (akuo *AgeKeyUpdateOne) SetNillableUpdated(t *time.Time) *AgeKeyUpdateOne

SetNillableUpdated sets the "updated" field if the given value is not nil.

func (*AgeKeyUpdateOne) SetUpdated

func (akuo *AgeKeyUpdateOne) SetUpdated(t time.Time) *AgeKeyUpdateOne

SetUpdated sets the "updated" field.

func (*AgeKeyUpdateOne) Where

func (akuo *AgeKeyUpdateOne) Where(ps ...predicate.AgeKey) *AgeKeyUpdateOne

Where appends a list predicates to the AgeKeyUpdate builder.

type AgeKeys

type AgeKeys []*AgeKey

AgeKeys is a parsable slice of AgeKey.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AgeKey is the client for interacting with the AgeKey builders.
	AgeKey *AgeKeyClient
	// HIBP is the client for interacting with the HIBP builders.
	HIBP *HIBPClient
	// LocalBreach is the client for interacting with the LocalBreach builders.
	LocalBreach *LocalBreachClient
	// SearchQuery is the client for interacting with the SearchQuery builders.
	SearchQuery *SearchQueryClient
	// Settings is the client for interacting with the Settings builders.
	Settings *SettingsClient
	// Setup is the client for interacting with the Setup builders.
	Setup *SetupClient
	// TrackedBreaches is the client for interacting with the TrackedBreaches builders.
	TrackedBreaches *TrackedBreachesClient
	// 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

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

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) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	AgeKey.
	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(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

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.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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 Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

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 HIBP

type HIBP struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Domain holds the value of the "domain" field.
	Domain string `json:"domain,omitempty"`
	// BreachDate holds the value of the "breach_date" field.
	BreachDate string `json:"breach_date,omitempty"`
	// AddedDate holds the value of the "added_date" field.
	AddedDate time.Time `json:"added_date,omitempty"`
	// ModifiedDate holds the value of the "modified_date" field.
	ModifiedDate time.Time `json:"modified_date,omitempty"`
	// PwnCount holds the value of the "pwn_count" field.
	PwnCount int `json:"pwn_count,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Dataclasses holds the value of the "dataclasses" field.
	Dataclasses []string `json:"dataclasses,omitempty"`
	// IsVerified holds the value of the "is_verified" field.
	IsVerified bool `json:"is_verified,omitempty"`
	// IsFabricated holds the value of the "is_fabricated" field.
	IsFabricated bool `json:"is_fabricated,omitempty"`
	// IsSensitive holds the value of the "is_sensitive" field.
	IsSensitive bool `json:"is_sensitive,omitempty"`
	// IsRetired holds the value of the "is_retired" field.
	IsRetired bool `json:"is_retired,omitempty"`
	// IsSpamList holds the value of the "is_spamList" field.
	IsSpamList bool `json:"is_spamList,omitempty"`
	// IsMalware holds the value of the "is_malware" field.
	IsMalware bool `json:"is_malware,omitempty"`
	// LogoPath holds the value of the "logo_path" field.
	LogoPath *string `json:"logo_path,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HIBPQuery when eager-loading is set.
	Edges HIBPEdges `json:"edges"`
	// contains filtered or unexported fields
}

HIBP is the model entity for the HIBP schema.

func (*HIBP) QueryTrackedBreaches

func (h *HIBP) QueryTrackedBreaches() *TrackedBreachesQuery

QueryTrackedBreaches queries the "tracked_breaches" edge of the HIBP entity.

func (*HIBP) String

func (h *HIBP) String() string

String implements the fmt.Stringer.

func (*HIBP) Unwrap

func (h *HIBP) Unwrap() *HIBP

Unwrap unwraps the HIBP 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 (*HIBP) Update

func (h *HIBP) Update() *HIBPUpdateOne

Update returns a builder for updating this HIBP. Note that you need to call HIBP.Unwrap() before calling this method if this HIBP was returned from a transaction, and the transaction was committed or rolled back.

func (*HIBP) Value

func (h *HIBP) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the HIBP. This includes values selected through modifiers, order, etc.

type HIBPClient

type HIBPClient struct {
	// contains filtered or unexported fields
}

HIBPClient is a client for the HIBP schema.

func NewHIBPClient

func NewHIBPClient(c config) *HIBPClient

NewHIBPClient returns a client for the HIBP from the given config.

func (*HIBPClient) Create

func (c *HIBPClient) Create() *HIBPCreate

Create returns a builder for creating a HIBP entity.

func (*HIBPClient) CreateBulk

func (c *HIBPClient) CreateBulk(builders ...*HIBPCreate) *HIBPCreateBulk

CreateBulk returns a builder for creating a bulk of HIBP entities.

func (*HIBPClient) Delete

func (c *HIBPClient) Delete() *HIBPDelete

Delete returns a delete builder for HIBP.

func (*HIBPClient) DeleteOne

func (c *HIBPClient) DeleteOne(h *HIBP) *HIBPDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*HIBPClient) DeleteOneID

func (c *HIBPClient) DeleteOneID(id uuid.UUID) *HIBPDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*HIBPClient) Get

func (c *HIBPClient) Get(ctx context.Context, id uuid.UUID) (*HIBP, error)

Get returns a HIBP entity by its id.

func (*HIBPClient) GetX

func (c *HIBPClient) GetX(ctx context.Context, id uuid.UUID) *HIBP

GetX is like Get, but panics if an error occurs.

func (*HIBPClient) Hooks

func (c *HIBPClient) Hooks() []Hook

Hooks returns the client hooks.

func (*HIBPClient) Intercept

func (c *HIBPClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `hibp.Intercept(f(g(h())))`.

func (*HIBPClient) Interceptors

func (c *HIBPClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*HIBPClient) Query

func (c *HIBPClient) Query() *HIBPQuery

Query returns a query builder for HIBP.

func (*HIBPClient) QueryTrackedBreaches

func (c *HIBPClient) QueryTrackedBreaches(h *HIBP) *TrackedBreachesQuery

QueryTrackedBreaches queries the tracked_breaches edge of a HIBP.

func (*HIBPClient) Update

func (c *HIBPClient) Update() *HIBPUpdate

Update returns an update builder for HIBP.

func (*HIBPClient) UpdateOne

func (c *HIBPClient) UpdateOne(h *HIBP) *HIBPUpdateOne

UpdateOne returns an update builder for the given entity.

func (*HIBPClient) UpdateOneID

func (c *HIBPClient) UpdateOneID(id uuid.UUID) *HIBPUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HIBPClient) Use

func (c *HIBPClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `hibp.Hooks(f(g(h())))`.

type HIBPCreate

type HIBPCreate struct {
	// contains filtered or unexported fields
}

HIBPCreate is the builder for creating a HIBP entity.

func (*HIBPCreate) Exec

func (hc *HIBPCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*HIBPCreate) ExecX

func (hc *HIBPCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HIBPCreate) Mutation

func (hc *HIBPCreate) Mutation() *HIBPMutation

Mutation returns the HIBPMutation object of the builder.

func (*HIBPCreate) Save

func (hc *HIBPCreate) Save(ctx context.Context) (*HIBP, error)

Save creates the HIBP in the database.

func (*HIBPCreate) SaveX

func (hc *HIBPCreate) SaveX(ctx context.Context) *HIBP

SaveX calls Save and panics if Save returns an error.

func (*HIBPCreate) SetAddedDate

func (hc *HIBPCreate) SetAddedDate(t time.Time) *HIBPCreate

SetAddedDate sets the "added_date" field.

func (*HIBPCreate) SetBreachDate

func (hc *HIBPCreate) SetBreachDate(s string) *HIBPCreate

SetBreachDate sets the "breach_date" field.

func (*HIBPCreate) SetDataclasses

func (hc *HIBPCreate) SetDataclasses(s []string) *HIBPCreate

SetDataclasses sets the "dataclasses" field.

func (*HIBPCreate) SetDescription

func (hc *HIBPCreate) SetDescription(s string) *HIBPCreate

SetDescription sets the "description" field.

func (*HIBPCreate) SetDomain

func (hc *HIBPCreate) SetDomain(s string) *HIBPCreate

SetDomain sets the "domain" field.

func (*HIBPCreate) SetID

func (hc *HIBPCreate) SetID(u uuid.UUID) *HIBPCreate

SetID sets the "id" field.

func (*HIBPCreate) SetIsFabricated

func (hc *HIBPCreate) SetIsFabricated(b bool) *HIBPCreate

SetIsFabricated sets the "is_fabricated" field.

func (*HIBPCreate) SetIsMalware

func (hc *HIBPCreate) SetIsMalware(b bool) *HIBPCreate

SetIsMalware sets the "is_malware" field.

func (*HIBPCreate) SetIsRetired

func (hc *HIBPCreate) SetIsRetired(b bool) *HIBPCreate

SetIsRetired sets the "is_retired" field.

func (*HIBPCreate) SetIsSensitive

func (hc *HIBPCreate) SetIsSensitive(b bool) *HIBPCreate

SetIsSensitive sets the "is_sensitive" field.

func (*HIBPCreate) SetIsSpamList

func (hc *HIBPCreate) SetIsSpamList(b bool) *HIBPCreate

SetIsSpamList sets the "is_spamList" field.

func (*HIBPCreate) SetIsVerified

func (hc *HIBPCreate) SetIsVerified(b bool) *HIBPCreate

SetIsVerified sets the "is_verified" field.

func (*HIBPCreate) SetLogoPath

func (hc *HIBPCreate) SetLogoPath(s string) *HIBPCreate

SetLogoPath sets the "logo_path" field.

func (*HIBPCreate) SetModifiedDate

func (hc *HIBPCreate) SetModifiedDate(t time.Time) *HIBPCreate

SetModifiedDate sets the "modified_date" field.

func (*HIBPCreate) SetName

func (hc *HIBPCreate) SetName(s string) *HIBPCreate

SetName sets the "name" field.

func (*HIBPCreate) SetNillableDescription

func (hc *HIBPCreate) SetNillableDescription(s *string) *HIBPCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*HIBPCreate) SetNillableID

func (hc *HIBPCreate) SetNillableID(u *uuid.UUID) *HIBPCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*HIBPCreate) SetNillableIsFabricated

func (hc *HIBPCreate) SetNillableIsFabricated(b *bool) *HIBPCreate

SetNillableIsFabricated sets the "is_fabricated" field if the given value is not nil.

func (*HIBPCreate) SetNillableIsMalware

func (hc *HIBPCreate) SetNillableIsMalware(b *bool) *HIBPCreate

SetNillableIsMalware sets the "is_malware" field if the given value is not nil.

func (*HIBPCreate) SetNillableIsRetired

func (hc *HIBPCreate) SetNillableIsRetired(b *bool) *HIBPCreate

SetNillableIsRetired sets the "is_retired" field if the given value is not nil.

func (*HIBPCreate) SetNillableIsSensitive

func (hc *HIBPCreate) SetNillableIsSensitive(b *bool) *HIBPCreate

SetNillableIsSensitive sets the "is_sensitive" field if the given value is not nil.

func (*HIBPCreate) SetNillableIsSpamList

func (hc *HIBPCreate) SetNillableIsSpamList(b *bool) *HIBPCreate

SetNillableIsSpamList sets the "is_spamList" field if the given value is not nil.

func (*HIBPCreate) SetNillableIsVerified

func (hc *HIBPCreate) SetNillableIsVerified(b *bool) *HIBPCreate

SetNillableIsVerified sets the "is_verified" field if the given value is not nil.

func (*HIBPCreate) SetNillableLogoPath

func (hc *HIBPCreate) SetNillableLogoPath(s *string) *HIBPCreate

SetNillableLogoPath sets the "logo_path" field if the given value is not nil.

func (*HIBPCreate) SetNillableTrackedBreachesID

func (hc *HIBPCreate) SetNillableTrackedBreachesID(id *uuid.UUID) *HIBPCreate

SetNillableTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by ID if the given value is not nil.

func (*HIBPCreate) SetPwnCount

func (hc *HIBPCreate) SetPwnCount(i int) *HIBPCreate

SetPwnCount sets the "pwn_count" field.

func (*HIBPCreate) SetTitle

func (hc *HIBPCreate) SetTitle(s string) *HIBPCreate

SetTitle sets the "title" field.

func (*HIBPCreate) SetTrackedBreaches

func (hc *HIBPCreate) SetTrackedBreaches(t *TrackedBreaches) *HIBPCreate

SetTrackedBreaches sets the "tracked_breaches" edge to the TrackedBreaches entity.

func (*HIBPCreate) SetTrackedBreachesID

func (hc *HIBPCreate) SetTrackedBreachesID(id uuid.UUID) *HIBPCreate

SetTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by ID.

type HIBPCreateBulk

type HIBPCreateBulk struct {
	// contains filtered or unexported fields
}

HIBPCreateBulk is the builder for creating many HIBP entities in bulk.

func (*HIBPCreateBulk) Exec

func (hcb *HIBPCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*HIBPCreateBulk) ExecX

func (hcb *HIBPCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HIBPCreateBulk) Save

func (hcb *HIBPCreateBulk) Save(ctx context.Context) ([]*HIBP, error)

Save creates the HIBP entities in the database.

func (*HIBPCreateBulk) SaveX

func (hcb *HIBPCreateBulk) SaveX(ctx context.Context) []*HIBP

SaveX is like Save, but panics if an error occurs.

type HIBPDelete

type HIBPDelete struct {
	// contains filtered or unexported fields
}

HIBPDelete is the builder for deleting a HIBP entity.

func (*HIBPDelete) Exec

func (hd *HIBPDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*HIBPDelete) ExecX

func (hd *HIBPDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*HIBPDelete) Where

func (hd *HIBPDelete) Where(ps ...predicate.HIBP) *HIBPDelete

Where appends a list predicates to the HIBPDelete builder.

type HIBPDeleteOne

type HIBPDeleteOne struct {
	// contains filtered or unexported fields
}

HIBPDeleteOne is the builder for deleting a single HIBP entity.

func (*HIBPDeleteOne) Exec

func (hdo *HIBPDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HIBPDeleteOne) ExecX

func (hdo *HIBPDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HIBPDeleteOne) Where

func (hdo *HIBPDeleteOne) Where(ps ...predicate.HIBP) *HIBPDeleteOne

Where appends a list predicates to the HIBPDelete builder.

type HIBPEdges

type HIBPEdges struct {
	// TrackedBreaches holds the value of the tracked_breaches edge.
	TrackedBreaches *TrackedBreaches `json:"tracked_breaches,omitempty"`
	// contains filtered or unexported fields
}

HIBPEdges holds the relations/edges for other nodes in the graph.

func (HIBPEdges) TrackedBreachesOrErr

func (e HIBPEdges) TrackedBreachesOrErr() (*TrackedBreaches, error)

TrackedBreachesOrErr returns the TrackedBreaches value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type HIBPGroupBy

type HIBPGroupBy struct {
	// contains filtered or unexported fields
}

HIBPGroupBy is the group-by builder for HIBP entities.

func (*HIBPGroupBy) Aggregate

func (hgb *HIBPGroupBy) Aggregate(fns ...AggregateFunc) *HIBPGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*HIBPGroupBy) Bool

func (s *HIBPGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) BoolX

func (s *HIBPGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HIBPGroupBy) Bools

func (s *HIBPGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) BoolsX

func (s *HIBPGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HIBPGroupBy) Float64

func (s *HIBPGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) Float64X

func (s *HIBPGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HIBPGroupBy) Float64s

func (s *HIBPGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) Float64sX

func (s *HIBPGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HIBPGroupBy) Int

func (s *HIBPGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) IntX

func (s *HIBPGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HIBPGroupBy) Ints

func (s *HIBPGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) IntsX

func (s *HIBPGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HIBPGroupBy) Scan

func (hgb *HIBPGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*HIBPGroupBy) ScanX

func (s *HIBPGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*HIBPGroupBy) String

func (s *HIBPGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) StringX

func (s *HIBPGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HIBPGroupBy) Strings

func (s *HIBPGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*HIBPGroupBy) StringsX

func (s *HIBPGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HIBPMutation

type HIBPMutation struct {
	// contains filtered or unexported fields
}

HIBPMutation represents an operation that mutates the HIBP nodes in the graph.

func (*HIBPMutation) AddField

func (m *HIBPMutation) 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 (*HIBPMutation) AddPwnCount

func (m *HIBPMutation) AddPwnCount(i int)

AddPwnCount adds i to the "pwn_count" field.

func (*HIBPMutation) AddedDate

func (m *HIBPMutation) AddedDate() (r time.Time, exists bool)

AddedDate returns the value of the "added_date" field in the mutation.

func (*HIBPMutation) AddedEdges

func (m *HIBPMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*HIBPMutation) AddedField

func (m *HIBPMutation) 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 (*HIBPMutation) AddedFields

func (m *HIBPMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*HIBPMutation) AddedIDs

func (m *HIBPMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*HIBPMutation) AddedPwnCount

func (m *HIBPMutation) AddedPwnCount() (r int, exists bool)

AddedPwnCount returns the value that was added to the "pwn_count" field in this mutation.

func (*HIBPMutation) AppendDataclasses

func (m *HIBPMutation) AppendDataclasses(s []string)

AppendDataclasses adds s to the "dataclasses" field.

func (*HIBPMutation) AppendedDataclasses

func (m *HIBPMutation) AppendedDataclasses() ([]string, bool)

AppendedDataclasses returns the list of values that were appended to the "dataclasses" field in this mutation.

func (*HIBPMutation) BreachDate

func (m *HIBPMutation) BreachDate() (r string, exists bool)

BreachDate returns the value of the "breach_date" field in the mutation.

func (*HIBPMutation) ClearDescription

func (m *HIBPMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*HIBPMutation) ClearEdge

func (m *HIBPMutation) 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 (*HIBPMutation) ClearField

func (m *HIBPMutation) 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 (*HIBPMutation) ClearLogoPath

func (m *HIBPMutation) ClearLogoPath()

ClearLogoPath clears the value of the "logo_path" field.

func (*HIBPMutation) ClearTrackedBreaches

func (m *HIBPMutation) ClearTrackedBreaches()

ClearTrackedBreaches clears the "tracked_breaches" edge to the TrackedBreaches entity.

func (*HIBPMutation) ClearedEdges

func (m *HIBPMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*HIBPMutation) ClearedFields

func (m *HIBPMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (HIBPMutation) Client

func (m HIBPMutation) 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 (*HIBPMutation) Dataclasses

func (m *HIBPMutation) Dataclasses() (r []string, exists bool)

Dataclasses returns the value of the "dataclasses" field in the mutation.

func (*HIBPMutation) Description

func (m *HIBPMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*HIBPMutation) DescriptionCleared

func (m *HIBPMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*HIBPMutation) Domain

func (m *HIBPMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*HIBPMutation) EdgeCleared

func (m *HIBPMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*HIBPMutation) Field

func (m *HIBPMutation) 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 (*HIBPMutation) FieldCleared

func (m *HIBPMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*HIBPMutation) Fields

func (m *HIBPMutation) 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 (*HIBPMutation) ID

func (m *HIBPMutation) ID() (id uuid.UUID, 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 (*HIBPMutation) IDs

func (m *HIBPMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*HIBPMutation) IsFabricated

func (m *HIBPMutation) IsFabricated() (r bool, exists bool)

IsFabricated returns the value of the "is_fabricated" field in the mutation.

func (*HIBPMutation) IsMalware

func (m *HIBPMutation) IsMalware() (r bool, exists bool)

IsMalware returns the value of the "is_malware" field in the mutation.

func (*HIBPMutation) IsRetired

func (m *HIBPMutation) IsRetired() (r bool, exists bool)

IsRetired returns the value of the "is_retired" field in the mutation.

func (*HIBPMutation) IsSensitive

func (m *HIBPMutation) IsSensitive() (r bool, exists bool)

IsSensitive returns the value of the "is_sensitive" field in the mutation.

func (*HIBPMutation) IsSpamList

func (m *HIBPMutation) IsSpamList() (r bool, exists bool)

IsSpamList returns the value of the "is_spamList" field in the mutation.

func (*HIBPMutation) IsVerified

func (m *HIBPMutation) IsVerified() (r bool, exists bool)

IsVerified returns the value of the "is_verified" field in the mutation.

func (*HIBPMutation) LogoPath

func (m *HIBPMutation) LogoPath() (r string, exists bool)

LogoPath returns the value of the "logo_path" field in the mutation.

func (*HIBPMutation) LogoPathCleared

func (m *HIBPMutation) LogoPathCleared() bool

LogoPathCleared returns if the "logo_path" field was cleared in this mutation.

func (*HIBPMutation) ModifiedDate

func (m *HIBPMutation) ModifiedDate() (r time.Time, exists bool)

ModifiedDate returns the value of the "modified_date" field in the mutation.

func (*HIBPMutation) Name

func (m *HIBPMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*HIBPMutation) OldAddedDate

func (m *HIBPMutation) OldAddedDate(ctx context.Context) (v time.Time, err error)

OldAddedDate returns the old "added_date" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldBreachDate

func (m *HIBPMutation) OldBreachDate(ctx context.Context) (v string, err error)

OldBreachDate returns the old "breach_date" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldDataclasses

func (m *HIBPMutation) OldDataclasses(ctx context.Context) (v []string, err error)

OldDataclasses returns the old "dataclasses" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldDescription

func (m *HIBPMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldDomain

func (m *HIBPMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldField

func (m *HIBPMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*HIBPMutation) OldIsFabricated

func (m *HIBPMutation) OldIsFabricated(ctx context.Context) (v bool, err error)

OldIsFabricated returns the old "is_fabricated" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldIsMalware

func (m *HIBPMutation) OldIsMalware(ctx context.Context) (v bool, err error)

OldIsMalware returns the old "is_malware" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldIsRetired

func (m *HIBPMutation) OldIsRetired(ctx context.Context) (v bool, err error)

OldIsRetired returns the old "is_retired" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldIsSensitive

func (m *HIBPMutation) OldIsSensitive(ctx context.Context) (v bool, err error)

OldIsSensitive returns the old "is_sensitive" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldIsSpamList

func (m *HIBPMutation) OldIsSpamList(ctx context.Context) (v bool, err error)

OldIsSpamList returns the old "is_spamList" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldIsVerified

func (m *HIBPMutation) OldIsVerified(ctx context.Context) (v bool, err error)

OldIsVerified returns the old "is_verified" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldLogoPath

func (m *HIBPMutation) OldLogoPath(ctx context.Context) (v *string, err error)

OldLogoPath returns the old "logo_path" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldModifiedDate

func (m *HIBPMutation) OldModifiedDate(ctx context.Context) (v time.Time, err error)

OldModifiedDate returns the old "modified_date" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldName

func (m *HIBPMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldPwnCount

func (m *HIBPMutation) OldPwnCount(ctx context.Context) (v int, err error)

OldPwnCount returns the old "pwn_count" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) OldTitle

func (m *HIBPMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the HIBP entity. If the HIBP 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 (*HIBPMutation) Op

func (m *HIBPMutation) Op() Op

Op returns the operation name.

func (*HIBPMutation) PwnCount

func (m *HIBPMutation) PwnCount() (r int, exists bool)

PwnCount returns the value of the "pwn_count" field in the mutation.

func (*HIBPMutation) RemovedEdges

func (m *HIBPMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*HIBPMutation) RemovedIDs

func (m *HIBPMutation) 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 (*HIBPMutation) ResetAddedDate

func (m *HIBPMutation) ResetAddedDate()

ResetAddedDate resets all changes to the "added_date" field.

func (*HIBPMutation) ResetBreachDate

func (m *HIBPMutation) ResetBreachDate()

ResetBreachDate resets all changes to the "breach_date" field.

func (*HIBPMutation) ResetDataclasses

func (m *HIBPMutation) ResetDataclasses()

ResetDataclasses resets all changes to the "dataclasses" field.

func (*HIBPMutation) ResetDescription

func (m *HIBPMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*HIBPMutation) ResetDomain

func (m *HIBPMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*HIBPMutation) ResetEdge

func (m *HIBPMutation) 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 (*HIBPMutation) ResetField

func (m *HIBPMutation) 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 (*HIBPMutation) ResetIsFabricated

func (m *HIBPMutation) ResetIsFabricated()

ResetIsFabricated resets all changes to the "is_fabricated" field.

func (*HIBPMutation) ResetIsMalware

func (m *HIBPMutation) ResetIsMalware()

ResetIsMalware resets all changes to the "is_malware" field.

func (*HIBPMutation) ResetIsRetired

func (m *HIBPMutation) ResetIsRetired()

ResetIsRetired resets all changes to the "is_retired" field.

func (*HIBPMutation) ResetIsSensitive

func (m *HIBPMutation) ResetIsSensitive()

ResetIsSensitive resets all changes to the "is_sensitive" field.

func (*HIBPMutation) ResetIsSpamList

func (m *HIBPMutation) ResetIsSpamList()

ResetIsSpamList resets all changes to the "is_spamList" field.

func (*HIBPMutation) ResetIsVerified

func (m *HIBPMutation) ResetIsVerified()

ResetIsVerified resets all changes to the "is_verified" field.

func (*HIBPMutation) ResetLogoPath

func (m *HIBPMutation) ResetLogoPath()

ResetLogoPath resets all changes to the "logo_path" field.

func (*HIBPMutation) ResetModifiedDate

func (m *HIBPMutation) ResetModifiedDate()

ResetModifiedDate resets all changes to the "modified_date" field.

func (*HIBPMutation) ResetName

func (m *HIBPMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*HIBPMutation) ResetPwnCount

func (m *HIBPMutation) ResetPwnCount()

ResetPwnCount resets all changes to the "pwn_count" field.

func (*HIBPMutation) ResetTitle

func (m *HIBPMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*HIBPMutation) ResetTrackedBreaches

func (m *HIBPMutation) ResetTrackedBreaches()

ResetTrackedBreaches resets all changes to the "tracked_breaches" edge.

func (*HIBPMutation) SetAddedDate

func (m *HIBPMutation) SetAddedDate(t time.Time)

SetAddedDate sets the "added_date" field.

func (*HIBPMutation) SetBreachDate

func (m *HIBPMutation) SetBreachDate(s string)

SetBreachDate sets the "breach_date" field.

func (*HIBPMutation) SetDataclasses

func (m *HIBPMutation) SetDataclasses(s []string)

SetDataclasses sets the "dataclasses" field.

func (*HIBPMutation) SetDescription

func (m *HIBPMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*HIBPMutation) SetDomain

func (m *HIBPMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*HIBPMutation) SetField

func (m *HIBPMutation) 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 (*HIBPMutation) SetID

func (m *HIBPMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of HIBP entities.

func (*HIBPMutation) SetIsFabricated

func (m *HIBPMutation) SetIsFabricated(b bool)

SetIsFabricated sets the "is_fabricated" field.

func (*HIBPMutation) SetIsMalware

func (m *HIBPMutation) SetIsMalware(b bool)

SetIsMalware sets the "is_malware" field.

func (*HIBPMutation) SetIsRetired

func (m *HIBPMutation) SetIsRetired(b bool)

SetIsRetired sets the "is_retired" field.

func (*HIBPMutation) SetIsSensitive

func (m *HIBPMutation) SetIsSensitive(b bool)

SetIsSensitive sets the "is_sensitive" field.

func (*HIBPMutation) SetIsSpamList

func (m *HIBPMutation) SetIsSpamList(b bool)

SetIsSpamList sets the "is_spamList" field.

func (*HIBPMutation) SetIsVerified

func (m *HIBPMutation) SetIsVerified(b bool)

SetIsVerified sets the "is_verified" field.

func (*HIBPMutation) SetLogoPath

func (m *HIBPMutation) SetLogoPath(s string)

SetLogoPath sets the "logo_path" field.

func (*HIBPMutation) SetModifiedDate

func (m *HIBPMutation) SetModifiedDate(t time.Time)

SetModifiedDate sets the "modified_date" field.

func (*HIBPMutation) SetName

func (m *HIBPMutation) SetName(s string)

SetName sets the "name" field.

func (*HIBPMutation) SetOp

func (m *HIBPMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*HIBPMutation) SetPwnCount

func (m *HIBPMutation) SetPwnCount(i int)

SetPwnCount sets the "pwn_count" field.

func (*HIBPMutation) SetTitle

func (m *HIBPMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*HIBPMutation) SetTrackedBreachesID

func (m *HIBPMutation) SetTrackedBreachesID(id uuid.UUID)

SetTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by id.

func (*HIBPMutation) Title

func (m *HIBPMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*HIBPMutation) TrackedBreachesCleared

func (m *HIBPMutation) TrackedBreachesCleared() bool

TrackedBreachesCleared reports if the "tracked_breaches" edge to the TrackedBreaches entity was cleared.

func (*HIBPMutation) TrackedBreachesID

func (m *HIBPMutation) TrackedBreachesID() (id uuid.UUID, exists bool)

TrackedBreachesID returns the "tracked_breaches" edge ID in the mutation.

func (*HIBPMutation) TrackedBreachesIDs

func (m *HIBPMutation) TrackedBreachesIDs() (ids []uuid.UUID)

TrackedBreachesIDs returns the "tracked_breaches" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TrackedBreachesID instead. It exists only for internal usage by the builders.

func (HIBPMutation) Tx

func (m HIBPMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*HIBPMutation) Type

func (m *HIBPMutation) Type() string

Type returns the node type of this mutation (HIBP).

func (*HIBPMutation) Where

func (m *HIBPMutation) Where(ps ...predicate.HIBP)

Where appends a list predicates to the HIBPMutation builder.

func (*HIBPMutation) WhereP

func (m *HIBPMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the HIBPMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type HIBPQuery

type HIBPQuery struct {
	// contains filtered or unexported fields
}

HIBPQuery is the builder for querying HIBP entities.

func (*HIBPQuery) Aggregate

func (hq *HIBPQuery) Aggregate(fns ...AggregateFunc) *HIBPSelect

Aggregate returns a HIBPSelect configured with the given aggregations.

func (*HIBPQuery) All

func (hq *HIBPQuery) All(ctx context.Context) ([]*HIBP, error)

All executes the query and returns a list of HIBPs.

func (*HIBPQuery) AllX

func (hq *HIBPQuery) AllX(ctx context.Context) []*HIBP

AllX is like All, but panics if an error occurs.

func (*HIBPQuery) Clone

func (hq *HIBPQuery) Clone() *HIBPQuery

Clone returns a duplicate of the HIBPQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*HIBPQuery) Count

func (hq *HIBPQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HIBPQuery) CountX

func (hq *HIBPQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*HIBPQuery) Exist

func (hq *HIBPQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*HIBPQuery) ExistX

func (hq *HIBPQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*HIBPQuery) First

func (hq *HIBPQuery) First(ctx context.Context) (*HIBP, error)

First returns the first HIBP entity from the query. Returns a *NotFoundError when no HIBP was found.

func (*HIBPQuery) FirstID

func (hq *HIBPQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first HIBP ID from the query. Returns a *NotFoundError when no HIBP ID was found.

func (*HIBPQuery) FirstIDX

func (hq *HIBPQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*HIBPQuery) FirstX

func (hq *HIBPQuery) FirstX(ctx context.Context) *HIBP

FirstX is like First, but panics if an error occurs.

func (*HIBPQuery) GroupBy

func (hq *HIBPQuery) GroupBy(field string, fields ...string) *HIBPGroupBy

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.HIBP.Query().
	GroupBy(hibp.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HIBPQuery) IDs

func (hq *HIBPQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of HIBP IDs.

func (*HIBPQuery) IDsX

func (hq *HIBPQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*HIBPQuery) Limit

func (hq *HIBPQuery) Limit(limit int) *HIBPQuery

Limit the number of records to be returned by this query.

func (*HIBPQuery) Offset

func (hq *HIBPQuery) Offset(offset int) *HIBPQuery

Offset to start from.

func (*HIBPQuery) Only

func (hq *HIBPQuery) Only(ctx context.Context) (*HIBP, error)

Only returns a single HIBP entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one HIBP entity is found. Returns a *NotFoundError when no HIBP entities are found.

func (*HIBPQuery) OnlyID

func (hq *HIBPQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only HIBP ID in the query. Returns a *NotSingularError when more than one HIBP ID is found. Returns a *NotFoundError when no entities are found.

func (*HIBPQuery) OnlyIDX

func (hq *HIBPQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*HIBPQuery) OnlyX

func (hq *HIBPQuery) OnlyX(ctx context.Context) *HIBP

OnlyX is like Only, but panics if an error occurs.

func (*HIBPQuery) Order

func (hq *HIBPQuery) Order(o ...hibp.OrderOption) *HIBPQuery

Order specifies how the records should be ordered.

func (*HIBPQuery) QueryTrackedBreaches

func (hq *HIBPQuery) QueryTrackedBreaches() *TrackedBreachesQuery

QueryTrackedBreaches chains the current query on the "tracked_breaches" edge.

func (*HIBPQuery) Select

func (hq *HIBPQuery) Select(fields ...string) *HIBPSelect

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.HIBP.Query().
	Select(hibp.FieldName).
	Scan(ctx, &v)

func (*HIBPQuery) Unique

func (hq *HIBPQuery) Unique(unique bool) *HIBPQuery

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 (*HIBPQuery) Where

func (hq *HIBPQuery) Where(ps ...predicate.HIBP) *HIBPQuery

Where adds a new predicate for the HIBPQuery builder.

func (*HIBPQuery) WithTrackedBreaches

func (hq *HIBPQuery) WithTrackedBreaches(opts ...func(*TrackedBreachesQuery)) *HIBPQuery

WithTrackedBreaches tells the query-builder to eager-load the nodes that are connected to the "tracked_breaches" edge. The optional arguments are used to configure the query builder of the edge.

type HIBPSelect

type HIBPSelect struct {
	*HIBPQuery
	// contains filtered or unexported fields
}

HIBPSelect is the builder for selecting fields of HIBP entities.

func (*HIBPSelect) Aggregate

func (hs *HIBPSelect) Aggregate(fns ...AggregateFunc) *HIBPSelect

Aggregate adds the given aggregation functions to the selector query.

func (*HIBPSelect) Bool

func (s *HIBPSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) BoolX

func (s *HIBPSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*HIBPSelect) Bools

func (s *HIBPSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) BoolsX

func (s *HIBPSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*HIBPSelect) Float64

func (s *HIBPSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) Float64X

func (s *HIBPSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*HIBPSelect) Float64s

func (s *HIBPSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) Float64sX

func (s *HIBPSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*HIBPSelect) Int

func (s *HIBPSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) IntX

func (s *HIBPSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*HIBPSelect) Ints

func (s *HIBPSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) IntsX

func (s *HIBPSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*HIBPSelect) Scan

func (hs *HIBPSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*HIBPSelect) ScanX

func (s *HIBPSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*HIBPSelect) String

func (s *HIBPSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) StringX

func (s *HIBPSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*HIBPSelect) Strings

func (s *HIBPSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*HIBPSelect) StringsX

func (s *HIBPSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type HIBPUpdate

type HIBPUpdate struct {
	// contains filtered or unexported fields
}

HIBPUpdate is the builder for updating HIBP entities.

func (*HIBPUpdate) AddPwnCount

func (hu *HIBPUpdate) AddPwnCount(i int) *HIBPUpdate

AddPwnCount adds i to the "pwn_count" field.

func (*HIBPUpdate) AppendDataclasses

func (hu *HIBPUpdate) AppendDataclasses(s []string) *HIBPUpdate

AppendDataclasses appends s to the "dataclasses" field.

func (*HIBPUpdate) ClearDescription

func (hu *HIBPUpdate) ClearDescription() *HIBPUpdate

ClearDescription clears the value of the "description" field.

func (*HIBPUpdate) ClearLogoPath

func (hu *HIBPUpdate) ClearLogoPath() *HIBPUpdate

ClearLogoPath clears the value of the "logo_path" field.

func (*HIBPUpdate) ClearTrackedBreaches

func (hu *HIBPUpdate) ClearTrackedBreaches() *HIBPUpdate

ClearTrackedBreaches clears the "tracked_breaches" edge to the TrackedBreaches entity.

func (*HIBPUpdate) Exec

func (hu *HIBPUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HIBPUpdate) ExecX

func (hu *HIBPUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HIBPUpdate) Mutation

func (hu *HIBPUpdate) Mutation() *HIBPMutation

Mutation returns the HIBPMutation object of the builder.

func (*HIBPUpdate) Save

func (hu *HIBPUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*HIBPUpdate) SaveX

func (hu *HIBPUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*HIBPUpdate) SetAddedDate

func (hu *HIBPUpdate) SetAddedDate(t time.Time) *HIBPUpdate

SetAddedDate sets the "added_date" field.

func (*HIBPUpdate) SetBreachDate

func (hu *HIBPUpdate) SetBreachDate(s string) *HIBPUpdate

SetBreachDate sets the "breach_date" field.

func (*HIBPUpdate) SetDataclasses

func (hu *HIBPUpdate) SetDataclasses(s []string) *HIBPUpdate

SetDataclasses sets the "dataclasses" field.

func (*HIBPUpdate) SetDescription

func (hu *HIBPUpdate) SetDescription(s string) *HIBPUpdate

SetDescription sets the "description" field.

func (*HIBPUpdate) SetIsFabricated

func (hu *HIBPUpdate) SetIsFabricated(b bool) *HIBPUpdate

SetIsFabricated sets the "is_fabricated" field.

func (*HIBPUpdate) SetIsMalware

func (hu *HIBPUpdate) SetIsMalware(b bool) *HIBPUpdate

SetIsMalware sets the "is_malware" field.

func (*HIBPUpdate) SetIsRetired

func (hu *HIBPUpdate) SetIsRetired(b bool) *HIBPUpdate

SetIsRetired sets the "is_retired" field.

func (*HIBPUpdate) SetIsSensitive

func (hu *HIBPUpdate) SetIsSensitive(b bool) *HIBPUpdate

SetIsSensitive sets the "is_sensitive" field.

func (*HIBPUpdate) SetIsSpamList

func (hu *HIBPUpdate) SetIsSpamList(b bool) *HIBPUpdate

SetIsSpamList sets the "is_spamList" field.

func (*HIBPUpdate) SetIsVerified

func (hu *HIBPUpdate) SetIsVerified(b bool) *HIBPUpdate

SetIsVerified sets the "is_verified" field.

func (*HIBPUpdate) SetLogoPath

func (hu *HIBPUpdate) SetLogoPath(s string) *HIBPUpdate

SetLogoPath sets the "logo_path" field.

func (*HIBPUpdate) SetModifiedDate

func (hu *HIBPUpdate) SetModifiedDate(t time.Time) *HIBPUpdate

SetModifiedDate sets the "modified_date" field.

func (*HIBPUpdate) SetNillableDescription

func (hu *HIBPUpdate) SetNillableDescription(s *string) *HIBPUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*HIBPUpdate) SetNillableIsFabricated

func (hu *HIBPUpdate) SetNillableIsFabricated(b *bool) *HIBPUpdate

SetNillableIsFabricated sets the "is_fabricated" field if the given value is not nil.

func (*HIBPUpdate) SetNillableIsMalware

func (hu *HIBPUpdate) SetNillableIsMalware(b *bool) *HIBPUpdate

SetNillableIsMalware sets the "is_malware" field if the given value is not nil.

func (*HIBPUpdate) SetNillableIsRetired

func (hu *HIBPUpdate) SetNillableIsRetired(b *bool) *HIBPUpdate

SetNillableIsRetired sets the "is_retired" field if the given value is not nil.

func (*HIBPUpdate) SetNillableIsSensitive

func (hu *HIBPUpdate) SetNillableIsSensitive(b *bool) *HIBPUpdate

SetNillableIsSensitive sets the "is_sensitive" field if the given value is not nil.

func (*HIBPUpdate) SetNillableIsSpamList

func (hu *HIBPUpdate) SetNillableIsSpamList(b *bool) *HIBPUpdate

SetNillableIsSpamList sets the "is_spamList" field if the given value is not nil.

func (*HIBPUpdate) SetNillableIsVerified

func (hu *HIBPUpdate) SetNillableIsVerified(b *bool) *HIBPUpdate

SetNillableIsVerified sets the "is_verified" field if the given value is not nil.

func (*HIBPUpdate) SetNillableLogoPath

func (hu *HIBPUpdate) SetNillableLogoPath(s *string) *HIBPUpdate

SetNillableLogoPath sets the "logo_path" field if the given value is not nil.

func (*HIBPUpdate) SetNillableTrackedBreachesID

func (hu *HIBPUpdate) SetNillableTrackedBreachesID(id *uuid.UUID) *HIBPUpdate

SetNillableTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by ID if the given value is not nil.

func (*HIBPUpdate) SetPwnCount

func (hu *HIBPUpdate) SetPwnCount(i int) *HIBPUpdate

SetPwnCount sets the "pwn_count" field.

func (*HIBPUpdate) SetTitle

func (hu *HIBPUpdate) SetTitle(s string) *HIBPUpdate

SetTitle sets the "title" field.

func (*HIBPUpdate) SetTrackedBreaches

func (hu *HIBPUpdate) SetTrackedBreaches(t *TrackedBreaches) *HIBPUpdate

SetTrackedBreaches sets the "tracked_breaches" edge to the TrackedBreaches entity.

func (*HIBPUpdate) SetTrackedBreachesID

func (hu *HIBPUpdate) SetTrackedBreachesID(id uuid.UUID) *HIBPUpdate

SetTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by ID.

func (*HIBPUpdate) Where

func (hu *HIBPUpdate) Where(ps ...predicate.HIBP) *HIBPUpdate

Where appends a list predicates to the HIBPUpdate builder.

type HIBPUpdateOne

type HIBPUpdateOne struct {
	// contains filtered or unexported fields
}

HIBPUpdateOne is the builder for updating a single HIBP entity.

func (*HIBPUpdateOne) AddPwnCount

func (huo *HIBPUpdateOne) AddPwnCount(i int) *HIBPUpdateOne

AddPwnCount adds i to the "pwn_count" field.

func (*HIBPUpdateOne) AppendDataclasses

func (huo *HIBPUpdateOne) AppendDataclasses(s []string) *HIBPUpdateOne

AppendDataclasses appends s to the "dataclasses" field.

func (*HIBPUpdateOne) ClearDescription

func (huo *HIBPUpdateOne) ClearDescription() *HIBPUpdateOne

ClearDescription clears the value of the "description" field.

func (*HIBPUpdateOne) ClearLogoPath

func (huo *HIBPUpdateOne) ClearLogoPath() *HIBPUpdateOne

ClearLogoPath clears the value of the "logo_path" field.

func (*HIBPUpdateOne) ClearTrackedBreaches

func (huo *HIBPUpdateOne) ClearTrackedBreaches() *HIBPUpdateOne

ClearTrackedBreaches clears the "tracked_breaches" edge to the TrackedBreaches entity.

func (*HIBPUpdateOne) Exec

func (huo *HIBPUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HIBPUpdateOne) ExecX

func (huo *HIBPUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*HIBPUpdateOne) Mutation

func (huo *HIBPUpdateOne) Mutation() *HIBPMutation

Mutation returns the HIBPMutation object of the builder.

func (*HIBPUpdateOne) Save

func (huo *HIBPUpdateOne) Save(ctx context.Context) (*HIBP, error)

Save executes the query and returns the updated HIBP entity.

func (*HIBPUpdateOne) SaveX

func (huo *HIBPUpdateOne) SaveX(ctx context.Context) *HIBP

SaveX is like Save, but panics if an error occurs.

func (*HIBPUpdateOne) Select

func (huo *HIBPUpdateOne) Select(field string, fields ...string) *HIBPUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*HIBPUpdateOne) SetAddedDate

func (huo *HIBPUpdateOne) SetAddedDate(t time.Time) *HIBPUpdateOne

SetAddedDate sets the "added_date" field.

func (*HIBPUpdateOne) SetBreachDate

func (huo *HIBPUpdateOne) SetBreachDate(s string) *HIBPUpdateOne

SetBreachDate sets the "breach_date" field.

func (*HIBPUpdateOne) SetDataclasses

func (huo *HIBPUpdateOne) SetDataclasses(s []string) *HIBPUpdateOne

SetDataclasses sets the "dataclasses" field.

func (*HIBPUpdateOne) SetDescription

func (huo *HIBPUpdateOne) SetDescription(s string) *HIBPUpdateOne

SetDescription sets the "description" field.

func (*HIBPUpdateOne) SetIsFabricated

func (huo *HIBPUpdateOne) SetIsFabricated(b bool) *HIBPUpdateOne

SetIsFabricated sets the "is_fabricated" field.

func (*HIBPUpdateOne) SetIsMalware

func (huo *HIBPUpdateOne) SetIsMalware(b bool) *HIBPUpdateOne

SetIsMalware sets the "is_malware" field.

func (*HIBPUpdateOne) SetIsRetired

func (huo *HIBPUpdateOne) SetIsRetired(b bool) *HIBPUpdateOne

SetIsRetired sets the "is_retired" field.

func (*HIBPUpdateOne) SetIsSensitive

func (huo *HIBPUpdateOne) SetIsSensitive(b bool) *HIBPUpdateOne

SetIsSensitive sets the "is_sensitive" field.

func (*HIBPUpdateOne) SetIsSpamList

func (huo *HIBPUpdateOne) SetIsSpamList(b bool) *HIBPUpdateOne

SetIsSpamList sets the "is_spamList" field.

func (*HIBPUpdateOne) SetIsVerified

func (huo *HIBPUpdateOne) SetIsVerified(b bool) *HIBPUpdateOne

SetIsVerified sets the "is_verified" field.

func (*HIBPUpdateOne) SetLogoPath

func (huo *HIBPUpdateOne) SetLogoPath(s string) *HIBPUpdateOne

SetLogoPath sets the "logo_path" field.

func (*HIBPUpdateOne) SetModifiedDate

func (huo *HIBPUpdateOne) SetModifiedDate(t time.Time) *HIBPUpdateOne

SetModifiedDate sets the "modified_date" field.

func (*HIBPUpdateOne) SetNillableDescription

func (huo *HIBPUpdateOne) SetNillableDescription(s *string) *HIBPUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableIsFabricated

func (huo *HIBPUpdateOne) SetNillableIsFabricated(b *bool) *HIBPUpdateOne

SetNillableIsFabricated sets the "is_fabricated" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableIsMalware

func (huo *HIBPUpdateOne) SetNillableIsMalware(b *bool) *HIBPUpdateOne

SetNillableIsMalware sets the "is_malware" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableIsRetired

func (huo *HIBPUpdateOne) SetNillableIsRetired(b *bool) *HIBPUpdateOne

SetNillableIsRetired sets the "is_retired" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableIsSensitive

func (huo *HIBPUpdateOne) SetNillableIsSensitive(b *bool) *HIBPUpdateOne

SetNillableIsSensitive sets the "is_sensitive" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableIsSpamList

func (huo *HIBPUpdateOne) SetNillableIsSpamList(b *bool) *HIBPUpdateOne

SetNillableIsSpamList sets the "is_spamList" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableIsVerified

func (huo *HIBPUpdateOne) SetNillableIsVerified(b *bool) *HIBPUpdateOne

SetNillableIsVerified sets the "is_verified" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableLogoPath

func (huo *HIBPUpdateOne) SetNillableLogoPath(s *string) *HIBPUpdateOne

SetNillableLogoPath sets the "logo_path" field if the given value is not nil.

func (*HIBPUpdateOne) SetNillableTrackedBreachesID

func (huo *HIBPUpdateOne) SetNillableTrackedBreachesID(id *uuid.UUID) *HIBPUpdateOne

SetNillableTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by ID if the given value is not nil.

func (*HIBPUpdateOne) SetPwnCount

func (huo *HIBPUpdateOne) SetPwnCount(i int) *HIBPUpdateOne

SetPwnCount sets the "pwn_count" field.

func (*HIBPUpdateOne) SetTitle

func (huo *HIBPUpdateOne) SetTitle(s string) *HIBPUpdateOne

SetTitle sets the "title" field.

func (*HIBPUpdateOne) SetTrackedBreaches

func (huo *HIBPUpdateOne) SetTrackedBreaches(t *TrackedBreaches) *HIBPUpdateOne

SetTrackedBreaches sets the "tracked_breaches" edge to the TrackedBreaches entity.

func (*HIBPUpdateOne) SetTrackedBreachesID

func (huo *HIBPUpdateOne) SetTrackedBreachesID(id uuid.UUID) *HIBPUpdateOne

SetTrackedBreachesID sets the "tracked_breaches" edge to the TrackedBreaches entity by ID.

func (*HIBPUpdateOne) Where

func (huo *HIBPUpdateOne) Where(ps ...predicate.HIBP) *HIBPUpdateOne

Where appends a list predicates to the HIBPUpdate builder.

type HIBPs

type HIBPs []*HIBP

HIBPs is a parsable slice of HIBP.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

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 LocalBreach

type LocalBreach struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// IsVerified holds the value of the "is_verified" field.
	IsVerified bool `json:"is_verified,omitempty"`
	// ContainsPasswords holds the value of the "contains_passwords" field.
	ContainsPasswords bool `json:"contains_passwords,omitempty"`
	// ContainsHashes holds the value of the "contains_hashes" field.
	ContainsHashes bool `json:"contains_hashes,omitempty"`
	// ContainsEmails holds the value of the "contains_emails" field.
	ContainsEmails bool `json:"contains_emails,omitempty"`
	// ContainsUsernames holds the value of the "contains_usernames" field.
	ContainsUsernames bool `json:"contains_usernames,omitempty"`
	// MD5, SHA1, Argon2id...
	HashType *string `json:"hash_type,omitempty"`
	// HashSalted holds the value of the "hash_salted" field.
	HashSalted *bool `json:"hash_salted,omitempty"`
	// HashPeppered holds the value of the "hash_peppered" field.
	HashPeppered *bool `json:"hash_peppered,omitempty"`
	// Data holds the value of the "data" field.
	Data *schema.Data `json:"data,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LocalBreachQuery when eager-loading is set.
	Edges LocalBreachEdges `json:"edges"`
	// contains filtered or unexported fields
}

LocalBreach is the model entity for the LocalBreach schema.

func (*LocalBreach) QueryTrackedBreaches

func (lb *LocalBreach) QueryTrackedBreaches() *TrackedBreachesQuery

QueryTrackedBreaches queries the "tracked_breaches" edge of the LocalBreach entity.

func (*LocalBreach) String

func (lb *LocalBreach) String() string

String implements the fmt.Stringer.

func (*LocalBreach) Unwrap

func (lb *LocalBreach) Unwrap() *LocalBreach

Unwrap unwraps the LocalBreach 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 (*LocalBreach) Update

func (lb *LocalBreach) Update() *LocalBreachUpdateOne

Update returns a builder for updating this LocalBreach. Note that you need to call LocalBreach.Unwrap() before calling this method if this LocalBreach was returned from a transaction, and the transaction was committed or rolled back.

func (*LocalBreach) Value

func (lb *LocalBreach) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the LocalBreach. This includes values selected through modifiers, order, etc.

type LocalBreachClient

type LocalBreachClient struct {
	// contains filtered or unexported fields
}

LocalBreachClient is a client for the LocalBreach schema.

func NewLocalBreachClient

func NewLocalBreachClient(c config) *LocalBreachClient

NewLocalBreachClient returns a client for the LocalBreach from the given config.

func (*LocalBreachClient) Create

func (c *LocalBreachClient) Create() *LocalBreachCreate

Create returns a builder for creating a LocalBreach entity.

func (*LocalBreachClient) CreateBulk

func (c *LocalBreachClient) CreateBulk(builders ...*LocalBreachCreate) *LocalBreachCreateBulk

CreateBulk returns a builder for creating a bulk of LocalBreach entities.

func (*LocalBreachClient) Delete

func (c *LocalBreachClient) Delete() *LocalBreachDelete

Delete returns a delete builder for LocalBreach.

func (*LocalBreachClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LocalBreachClient) DeleteOneID

func (c *LocalBreachClient) DeleteOneID(id uuid.UUID) *LocalBreachDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*LocalBreachClient) Get

Get returns a LocalBreach entity by its id.

func (*LocalBreachClient) GetX

GetX is like Get, but panics if an error occurs.

func (*LocalBreachClient) Hooks

func (c *LocalBreachClient) Hooks() []Hook

Hooks returns the client hooks.

func (*LocalBreachClient) Intercept

func (c *LocalBreachClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `localbreach.Intercept(f(g(h())))`.

func (*LocalBreachClient) Interceptors

func (c *LocalBreachClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*LocalBreachClient) Query

func (c *LocalBreachClient) Query() *LocalBreachQuery

Query returns a query builder for LocalBreach.

func (*LocalBreachClient) QueryTrackedBreaches

func (c *LocalBreachClient) QueryTrackedBreaches(lb *LocalBreach) *TrackedBreachesQuery

QueryTrackedBreaches queries the tracked_breaches edge of a LocalBreach.

func (*LocalBreachClient) Update

func (c *LocalBreachClient) Update() *LocalBreachUpdate

Update returns an update builder for LocalBreach.

func (*LocalBreachClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*LocalBreachClient) UpdateOneID

func (c *LocalBreachClient) UpdateOneID(id uuid.UUID) *LocalBreachUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LocalBreachClient) Use

func (c *LocalBreachClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `localbreach.Hooks(f(g(h())))`.

type LocalBreachCreate

type LocalBreachCreate struct {
	// contains filtered or unexported fields
}

LocalBreachCreate is the builder for creating a LocalBreach entity.

func (*LocalBreachCreate) AddTrackedBreachIDs

func (lbc *LocalBreachCreate) AddTrackedBreachIDs(ids ...uuid.UUID) *LocalBreachCreate

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*LocalBreachCreate) AddTrackedBreaches

func (lbc *LocalBreachCreate) AddTrackedBreaches(t ...*TrackedBreaches) *LocalBreachCreate

AddTrackedBreaches adds the "tracked_breaches" edges to the TrackedBreaches entity.

func (*LocalBreachCreate) Exec

func (lbc *LocalBreachCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocalBreachCreate) ExecX

func (lbc *LocalBreachCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocalBreachCreate) Mutation

func (lbc *LocalBreachCreate) Mutation() *LocalBreachMutation

Mutation returns the LocalBreachMutation object of the builder.

func (*LocalBreachCreate) Save

func (lbc *LocalBreachCreate) Save(ctx context.Context) (*LocalBreach, error)

Save creates the LocalBreach in the database.

func (*LocalBreachCreate) SaveX

func (lbc *LocalBreachCreate) SaveX(ctx context.Context) *LocalBreach

SaveX calls Save and panics if Save returns an error.

func (*LocalBreachCreate) SetContainsEmails

func (lbc *LocalBreachCreate) SetContainsEmails(b bool) *LocalBreachCreate

SetContainsEmails sets the "contains_emails" field.

func (*LocalBreachCreate) SetContainsHashes

func (lbc *LocalBreachCreate) SetContainsHashes(b bool) *LocalBreachCreate

SetContainsHashes sets the "contains_hashes" field.

func (*LocalBreachCreate) SetContainsPasswords

func (lbc *LocalBreachCreate) SetContainsPasswords(b bool) *LocalBreachCreate

SetContainsPasswords sets the "contains_passwords" field.

func (*LocalBreachCreate) SetContainsUsernames

func (lbc *LocalBreachCreate) SetContainsUsernames(b bool) *LocalBreachCreate

SetContainsUsernames sets the "contains_usernames" field.

func (*LocalBreachCreate) SetCreatedAt

func (lbc *LocalBreachCreate) SetCreatedAt(t time.Time) *LocalBreachCreate

SetCreatedAt sets the "created_at" field.

func (*LocalBreachCreate) SetData

func (lbc *LocalBreachCreate) SetData(s *schema.Data) *LocalBreachCreate

SetData sets the "data" field.

func (*LocalBreachCreate) SetDate

func (lbc *LocalBreachCreate) SetDate(t time.Time) *LocalBreachCreate

SetDate sets the "date" field.

func (*LocalBreachCreate) SetDescription

func (lbc *LocalBreachCreate) SetDescription(s string) *LocalBreachCreate

SetDescription sets the "description" field.

func (*LocalBreachCreate) SetHashPeppered

func (lbc *LocalBreachCreate) SetHashPeppered(b bool) *LocalBreachCreate

SetHashPeppered sets the "hash_peppered" field.

func (*LocalBreachCreate) SetHashSalted

func (lbc *LocalBreachCreate) SetHashSalted(b bool) *LocalBreachCreate

SetHashSalted sets the "hash_salted" field.

func (*LocalBreachCreate) SetHashType

func (lbc *LocalBreachCreate) SetHashType(s string) *LocalBreachCreate

SetHashType sets the "hash_type" field.

func (*LocalBreachCreate) SetID

SetID sets the "id" field.

func (*LocalBreachCreate) SetIsVerified

func (lbc *LocalBreachCreate) SetIsVerified(b bool) *LocalBreachCreate

SetIsVerified sets the "is_verified" field.

func (*LocalBreachCreate) SetName

func (lbc *LocalBreachCreate) SetName(s string) *LocalBreachCreate

SetName sets the "name" field.

func (*LocalBreachCreate) SetNillableCreatedAt

func (lbc *LocalBreachCreate) SetNillableCreatedAt(t *time.Time) *LocalBreachCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*LocalBreachCreate) SetNillableDate

func (lbc *LocalBreachCreate) SetNillableDate(t *time.Time) *LocalBreachCreate

SetNillableDate sets the "date" field if the given value is not nil.

func (*LocalBreachCreate) SetNillableDescription

func (lbc *LocalBreachCreate) SetNillableDescription(s *string) *LocalBreachCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LocalBreachCreate) SetNillableHashPeppered

func (lbc *LocalBreachCreate) SetNillableHashPeppered(b *bool) *LocalBreachCreate

SetNillableHashPeppered sets the "hash_peppered" field if the given value is not nil.

func (*LocalBreachCreate) SetNillableHashSalted

func (lbc *LocalBreachCreate) SetNillableHashSalted(b *bool) *LocalBreachCreate

SetNillableHashSalted sets the "hash_salted" field if the given value is not nil.

func (*LocalBreachCreate) SetNillableHashType

func (lbc *LocalBreachCreate) SetNillableHashType(s *string) *LocalBreachCreate

SetNillableHashType sets the "hash_type" field if the given value is not nil.

func (*LocalBreachCreate) SetNillableID

func (lbc *LocalBreachCreate) SetNillableID(u *uuid.UUID) *LocalBreachCreate

SetNillableID sets the "id" field if the given value is not nil.

type LocalBreachCreateBulk

type LocalBreachCreateBulk struct {
	// contains filtered or unexported fields
}

LocalBreachCreateBulk is the builder for creating many LocalBreach entities in bulk.

func (*LocalBreachCreateBulk) Exec

func (lbcb *LocalBreachCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LocalBreachCreateBulk) ExecX

func (lbcb *LocalBreachCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocalBreachCreateBulk) Save

func (lbcb *LocalBreachCreateBulk) Save(ctx context.Context) ([]*LocalBreach, error)

Save creates the LocalBreach entities in the database.

func (*LocalBreachCreateBulk) SaveX

func (lbcb *LocalBreachCreateBulk) SaveX(ctx context.Context) []*LocalBreach

SaveX is like Save, but panics if an error occurs.

type LocalBreachDelete

type LocalBreachDelete struct {
	// contains filtered or unexported fields
}

LocalBreachDelete is the builder for deleting a LocalBreach entity.

func (*LocalBreachDelete) Exec

func (lbd *LocalBreachDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*LocalBreachDelete) ExecX

func (lbd *LocalBreachDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*LocalBreachDelete) Where

Where appends a list predicates to the LocalBreachDelete builder.

type LocalBreachDeleteOne

type LocalBreachDeleteOne struct {
	// contains filtered or unexported fields
}

LocalBreachDeleteOne is the builder for deleting a single LocalBreach entity.

func (*LocalBreachDeleteOne) Exec

func (lbdo *LocalBreachDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LocalBreachDeleteOne) ExecX

func (lbdo *LocalBreachDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocalBreachDeleteOne) Where

Where appends a list predicates to the LocalBreachDelete builder.

type LocalBreachEdges

type LocalBreachEdges struct {
	// TrackedBreaches holds the value of the tracked_breaches edge.
	TrackedBreaches []*TrackedBreaches `json:"tracked_breaches,omitempty"`
	// contains filtered or unexported fields
}

LocalBreachEdges holds the relations/edges for other nodes in the graph.

func (LocalBreachEdges) TrackedBreachesOrErr

func (e LocalBreachEdges) TrackedBreachesOrErr() ([]*TrackedBreaches, error)

TrackedBreachesOrErr returns the TrackedBreaches value or an error if the edge was not loaded in eager-loading.

type LocalBreachGroupBy

type LocalBreachGroupBy struct {
	// contains filtered or unexported fields
}

LocalBreachGroupBy is the group-by builder for LocalBreach entities.

func (*LocalBreachGroupBy) Aggregate

func (lbgb *LocalBreachGroupBy) Aggregate(fns ...AggregateFunc) *LocalBreachGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*LocalBreachGroupBy) Bool

func (s *LocalBreachGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) BoolX

func (s *LocalBreachGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LocalBreachGroupBy) Bools

func (s *LocalBreachGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) BoolsX

func (s *LocalBreachGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LocalBreachGroupBy) Float64

func (s *LocalBreachGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) Float64X

func (s *LocalBreachGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LocalBreachGroupBy) Float64s

func (s *LocalBreachGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) Float64sX

func (s *LocalBreachGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LocalBreachGroupBy) Int

func (s *LocalBreachGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) IntX

func (s *LocalBreachGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LocalBreachGroupBy) Ints

func (s *LocalBreachGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) IntsX

func (s *LocalBreachGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LocalBreachGroupBy) Scan

func (lbgb *LocalBreachGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LocalBreachGroupBy) ScanX

func (s *LocalBreachGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LocalBreachGroupBy) String

func (s *LocalBreachGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) StringX

func (s *LocalBreachGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LocalBreachGroupBy) Strings

func (s *LocalBreachGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LocalBreachGroupBy) StringsX

func (s *LocalBreachGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LocalBreachMutation

type LocalBreachMutation struct {
	// contains filtered or unexported fields
}

LocalBreachMutation represents an operation that mutates the LocalBreach nodes in the graph.

func (*LocalBreachMutation) AddField

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) AddTrackedBreachIDs

func (m *LocalBreachMutation) AddTrackedBreachIDs(ids ...uuid.UUID)

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by ids.

func (*LocalBreachMutation) AddedEdges

func (m *LocalBreachMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*LocalBreachMutation) AddedField

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) AddedFields

func (m *LocalBreachMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*LocalBreachMutation) AddedIDs

func (m *LocalBreachMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*LocalBreachMutation) ClearData

func (m *LocalBreachMutation) ClearData()

ClearData clears the value of the "data" field.

func (*LocalBreachMutation) ClearDescription

func (m *LocalBreachMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*LocalBreachMutation) ClearEdge

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) ClearField

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) ClearHashPeppered

func (m *LocalBreachMutation) ClearHashPeppered()

ClearHashPeppered clears the value of the "hash_peppered" field.

func (*LocalBreachMutation) ClearHashSalted

func (m *LocalBreachMutation) ClearHashSalted()

ClearHashSalted clears the value of the "hash_salted" field.

func (*LocalBreachMutation) ClearHashType

func (m *LocalBreachMutation) ClearHashType()

ClearHashType clears the value of the "hash_type" field.

func (*LocalBreachMutation) ClearTrackedBreaches

func (m *LocalBreachMutation) ClearTrackedBreaches()

ClearTrackedBreaches clears the "tracked_breaches" edge to the TrackedBreaches entity.

func (*LocalBreachMutation) ClearedEdges

func (m *LocalBreachMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*LocalBreachMutation) ClearedFields

func (m *LocalBreachMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (LocalBreachMutation) Client

func (m LocalBreachMutation) 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 (*LocalBreachMutation) ContainsEmails

func (m *LocalBreachMutation) ContainsEmails() (r bool, exists bool)

ContainsEmails returns the value of the "contains_emails" field in the mutation.

func (*LocalBreachMutation) ContainsHashes

func (m *LocalBreachMutation) ContainsHashes() (r bool, exists bool)

ContainsHashes returns the value of the "contains_hashes" field in the mutation.

func (*LocalBreachMutation) ContainsPasswords

func (m *LocalBreachMutation) ContainsPasswords() (r bool, exists bool)

ContainsPasswords returns the value of the "contains_passwords" field in the mutation.

func (*LocalBreachMutation) ContainsUsernames

func (m *LocalBreachMutation) ContainsUsernames() (r bool, exists bool)

ContainsUsernames returns the value of the "contains_usernames" field in the mutation.

func (*LocalBreachMutation) CreatedAt

func (m *LocalBreachMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*LocalBreachMutation) Data

func (m *LocalBreachMutation) Data() (r *schema.Data, exists bool)

Data returns the value of the "data" field in the mutation.

func (*LocalBreachMutation) DataCleared

func (m *LocalBreachMutation) DataCleared() bool

DataCleared returns if the "data" field was cleared in this mutation.

func (*LocalBreachMutation) Date

func (m *LocalBreachMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*LocalBreachMutation) Description

func (m *LocalBreachMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*LocalBreachMutation) DescriptionCleared

func (m *LocalBreachMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*LocalBreachMutation) EdgeCleared

func (m *LocalBreachMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*LocalBreachMutation) Field

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) FieldCleared

func (m *LocalBreachMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*LocalBreachMutation) Fields

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) HashPeppered

func (m *LocalBreachMutation) HashPeppered() (r bool, exists bool)

HashPeppered returns the value of the "hash_peppered" field in the mutation.

func (*LocalBreachMutation) HashPepperedCleared

func (m *LocalBreachMutation) HashPepperedCleared() bool

HashPepperedCleared returns if the "hash_peppered" field was cleared in this mutation.

func (*LocalBreachMutation) HashSalted

func (m *LocalBreachMutation) HashSalted() (r bool, exists bool)

HashSalted returns the value of the "hash_salted" field in the mutation.

func (*LocalBreachMutation) HashSaltedCleared

func (m *LocalBreachMutation) HashSaltedCleared() bool

HashSaltedCleared returns if the "hash_salted" field was cleared in this mutation.

func (*LocalBreachMutation) HashType

func (m *LocalBreachMutation) HashType() (r string, exists bool)

HashType returns the value of the "hash_type" field in the mutation.

func (*LocalBreachMutation) HashTypeCleared

func (m *LocalBreachMutation) HashTypeCleared() bool

HashTypeCleared returns if the "hash_type" field was cleared in this mutation.

func (*LocalBreachMutation) ID

func (m *LocalBreachMutation) ID() (id uuid.UUID, 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 (*LocalBreachMutation) IDs

func (m *LocalBreachMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*LocalBreachMutation) IsVerified

func (m *LocalBreachMutation) IsVerified() (r bool, exists bool)

IsVerified returns the value of the "is_verified" field in the mutation.

func (*LocalBreachMutation) Name

func (m *LocalBreachMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*LocalBreachMutation) OldContainsEmails

func (m *LocalBreachMutation) OldContainsEmails(ctx context.Context) (v bool, err error)

OldContainsEmails returns the old "contains_emails" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldContainsHashes

func (m *LocalBreachMutation) OldContainsHashes(ctx context.Context) (v bool, err error)

OldContainsHashes returns the old "contains_hashes" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldContainsPasswords

func (m *LocalBreachMutation) OldContainsPasswords(ctx context.Context) (v bool, err error)

OldContainsPasswords returns the old "contains_passwords" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldContainsUsernames

func (m *LocalBreachMutation) OldContainsUsernames(ctx context.Context) (v bool, err error)

OldContainsUsernames returns the old "contains_usernames" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldCreatedAt

func (m *LocalBreachMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldData

func (m *LocalBreachMutation) OldData(ctx context.Context) (v *schema.Data, err error)

OldData returns the old "data" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldDate

func (m *LocalBreachMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldDescription

func (m *LocalBreachMutation) OldDescription(ctx context.Context) (v *string, err error)

OldDescription returns the old "description" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldField

func (m *LocalBreachMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*LocalBreachMutation) OldHashPeppered

func (m *LocalBreachMutation) OldHashPeppered(ctx context.Context) (v *bool, err error)

OldHashPeppered returns the old "hash_peppered" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldHashSalted

func (m *LocalBreachMutation) OldHashSalted(ctx context.Context) (v *bool, err error)

OldHashSalted returns the old "hash_salted" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldHashType

func (m *LocalBreachMutation) OldHashType(ctx context.Context) (v *string, err error)

OldHashType returns the old "hash_type" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldIsVerified

func (m *LocalBreachMutation) OldIsVerified(ctx context.Context) (v bool, err error)

OldIsVerified returns the old "is_verified" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) OldName

func (m *LocalBreachMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the LocalBreach entity. If the LocalBreach 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 (*LocalBreachMutation) Op

func (m *LocalBreachMutation) Op() Op

Op returns the operation name.

func (*LocalBreachMutation) RemoveTrackedBreachIDs

func (m *LocalBreachMutation) RemoveTrackedBreachIDs(ids ...uuid.UUID)

RemoveTrackedBreachIDs removes the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*LocalBreachMutation) RemovedEdges

func (m *LocalBreachMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*LocalBreachMutation) RemovedIDs

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) RemovedTrackedBreachesIDs

func (m *LocalBreachMutation) RemovedTrackedBreachesIDs() (ids []uuid.UUID)

RemovedTrackedBreaches returns the removed IDs of the "tracked_breaches" edge to the TrackedBreaches entity.

func (*LocalBreachMutation) ResetContainsEmails

func (m *LocalBreachMutation) ResetContainsEmails()

ResetContainsEmails resets all changes to the "contains_emails" field.

func (*LocalBreachMutation) ResetContainsHashes

func (m *LocalBreachMutation) ResetContainsHashes()

ResetContainsHashes resets all changes to the "contains_hashes" field.

func (*LocalBreachMutation) ResetContainsPasswords

func (m *LocalBreachMutation) ResetContainsPasswords()

ResetContainsPasswords resets all changes to the "contains_passwords" field.

func (*LocalBreachMutation) ResetContainsUsernames

func (m *LocalBreachMutation) ResetContainsUsernames()

ResetContainsUsernames resets all changes to the "contains_usernames" field.

func (*LocalBreachMutation) ResetCreatedAt

func (m *LocalBreachMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LocalBreachMutation) ResetData

func (m *LocalBreachMutation) ResetData()

ResetData resets all changes to the "data" field.

func (*LocalBreachMutation) ResetDate

func (m *LocalBreachMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*LocalBreachMutation) ResetDescription

func (m *LocalBreachMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*LocalBreachMutation) ResetEdge

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) ResetField

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) ResetHashPeppered

func (m *LocalBreachMutation) ResetHashPeppered()

ResetHashPeppered resets all changes to the "hash_peppered" field.

func (*LocalBreachMutation) ResetHashSalted

func (m *LocalBreachMutation) ResetHashSalted()

ResetHashSalted resets all changes to the "hash_salted" field.

func (*LocalBreachMutation) ResetHashType

func (m *LocalBreachMutation) ResetHashType()

ResetHashType resets all changes to the "hash_type" field.

func (*LocalBreachMutation) ResetIsVerified

func (m *LocalBreachMutation) ResetIsVerified()

ResetIsVerified resets all changes to the "is_verified" field.

func (*LocalBreachMutation) ResetName

func (m *LocalBreachMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*LocalBreachMutation) ResetTrackedBreaches

func (m *LocalBreachMutation) ResetTrackedBreaches()

ResetTrackedBreaches resets all changes to the "tracked_breaches" edge.

func (*LocalBreachMutation) SetContainsEmails

func (m *LocalBreachMutation) SetContainsEmails(b bool)

SetContainsEmails sets the "contains_emails" field.

func (*LocalBreachMutation) SetContainsHashes

func (m *LocalBreachMutation) SetContainsHashes(b bool)

SetContainsHashes sets the "contains_hashes" field.

func (*LocalBreachMutation) SetContainsPasswords

func (m *LocalBreachMutation) SetContainsPasswords(b bool)

SetContainsPasswords sets the "contains_passwords" field.

func (*LocalBreachMutation) SetContainsUsernames

func (m *LocalBreachMutation) SetContainsUsernames(b bool)

SetContainsUsernames sets the "contains_usernames" field.

func (*LocalBreachMutation) SetCreatedAt

func (m *LocalBreachMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*LocalBreachMutation) SetData

func (m *LocalBreachMutation) SetData(s *schema.Data)

SetData sets the "data" field.

func (*LocalBreachMutation) SetDate

func (m *LocalBreachMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*LocalBreachMutation) SetDescription

func (m *LocalBreachMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*LocalBreachMutation) SetField

func (m *LocalBreachMutation) 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 (*LocalBreachMutation) SetHashPeppered

func (m *LocalBreachMutation) SetHashPeppered(b bool)

SetHashPeppered sets the "hash_peppered" field.

func (*LocalBreachMutation) SetHashSalted

func (m *LocalBreachMutation) SetHashSalted(b bool)

SetHashSalted sets the "hash_salted" field.

func (*LocalBreachMutation) SetHashType

func (m *LocalBreachMutation) SetHashType(s string)

SetHashType sets the "hash_type" field.

func (*LocalBreachMutation) SetID

func (m *LocalBreachMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of LocalBreach entities.

func (*LocalBreachMutation) SetIsVerified

func (m *LocalBreachMutation) SetIsVerified(b bool)

SetIsVerified sets the "is_verified" field.

func (*LocalBreachMutation) SetName

func (m *LocalBreachMutation) SetName(s string)

SetName sets the "name" field.

func (*LocalBreachMutation) SetOp

func (m *LocalBreachMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LocalBreachMutation) TrackedBreachesCleared

func (m *LocalBreachMutation) TrackedBreachesCleared() bool

TrackedBreachesCleared reports if the "tracked_breaches" edge to the TrackedBreaches entity was cleared.

func (*LocalBreachMutation) TrackedBreachesIDs

func (m *LocalBreachMutation) TrackedBreachesIDs() (ids []uuid.UUID)

TrackedBreachesIDs returns the "tracked_breaches" edge IDs in the mutation.

func (LocalBreachMutation) Tx

func (m LocalBreachMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*LocalBreachMutation) Type

func (m *LocalBreachMutation) Type() string

Type returns the node type of this mutation (LocalBreach).

func (*LocalBreachMutation) Where

func (m *LocalBreachMutation) Where(ps ...predicate.LocalBreach)

Where appends a list predicates to the LocalBreachMutation builder.

func (*LocalBreachMutation) WhereP

func (m *LocalBreachMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the LocalBreachMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type LocalBreachQuery

type LocalBreachQuery struct {
	// contains filtered or unexported fields
}

LocalBreachQuery is the builder for querying LocalBreach entities.

func (*LocalBreachQuery) Aggregate

func (lbq *LocalBreachQuery) Aggregate(fns ...AggregateFunc) *LocalBreachSelect

Aggregate returns a LocalBreachSelect configured with the given aggregations.

func (*LocalBreachQuery) All

func (lbq *LocalBreachQuery) All(ctx context.Context) ([]*LocalBreach, error)

All executes the query and returns a list of LocalBreaches.

func (*LocalBreachQuery) AllX

func (lbq *LocalBreachQuery) AllX(ctx context.Context) []*LocalBreach

AllX is like All, but panics if an error occurs.

func (*LocalBreachQuery) Clone

func (lbq *LocalBreachQuery) Clone() *LocalBreachQuery

Clone returns a duplicate of the LocalBreachQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*LocalBreachQuery) Count

func (lbq *LocalBreachQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LocalBreachQuery) CountX

func (lbq *LocalBreachQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*LocalBreachQuery) Exist

func (lbq *LocalBreachQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*LocalBreachQuery) ExistX

func (lbq *LocalBreachQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*LocalBreachQuery) First

func (lbq *LocalBreachQuery) First(ctx context.Context) (*LocalBreach, error)

First returns the first LocalBreach entity from the query. Returns a *NotFoundError when no LocalBreach was found.

func (*LocalBreachQuery) FirstID

func (lbq *LocalBreachQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first LocalBreach ID from the query. Returns a *NotFoundError when no LocalBreach ID was found.

func (*LocalBreachQuery) FirstIDX

func (lbq *LocalBreachQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*LocalBreachQuery) FirstX

func (lbq *LocalBreachQuery) FirstX(ctx context.Context) *LocalBreach

FirstX is like First, but panics if an error occurs.

func (*LocalBreachQuery) GroupBy

func (lbq *LocalBreachQuery) GroupBy(field string, fields ...string) *LocalBreachGroupBy

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.LocalBreach.Query().
	GroupBy(localbreach.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LocalBreachQuery) IDs

func (lbq *LocalBreachQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of LocalBreach IDs.

func (*LocalBreachQuery) IDsX

func (lbq *LocalBreachQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*LocalBreachQuery) Limit

func (lbq *LocalBreachQuery) Limit(limit int) *LocalBreachQuery

Limit the number of records to be returned by this query.

func (*LocalBreachQuery) Offset

func (lbq *LocalBreachQuery) Offset(offset int) *LocalBreachQuery

Offset to start from.

func (*LocalBreachQuery) Only

func (lbq *LocalBreachQuery) Only(ctx context.Context) (*LocalBreach, error)

Only returns a single LocalBreach entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one LocalBreach entity is found. Returns a *NotFoundError when no LocalBreach entities are found.

func (*LocalBreachQuery) OnlyID

func (lbq *LocalBreachQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only LocalBreach ID in the query. Returns a *NotSingularError when more than one LocalBreach ID is found. Returns a *NotFoundError when no entities are found.

func (*LocalBreachQuery) OnlyIDX

func (lbq *LocalBreachQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*LocalBreachQuery) OnlyX

func (lbq *LocalBreachQuery) OnlyX(ctx context.Context) *LocalBreach

OnlyX is like Only, but panics if an error occurs.

func (*LocalBreachQuery) Order

Order specifies how the records should be ordered.

func (*LocalBreachQuery) QueryTrackedBreaches

func (lbq *LocalBreachQuery) QueryTrackedBreaches() *TrackedBreachesQuery

QueryTrackedBreaches chains the current query on the "tracked_breaches" edge.

func (*LocalBreachQuery) Select

func (lbq *LocalBreachQuery) Select(fields ...string) *LocalBreachSelect

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.LocalBreach.Query().
	Select(localbreach.FieldName).
	Scan(ctx, &v)

func (*LocalBreachQuery) Unique

func (lbq *LocalBreachQuery) Unique(unique bool) *LocalBreachQuery

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 (*LocalBreachQuery) Where

Where adds a new predicate for the LocalBreachQuery builder.

func (*LocalBreachQuery) WithTrackedBreaches

func (lbq *LocalBreachQuery) WithTrackedBreaches(opts ...func(*TrackedBreachesQuery)) *LocalBreachQuery

WithTrackedBreaches tells the query-builder to eager-load the nodes that are connected to the "tracked_breaches" edge. The optional arguments are used to configure the query builder of the edge.

type LocalBreachSelect

type LocalBreachSelect struct {
	*LocalBreachQuery
	// contains filtered or unexported fields
}

LocalBreachSelect is the builder for selecting fields of LocalBreach entities.

func (*LocalBreachSelect) Aggregate

func (lbs *LocalBreachSelect) Aggregate(fns ...AggregateFunc) *LocalBreachSelect

Aggregate adds the given aggregation functions to the selector query.

func (*LocalBreachSelect) Bool

func (s *LocalBreachSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) BoolX

func (s *LocalBreachSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*LocalBreachSelect) Bools

func (s *LocalBreachSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) BoolsX

func (s *LocalBreachSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*LocalBreachSelect) Float64

func (s *LocalBreachSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) Float64X

func (s *LocalBreachSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*LocalBreachSelect) Float64s

func (s *LocalBreachSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) Float64sX

func (s *LocalBreachSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*LocalBreachSelect) Int

func (s *LocalBreachSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) IntX

func (s *LocalBreachSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*LocalBreachSelect) Ints

func (s *LocalBreachSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) IntsX

func (s *LocalBreachSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*LocalBreachSelect) Scan

func (lbs *LocalBreachSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*LocalBreachSelect) ScanX

func (s *LocalBreachSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*LocalBreachSelect) String

func (s *LocalBreachSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) StringX

func (s *LocalBreachSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*LocalBreachSelect) Strings

func (s *LocalBreachSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*LocalBreachSelect) StringsX

func (s *LocalBreachSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type LocalBreachUpdate

type LocalBreachUpdate struct {
	// contains filtered or unexported fields
}

LocalBreachUpdate is the builder for updating LocalBreach entities.

func (*LocalBreachUpdate) AddTrackedBreachIDs

func (lbu *LocalBreachUpdate) AddTrackedBreachIDs(ids ...uuid.UUID) *LocalBreachUpdate

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*LocalBreachUpdate) AddTrackedBreaches

func (lbu *LocalBreachUpdate) AddTrackedBreaches(t ...*TrackedBreaches) *LocalBreachUpdate

AddTrackedBreaches adds the "tracked_breaches" edges to the TrackedBreaches entity.

func (*LocalBreachUpdate) ClearData

func (lbu *LocalBreachUpdate) ClearData() *LocalBreachUpdate

ClearData clears the value of the "data" field.

func (*LocalBreachUpdate) ClearDescription

func (lbu *LocalBreachUpdate) ClearDescription() *LocalBreachUpdate

ClearDescription clears the value of the "description" field.

func (*LocalBreachUpdate) ClearHashPeppered

func (lbu *LocalBreachUpdate) ClearHashPeppered() *LocalBreachUpdate

ClearHashPeppered clears the value of the "hash_peppered" field.

func (*LocalBreachUpdate) ClearHashSalted

func (lbu *LocalBreachUpdate) ClearHashSalted() *LocalBreachUpdate

ClearHashSalted clears the value of the "hash_salted" field.

func (*LocalBreachUpdate) ClearHashType

func (lbu *LocalBreachUpdate) ClearHashType() *LocalBreachUpdate

ClearHashType clears the value of the "hash_type" field.

func (*LocalBreachUpdate) ClearTrackedBreaches

func (lbu *LocalBreachUpdate) ClearTrackedBreaches() *LocalBreachUpdate

ClearTrackedBreaches clears all "tracked_breaches" edges to the TrackedBreaches entity.

func (*LocalBreachUpdate) Exec

func (lbu *LocalBreachUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LocalBreachUpdate) ExecX

func (lbu *LocalBreachUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocalBreachUpdate) Mutation

func (lbu *LocalBreachUpdate) Mutation() *LocalBreachMutation

Mutation returns the LocalBreachMutation object of the builder.

func (*LocalBreachUpdate) RemoveTrackedBreachIDs

func (lbu *LocalBreachUpdate) RemoveTrackedBreachIDs(ids ...uuid.UUID) *LocalBreachUpdate

RemoveTrackedBreachIDs removes the "tracked_breaches" edge to TrackedBreaches entities by IDs.

func (*LocalBreachUpdate) RemoveTrackedBreaches

func (lbu *LocalBreachUpdate) RemoveTrackedBreaches(t ...*TrackedBreaches) *LocalBreachUpdate

RemoveTrackedBreaches removes "tracked_breaches" edges to TrackedBreaches entities.

func (*LocalBreachUpdate) Save

func (lbu *LocalBreachUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*LocalBreachUpdate) SaveX

func (lbu *LocalBreachUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*LocalBreachUpdate) SetContainsEmails

func (lbu *LocalBreachUpdate) SetContainsEmails(b bool) *LocalBreachUpdate

SetContainsEmails sets the "contains_emails" field.

func (*LocalBreachUpdate) SetContainsHashes

func (lbu *LocalBreachUpdate) SetContainsHashes(b bool) *LocalBreachUpdate

SetContainsHashes sets the "contains_hashes" field.

func (*LocalBreachUpdate) SetContainsPasswords

func (lbu *LocalBreachUpdate) SetContainsPasswords(b bool) *LocalBreachUpdate

SetContainsPasswords sets the "contains_passwords" field.

func (*LocalBreachUpdate) SetContainsUsernames

func (lbu *LocalBreachUpdate) SetContainsUsernames(b bool) *LocalBreachUpdate

SetContainsUsernames sets the "contains_usernames" field.

func (*LocalBreachUpdate) SetData

func (lbu *LocalBreachUpdate) SetData(s *schema.Data) *LocalBreachUpdate

SetData sets the "data" field.

func (*LocalBreachUpdate) SetDate

func (lbu *LocalBreachUpdate) SetDate(t time.Time) *LocalBreachUpdate

SetDate sets the "date" field.

func (*LocalBreachUpdate) SetDescription

func (lbu *LocalBreachUpdate) SetDescription(s string) *LocalBreachUpdate

SetDescription sets the "description" field.

func (*LocalBreachUpdate) SetHashPeppered

func (lbu *LocalBreachUpdate) SetHashPeppered(b bool) *LocalBreachUpdate

SetHashPeppered sets the "hash_peppered" field.

func (*LocalBreachUpdate) SetHashSalted

func (lbu *LocalBreachUpdate) SetHashSalted(b bool) *LocalBreachUpdate

SetHashSalted sets the "hash_salted" field.

func (*LocalBreachUpdate) SetHashType

func (lbu *LocalBreachUpdate) SetHashType(s string) *LocalBreachUpdate

SetHashType sets the "hash_type" field.

func (*LocalBreachUpdate) SetIsVerified

func (lbu *LocalBreachUpdate) SetIsVerified(b bool) *LocalBreachUpdate

SetIsVerified sets the "is_verified" field.

func (*LocalBreachUpdate) SetName

func (lbu *LocalBreachUpdate) SetName(s string) *LocalBreachUpdate

SetName sets the "name" field.

func (*LocalBreachUpdate) SetNillableDate

func (lbu *LocalBreachUpdate) SetNillableDate(t *time.Time) *LocalBreachUpdate

SetNillableDate sets the "date" field if the given value is not nil.

func (*LocalBreachUpdate) SetNillableDescription

func (lbu *LocalBreachUpdate) SetNillableDescription(s *string) *LocalBreachUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LocalBreachUpdate) SetNillableHashPeppered

func (lbu *LocalBreachUpdate) SetNillableHashPeppered(b *bool) *LocalBreachUpdate

SetNillableHashPeppered sets the "hash_peppered" field if the given value is not nil.

func (*LocalBreachUpdate) SetNillableHashSalted

func (lbu *LocalBreachUpdate) SetNillableHashSalted(b *bool) *LocalBreachUpdate

SetNillableHashSalted sets the "hash_salted" field if the given value is not nil.

func (*LocalBreachUpdate) SetNillableHashType

func (lbu *LocalBreachUpdate) SetNillableHashType(s *string) *LocalBreachUpdate

SetNillableHashType sets the "hash_type" field if the given value is not nil.

func (*LocalBreachUpdate) Where

Where appends a list predicates to the LocalBreachUpdate builder.

type LocalBreachUpdateOne

type LocalBreachUpdateOne struct {
	// contains filtered or unexported fields
}

LocalBreachUpdateOne is the builder for updating a single LocalBreach entity.

func (*LocalBreachUpdateOne) AddTrackedBreachIDs

func (lbuo *LocalBreachUpdateOne) AddTrackedBreachIDs(ids ...uuid.UUID) *LocalBreachUpdateOne

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*LocalBreachUpdateOne) AddTrackedBreaches

func (lbuo *LocalBreachUpdateOne) AddTrackedBreaches(t ...*TrackedBreaches) *LocalBreachUpdateOne

AddTrackedBreaches adds the "tracked_breaches" edges to the TrackedBreaches entity.

func (*LocalBreachUpdateOne) ClearData

func (lbuo *LocalBreachUpdateOne) ClearData() *LocalBreachUpdateOne

ClearData clears the value of the "data" field.

func (*LocalBreachUpdateOne) ClearDescription

func (lbuo *LocalBreachUpdateOne) ClearDescription() *LocalBreachUpdateOne

ClearDescription clears the value of the "description" field.

func (*LocalBreachUpdateOne) ClearHashPeppered

func (lbuo *LocalBreachUpdateOne) ClearHashPeppered() *LocalBreachUpdateOne

ClearHashPeppered clears the value of the "hash_peppered" field.

func (*LocalBreachUpdateOne) ClearHashSalted

func (lbuo *LocalBreachUpdateOne) ClearHashSalted() *LocalBreachUpdateOne

ClearHashSalted clears the value of the "hash_salted" field.

func (*LocalBreachUpdateOne) ClearHashType

func (lbuo *LocalBreachUpdateOne) ClearHashType() *LocalBreachUpdateOne

ClearHashType clears the value of the "hash_type" field.

func (*LocalBreachUpdateOne) ClearTrackedBreaches

func (lbuo *LocalBreachUpdateOne) ClearTrackedBreaches() *LocalBreachUpdateOne

ClearTrackedBreaches clears all "tracked_breaches" edges to the TrackedBreaches entity.

func (*LocalBreachUpdateOne) Exec

func (lbuo *LocalBreachUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LocalBreachUpdateOne) ExecX

func (lbuo *LocalBreachUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*LocalBreachUpdateOne) Mutation

func (lbuo *LocalBreachUpdateOne) Mutation() *LocalBreachMutation

Mutation returns the LocalBreachMutation object of the builder.

func (*LocalBreachUpdateOne) RemoveTrackedBreachIDs

func (lbuo *LocalBreachUpdateOne) RemoveTrackedBreachIDs(ids ...uuid.UUID) *LocalBreachUpdateOne

RemoveTrackedBreachIDs removes the "tracked_breaches" edge to TrackedBreaches entities by IDs.

func (*LocalBreachUpdateOne) RemoveTrackedBreaches

func (lbuo *LocalBreachUpdateOne) RemoveTrackedBreaches(t ...*TrackedBreaches) *LocalBreachUpdateOne

RemoveTrackedBreaches removes "tracked_breaches" edges to TrackedBreaches entities.

func (*LocalBreachUpdateOne) Save

Save executes the query and returns the updated LocalBreach entity.

func (*LocalBreachUpdateOne) SaveX

func (lbuo *LocalBreachUpdateOne) SaveX(ctx context.Context) *LocalBreach

SaveX is like Save, but panics if an error occurs.

func (*LocalBreachUpdateOne) Select

func (lbuo *LocalBreachUpdateOne) Select(field string, fields ...string) *LocalBreachUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*LocalBreachUpdateOne) SetContainsEmails

func (lbuo *LocalBreachUpdateOne) SetContainsEmails(b bool) *LocalBreachUpdateOne

SetContainsEmails sets the "contains_emails" field.

func (*LocalBreachUpdateOne) SetContainsHashes

func (lbuo *LocalBreachUpdateOne) SetContainsHashes(b bool) *LocalBreachUpdateOne

SetContainsHashes sets the "contains_hashes" field.

func (*LocalBreachUpdateOne) SetContainsPasswords

func (lbuo *LocalBreachUpdateOne) SetContainsPasswords(b bool) *LocalBreachUpdateOne

SetContainsPasswords sets the "contains_passwords" field.

func (*LocalBreachUpdateOne) SetContainsUsernames

func (lbuo *LocalBreachUpdateOne) SetContainsUsernames(b bool) *LocalBreachUpdateOne

SetContainsUsernames sets the "contains_usernames" field.

func (*LocalBreachUpdateOne) SetData

SetData sets the "data" field.

func (*LocalBreachUpdateOne) SetDate

SetDate sets the "date" field.

func (*LocalBreachUpdateOne) SetDescription

func (lbuo *LocalBreachUpdateOne) SetDescription(s string) *LocalBreachUpdateOne

SetDescription sets the "description" field.

func (*LocalBreachUpdateOne) SetHashPeppered

func (lbuo *LocalBreachUpdateOne) SetHashPeppered(b bool) *LocalBreachUpdateOne

SetHashPeppered sets the "hash_peppered" field.

func (*LocalBreachUpdateOne) SetHashSalted

func (lbuo *LocalBreachUpdateOne) SetHashSalted(b bool) *LocalBreachUpdateOne

SetHashSalted sets the "hash_salted" field.

func (*LocalBreachUpdateOne) SetHashType

func (lbuo *LocalBreachUpdateOne) SetHashType(s string) *LocalBreachUpdateOne

SetHashType sets the "hash_type" field.

func (*LocalBreachUpdateOne) SetIsVerified

func (lbuo *LocalBreachUpdateOne) SetIsVerified(b bool) *LocalBreachUpdateOne

SetIsVerified sets the "is_verified" field.

func (*LocalBreachUpdateOne) SetName

SetName sets the "name" field.

func (*LocalBreachUpdateOne) SetNillableDate

func (lbuo *LocalBreachUpdateOne) SetNillableDate(t *time.Time) *LocalBreachUpdateOne

SetNillableDate sets the "date" field if the given value is not nil.

func (*LocalBreachUpdateOne) SetNillableDescription

func (lbuo *LocalBreachUpdateOne) SetNillableDescription(s *string) *LocalBreachUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*LocalBreachUpdateOne) SetNillableHashPeppered

func (lbuo *LocalBreachUpdateOne) SetNillableHashPeppered(b *bool) *LocalBreachUpdateOne

SetNillableHashPeppered sets the "hash_peppered" field if the given value is not nil.

func (*LocalBreachUpdateOne) SetNillableHashSalted

func (lbuo *LocalBreachUpdateOne) SetNillableHashSalted(b *bool) *LocalBreachUpdateOne

SetNillableHashSalted sets the "hash_salted" field if the given value is not nil.

func (*LocalBreachUpdateOne) SetNillableHashType

func (lbuo *LocalBreachUpdateOne) SetNillableHashType(s *string) *LocalBreachUpdateOne

SetNillableHashType sets the "hash_type" field if the given value is not nil.

func (*LocalBreachUpdateOne) Where

Where appends a list predicates to the LocalBreachUpdate builder.

type LocalBreaches

type LocalBreaches []*LocalBreach

LocalBreaches is a parsable slice of LocalBreach.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

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 Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

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.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

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

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type SearchQueries

type SearchQueries []*SearchQuery

SearchQueries is a parsable slice of SearchQuery.

type SearchQuery

type SearchQuery struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Query holds the value of the "query" field.
	Query string `json:"query,omitempty"`
	// Created holds the value of the "created" field.
	Created time.Time `json:"created,omitempty"`
	// id of the user that's done the search query
	Owner uuid.UUID `json:"owner,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SearchQueryQuery when eager-loading is set.
	Edges SearchQueryEdges `json:"edges"`
	// contains filtered or unexported fields
}

SearchQuery is the model entity for the SearchQuery schema.

func (*SearchQuery) QueryUser

func (sq *SearchQuery) QueryUser() *UserQuery

QueryUser queries the "user" edge of the SearchQuery entity.

func (*SearchQuery) String

func (sq *SearchQuery) String() string

String implements the fmt.Stringer.

func (*SearchQuery) Unwrap

func (sq *SearchQuery) Unwrap() *SearchQuery

Unwrap unwraps the SearchQuery 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 (*SearchQuery) Update

func (sq *SearchQuery) Update() *SearchQueryUpdateOne

Update returns a builder for updating this SearchQuery. Note that you need to call SearchQuery.Unwrap() before calling this method if this SearchQuery was returned from a transaction, and the transaction was committed or rolled back.

func (*SearchQuery) Value

func (sq *SearchQuery) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SearchQuery. This includes values selected through modifiers, order, etc.

type SearchQueryClient

type SearchQueryClient struct {
	// contains filtered or unexported fields
}

SearchQueryClient is a client for the SearchQuery schema.

func NewSearchQueryClient

func NewSearchQueryClient(c config) *SearchQueryClient

NewSearchQueryClient returns a client for the SearchQuery from the given config.

func (*SearchQueryClient) Create

func (c *SearchQueryClient) Create() *SearchQueryCreate

Create returns a builder for creating a SearchQuery entity.

func (*SearchQueryClient) CreateBulk

func (c *SearchQueryClient) CreateBulk(builders ...*SearchQueryCreate) *SearchQueryCreateBulk

CreateBulk returns a builder for creating a bulk of SearchQuery entities.

func (*SearchQueryClient) Delete

func (c *SearchQueryClient) Delete() *SearchQueryDelete

Delete returns a delete builder for SearchQuery.

func (*SearchQueryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SearchQueryClient) DeleteOneID

func (c *SearchQueryClient) DeleteOneID(id uuid.UUID) *SearchQueryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SearchQueryClient) Get

Get returns a SearchQuery entity by its id.

func (*SearchQueryClient) GetX

GetX is like Get, but panics if an error occurs.

func (*SearchQueryClient) Hooks

func (c *SearchQueryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SearchQueryClient) Intercept

func (c *SearchQueryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `searchquery.Intercept(f(g(h())))`.

func (*SearchQueryClient) Interceptors

func (c *SearchQueryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SearchQueryClient) Query

func (c *SearchQueryClient) Query() *SearchQueryQuery

Query returns a query builder for SearchQuery.

func (*SearchQueryClient) QueryUser

func (c *SearchQueryClient) QueryUser(sq *SearchQuery) *UserQuery

QueryUser queries the user edge of a SearchQuery.

func (*SearchQueryClient) Update

func (c *SearchQueryClient) Update() *SearchQueryUpdate

Update returns an update builder for SearchQuery.

func (*SearchQueryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SearchQueryClient) UpdateOneID

func (c *SearchQueryClient) UpdateOneID(id uuid.UUID) *SearchQueryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SearchQueryClient) Use

func (c *SearchQueryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `searchquery.Hooks(f(g(h())))`.

type SearchQueryCreate

type SearchQueryCreate struct {
	// contains filtered or unexported fields
}

SearchQueryCreate is the builder for creating a SearchQuery entity.

func (*SearchQueryCreate) Exec

func (sqc *SearchQueryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SearchQueryCreate) ExecX

func (sqc *SearchQueryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SearchQueryCreate) Mutation

func (sqc *SearchQueryCreate) Mutation() *SearchQueryMutation

Mutation returns the SearchQueryMutation object of the builder.

func (*SearchQueryCreate) Save

func (sqc *SearchQueryCreate) Save(ctx context.Context) (*SearchQuery, error)

Save creates the SearchQuery in the database.

func (*SearchQueryCreate) SaveX

func (sqc *SearchQueryCreate) SaveX(ctx context.Context) *SearchQuery

SaveX calls Save and panics if Save returns an error.

func (*SearchQueryCreate) SetCreated

func (sqc *SearchQueryCreate) SetCreated(t time.Time) *SearchQueryCreate

SetCreated sets the "created" field.

func (*SearchQueryCreate) SetID

SetID sets the "id" field.

func (*SearchQueryCreate) SetNillableCreated

func (sqc *SearchQueryCreate) SetNillableCreated(t *time.Time) *SearchQueryCreate

SetNillableCreated sets the "created" field if the given value is not nil.

func (*SearchQueryCreate) SetNillableID

func (sqc *SearchQueryCreate) SetNillableID(u *uuid.UUID) *SearchQueryCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SearchQueryCreate) SetOwner

func (sqc *SearchQueryCreate) SetOwner(u uuid.UUID) *SearchQueryCreate

SetOwner sets the "owner" field.

func (*SearchQueryCreate) SetQuery

func (sqc *SearchQueryCreate) SetQuery(s string) *SearchQueryCreate

SetQuery sets the "query" field.

func (*SearchQueryCreate) SetUser

func (sqc *SearchQueryCreate) SetUser(u *User) *SearchQueryCreate

SetUser sets the "user" edge to the User entity.

func (*SearchQueryCreate) SetUserID

func (sqc *SearchQueryCreate) SetUserID(id uuid.UUID) *SearchQueryCreate

SetUserID sets the "user" edge to the User entity by ID.

type SearchQueryCreateBulk

type SearchQueryCreateBulk struct {
	// contains filtered or unexported fields
}

SearchQueryCreateBulk is the builder for creating many SearchQuery entities in bulk.

func (*SearchQueryCreateBulk) Exec

func (sqcb *SearchQueryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SearchQueryCreateBulk) ExecX

func (sqcb *SearchQueryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SearchQueryCreateBulk) Save

func (sqcb *SearchQueryCreateBulk) Save(ctx context.Context) ([]*SearchQuery, error)

Save creates the SearchQuery entities in the database.

func (*SearchQueryCreateBulk) SaveX

func (sqcb *SearchQueryCreateBulk) SaveX(ctx context.Context) []*SearchQuery

SaveX is like Save, but panics if an error occurs.

type SearchQueryDelete

type SearchQueryDelete struct {
	// contains filtered or unexported fields
}

SearchQueryDelete is the builder for deleting a SearchQuery entity.

func (*SearchQueryDelete) Exec

func (sqd *SearchQueryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SearchQueryDelete) ExecX

func (sqd *SearchQueryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SearchQueryDelete) Where

Where appends a list predicates to the SearchQueryDelete builder.

type SearchQueryDeleteOne

type SearchQueryDeleteOne struct {
	// contains filtered or unexported fields
}

SearchQueryDeleteOne is the builder for deleting a single SearchQuery entity.

func (*SearchQueryDeleteOne) Exec

func (sqdo *SearchQueryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SearchQueryDeleteOne) ExecX

func (sqdo *SearchQueryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SearchQueryDeleteOne) Where

Where appends a list predicates to the SearchQueryDelete builder.

type SearchQueryEdges

type SearchQueryEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

SearchQueryEdges holds the relations/edges for other nodes in the graph.

func (SearchQueryEdges) UserOrErr

func (e SearchQueryEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SearchQueryGroupBy

type SearchQueryGroupBy struct {
	// contains filtered or unexported fields
}

SearchQueryGroupBy is the group-by builder for SearchQuery entities.

func (*SearchQueryGroupBy) Aggregate

func (sqgb *SearchQueryGroupBy) Aggregate(fns ...AggregateFunc) *SearchQueryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SearchQueryGroupBy) Bool

func (s *SearchQueryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) BoolX

func (s *SearchQueryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SearchQueryGroupBy) Bools

func (s *SearchQueryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) BoolsX

func (s *SearchQueryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SearchQueryGroupBy) Float64

func (s *SearchQueryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) Float64X

func (s *SearchQueryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SearchQueryGroupBy) Float64s

func (s *SearchQueryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) Float64sX

func (s *SearchQueryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SearchQueryGroupBy) Int

func (s *SearchQueryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) IntX

func (s *SearchQueryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SearchQueryGroupBy) Ints

func (s *SearchQueryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) IntsX

func (s *SearchQueryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SearchQueryGroupBy) Scan

func (sqgb *SearchQueryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SearchQueryGroupBy) ScanX

func (s *SearchQueryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SearchQueryGroupBy) String

func (s *SearchQueryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) StringX

func (s *SearchQueryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SearchQueryGroupBy) Strings

func (s *SearchQueryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SearchQueryGroupBy) StringsX

func (s *SearchQueryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SearchQueryMutation

type SearchQueryMutation struct {
	// contains filtered or unexported fields
}

SearchQueryMutation represents an operation that mutates the SearchQuery nodes in the graph.

func (*SearchQueryMutation) AddField

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) AddedEdges

func (m *SearchQueryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SearchQueryMutation) AddedField

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) AddedFields

func (m *SearchQueryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SearchQueryMutation) AddedIDs

func (m *SearchQueryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SearchQueryMutation) ClearEdge

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) ClearField

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) ClearUser

func (m *SearchQueryMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*SearchQueryMutation) ClearedEdges

func (m *SearchQueryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SearchQueryMutation) ClearedFields

func (m *SearchQueryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SearchQueryMutation) Client

func (m SearchQueryMutation) 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 (*SearchQueryMutation) Created

func (m *SearchQueryMutation) Created() (r time.Time, exists bool)

Created returns the value of the "created" field in the mutation.

func (*SearchQueryMutation) EdgeCleared

func (m *SearchQueryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SearchQueryMutation) Field

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) FieldCleared

func (m *SearchQueryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SearchQueryMutation) Fields

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) ID

func (m *SearchQueryMutation) ID() (id uuid.UUID, 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 (*SearchQueryMutation) IDs

func (m *SearchQueryMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*SearchQueryMutation) OldCreated

func (m *SearchQueryMutation) OldCreated(ctx context.Context) (v time.Time, err error)

OldCreated returns the old "created" field's value of the SearchQuery entity. If the SearchQuery 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 (*SearchQueryMutation) OldField

func (m *SearchQueryMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*SearchQueryMutation) OldOwner

func (m *SearchQueryMutation) OldOwner(ctx context.Context) (v uuid.UUID, err error)

OldOwner returns the old "owner" field's value of the SearchQuery entity. If the SearchQuery 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 (*SearchQueryMutation) OldQuery

func (m *SearchQueryMutation) OldQuery(ctx context.Context) (v string, err error)

OldQuery returns the old "query" field's value of the SearchQuery entity. If the SearchQuery 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 (*SearchQueryMutation) Op

func (m *SearchQueryMutation) Op() Op

Op returns the operation name.

func (*SearchQueryMutation) Owner

func (m *SearchQueryMutation) Owner() (r uuid.UUID, exists bool)

Owner returns the value of the "owner" field in the mutation.

func (*SearchQueryMutation) Query

func (m *SearchQueryMutation) Query() (r string, exists bool)

Query returns the value of the "query" field in the mutation.

func (*SearchQueryMutation) RemovedEdges

func (m *SearchQueryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SearchQueryMutation) RemovedIDs

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) ResetCreated

func (m *SearchQueryMutation) ResetCreated()

ResetCreated resets all changes to the "created" field.

func (*SearchQueryMutation) ResetEdge

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) ResetField

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) ResetOwner

func (m *SearchQueryMutation) ResetOwner()

ResetOwner resets all changes to the "owner" field.

func (*SearchQueryMutation) ResetQuery

func (m *SearchQueryMutation) ResetQuery()

ResetQuery resets all changes to the "query" field.

func (*SearchQueryMutation) ResetUser

func (m *SearchQueryMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*SearchQueryMutation) SetCreated

func (m *SearchQueryMutation) SetCreated(t time.Time)

SetCreated sets the "created" field.

func (*SearchQueryMutation) SetField

func (m *SearchQueryMutation) 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 (*SearchQueryMutation) SetID

func (m *SearchQueryMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of SearchQuery entities.

func (*SearchQueryMutation) SetOp

func (m *SearchQueryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SearchQueryMutation) SetOwner

func (m *SearchQueryMutation) SetOwner(u uuid.UUID)

SetOwner sets the "owner" field.

func (*SearchQueryMutation) SetQuery

func (m *SearchQueryMutation) SetQuery(s string)

SetQuery sets the "query" field.

func (*SearchQueryMutation) SetUserID

func (m *SearchQueryMutation) SetUserID(id uuid.UUID)

SetUserID sets the "user" edge to the User entity by id.

func (SearchQueryMutation) Tx

func (m SearchQueryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SearchQueryMutation) Type

func (m *SearchQueryMutation) Type() string

Type returns the node type of this mutation (SearchQuery).

func (*SearchQueryMutation) UserCleared

func (m *SearchQueryMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*SearchQueryMutation) UserID

func (m *SearchQueryMutation) UserID() (id uuid.UUID, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*SearchQueryMutation) UserIDs

func (m *SearchQueryMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*SearchQueryMutation) Where

func (m *SearchQueryMutation) Where(ps ...predicate.SearchQuery)

Where appends a list predicates to the SearchQueryMutation builder.

func (*SearchQueryMutation) WhereP

func (m *SearchQueryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SearchQueryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SearchQueryQuery

type SearchQueryQuery struct {
	// contains filtered or unexported fields
}

SearchQueryQuery is the builder for querying SearchQuery entities.

func (*SearchQueryQuery) Aggregate

func (sqq *SearchQueryQuery) Aggregate(fns ...AggregateFunc) *SearchQuerySelect

Aggregate returns a SearchQuerySelect configured with the given aggregations.

func (*SearchQueryQuery) All

func (sqq *SearchQueryQuery) All(ctx context.Context) ([]*SearchQuery, error)

All executes the query and returns a list of SearchQueries.

func (*SearchQueryQuery) AllX

func (sqq *SearchQueryQuery) AllX(ctx context.Context) []*SearchQuery

AllX is like All, but panics if an error occurs.

func (*SearchQueryQuery) Clone

func (sqq *SearchQueryQuery) Clone() *SearchQueryQuery

Clone returns a duplicate of the SearchQueryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SearchQueryQuery) Count

func (sqq *SearchQueryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SearchQueryQuery) CountX

func (sqq *SearchQueryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SearchQueryQuery) Exist

func (sqq *SearchQueryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SearchQueryQuery) ExistX

func (sqq *SearchQueryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SearchQueryQuery) First

func (sqq *SearchQueryQuery) First(ctx context.Context) (*SearchQuery, error)

First returns the first SearchQuery entity from the query. Returns a *NotFoundError when no SearchQuery was found.

func (*SearchQueryQuery) FirstID

func (sqq *SearchQueryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first SearchQuery ID from the query. Returns a *NotFoundError when no SearchQuery ID was found.

func (*SearchQueryQuery) FirstIDX

func (sqq *SearchQueryQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SearchQueryQuery) FirstX

func (sqq *SearchQueryQuery) FirstX(ctx context.Context) *SearchQuery

FirstX is like First, but panics if an error occurs.

func (*SearchQueryQuery) GroupBy

func (sqq *SearchQueryQuery) GroupBy(field string, fields ...string) *SearchQueryGroupBy

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 {
	Query string `json:"query,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SearchQuery.Query().
	GroupBy(searchquery.FieldQuery).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SearchQueryQuery) IDs

func (sqq *SearchQueryQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of SearchQuery IDs.

func (*SearchQueryQuery) IDsX

func (sqq *SearchQueryQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SearchQueryQuery) Limit

func (sqq *SearchQueryQuery) Limit(limit int) *SearchQueryQuery

Limit the number of records to be returned by this query.

func (*SearchQueryQuery) Offset

func (sqq *SearchQueryQuery) Offset(offset int) *SearchQueryQuery

Offset to start from.

func (*SearchQueryQuery) Only

func (sqq *SearchQueryQuery) Only(ctx context.Context) (*SearchQuery, error)

Only returns a single SearchQuery entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SearchQuery entity is found. Returns a *NotFoundError when no SearchQuery entities are found.

func (*SearchQueryQuery) OnlyID

func (sqq *SearchQueryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only SearchQuery ID in the query. Returns a *NotSingularError when more than one SearchQuery ID is found. Returns a *NotFoundError when no entities are found.

func (*SearchQueryQuery) OnlyIDX

func (sqq *SearchQueryQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SearchQueryQuery) OnlyX

func (sqq *SearchQueryQuery) OnlyX(ctx context.Context) *SearchQuery

OnlyX is like Only, but panics if an error occurs.

func (*SearchQueryQuery) Order

Order specifies how the records should be ordered.

func (*SearchQueryQuery) QueryUser

func (sqq *SearchQueryQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*SearchQueryQuery) Select

func (sqq *SearchQueryQuery) Select(fields ...string) *SearchQuerySelect

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 {
	Query string `json:"query,omitempty"`
}

client.SearchQuery.Query().
	Select(searchquery.FieldQuery).
	Scan(ctx, &v)

func (*SearchQueryQuery) Unique

func (sqq *SearchQueryQuery) Unique(unique bool) *SearchQueryQuery

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 (*SearchQueryQuery) Where

Where adds a new predicate for the SearchQueryQuery builder.

func (*SearchQueryQuery) WithUser

func (sqq *SearchQueryQuery) WithUser(opts ...func(*UserQuery)) *SearchQueryQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type SearchQuerySelect

type SearchQuerySelect struct {
	*SearchQueryQuery
	// contains filtered or unexported fields
}

SearchQuerySelect is the builder for selecting fields of SearchQuery entities.

func (*SearchQuerySelect) Aggregate

func (sqs *SearchQuerySelect) Aggregate(fns ...AggregateFunc) *SearchQuerySelect

Aggregate adds the given aggregation functions to the selector query.

func (*SearchQuerySelect) Bool

func (s *SearchQuerySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) BoolX

func (s *SearchQuerySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SearchQuerySelect) Bools

func (s *SearchQuerySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) BoolsX

func (s *SearchQuerySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SearchQuerySelect) Float64

func (s *SearchQuerySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) Float64X

func (s *SearchQuerySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SearchQuerySelect) Float64s

func (s *SearchQuerySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) Float64sX

func (s *SearchQuerySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SearchQuerySelect) Int

func (s *SearchQuerySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) IntX

func (s *SearchQuerySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SearchQuerySelect) Ints

func (s *SearchQuerySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) IntsX

func (s *SearchQuerySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SearchQuerySelect) Scan

func (sqs *SearchQuerySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SearchQuerySelect) ScanX

func (s *SearchQuerySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SearchQuerySelect) String

func (s *SearchQuerySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) StringX

func (s *SearchQuerySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SearchQuerySelect) Strings

func (s *SearchQuerySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SearchQuerySelect) StringsX

func (s *SearchQuerySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SearchQueryUpdate

type SearchQueryUpdate struct {
	// contains filtered or unexported fields
}

SearchQueryUpdate is the builder for updating SearchQuery entities.

func (*SearchQueryUpdate) Exec

func (squ *SearchQueryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SearchQueryUpdate) ExecX

func (squ *SearchQueryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SearchQueryUpdate) Mutation

func (squ *SearchQueryUpdate) Mutation() *SearchQueryMutation

Mutation returns the SearchQueryMutation object of the builder.

func (*SearchQueryUpdate) Save

func (squ *SearchQueryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SearchQueryUpdate) SaveX

func (squ *SearchQueryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SearchQueryUpdate) Where

Where appends a list predicates to the SearchQueryUpdate builder.

type SearchQueryUpdateOne

type SearchQueryUpdateOne struct {
	// contains filtered or unexported fields
}

SearchQueryUpdateOne is the builder for updating a single SearchQuery entity.

func (*SearchQueryUpdateOne) Exec

func (squo *SearchQueryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SearchQueryUpdateOne) ExecX

func (squo *SearchQueryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SearchQueryUpdateOne) Mutation

func (squo *SearchQueryUpdateOne) Mutation() *SearchQueryMutation

Mutation returns the SearchQueryMutation object of the builder.

func (*SearchQueryUpdateOne) Save

Save executes the query and returns the updated SearchQuery entity.

func (*SearchQueryUpdateOne) SaveX

func (squo *SearchQueryUpdateOne) SaveX(ctx context.Context) *SearchQuery

SaveX is like Save, but panics if an error occurs.

func (*SearchQueryUpdateOne) Select

func (squo *SearchQueryUpdateOne) Select(field string, fields ...string) *SearchQueryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SearchQueryUpdateOne) Where

Where appends a list predicates to the SearchQueryUpdate builder.

type Settings

type Settings struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// api key for the hibp service
	HibpAPIKey string `json:"-"`
	// api key for the dehashed.com service
	DehashedAPIKey string `json:"-"`
	// the number of searches performed
	Searches uint64 `json:"searches,omitempty"`
	// contains filtered or unexported fields
}

Settings is the model entity for the Settings schema.

func (*Settings) String

func (s *Settings) String() string

String implements the fmt.Stringer.

func (*Settings) Unwrap

func (s *Settings) Unwrap() *Settings

Unwrap unwraps the Settings 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 (*Settings) Update

func (s *Settings) Update() *SettingsUpdateOne

Update returns a builder for updating this Settings. Note that you need to call Settings.Unwrap() before calling this method if this Settings was returned from a transaction, and the transaction was committed or rolled back.

func (*Settings) Value

func (s *Settings) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Settings. This includes values selected through modifiers, order, etc.

type SettingsClient

type SettingsClient struct {
	// contains filtered or unexported fields
}

SettingsClient is a client for the Settings schema.

func NewSettingsClient

func NewSettingsClient(c config) *SettingsClient

NewSettingsClient returns a client for the Settings from the given config.

func (*SettingsClient) Create

func (c *SettingsClient) Create() *SettingsCreate

Create returns a builder for creating a Settings entity.

func (*SettingsClient) CreateBulk

func (c *SettingsClient) CreateBulk(builders ...*SettingsCreate) *SettingsCreateBulk

CreateBulk returns a builder for creating a bulk of Settings entities.

func (*SettingsClient) Delete

func (c *SettingsClient) Delete() *SettingsDelete

Delete returns a delete builder for Settings.

func (*SettingsClient) DeleteOne

func (c *SettingsClient) DeleteOne(s *Settings) *SettingsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SettingsClient) DeleteOneID

func (c *SettingsClient) DeleteOneID(id uuid.UUID) *SettingsDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SettingsClient) Get

func (c *SettingsClient) Get(ctx context.Context, id uuid.UUID) (*Settings, error)

Get returns a Settings entity by its id.

func (*SettingsClient) GetX

func (c *SettingsClient) GetX(ctx context.Context, id uuid.UUID) *Settings

GetX is like Get, but panics if an error occurs.

func (*SettingsClient) Hooks

func (c *SettingsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SettingsClient) Intercept

func (c *SettingsClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `settings.Intercept(f(g(h())))`.

func (*SettingsClient) Interceptors

func (c *SettingsClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SettingsClient) Query

func (c *SettingsClient) Query() *SettingsQuery

Query returns a query builder for Settings.

func (*SettingsClient) Update

func (c *SettingsClient) Update() *SettingsUpdate

Update returns an update builder for Settings.

func (*SettingsClient) UpdateOne

func (c *SettingsClient) UpdateOne(s *Settings) *SettingsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SettingsClient) UpdateOneID

func (c *SettingsClient) UpdateOneID(id uuid.UUID) *SettingsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SettingsClient) Use

func (c *SettingsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `settings.Hooks(f(g(h())))`.

type SettingsCreate

type SettingsCreate struct {
	// contains filtered or unexported fields
}

SettingsCreate is the builder for creating a Settings entity.

func (*SettingsCreate) Exec

func (sc *SettingsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsCreate) ExecX

func (sc *SettingsCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsCreate) Mutation

func (sc *SettingsCreate) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsCreate) Save

func (sc *SettingsCreate) Save(ctx context.Context) (*Settings, error)

Save creates the Settings in the database.

func (*SettingsCreate) SaveX

func (sc *SettingsCreate) SaveX(ctx context.Context) *Settings

SaveX calls Save and panics if Save returns an error.

func (*SettingsCreate) SetDehashedAPIKey

func (sc *SettingsCreate) SetDehashedAPIKey(s string) *SettingsCreate

SetDehashedAPIKey sets the "dehashed_api_key" field.

func (*SettingsCreate) SetHibpAPIKey

func (sc *SettingsCreate) SetHibpAPIKey(s string) *SettingsCreate

SetHibpAPIKey sets the "hibp_api_key" field.

func (*SettingsCreate) SetID

func (sc *SettingsCreate) SetID(u uuid.UUID) *SettingsCreate

SetID sets the "id" field.

func (*SettingsCreate) SetNillableDehashedAPIKey

func (sc *SettingsCreate) SetNillableDehashedAPIKey(s *string) *SettingsCreate

SetNillableDehashedAPIKey sets the "dehashed_api_key" field if the given value is not nil.

func (*SettingsCreate) SetNillableHibpAPIKey

func (sc *SettingsCreate) SetNillableHibpAPIKey(s *string) *SettingsCreate

SetNillableHibpAPIKey sets the "hibp_api_key" field if the given value is not nil.

func (*SettingsCreate) SetNillableID

func (sc *SettingsCreate) SetNillableID(u *uuid.UUID) *SettingsCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SettingsCreate) SetNillableSearches

func (sc *SettingsCreate) SetNillableSearches(u *uint64) *SettingsCreate

SetNillableSearches sets the "searches" field if the given value is not nil.

func (*SettingsCreate) SetSearches

func (sc *SettingsCreate) SetSearches(u uint64) *SettingsCreate

SetSearches sets the "searches" field.

type SettingsCreateBulk

type SettingsCreateBulk struct {
	// contains filtered or unexported fields
}

SettingsCreateBulk is the builder for creating many Settings entities in bulk.

func (*SettingsCreateBulk) Exec

func (scb *SettingsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsCreateBulk) ExecX

func (scb *SettingsCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsCreateBulk) Save

func (scb *SettingsCreateBulk) Save(ctx context.Context) ([]*Settings, error)

Save creates the Settings entities in the database.

func (*SettingsCreateBulk) SaveX

func (scb *SettingsCreateBulk) SaveX(ctx context.Context) []*Settings

SaveX is like Save, but panics if an error occurs.

type SettingsDelete

type SettingsDelete struct {
	// contains filtered or unexported fields
}

SettingsDelete is the builder for deleting a Settings entity.

func (*SettingsDelete) Exec

func (sd *SettingsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SettingsDelete) ExecX

func (sd *SettingsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SettingsDelete) Where

func (sd *SettingsDelete) Where(ps ...predicate.Settings) *SettingsDelete

Where appends a list predicates to the SettingsDelete builder.

type SettingsDeleteOne

type SettingsDeleteOne struct {
	// contains filtered or unexported fields
}

SettingsDeleteOne is the builder for deleting a single Settings entity.

func (*SettingsDeleteOne) Exec

func (sdo *SettingsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SettingsDeleteOne) ExecX

func (sdo *SettingsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsDeleteOne) Where

Where appends a list predicates to the SettingsDelete builder.

type SettingsGroupBy

type SettingsGroupBy struct {
	// contains filtered or unexported fields
}

SettingsGroupBy is the group-by builder for Settings entities.

func (*SettingsGroupBy) Aggregate

func (sgb *SettingsGroupBy) Aggregate(fns ...AggregateFunc) *SettingsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SettingsGroupBy) Bool

func (s *SettingsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) BoolX

func (s *SettingsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SettingsGroupBy) Bools

func (s *SettingsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) BoolsX

func (s *SettingsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SettingsGroupBy) Float64

func (s *SettingsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) Float64X

func (s *SettingsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SettingsGroupBy) Float64s

func (s *SettingsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) Float64sX

func (s *SettingsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SettingsGroupBy) Int

func (s *SettingsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) IntX

func (s *SettingsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SettingsGroupBy) Ints

func (s *SettingsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) IntsX

func (s *SettingsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SettingsGroupBy) Scan

func (sgb *SettingsGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SettingsGroupBy) ScanX

func (s *SettingsGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SettingsGroupBy) String

func (s *SettingsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) StringX

func (s *SettingsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SettingsGroupBy) Strings

func (s *SettingsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SettingsGroupBy) StringsX

func (s *SettingsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SettingsMutation

type SettingsMutation struct {
	// contains filtered or unexported fields
}

SettingsMutation represents an operation that mutates the Settings nodes in the graph.

func (*SettingsMutation) AddField

func (m *SettingsMutation) 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 (*SettingsMutation) AddSearches

func (m *SettingsMutation) AddSearches(u int64)

AddSearches adds u to the "searches" field.

func (*SettingsMutation) AddedEdges

func (m *SettingsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SettingsMutation) AddedField

func (m *SettingsMutation) 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 (*SettingsMutation) AddedFields

func (m *SettingsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SettingsMutation) AddedIDs

func (m *SettingsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SettingsMutation) AddedSearches

func (m *SettingsMutation) AddedSearches() (r int64, exists bool)

AddedSearches returns the value that was added to the "searches" field in this mutation.

func (*SettingsMutation) ClearDehashedAPIKey

func (m *SettingsMutation) ClearDehashedAPIKey()

ClearDehashedAPIKey clears the value of the "dehashed_api_key" field.

func (*SettingsMutation) ClearEdge

func (m *SettingsMutation) 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 (*SettingsMutation) ClearField

func (m *SettingsMutation) 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 (*SettingsMutation) ClearHibpAPIKey

func (m *SettingsMutation) ClearHibpAPIKey()

ClearHibpAPIKey clears the value of the "hibp_api_key" field.

func (*SettingsMutation) ClearedEdges

func (m *SettingsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SettingsMutation) ClearedFields

func (m *SettingsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SettingsMutation) Client

func (m SettingsMutation) 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 (*SettingsMutation) DehashedAPIKey

func (m *SettingsMutation) DehashedAPIKey() (r string, exists bool)

DehashedAPIKey returns the value of the "dehashed_api_key" field in the mutation.

func (*SettingsMutation) DehashedAPIKeyCleared

func (m *SettingsMutation) DehashedAPIKeyCleared() bool

DehashedAPIKeyCleared returns if the "dehashed_api_key" field was cleared in this mutation.

func (*SettingsMutation) EdgeCleared

func (m *SettingsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SettingsMutation) Field

func (m *SettingsMutation) 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 (*SettingsMutation) FieldCleared

func (m *SettingsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SettingsMutation) Fields

func (m *SettingsMutation) 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 (*SettingsMutation) HibpAPIKey

func (m *SettingsMutation) HibpAPIKey() (r string, exists bool)

HibpAPIKey returns the value of the "hibp_api_key" field in the mutation.

func (*SettingsMutation) HibpAPIKeyCleared

func (m *SettingsMutation) HibpAPIKeyCleared() bool

HibpAPIKeyCleared returns if the "hibp_api_key" field was cleared in this mutation.

func (*SettingsMutation) ID

func (m *SettingsMutation) ID() (id uuid.UUID, 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 (*SettingsMutation) IDs

func (m *SettingsMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*SettingsMutation) OldDehashedAPIKey

func (m *SettingsMutation) OldDehashedAPIKey(ctx context.Context) (v string, err error)

OldDehashedAPIKey returns the old "dehashed_api_key" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldField

func (m *SettingsMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*SettingsMutation) OldHibpAPIKey

func (m *SettingsMutation) OldHibpAPIKey(ctx context.Context) (v string, err error)

OldHibpAPIKey returns the old "hibp_api_key" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldSearches

func (m *SettingsMutation) OldSearches(ctx context.Context) (v uint64, err error)

OldSearches returns the old "searches" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) Op

func (m *SettingsMutation) Op() Op

Op returns the operation name.

func (*SettingsMutation) RemovedEdges

func (m *SettingsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SettingsMutation) RemovedIDs

func (m *SettingsMutation) 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 (*SettingsMutation) ResetDehashedAPIKey

func (m *SettingsMutation) ResetDehashedAPIKey()

ResetDehashedAPIKey resets all changes to the "dehashed_api_key" field.

func (*SettingsMutation) ResetEdge

func (m *SettingsMutation) 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 (*SettingsMutation) ResetField

func (m *SettingsMutation) 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 (*SettingsMutation) ResetHibpAPIKey

func (m *SettingsMutation) ResetHibpAPIKey()

ResetHibpAPIKey resets all changes to the "hibp_api_key" field.

func (*SettingsMutation) ResetSearches

func (m *SettingsMutation) ResetSearches()

ResetSearches resets all changes to the "searches" field.

func (*SettingsMutation) Searches

func (m *SettingsMutation) Searches() (r uint64, exists bool)

Searches returns the value of the "searches" field in the mutation.

func (*SettingsMutation) SetDehashedAPIKey

func (m *SettingsMutation) SetDehashedAPIKey(s string)

SetDehashedAPIKey sets the "dehashed_api_key" field.

func (*SettingsMutation) SetField

func (m *SettingsMutation) 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 (*SettingsMutation) SetHibpAPIKey

func (m *SettingsMutation) SetHibpAPIKey(s string)

SetHibpAPIKey sets the "hibp_api_key" field.

func (*SettingsMutation) SetID

func (m *SettingsMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Settings entities.

func (*SettingsMutation) SetOp

func (m *SettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SettingsMutation) SetSearches

func (m *SettingsMutation) SetSearches(u uint64)

SetSearches sets the "searches" field.

func (SettingsMutation) Tx

func (m SettingsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SettingsMutation) Type

func (m *SettingsMutation) Type() string

Type returns the node type of this mutation (Settings).

func (*SettingsMutation) Where

func (m *SettingsMutation) Where(ps ...predicate.Settings)

Where appends a list predicates to the SettingsMutation builder.

func (*SettingsMutation) WhereP

func (m *SettingsMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SettingsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SettingsQuery

type SettingsQuery struct {
	// contains filtered or unexported fields
}

SettingsQuery is the builder for querying Settings entities.

func (*SettingsQuery) Aggregate

func (sq *SettingsQuery) Aggregate(fns ...AggregateFunc) *SettingsSelect

Aggregate returns a SettingsSelect configured with the given aggregations.

func (*SettingsQuery) All

func (sq *SettingsQuery) All(ctx context.Context) ([]*Settings, error)

All executes the query and returns a list of SettingsSlice.

func (*SettingsQuery) AllX

func (sq *SettingsQuery) AllX(ctx context.Context) []*Settings

AllX is like All, but panics if an error occurs.

func (*SettingsQuery) Clone

func (sq *SettingsQuery) Clone() *SettingsQuery

Clone returns a duplicate of the SettingsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SettingsQuery) Count

func (sq *SettingsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SettingsQuery) CountX

func (sq *SettingsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SettingsQuery) Exist

func (sq *SettingsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SettingsQuery) ExistX

func (sq *SettingsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SettingsQuery) First

func (sq *SettingsQuery) First(ctx context.Context) (*Settings, error)

First returns the first Settings entity from the query. Returns a *NotFoundError when no Settings was found.

func (*SettingsQuery) FirstID

func (sq *SettingsQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Settings ID from the query. Returns a *NotFoundError when no Settings ID was found.

func (*SettingsQuery) FirstIDX

func (sq *SettingsQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SettingsQuery) FirstX

func (sq *SettingsQuery) FirstX(ctx context.Context) *Settings

FirstX is like First, but panics if an error occurs.

func (*SettingsQuery) GroupBy

func (sq *SettingsQuery) GroupBy(field string, fields ...string) *SettingsGroupBy

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 {
	HibpAPIKey string `json:"hibp_api_key,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Settings.Query().
	GroupBy(settings.FieldHibpAPIKey).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SettingsQuery) IDs

func (sq *SettingsQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Settings IDs.

func (*SettingsQuery) IDsX

func (sq *SettingsQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SettingsQuery) Limit

func (sq *SettingsQuery) Limit(limit int) *SettingsQuery

Limit the number of records to be returned by this query.

func (*SettingsQuery) Offset

func (sq *SettingsQuery) Offset(offset int) *SettingsQuery

Offset to start from.

func (*SettingsQuery) Only

func (sq *SettingsQuery) Only(ctx context.Context) (*Settings, error)

Only returns a single Settings entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Settings entity is found. Returns a *NotFoundError when no Settings entities are found.

func (*SettingsQuery) OnlyID

func (sq *SettingsQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Settings ID in the query. Returns a *NotSingularError when more than one Settings ID is found. Returns a *NotFoundError when no entities are found.

func (*SettingsQuery) OnlyIDX

func (sq *SettingsQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SettingsQuery) OnlyX

func (sq *SettingsQuery) OnlyX(ctx context.Context) *Settings

OnlyX is like Only, but panics if an error occurs.

func (*SettingsQuery) Order

Order specifies how the records should be ordered.

func (*SettingsQuery) Select

func (sq *SettingsQuery) Select(fields ...string) *SettingsSelect

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 {
	HibpAPIKey string `json:"hibp_api_key,omitempty"`
}

client.Settings.Query().
	Select(settings.FieldHibpAPIKey).
	Scan(ctx, &v)

func (*SettingsQuery) Unique

func (sq *SettingsQuery) Unique(unique bool) *SettingsQuery

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 (*SettingsQuery) Where

func (sq *SettingsQuery) Where(ps ...predicate.Settings) *SettingsQuery

Where adds a new predicate for the SettingsQuery builder.

type SettingsSelect

type SettingsSelect struct {
	*SettingsQuery
	// contains filtered or unexported fields
}

SettingsSelect is the builder for selecting fields of Settings entities.

func (*SettingsSelect) Aggregate

func (ss *SettingsSelect) Aggregate(fns ...AggregateFunc) *SettingsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SettingsSelect) Bool

func (s *SettingsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) BoolX

func (s *SettingsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SettingsSelect) Bools

func (s *SettingsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) BoolsX

func (s *SettingsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SettingsSelect) Float64

func (s *SettingsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) Float64X

func (s *SettingsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SettingsSelect) Float64s

func (s *SettingsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) Float64sX

func (s *SettingsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SettingsSelect) Int

func (s *SettingsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) IntX

func (s *SettingsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SettingsSelect) Ints

func (s *SettingsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) IntsX

func (s *SettingsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SettingsSelect) Scan

func (ss *SettingsSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SettingsSelect) ScanX

func (s *SettingsSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SettingsSelect) String

func (s *SettingsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) StringX

func (s *SettingsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SettingsSelect) Strings

func (s *SettingsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SettingsSelect) StringsX

func (s *SettingsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SettingsSlice

type SettingsSlice []*Settings

SettingsSlice is a parsable slice of Settings.

type SettingsUpdate

type SettingsUpdate struct {
	// contains filtered or unexported fields
}

SettingsUpdate is the builder for updating Settings entities.

func (*SettingsUpdate) AddSearches

func (su *SettingsUpdate) AddSearches(u int64) *SettingsUpdate

AddSearches adds u to the "searches" field.

func (*SettingsUpdate) ClearDehashedAPIKey

func (su *SettingsUpdate) ClearDehashedAPIKey() *SettingsUpdate

ClearDehashedAPIKey clears the value of the "dehashed_api_key" field.

func (*SettingsUpdate) ClearHibpAPIKey

func (su *SettingsUpdate) ClearHibpAPIKey() *SettingsUpdate

ClearHibpAPIKey clears the value of the "hibp_api_key" field.

func (*SettingsUpdate) Exec

func (su *SettingsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsUpdate) ExecX

func (su *SettingsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsUpdate) Mutation

func (su *SettingsUpdate) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsUpdate) Save

func (su *SettingsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SettingsUpdate) SaveX

func (su *SettingsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SettingsUpdate) SetDehashedAPIKey

func (su *SettingsUpdate) SetDehashedAPIKey(s string) *SettingsUpdate

SetDehashedAPIKey sets the "dehashed_api_key" field.

func (*SettingsUpdate) SetHibpAPIKey

func (su *SettingsUpdate) SetHibpAPIKey(s string) *SettingsUpdate

SetHibpAPIKey sets the "hibp_api_key" field.

func (*SettingsUpdate) SetNillableDehashedAPIKey

func (su *SettingsUpdate) SetNillableDehashedAPIKey(s *string) *SettingsUpdate

SetNillableDehashedAPIKey sets the "dehashed_api_key" field if the given value is not nil.

func (*SettingsUpdate) SetNillableHibpAPIKey

func (su *SettingsUpdate) SetNillableHibpAPIKey(s *string) *SettingsUpdate

SetNillableHibpAPIKey sets the "hibp_api_key" field if the given value is not nil.

func (*SettingsUpdate) SetNillableSearches

func (su *SettingsUpdate) SetNillableSearches(u *uint64) *SettingsUpdate

SetNillableSearches sets the "searches" field if the given value is not nil.

func (*SettingsUpdate) SetSearches

func (su *SettingsUpdate) SetSearches(u uint64) *SettingsUpdate

SetSearches sets the "searches" field.

func (*SettingsUpdate) Where

func (su *SettingsUpdate) Where(ps ...predicate.Settings) *SettingsUpdate

Where appends a list predicates to the SettingsUpdate builder.

type SettingsUpdateOne

type SettingsUpdateOne struct {
	// contains filtered or unexported fields
}

SettingsUpdateOne is the builder for updating a single Settings entity.

func (*SettingsUpdateOne) AddSearches

func (suo *SettingsUpdateOne) AddSearches(u int64) *SettingsUpdateOne

AddSearches adds u to the "searches" field.

func (*SettingsUpdateOne) ClearDehashedAPIKey

func (suo *SettingsUpdateOne) ClearDehashedAPIKey() *SettingsUpdateOne

ClearDehashedAPIKey clears the value of the "dehashed_api_key" field.

func (*SettingsUpdateOne) ClearHibpAPIKey

func (suo *SettingsUpdateOne) ClearHibpAPIKey() *SettingsUpdateOne

ClearHibpAPIKey clears the value of the "hibp_api_key" field.

func (*SettingsUpdateOne) Exec

func (suo *SettingsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SettingsUpdateOne) ExecX

func (suo *SettingsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SettingsUpdateOne) Mutation

func (suo *SettingsUpdateOne) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsUpdateOne) Save

func (suo *SettingsUpdateOne) Save(ctx context.Context) (*Settings, error)

Save executes the query and returns the updated Settings entity.

func (*SettingsUpdateOne) SaveX

func (suo *SettingsUpdateOne) SaveX(ctx context.Context) *Settings

SaveX is like Save, but panics if an error occurs.

func (*SettingsUpdateOne) Select

func (suo *SettingsUpdateOne) Select(field string, fields ...string) *SettingsUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SettingsUpdateOne) SetDehashedAPIKey

func (suo *SettingsUpdateOne) SetDehashedAPIKey(s string) *SettingsUpdateOne

SetDehashedAPIKey sets the "dehashed_api_key" field.

func (*SettingsUpdateOne) SetHibpAPIKey

func (suo *SettingsUpdateOne) SetHibpAPIKey(s string) *SettingsUpdateOne

SetHibpAPIKey sets the "hibp_api_key" field.

func (*SettingsUpdateOne) SetNillableDehashedAPIKey

func (suo *SettingsUpdateOne) SetNillableDehashedAPIKey(s *string) *SettingsUpdateOne

SetNillableDehashedAPIKey sets the "dehashed_api_key" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableHibpAPIKey

func (suo *SettingsUpdateOne) SetNillableHibpAPIKey(s *string) *SettingsUpdateOne

SetNillableHibpAPIKey sets the "hibp_api_key" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableSearches

func (suo *SettingsUpdateOne) SetNillableSearches(u *uint64) *SettingsUpdateOne

SetNillableSearches sets the "searches" field if the given value is not nil.

func (*SettingsUpdateOne) SetSearches

func (suo *SettingsUpdateOne) SetSearches(u uint64) *SettingsUpdateOne

SetSearches sets the "searches" field.

func (*SettingsUpdateOne) Where

Where appends a list predicates to the SettingsUpdate builder.

type Setup

type Setup struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SetUpAt holds the value of the "set_up_at" field.
	SetUpAt time.Time `json:"set_up_at,omitempty"`
	// contains filtered or unexported fields
}

Setup is the model entity for the Setup schema.

func (*Setup) String

func (s *Setup) String() string

String implements the fmt.Stringer.

func (*Setup) Unwrap

func (s *Setup) Unwrap() *Setup

Unwrap unwraps the Setup 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 (*Setup) Update

func (s *Setup) Update() *SetupUpdateOne

Update returns a builder for updating this Setup. Note that you need to call Setup.Unwrap() before calling this method if this Setup was returned from a transaction, and the transaction was committed or rolled back.

func (*Setup) Value

func (s *Setup) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Setup. This includes values selected through modifiers, order, etc.

type SetupClient

type SetupClient struct {
	// contains filtered or unexported fields
}

SetupClient is a client for the Setup schema.

func NewSetupClient

func NewSetupClient(c config) *SetupClient

NewSetupClient returns a client for the Setup from the given config.

func (*SetupClient) Create

func (c *SetupClient) Create() *SetupCreate

Create returns a builder for creating a Setup entity.

func (*SetupClient) CreateBulk

func (c *SetupClient) CreateBulk(builders ...*SetupCreate) *SetupCreateBulk

CreateBulk returns a builder for creating a bulk of Setup entities.

func (*SetupClient) Delete

func (c *SetupClient) Delete() *SetupDelete

Delete returns a delete builder for Setup.

func (*SetupClient) DeleteOne

func (c *SetupClient) DeleteOne(s *Setup) *SetupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SetupClient) DeleteOneID

func (c *SetupClient) DeleteOneID(id uuid.UUID) *SetupDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SetupClient) Get

func (c *SetupClient) Get(ctx context.Context, id uuid.UUID) (*Setup, error)

Get returns a Setup entity by its id.

func (*SetupClient) GetX

func (c *SetupClient) GetX(ctx context.Context, id uuid.UUID) *Setup

GetX is like Get, but panics if an error occurs.

func (*SetupClient) Hooks

func (c *SetupClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SetupClient) Intercept

func (c *SetupClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `setup.Intercept(f(g(h())))`.

func (*SetupClient) Interceptors

func (c *SetupClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SetupClient) Query

func (c *SetupClient) Query() *SetupQuery

Query returns a query builder for Setup.

func (*SetupClient) Update

func (c *SetupClient) Update() *SetupUpdate

Update returns an update builder for Setup.

func (*SetupClient) UpdateOne

func (c *SetupClient) UpdateOne(s *Setup) *SetupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SetupClient) UpdateOneID

func (c *SetupClient) UpdateOneID(id uuid.UUID) *SetupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SetupClient) Use

func (c *SetupClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `setup.Hooks(f(g(h())))`.

type SetupCreate

type SetupCreate struct {
	// contains filtered or unexported fields
}

SetupCreate is the builder for creating a Setup entity.

func (*SetupCreate) Exec

func (sc *SetupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetupCreate) ExecX

func (sc *SetupCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetupCreate) Mutation

func (sc *SetupCreate) Mutation() *SetupMutation

Mutation returns the SetupMutation object of the builder.

func (*SetupCreate) Save

func (sc *SetupCreate) Save(ctx context.Context) (*Setup, error)

Save creates the Setup in the database.

func (*SetupCreate) SaveX

func (sc *SetupCreate) SaveX(ctx context.Context) *Setup

SaveX calls Save and panics if Save returns an error.

func (*SetupCreate) SetID

func (sc *SetupCreate) SetID(u uuid.UUID) *SetupCreate

SetID sets the "id" field.

func (*SetupCreate) SetNillableID

func (sc *SetupCreate) SetNillableID(u *uuid.UUID) *SetupCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SetupCreate) SetNillableSetUpAt

func (sc *SetupCreate) SetNillableSetUpAt(t *time.Time) *SetupCreate

SetNillableSetUpAt sets the "set_up_at" field if the given value is not nil.

func (*SetupCreate) SetSetUpAt

func (sc *SetupCreate) SetSetUpAt(t time.Time) *SetupCreate

SetSetUpAt sets the "set_up_at" field.

type SetupCreateBulk

type SetupCreateBulk struct {
	// contains filtered or unexported fields
}

SetupCreateBulk is the builder for creating many Setup entities in bulk.

func (*SetupCreateBulk) Exec

func (scb *SetupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SetupCreateBulk) ExecX

func (scb *SetupCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetupCreateBulk) Save

func (scb *SetupCreateBulk) Save(ctx context.Context) ([]*Setup, error)

Save creates the Setup entities in the database.

func (*SetupCreateBulk) SaveX

func (scb *SetupCreateBulk) SaveX(ctx context.Context) []*Setup

SaveX is like Save, but panics if an error occurs.

type SetupDelete

type SetupDelete struct {
	// contains filtered or unexported fields
}

SetupDelete is the builder for deleting a Setup entity.

func (*SetupDelete) Exec

func (sd *SetupDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SetupDelete) ExecX

func (sd *SetupDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SetupDelete) Where

func (sd *SetupDelete) Where(ps ...predicate.Setup) *SetupDelete

Where appends a list predicates to the SetupDelete builder.

type SetupDeleteOne

type SetupDeleteOne struct {
	// contains filtered or unexported fields
}

SetupDeleteOne is the builder for deleting a single Setup entity.

func (*SetupDeleteOne) Exec

func (sdo *SetupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SetupDeleteOne) ExecX

func (sdo *SetupDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetupDeleteOne) Where

func (sdo *SetupDeleteOne) Where(ps ...predicate.Setup) *SetupDeleteOne

Where appends a list predicates to the SetupDelete builder.

type SetupGroupBy

type SetupGroupBy struct {
	// contains filtered or unexported fields
}

SetupGroupBy is the group-by builder for Setup entities.

func (*SetupGroupBy) Aggregate

func (sgb *SetupGroupBy) Aggregate(fns ...AggregateFunc) *SetupGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SetupGroupBy) Bool

func (s *SetupGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) BoolX

func (s *SetupGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetupGroupBy) Bools

func (s *SetupGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) BoolsX

func (s *SetupGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SetupGroupBy) Float64

func (s *SetupGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) Float64X

func (s *SetupGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetupGroupBy) Float64s

func (s *SetupGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) Float64sX

func (s *SetupGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetupGroupBy) Int

func (s *SetupGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) IntX

func (s *SetupGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetupGroupBy) Ints

func (s *SetupGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) IntsX

func (s *SetupGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SetupGroupBy) Scan

func (sgb *SetupGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetupGroupBy) ScanX

func (s *SetupGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetupGroupBy) String

func (s *SetupGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) StringX

func (s *SetupGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetupGroupBy) Strings

func (s *SetupGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetupGroupBy) StringsX

func (s *SetupGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetupMutation

type SetupMutation struct {
	// contains filtered or unexported fields
}

SetupMutation represents an operation that mutates the Setup nodes in the graph.

func (*SetupMutation) AddField

func (m *SetupMutation) 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 (*SetupMutation) AddedEdges

func (m *SetupMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SetupMutation) AddedField

func (m *SetupMutation) 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 (*SetupMutation) AddedFields

func (m *SetupMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SetupMutation) AddedIDs

func (m *SetupMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SetupMutation) ClearEdge

func (m *SetupMutation) 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 (*SetupMutation) ClearField

func (m *SetupMutation) 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 (*SetupMutation) ClearedEdges

func (m *SetupMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SetupMutation) ClearedFields

func (m *SetupMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SetupMutation) Client

func (m SetupMutation) 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 (*SetupMutation) EdgeCleared

func (m *SetupMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SetupMutation) Field

func (m *SetupMutation) 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 (*SetupMutation) FieldCleared

func (m *SetupMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SetupMutation) Fields

func (m *SetupMutation) 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 (*SetupMutation) ID

func (m *SetupMutation) ID() (id uuid.UUID, 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 (*SetupMutation) IDs

func (m *SetupMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*SetupMutation) OldField

func (m *SetupMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*SetupMutation) OldSetUpAt

func (m *SetupMutation) OldSetUpAt(ctx context.Context) (v time.Time, err error)

OldSetUpAt returns the old "set_up_at" field's value of the Setup entity. If the Setup 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 (*SetupMutation) Op

func (m *SetupMutation) Op() Op

Op returns the operation name.

func (*SetupMutation) RemovedEdges

func (m *SetupMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SetupMutation) RemovedIDs

func (m *SetupMutation) 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 (*SetupMutation) ResetEdge

func (m *SetupMutation) 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 (*SetupMutation) ResetField

func (m *SetupMutation) 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 (*SetupMutation) ResetSetUpAt

func (m *SetupMutation) ResetSetUpAt()

ResetSetUpAt resets all changes to the "set_up_at" field.

func (*SetupMutation) SetField

func (m *SetupMutation) 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 (*SetupMutation) SetID

func (m *SetupMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Setup entities.

func (*SetupMutation) SetOp

func (m *SetupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SetupMutation) SetSetUpAt

func (m *SetupMutation) SetSetUpAt(t time.Time)

SetSetUpAt sets the "set_up_at" field.

func (*SetupMutation) SetUpAt

func (m *SetupMutation) SetUpAt() (r time.Time, exists bool)

SetUpAt returns the value of the "set_up_at" field in the mutation.

func (SetupMutation) Tx

func (m SetupMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SetupMutation) Type

func (m *SetupMutation) Type() string

Type returns the node type of this mutation (Setup).

func (*SetupMutation) Where

func (m *SetupMutation) Where(ps ...predicate.Setup)

Where appends a list predicates to the SetupMutation builder.

func (*SetupMutation) WhereP

func (m *SetupMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SetupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SetupQuery

type SetupQuery struct {
	// contains filtered or unexported fields
}

SetupQuery is the builder for querying Setup entities.

func (*SetupQuery) Aggregate

func (sq *SetupQuery) Aggregate(fns ...AggregateFunc) *SetupSelect

Aggregate returns a SetupSelect configured with the given aggregations.

func (*SetupQuery) All

func (sq *SetupQuery) All(ctx context.Context) ([]*Setup, error)

All executes the query and returns a list of Setups.

func (*SetupQuery) AllX

func (sq *SetupQuery) AllX(ctx context.Context) []*Setup

AllX is like All, but panics if an error occurs.

func (*SetupQuery) Clone

func (sq *SetupQuery) Clone() *SetupQuery

Clone returns a duplicate of the SetupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SetupQuery) Count

func (sq *SetupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SetupQuery) CountX

func (sq *SetupQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SetupQuery) Exist

func (sq *SetupQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SetupQuery) ExistX

func (sq *SetupQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SetupQuery) First

func (sq *SetupQuery) First(ctx context.Context) (*Setup, error)

First returns the first Setup entity from the query. Returns a *NotFoundError when no Setup was found.

func (*SetupQuery) FirstID

func (sq *SetupQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Setup ID from the query. Returns a *NotFoundError when no Setup ID was found.

func (*SetupQuery) FirstIDX

func (sq *SetupQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SetupQuery) FirstX

func (sq *SetupQuery) FirstX(ctx context.Context) *Setup

FirstX is like First, but panics if an error occurs.

func (*SetupQuery) GroupBy

func (sq *SetupQuery) GroupBy(field string, fields ...string) *SetupGroupBy

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 {
	SetUpAt time.Time `json:"set_up_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Setup.Query().
	GroupBy(setup.FieldSetUpAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SetupQuery) IDs

func (sq *SetupQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Setup IDs.

func (*SetupQuery) IDsX

func (sq *SetupQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SetupQuery) Limit

func (sq *SetupQuery) Limit(limit int) *SetupQuery

Limit the number of records to be returned by this query.

func (*SetupQuery) Offset

func (sq *SetupQuery) Offset(offset int) *SetupQuery

Offset to start from.

func (*SetupQuery) Only

func (sq *SetupQuery) Only(ctx context.Context) (*Setup, error)

Only returns a single Setup entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Setup entity is found. Returns a *NotFoundError when no Setup entities are found.

func (*SetupQuery) OnlyID

func (sq *SetupQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Setup ID in the query. Returns a *NotSingularError when more than one Setup ID is found. Returns a *NotFoundError when no entities are found.

func (*SetupQuery) OnlyIDX

func (sq *SetupQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SetupQuery) OnlyX

func (sq *SetupQuery) OnlyX(ctx context.Context) *Setup

OnlyX is like Only, but panics if an error occurs.

func (*SetupQuery) Order

func (sq *SetupQuery) Order(o ...setup.OrderOption) *SetupQuery

Order specifies how the records should be ordered.

func (*SetupQuery) Select

func (sq *SetupQuery) Select(fields ...string) *SetupSelect

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 {
	SetUpAt time.Time `json:"set_up_at,omitempty"`
}

client.Setup.Query().
	Select(setup.FieldSetUpAt).
	Scan(ctx, &v)

func (*SetupQuery) Unique

func (sq *SetupQuery) Unique(unique bool) *SetupQuery

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 (*SetupQuery) Where

func (sq *SetupQuery) Where(ps ...predicate.Setup) *SetupQuery

Where adds a new predicate for the SetupQuery builder.

type SetupSelect

type SetupSelect struct {
	*SetupQuery
	// contains filtered or unexported fields
}

SetupSelect is the builder for selecting fields of Setup entities.

func (*SetupSelect) Aggregate

func (ss *SetupSelect) Aggregate(fns ...AggregateFunc) *SetupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SetupSelect) Bool

func (s *SetupSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SetupSelect) BoolX

func (s *SetupSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SetupSelect) Bools

func (s *SetupSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SetupSelect) BoolsX

func (s *SetupSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SetupSelect) Float64

func (s *SetupSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SetupSelect) Float64X

func (s *SetupSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SetupSelect) Float64s

func (s *SetupSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SetupSelect) Float64sX

func (s *SetupSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SetupSelect) Int

func (s *SetupSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SetupSelect) IntX

func (s *SetupSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SetupSelect) Ints

func (s *SetupSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SetupSelect) IntsX

func (s *SetupSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SetupSelect) Scan

func (ss *SetupSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SetupSelect) ScanX

func (s *SetupSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SetupSelect) String

func (s *SetupSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SetupSelect) StringX

func (s *SetupSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SetupSelect) Strings

func (s *SetupSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SetupSelect) StringsX

func (s *SetupSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SetupUpdate

type SetupUpdate struct {
	// contains filtered or unexported fields
}

SetupUpdate is the builder for updating Setup entities.

func (*SetupUpdate) Exec

func (su *SetupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SetupUpdate) ExecX

func (su *SetupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetupUpdate) Mutation

func (su *SetupUpdate) Mutation() *SetupMutation

Mutation returns the SetupMutation object of the builder.

func (*SetupUpdate) Save

func (su *SetupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SetupUpdate) SaveX

func (su *SetupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SetupUpdate) Where

func (su *SetupUpdate) Where(ps ...predicate.Setup) *SetupUpdate

Where appends a list predicates to the SetupUpdate builder.

type SetupUpdateOne

type SetupUpdateOne struct {
	// contains filtered or unexported fields
}

SetupUpdateOne is the builder for updating a single Setup entity.

func (*SetupUpdateOne) Exec

func (suo *SetupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SetupUpdateOne) ExecX

func (suo *SetupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SetupUpdateOne) Mutation

func (suo *SetupUpdateOne) Mutation() *SetupMutation

Mutation returns the SetupMutation object of the builder.

func (*SetupUpdateOne) Save

func (suo *SetupUpdateOne) Save(ctx context.Context) (*Setup, error)

Save executes the query and returns the updated Setup entity.

func (*SetupUpdateOne) SaveX

func (suo *SetupUpdateOne) SaveX(ctx context.Context) *Setup

SaveX is like Save, but panics if an error occurs.

func (*SetupUpdateOne) Select

func (suo *SetupUpdateOne) Select(field string, fields ...string) *SetupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SetupUpdateOne) Where

func (suo *SetupUpdateOne) Where(ps ...predicate.Setup) *SetupUpdateOne

Where appends a list predicates to the SetupUpdate builder.

type Setups

type Setups []*Setup

Setups is a parsable slice of Setup.

type TrackedBreaches

type TrackedBreaches struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Breach holds the value of the "breach" field.
	Breach uuid.UUID `json:"breach,omitempty"`
	// Whether the breach is a locally added one or obtained from an online service
	Online bool `json:"online,omitempty"`
	// id of the user tracking the breach
	Owner uuid.UUID `json:"owner,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TrackedBreachesQuery when eager-loading is set.
	Edges TrackedBreachesEdges `json:"edges"`
	// contains filtered or unexported fields
}

TrackedBreaches is the model entity for the TrackedBreaches schema.

func (*TrackedBreaches) QueryHibp

func (tb *TrackedBreaches) QueryHibp() *HIBPQuery

QueryHibp queries the "hibp" edge of the TrackedBreaches entity.

func (*TrackedBreaches) QueryLocalbreach

func (tb *TrackedBreaches) QueryLocalbreach() *LocalBreachQuery

QueryLocalbreach queries the "localbreach" edge of the TrackedBreaches entity.

func (*TrackedBreaches) QueryUser

func (tb *TrackedBreaches) QueryUser() *UserQuery

QueryUser queries the "user" edge of the TrackedBreaches entity.

func (*TrackedBreaches) String

func (tb *TrackedBreaches) String() string

String implements the fmt.Stringer.

func (*TrackedBreaches) Unwrap

func (tb *TrackedBreaches) Unwrap() *TrackedBreaches

Unwrap unwraps the TrackedBreaches 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 (*TrackedBreaches) Update

Update returns a builder for updating this TrackedBreaches. Note that you need to call TrackedBreaches.Unwrap() before calling this method if this TrackedBreaches was returned from a transaction, and the transaction was committed or rolled back.

func (*TrackedBreaches) Value

func (tb *TrackedBreaches) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the TrackedBreaches. This includes values selected through modifiers, order, etc.

type TrackedBreachesClient

type TrackedBreachesClient struct {
	// contains filtered or unexported fields
}

TrackedBreachesClient is a client for the TrackedBreaches schema.

func NewTrackedBreachesClient

func NewTrackedBreachesClient(c config) *TrackedBreachesClient

NewTrackedBreachesClient returns a client for the TrackedBreaches from the given config.

func (*TrackedBreachesClient) Create

Create returns a builder for creating a TrackedBreaches entity.

func (*TrackedBreachesClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TrackedBreaches entities.

func (*TrackedBreachesClient) Delete

Delete returns a delete builder for TrackedBreaches.

func (*TrackedBreachesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TrackedBreachesClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TrackedBreachesClient) Get

Get returns a TrackedBreaches entity by its id.

func (*TrackedBreachesClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TrackedBreachesClient) Hooks

func (c *TrackedBreachesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TrackedBreachesClient) Intercept

func (c *TrackedBreachesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `trackedbreaches.Intercept(f(g(h())))`.

func (*TrackedBreachesClient) Interceptors

func (c *TrackedBreachesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TrackedBreachesClient) Query

Query returns a query builder for TrackedBreaches.

func (*TrackedBreachesClient) QueryHibp

func (c *TrackedBreachesClient) QueryHibp(tb *TrackedBreaches) *HIBPQuery

QueryHibp queries the hibp edge of a TrackedBreaches.

func (*TrackedBreachesClient) QueryLocalbreach

func (c *TrackedBreachesClient) QueryLocalbreach(tb *TrackedBreaches) *LocalBreachQuery

QueryLocalbreach queries the localbreach edge of a TrackedBreaches.

func (*TrackedBreachesClient) QueryUser

func (c *TrackedBreachesClient) QueryUser(tb *TrackedBreaches) *UserQuery

QueryUser queries the user edge of a TrackedBreaches.

func (*TrackedBreachesClient) Update

Update returns an update builder for TrackedBreaches.

func (*TrackedBreachesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TrackedBreachesClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*TrackedBreachesClient) Use

func (c *TrackedBreachesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `trackedbreaches.Hooks(f(g(h())))`.

type TrackedBreachesCreate

type TrackedBreachesCreate struct {
	// contains filtered or unexported fields
}

TrackedBreachesCreate is the builder for creating a TrackedBreaches entity.

func (*TrackedBreachesCreate) AddHibp

func (tbc *TrackedBreachesCreate) AddHibp(h ...*HIBP) *TrackedBreachesCreate

AddHibp adds the "hibp" edges to the HIBP entity.

func (*TrackedBreachesCreate) AddHibpIDs

func (tbc *TrackedBreachesCreate) AddHibpIDs(ids ...uuid.UUID) *TrackedBreachesCreate

AddHibpIDs adds the "hibp" edge to the HIBP entity by IDs.

func (*TrackedBreachesCreate) AddLocalbreach

func (tbc *TrackedBreachesCreate) AddLocalbreach(l ...*LocalBreach) *TrackedBreachesCreate

AddLocalbreach adds the "localbreach" edges to the LocalBreach entity.

func (*TrackedBreachesCreate) AddLocalbreachIDs

func (tbc *TrackedBreachesCreate) AddLocalbreachIDs(ids ...uuid.UUID) *TrackedBreachesCreate

AddLocalbreachIDs adds the "localbreach" edge to the LocalBreach entity by IDs.

func (*TrackedBreachesCreate) Exec

func (tbc *TrackedBreachesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TrackedBreachesCreate) ExecX

func (tbc *TrackedBreachesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TrackedBreachesCreate) Mutation

Mutation returns the TrackedBreachesMutation object of the builder.

func (*TrackedBreachesCreate) Save

Save creates the TrackedBreaches in the database.

func (*TrackedBreachesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TrackedBreachesCreate) SetBreach

SetBreach sets the "breach" field.

func (*TrackedBreachesCreate) SetID

SetID sets the "id" field.

func (*TrackedBreachesCreate) SetNillableID

func (tbc *TrackedBreachesCreate) SetNillableID(u *uuid.UUID) *TrackedBreachesCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TrackedBreachesCreate) SetNillableOnline

func (tbc *TrackedBreachesCreate) SetNillableOnline(b *bool) *TrackedBreachesCreate

SetNillableOnline sets the "online" field if the given value is not nil.

func (*TrackedBreachesCreate) SetOnline

SetOnline sets the "online" field.

func (*TrackedBreachesCreate) SetOwner

SetOwner sets the "owner" field.

func (*TrackedBreachesCreate) SetUser

SetUser sets the "user" edge to the User entity.

func (*TrackedBreachesCreate) SetUserID

SetUserID sets the "user" edge to the User entity by ID.

type TrackedBreachesCreateBulk

type TrackedBreachesCreateBulk struct {
	// contains filtered or unexported fields
}

TrackedBreachesCreateBulk is the builder for creating many TrackedBreaches entities in bulk.

func (*TrackedBreachesCreateBulk) Exec

Exec executes the query.

func (*TrackedBreachesCreateBulk) ExecX

func (tbcb *TrackedBreachesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TrackedBreachesCreateBulk) Save

Save creates the TrackedBreaches entities in the database.

func (*TrackedBreachesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TrackedBreachesDelete

type TrackedBreachesDelete struct {
	// contains filtered or unexported fields
}

TrackedBreachesDelete is the builder for deleting a TrackedBreaches entity.

func (*TrackedBreachesDelete) Exec

func (tbd *TrackedBreachesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TrackedBreachesDelete) ExecX

func (tbd *TrackedBreachesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TrackedBreachesDelete) Where

Where appends a list predicates to the TrackedBreachesDelete builder.

type TrackedBreachesDeleteOne

type TrackedBreachesDeleteOne struct {
	// contains filtered or unexported fields
}

TrackedBreachesDeleteOne is the builder for deleting a single TrackedBreaches entity.

func (*TrackedBreachesDeleteOne) Exec

Exec executes the deletion query.

func (*TrackedBreachesDeleteOne) ExecX

func (tbdo *TrackedBreachesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TrackedBreachesDeleteOne) Where

Where appends a list predicates to the TrackedBreachesDelete builder.

type TrackedBreachesEdges

type TrackedBreachesEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Localbreach holds the value of the localbreach edge.
	Localbreach []*LocalBreach `json:"localbreach,omitempty"`
	// Hibp holds the value of the hibp edge.
	Hibp []*HIBP `json:"hibp,omitempty"`
	// contains filtered or unexported fields
}

TrackedBreachesEdges holds the relations/edges for other nodes in the graph.

func (TrackedBreachesEdges) HibpOrErr

func (e TrackedBreachesEdges) HibpOrErr() ([]*HIBP, error)

HibpOrErr returns the Hibp value or an error if the edge was not loaded in eager-loading.

func (TrackedBreachesEdges) LocalbreachOrErr

func (e TrackedBreachesEdges) LocalbreachOrErr() ([]*LocalBreach, error)

LocalbreachOrErr returns the Localbreach value or an error if the edge was not loaded in eager-loading.

func (TrackedBreachesEdges) UserOrErr

func (e TrackedBreachesEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TrackedBreachesGroupBy

type TrackedBreachesGroupBy struct {
	// contains filtered or unexported fields
}

TrackedBreachesGroupBy is the group-by builder for TrackedBreaches entities.

func (*TrackedBreachesGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*TrackedBreachesGroupBy) Bool

func (s *TrackedBreachesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) BoolX

func (s *TrackedBreachesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Bools

func (s *TrackedBreachesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) BoolsX

func (s *TrackedBreachesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Float64

func (s *TrackedBreachesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) Float64X

func (s *TrackedBreachesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Float64s

func (s *TrackedBreachesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) Float64sX

func (s *TrackedBreachesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Int

func (s *TrackedBreachesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) IntX

func (s *TrackedBreachesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Ints

func (s *TrackedBreachesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) IntsX

func (s *TrackedBreachesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Scan

func (tbgb *TrackedBreachesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TrackedBreachesGroupBy) ScanX

func (s *TrackedBreachesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TrackedBreachesGroupBy) String

func (s *TrackedBreachesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) StringX

func (s *TrackedBreachesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TrackedBreachesGroupBy) Strings

func (s *TrackedBreachesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesGroupBy) StringsX

func (s *TrackedBreachesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TrackedBreachesMutation

type TrackedBreachesMutation struct {
	// contains filtered or unexported fields
}

TrackedBreachesMutation represents an operation that mutates the TrackedBreaches nodes in the graph.

func (*TrackedBreachesMutation) AddField

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) AddHibpIDs

func (m *TrackedBreachesMutation) AddHibpIDs(ids ...uuid.UUID)

AddHibpIDs adds the "hibp" edge to the HIBP entity by ids.

func (*TrackedBreachesMutation) AddLocalbreachIDs

func (m *TrackedBreachesMutation) AddLocalbreachIDs(ids ...uuid.UUID)

AddLocalbreachIDs adds the "localbreach" edge to the LocalBreach entity by ids.

func (*TrackedBreachesMutation) AddedEdges

func (m *TrackedBreachesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TrackedBreachesMutation) AddedField

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) AddedFields

func (m *TrackedBreachesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TrackedBreachesMutation) AddedIDs

func (m *TrackedBreachesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TrackedBreachesMutation) Breach

func (m *TrackedBreachesMutation) Breach() (r uuid.UUID, exists bool)

Breach returns the value of the "breach" field in the mutation.

func (*TrackedBreachesMutation) ClearEdge

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) ClearField

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) ClearHibp

func (m *TrackedBreachesMutation) ClearHibp()

ClearHibp clears the "hibp" edge to the HIBP entity.

func (*TrackedBreachesMutation) ClearLocalbreach

func (m *TrackedBreachesMutation) ClearLocalbreach()

ClearLocalbreach clears the "localbreach" edge to the LocalBreach entity.

func (*TrackedBreachesMutation) ClearUser

func (m *TrackedBreachesMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*TrackedBreachesMutation) ClearedEdges

func (m *TrackedBreachesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TrackedBreachesMutation) ClearedFields

func (m *TrackedBreachesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TrackedBreachesMutation) Client

func (m TrackedBreachesMutation) 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 (*TrackedBreachesMutation) EdgeCleared

func (m *TrackedBreachesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TrackedBreachesMutation) Field

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) FieldCleared

func (m *TrackedBreachesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TrackedBreachesMutation) Fields

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) HibpCleared

func (m *TrackedBreachesMutation) HibpCleared() bool

HibpCleared reports if the "hibp" edge to the HIBP entity was cleared.

func (*TrackedBreachesMutation) HibpIDs

func (m *TrackedBreachesMutation) HibpIDs() (ids []uuid.UUID)

HibpIDs returns the "hibp" edge IDs in the mutation.

func (*TrackedBreachesMutation) ID

func (m *TrackedBreachesMutation) ID() (id uuid.UUID, 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 (*TrackedBreachesMutation) IDs

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 (*TrackedBreachesMutation) LocalbreachCleared

func (m *TrackedBreachesMutation) LocalbreachCleared() bool

LocalbreachCleared reports if the "localbreach" edge to the LocalBreach entity was cleared.

func (*TrackedBreachesMutation) LocalbreachIDs

func (m *TrackedBreachesMutation) LocalbreachIDs() (ids []uuid.UUID)

LocalbreachIDs returns the "localbreach" edge IDs in the mutation.

func (*TrackedBreachesMutation) OldBreach

func (m *TrackedBreachesMutation) OldBreach(ctx context.Context) (v uuid.UUID, err error)

OldBreach returns the old "breach" field's value of the TrackedBreaches entity. If the TrackedBreaches 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 (*TrackedBreachesMutation) OldField

func (m *TrackedBreachesMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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 (*TrackedBreachesMutation) OldOnline

func (m *TrackedBreachesMutation) OldOnline(ctx context.Context) (v bool, err error)

OldOnline returns the old "online" field's value of the TrackedBreaches entity. If the TrackedBreaches 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 (*TrackedBreachesMutation) OldOwner

func (m *TrackedBreachesMutation) OldOwner(ctx context.Context) (v uuid.UUID, err error)

OldOwner returns the old "owner" field's value of the TrackedBreaches entity. If the TrackedBreaches 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 (*TrackedBreachesMutation) Online

func (m *TrackedBreachesMutation) Online() (r bool, exists bool)

Online returns the value of the "online" field in the mutation.

func (*TrackedBreachesMutation) Op

func (m *TrackedBreachesMutation) Op() Op

Op returns the operation name.

func (*TrackedBreachesMutation) Owner

func (m *TrackedBreachesMutation) Owner() (r uuid.UUID, exists bool)

Owner returns the value of the "owner" field in the mutation.

func (*TrackedBreachesMutation) RemoveHibpIDs

func (m *TrackedBreachesMutation) RemoveHibpIDs(ids ...uuid.UUID)

RemoveHibpIDs removes the "hibp" edge to the HIBP entity by IDs.

func (*TrackedBreachesMutation) RemoveLocalbreachIDs

func (m *TrackedBreachesMutation) RemoveLocalbreachIDs(ids ...uuid.UUID)

RemoveLocalbreachIDs removes the "localbreach" edge to the LocalBreach entity by IDs.

func (*TrackedBreachesMutation) RemovedEdges

func (m *TrackedBreachesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TrackedBreachesMutation) RemovedHibpIDs

func (m *TrackedBreachesMutation) RemovedHibpIDs() (ids []uuid.UUID)

RemovedHibp returns the removed IDs of the "hibp" edge to the HIBP entity.

func (*TrackedBreachesMutation) RemovedIDs

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) RemovedLocalbreachIDs

func (m *TrackedBreachesMutation) RemovedLocalbreachIDs() (ids []uuid.UUID)

RemovedLocalbreach returns the removed IDs of the "localbreach" edge to the LocalBreach entity.

func (*TrackedBreachesMutation) ResetBreach

func (m *TrackedBreachesMutation) ResetBreach()

ResetBreach resets all changes to the "breach" field.

func (*TrackedBreachesMutation) ResetEdge

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) ResetField

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) ResetHibp

func (m *TrackedBreachesMutation) ResetHibp()

ResetHibp resets all changes to the "hibp" edge.

func (*TrackedBreachesMutation) ResetLocalbreach

func (m *TrackedBreachesMutation) ResetLocalbreach()

ResetLocalbreach resets all changes to the "localbreach" edge.

func (*TrackedBreachesMutation) ResetOnline

func (m *TrackedBreachesMutation) ResetOnline()

ResetOnline resets all changes to the "online" field.

func (*TrackedBreachesMutation) ResetOwner

func (m *TrackedBreachesMutation) ResetOwner()

ResetOwner resets all changes to the "owner" field.

func (*TrackedBreachesMutation) ResetUser

func (m *TrackedBreachesMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*TrackedBreachesMutation) SetBreach

func (m *TrackedBreachesMutation) SetBreach(u uuid.UUID)

SetBreach sets the "breach" field.

func (*TrackedBreachesMutation) SetField

func (m *TrackedBreachesMutation) 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 (*TrackedBreachesMutation) SetID

func (m *TrackedBreachesMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TrackedBreaches entities.

func (*TrackedBreachesMutation) SetOnline

func (m *TrackedBreachesMutation) SetOnline(b bool)

SetOnline sets the "online" field.

func (*TrackedBreachesMutation) SetOp

func (m *TrackedBreachesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TrackedBreachesMutation) SetOwner

func (m *TrackedBreachesMutation) SetOwner(u uuid.UUID)

SetOwner sets the "owner" field.

func (*TrackedBreachesMutation) SetUserID

func (m *TrackedBreachesMutation) SetUserID(id uuid.UUID)

SetUserID sets the "user" edge to the User entity by id.

func (TrackedBreachesMutation) Tx

func (m TrackedBreachesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TrackedBreachesMutation) Type

func (m *TrackedBreachesMutation) Type() string

Type returns the node type of this mutation (TrackedBreaches).

func (*TrackedBreachesMutation) UserCleared

func (m *TrackedBreachesMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*TrackedBreachesMutation) UserID

func (m *TrackedBreachesMutation) UserID() (id uuid.UUID, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*TrackedBreachesMutation) UserIDs

func (m *TrackedBreachesMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*TrackedBreachesMutation) Where

Where appends a list predicates to the TrackedBreachesMutation builder.

func (*TrackedBreachesMutation) WhereP

func (m *TrackedBreachesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TrackedBreachesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TrackedBreachesQuery

type TrackedBreachesQuery struct {
	// contains filtered or unexported fields
}

TrackedBreachesQuery is the builder for querying TrackedBreaches entities.

func (*TrackedBreachesQuery) Aggregate

Aggregate returns a TrackedBreachesSelect configured with the given aggregations.

func (*TrackedBreachesQuery) All

All executes the query and returns a list of TrackedBreachesSlice.

func (*TrackedBreachesQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TrackedBreachesQuery) Clone

Clone returns a duplicate of the TrackedBreachesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TrackedBreachesQuery) Count

func (tbq *TrackedBreachesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TrackedBreachesQuery) CountX

func (tbq *TrackedBreachesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TrackedBreachesQuery) Exist

func (tbq *TrackedBreachesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TrackedBreachesQuery) ExistX

func (tbq *TrackedBreachesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TrackedBreachesQuery) First

First returns the first TrackedBreaches entity from the query. Returns a *NotFoundError when no TrackedBreaches was found.

func (*TrackedBreachesQuery) FirstID

func (tbq *TrackedBreachesQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first TrackedBreaches ID from the query. Returns a *NotFoundError when no TrackedBreaches ID was found.

func (*TrackedBreachesQuery) FirstIDX

func (tbq *TrackedBreachesQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TrackedBreachesQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TrackedBreachesQuery) GroupBy

func (tbq *TrackedBreachesQuery) GroupBy(field string, fields ...string) *TrackedBreachesGroupBy

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 {
	Breach uuid.UUID `json:"breach,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TrackedBreaches.Query().
	GroupBy(trackedbreaches.FieldBreach).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TrackedBreachesQuery) IDs

func (tbq *TrackedBreachesQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of TrackedBreaches IDs.

func (*TrackedBreachesQuery) IDsX

func (tbq *TrackedBreachesQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TrackedBreachesQuery) Limit

func (tbq *TrackedBreachesQuery) Limit(limit int) *TrackedBreachesQuery

Limit the number of records to be returned by this query.

func (*TrackedBreachesQuery) Offset

func (tbq *TrackedBreachesQuery) Offset(offset int) *TrackedBreachesQuery

Offset to start from.

func (*TrackedBreachesQuery) Only

Only returns a single TrackedBreaches entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TrackedBreaches entity is found. Returns a *NotFoundError when no TrackedBreaches entities are found.

func (*TrackedBreachesQuery) OnlyID

func (tbq *TrackedBreachesQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only TrackedBreaches ID in the query. Returns a *NotSingularError when more than one TrackedBreaches ID is found. Returns a *NotFoundError when no entities are found.

func (*TrackedBreachesQuery) OnlyIDX

func (tbq *TrackedBreachesQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TrackedBreachesQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TrackedBreachesQuery) Order

Order specifies how the records should be ordered.

func (*TrackedBreachesQuery) QueryHibp

func (tbq *TrackedBreachesQuery) QueryHibp() *HIBPQuery

QueryHibp chains the current query on the "hibp" edge.

func (*TrackedBreachesQuery) QueryLocalbreach

func (tbq *TrackedBreachesQuery) QueryLocalbreach() *LocalBreachQuery

QueryLocalbreach chains the current query on the "localbreach" edge.

func (*TrackedBreachesQuery) QueryUser

func (tbq *TrackedBreachesQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*TrackedBreachesQuery) Select

func (tbq *TrackedBreachesQuery) Select(fields ...string) *TrackedBreachesSelect

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 {
	Breach uuid.UUID `json:"breach,omitempty"`
}

client.TrackedBreaches.Query().
	Select(trackedbreaches.FieldBreach).
	Scan(ctx, &v)

func (*TrackedBreachesQuery) Unique

func (tbq *TrackedBreachesQuery) Unique(unique bool) *TrackedBreachesQuery

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 (*TrackedBreachesQuery) Where

Where adds a new predicate for the TrackedBreachesQuery builder.

func (*TrackedBreachesQuery) WithHibp

func (tbq *TrackedBreachesQuery) WithHibp(opts ...func(*HIBPQuery)) *TrackedBreachesQuery

WithHibp tells the query-builder to eager-load the nodes that are connected to the "hibp" edge. The optional arguments are used to configure the query builder of the edge.

func (*TrackedBreachesQuery) WithLocalbreach

func (tbq *TrackedBreachesQuery) WithLocalbreach(opts ...func(*LocalBreachQuery)) *TrackedBreachesQuery

WithLocalbreach tells the query-builder to eager-load the nodes that are connected to the "localbreach" edge. The optional arguments are used to configure the query builder of the edge.

func (*TrackedBreachesQuery) WithUser

func (tbq *TrackedBreachesQuery) WithUser(opts ...func(*UserQuery)) *TrackedBreachesQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type TrackedBreachesSelect

type TrackedBreachesSelect struct {
	*TrackedBreachesQuery
	// contains filtered or unexported fields
}

TrackedBreachesSelect is the builder for selecting fields of TrackedBreaches entities.

func (*TrackedBreachesSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*TrackedBreachesSelect) Bool

func (s *TrackedBreachesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) BoolX

func (s *TrackedBreachesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TrackedBreachesSelect) Bools

func (s *TrackedBreachesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) BoolsX

func (s *TrackedBreachesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TrackedBreachesSelect) Float64

func (s *TrackedBreachesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) Float64X

func (s *TrackedBreachesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TrackedBreachesSelect) Float64s

func (s *TrackedBreachesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) Float64sX

func (s *TrackedBreachesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TrackedBreachesSelect) Int

func (s *TrackedBreachesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) IntX

func (s *TrackedBreachesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TrackedBreachesSelect) Ints

func (s *TrackedBreachesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) IntsX

func (s *TrackedBreachesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TrackedBreachesSelect) Scan

func (tbs *TrackedBreachesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TrackedBreachesSelect) ScanX

func (s *TrackedBreachesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TrackedBreachesSelect) String

func (s *TrackedBreachesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) StringX

func (s *TrackedBreachesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TrackedBreachesSelect) Strings

func (s *TrackedBreachesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TrackedBreachesSelect) StringsX

func (s *TrackedBreachesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TrackedBreachesSlice

type TrackedBreachesSlice []*TrackedBreaches

TrackedBreachesSlice is a parsable slice of TrackedBreaches.

type TrackedBreachesUpdate

type TrackedBreachesUpdate struct {
	// contains filtered or unexported fields
}

TrackedBreachesUpdate is the builder for updating TrackedBreaches entities.

func (*TrackedBreachesUpdate) AddHibp

func (tbu *TrackedBreachesUpdate) AddHibp(h ...*HIBP) *TrackedBreachesUpdate

AddHibp adds the "hibp" edges to the HIBP entity.

func (*TrackedBreachesUpdate) AddHibpIDs

func (tbu *TrackedBreachesUpdate) AddHibpIDs(ids ...uuid.UUID) *TrackedBreachesUpdate

AddHibpIDs adds the "hibp" edge to the HIBP entity by IDs.

func (*TrackedBreachesUpdate) AddLocalbreach

func (tbu *TrackedBreachesUpdate) AddLocalbreach(l ...*LocalBreach) *TrackedBreachesUpdate

AddLocalbreach adds the "localbreach" edges to the LocalBreach entity.

func (*TrackedBreachesUpdate) AddLocalbreachIDs

func (tbu *TrackedBreachesUpdate) AddLocalbreachIDs(ids ...uuid.UUID) *TrackedBreachesUpdate

AddLocalbreachIDs adds the "localbreach" edge to the LocalBreach entity by IDs.

func (*TrackedBreachesUpdate) ClearHibp

func (tbu *TrackedBreachesUpdate) ClearHibp() *TrackedBreachesUpdate

ClearHibp clears all "hibp" edges to the HIBP entity.

func (*TrackedBreachesUpdate) ClearLocalbreach

func (tbu *TrackedBreachesUpdate) ClearLocalbreach() *TrackedBreachesUpdate

ClearLocalbreach clears all "localbreach" edges to the LocalBreach entity.

func (*TrackedBreachesUpdate) Exec

func (tbu *TrackedBreachesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TrackedBreachesUpdate) ExecX

func (tbu *TrackedBreachesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TrackedBreachesUpdate) Mutation

Mutation returns the TrackedBreachesMutation object of the builder.

func (*TrackedBreachesUpdate) RemoveHibp

func (tbu *TrackedBreachesUpdate) RemoveHibp(h ...*HIBP) *TrackedBreachesUpdate

RemoveHibp removes "hibp" edges to HIBP entities.

func (*TrackedBreachesUpdate) RemoveHibpIDs

func (tbu *TrackedBreachesUpdate) RemoveHibpIDs(ids ...uuid.UUID) *TrackedBreachesUpdate

RemoveHibpIDs removes the "hibp" edge to HIBP entities by IDs.

func (*TrackedBreachesUpdate) RemoveLocalbreach

func (tbu *TrackedBreachesUpdate) RemoveLocalbreach(l ...*LocalBreach) *TrackedBreachesUpdate

RemoveLocalbreach removes "localbreach" edges to LocalBreach entities.

func (*TrackedBreachesUpdate) RemoveLocalbreachIDs

func (tbu *TrackedBreachesUpdate) RemoveLocalbreachIDs(ids ...uuid.UUID) *TrackedBreachesUpdate

RemoveLocalbreachIDs removes the "localbreach" edge to LocalBreach entities by IDs.

func (*TrackedBreachesUpdate) Save

func (tbu *TrackedBreachesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TrackedBreachesUpdate) SaveX

func (tbu *TrackedBreachesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TrackedBreachesUpdate) SetBreach

SetBreach sets the "breach" field.

func (*TrackedBreachesUpdate) Where

Where appends a list predicates to the TrackedBreachesUpdate builder.

type TrackedBreachesUpdateOne

type TrackedBreachesUpdateOne struct {
	// contains filtered or unexported fields
}

TrackedBreachesUpdateOne is the builder for updating a single TrackedBreaches entity.

func (*TrackedBreachesUpdateOne) AddHibp

AddHibp adds the "hibp" edges to the HIBP entity.

func (*TrackedBreachesUpdateOne) AddHibpIDs

func (tbuo *TrackedBreachesUpdateOne) AddHibpIDs(ids ...uuid.UUID) *TrackedBreachesUpdateOne

AddHibpIDs adds the "hibp" edge to the HIBP entity by IDs.

func (*TrackedBreachesUpdateOne) AddLocalbreach

func (tbuo *TrackedBreachesUpdateOne) AddLocalbreach(l ...*LocalBreach) *TrackedBreachesUpdateOne

AddLocalbreach adds the "localbreach" edges to the LocalBreach entity.

func (*TrackedBreachesUpdateOne) AddLocalbreachIDs

func (tbuo *TrackedBreachesUpdateOne) AddLocalbreachIDs(ids ...uuid.UUID) *TrackedBreachesUpdateOne

AddLocalbreachIDs adds the "localbreach" edge to the LocalBreach entity by IDs.

func (*TrackedBreachesUpdateOne) ClearHibp

ClearHibp clears all "hibp" edges to the HIBP entity.

func (*TrackedBreachesUpdateOne) ClearLocalbreach

func (tbuo *TrackedBreachesUpdateOne) ClearLocalbreach() *TrackedBreachesUpdateOne

ClearLocalbreach clears all "localbreach" edges to the LocalBreach entity.

func (*TrackedBreachesUpdateOne) Exec

Exec executes the query on the entity.

func (*TrackedBreachesUpdateOne) ExecX

func (tbuo *TrackedBreachesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TrackedBreachesUpdateOne) Mutation

Mutation returns the TrackedBreachesMutation object of the builder.

func (*TrackedBreachesUpdateOne) RemoveHibp

func (tbuo *TrackedBreachesUpdateOne) RemoveHibp(h ...*HIBP) *TrackedBreachesUpdateOne

RemoveHibp removes "hibp" edges to HIBP entities.

func (*TrackedBreachesUpdateOne) RemoveHibpIDs

func (tbuo *TrackedBreachesUpdateOne) RemoveHibpIDs(ids ...uuid.UUID) *TrackedBreachesUpdateOne

RemoveHibpIDs removes the "hibp" edge to HIBP entities by IDs.

func (*TrackedBreachesUpdateOne) RemoveLocalbreach

func (tbuo *TrackedBreachesUpdateOne) RemoveLocalbreach(l ...*LocalBreach) *TrackedBreachesUpdateOne

RemoveLocalbreach removes "localbreach" edges to LocalBreach entities.

func (*TrackedBreachesUpdateOne) RemoveLocalbreachIDs

func (tbuo *TrackedBreachesUpdateOne) RemoveLocalbreachIDs(ids ...uuid.UUID) *TrackedBreachesUpdateOne

RemoveLocalbreachIDs removes the "localbreach" edge to LocalBreach entities by IDs.

func (*TrackedBreachesUpdateOne) Save

Save executes the query and returns the updated TrackedBreaches entity.

func (*TrackedBreachesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TrackedBreachesUpdateOne) Select

func (tbuo *TrackedBreachesUpdateOne) Select(field string, fields ...string) *TrackedBreachesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TrackedBreachesUpdateOne) SetBreach

SetBreach sets the "breach" field.

func (*TrackedBreachesUpdateOne) Where

Where appends a list predicates to the TrackedBreachesUpdate builder.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// AgeKey is the client for interacting with the AgeKey builders.
	AgeKey *AgeKeyClient
	// HIBP is the client for interacting with the HIBP builders.
	HIBP *HIBPClient
	// LocalBreach is the client for interacting with the LocalBreach builders.
	LocalBreach *LocalBreachClient
	// SearchQuery is the client for interacting with the SearchQuery builders.
	SearchQuery *SearchQueryClient
	// Settings is the client for interacting with the Settings builders.
	Settings *SettingsClient
	// Setup is the client for interacting with the Setup builders.
	Setup *SetupClient
	// TrackedBreaches is the client for interacting with the TrackedBreaches builders.
	TrackedBreaches *TrackedBreachesClient
	// 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

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// user's handle, allowed `<>~+-_` symbols and alphanumeric ASCII characters, including capital letters
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password []byte `json:"-"`
	// IsAdmin holds the value of the "is_admin" field.
	IsAdmin bool `json:"is_admin,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// LastLogin holds the value of the "last_login" field.
	LastLogin time.Time `json:"last_login,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) QueryAgekey

func (u *User) QueryAgekey() *AgeKeyQuery

QueryAgekey queries the "agekey" edge of the User entity.

func (*User) QuerySearchQueries

func (u *User) QuerySearchQueries() *SearchQueryQuery

QuerySearchQueries queries the "search_queries" edge of the User entity.

func (*User) QueryTrackedBreaches

func (u *User) QueryTrackedBreaches() *TrackedBreachesQuery

QueryTrackedBreaches queries the "tracked_breaches" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

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) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAgekey

func (c *UserClient) QueryAgekey(u *User) *AgeKeyQuery

QueryAgekey queries the agekey edge of a User.

func (*UserClient) QuerySearchQueries

func (c *UserClient) QuerySearchQueries(u *User) *SearchQueryQuery

QuerySearchQueries queries the search_queries edge of a User.

func (*UserClient) QueryTrackedBreaches

func (c *UserClient) QueryTrackedBreaches(u *User) *TrackedBreachesQuery

QueryTrackedBreaches queries the tracked_breaches edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *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) AddSearchQueries

func (uc *UserCreate) AddSearchQueries(s ...*SearchQuery) *UserCreate

AddSearchQueries adds the "search_queries" edges to the SearchQuery entity.

func (*UserCreate) AddSearchQueryIDs

func (uc *UserCreate) AddSearchQueryIDs(ids ...uuid.UUID) *UserCreate

AddSearchQueryIDs adds the "search_queries" edge to the SearchQuery entity by IDs.

func (*UserCreate) AddTrackedBreachIDs

func (uc *UserCreate) AddTrackedBreachIDs(ids ...uuid.UUID) *UserCreate

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*UserCreate) AddTrackedBreaches

func (uc *UserCreate) AddTrackedBreaches(t ...*TrackedBreaches) *UserCreate

AddTrackedBreaches adds the "tracked_breaches" edges to the TrackedBreaches entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAgekey

func (uc *UserCreate) SetAgekey(a *AgeKey) *UserCreate

SetAgekey sets the "agekey" edge to the AgeKey entity.

func (*UserCreate) SetAgekeyID

func (uc *UserCreate) SetAgekeyID(id uuid.UUID) *UserCreate

SetAgekeyID sets the "agekey" edge to the AgeKey entity by ID.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsActive

func (uc *UserCreate) SetIsActive(b bool) *UserCreate

SetIsActive sets the "is_active" field.

func (*UserCreate) SetIsAdmin

func (uc *UserCreate) SetIsAdmin(b bool) *UserCreate

SetIsAdmin sets the "is_admin" field.

func (*UserCreate) SetLastLogin

func (uc *UserCreate) SetLastLogin(t time.Time) *UserCreate

SetLastLogin sets the "last_login" field.

func (*UserCreate) SetNillableAgekeyID

func (uc *UserCreate) SetNillableAgekeyID(id *uuid.UUID) *UserCreate

SetNillableAgekeyID sets the "agekey" edge to the AgeKey entity by ID if the given value is not nil.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableIsActive

func (uc *UserCreate) SetNillableIsActive(b *bool) *UserCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserCreate) SetNillableIsAdmin

func (uc *UserCreate) SetNillableIsAdmin(b *bool) *UserCreate

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserCreate) SetNillableLastLogin

func (uc *UserCreate) SetNillableLastLogin(t *time.Time) *UserCreate

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(b []byte) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s 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 (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Agekey holds the value of the agekey edge.
	Agekey *AgeKey `json:"agekey,omitempty"`
	// TrackedBreaches holds the value of the tracked_breaches edge.
	TrackedBreaches []*TrackedBreaches `json:"tracked_breaches,omitempty"`
	// SearchQueries holds the value of the search_queries edge.
	SearchQueries []*SearchQuery `json:"search_queries,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AgekeyOrErr

func (e UserEdges) AgekeyOrErr() (*AgeKey, error)

AgekeyOrErr returns the Agekey value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) SearchQueriesOrErr

func (e UserEdges) SearchQueriesOrErr() ([]*SearchQuery, error)

SearchQueriesOrErr returns the SearchQueries value or an error if the edge was not loaded in eager-loading.

func (UserEdges) TrackedBreachesOrErr

func (e UserEdges) TrackedBreachesOrErr() ([]*TrackedBreaches, error)

TrackedBreachesOrErr returns the TrackedBreaches value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddSearchQueryIDs

func (m *UserMutation) AddSearchQueryIDs(ids ...uuid.UUID)

AddSearchQueryIDs adds the "search_queries" edge to the SearchQuery entity by ids.

func (*UserMutation) AddTrackedBreachIDs

func (m *UserMutation) AddTrackedBreachIDs(ids ...uuid.UUID)

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches 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) AgekeyCleared

func (m *UserMutation) AgekeyCleared() bool

AgekeyCleared reports if the "agekey" edge to the AgeKey entity was cleared.

func (*UserMutation) AgekeyID

func (m *UserMutation) AgekeyID() (id uuid.UUID, exists bool)

AgekeyID returns the "agekey" edge ID in the mutation.

func (*UserMutation) AgekeyIDs

func (m *UserMutation) AgekeyIDs() (ids []uuid.UUID)

AgekeyIDs returns the "agekey" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AgekeyID instead. It exists only for internal usage by the builders.

func (*UserMutation) ClearAgekey

func (m *UserMutation) ClearAgekey()

ClearAgekey clears the "agekey" edge to the AgeKey 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) ClearSearchQueries

func (m *UserMutation) ClearSearchQueries()

ClearSearchQueries clears the "search_queries" edge to the SearchQuery entity.

func (*UserMutation) ClearTrackedBreaches

func (m *UserMutation) ClearTrackedBreaches()

ClearTrackedBreaches clears the "tracked_breaches" edge to the TrackedBreaches 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 uuid.UUID, 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) ([]uuid.UUID, 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) IsActive

func (m *UserMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*UserMutation) IsAdmin

func (m *UserMutation) IsAdmin() (r bool, exists bool)

IsAdmin returns the value of the "is_admin" field in the mutation.

func (*UserMutation) LastLogin

func (m *UserMutation) LastLogin() (r time.Time, exists bool)

LastLogin returns the value of the "last_login" field in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

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

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

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) OldIsActive

func (m *UserMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldIsAdmin

func (m *UserMutation) OldIsAdmin(ctx context.Context) (v bool, err error)

OldIsAdmin returns the old "is_admin" 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) OldLastLogin

func (m *UserMutation) OldLastLogin(ctx context.Context) (v time.Time, err error)

OldLastLogin returns the old "last_login" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v []byte, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

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) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r []byte, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemoveSearchQueryIDs

func (m *UserMutation) RemoveSearchQueryIDs(ids ...uuid.UUID)

RemoveSearchQueryIDs removes the "search_queries" edge to the SearchQuery entity by IDs.

func (*UserMutation) RemoveTrackedBreachIDs

func (m *UserMutation) RemoveTrackedBreachIDs(ids ...uuid.UUID)

RemoveTrackedBreachIDs removes the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedSearchQueriesIDs

func (m *UserMutation) RemovedSearchQueriesIDs() (ids []uuid.UUID)

RemovedSearchQueries returns the removed IDs of the "search_queries" edge to the SearchQuery entity.

func (*UserMutation) RemovedTrackedBreachesIDs

func (m *UserMutation) RemovedTrackedBreachesIDs() (ids []uuid.UUID)

RemovedTrackedBreaches returns the removed IDs of the "tracked_breaches" edge to the TrackedBreaches entity.

func (*UserMutation) ResetAgekey

func (m *UserMutation) ResetAgekey()

ResetAgekey resets all changes to the "agekey" 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) ResetIsActive

func (m *UserMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*UserMutation) ResetIsAdmin

func (m *UserMutation) ResetIsAdmin()

ResetIsAdmin resets all changes to the "is_admin" field.

func (*UserMutation) ResetLastLogin

func (m *UserMutation) ResetLastLogin()

ResetLastLogin resets all changes to the "last_login" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetSearchQueries

func (m *UserMutation) ResetSearchQueries()

ResetSearchQueries resets all changes to the "search_queries" edge.

func (*UserMutation) ResetTrackedBreaches

func (m *UserMutation) ResetTrackedBreaches()

ResetTrackedBreaches resets all changes to the "tracked_breaches" edge.

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) SearchQueriesCleared

func (m *UserMutation) SearchQueriesCleared() bool

SearchQueriesCleared reports if the "search_queries" edge to the SearchQuery entity was cleared.

func (*UserMutation) SearchQueriesIDs

func (m *UserMutation) SearchQueriesIDs() (ids []uuid.UUID)

SearchQueriesIDs returns the "search_queries" edge IDs in the mutation.

func (*UserMutation) SetAgekeyID

func (m *UserMutation) SetAgekeyID(id uuid.UUID)

SetAgekeyID sets the "agekey" edge to the AgeKey entity by id.

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) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIsActive

func (m *UserMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*UserMutation) SetIsAdmin

func (m *UserMutation) SetIsAdmin(b bool)

SetIsAdmin sets the "is_admin" field.

func (*UserMutation) SetLastLogin

func (m *UserMutation) SetLastLogin(t time.Time)

SetLastLogin sets the "last_login" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(b []byte)

SetPassword sets the "password" 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) TrackedBreachesCleared

func (m *UserMutation) TrackedBreachesCleared() bool

TrackedBreachesCleared reports if the "tracked_breaches" edge to the TrackedBreaches entity was cleared.

func (*UserMutation) TrackedBreachesIDs

func (m *UserMutation) TrackedBreachesIDs() (ids []uuid.UUID)

TrackedBreachesIDs returns the "tracked_breaches" edge IDs in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) 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 (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryAgekey

func (uq *UserQuery) QueryAgekey() *AgeKeyQuery

QueryAgekey chains the current query on the "agekey" edge.

func (*UserQuery) QuerySearchQueries

func (uq *UserQuery) QuerySearchQueries() *SearchQueryQuery

QuerySearchQueries chains the current query on the "search_queries" edge.

func (*UserQuery) QueryTrackedBreaches

func (uq *UserQuery) QueryTrackedBreaches() *TrackedBreachesQuery

QueryTrackedBreaches chains the current query on the "tracked_breaches" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAgekey

func (uq *UserQuery) WithAgekey(opts ...func(*AgeKeyQuery)) *UserQuery

WithAgekey tells the query-builder to eager-load the nodes that are connected to the "agekey" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSearchQueries

func (uq *UserQuery) WithSearchQueries(opts ...func(*SearchQueryQuery)) *UserQuery

WithSearchQueries tells the query-builder to eager-load the nodes that are connected to the "search_queries" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithTrackedBreaches

func (uq *UserQuery) WithTrackedBreaches(opts ...func(*TrackedBreachesQuery)) *UserQuery

WithTrackedBreaches tells the query-builder to eager-load the nodes that are connected to the "tracked_breaches" 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 (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddSearchQueries

func (uu *UserUpdate) AddSearchQueries(s ...*SearchQuery) *UserUpdate

AddSearchQueries adds the "search_queries" edges to the SearchQuery entity.

func (*UserUpdate) AddSearchQueryIDs

func (uu *UserUpdate) AddSearchQueryIDs(ids ...uuid.UUID) *UserUpdate

AddSearchQueryIDs adds the "search_queries" edge to the SearchQuery entity by IDs.

func (*UserUpdate) AddTrackedBreachIDs

func (uu *UserUpdate) AddTrackedBreachIDs(ids ...uuid.UUID) *UserUpdate

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*UserUpdate) AddTrackedBreaches

func (uu *UserUpdate) AddTrackedBreaches(t ...*TrackedBreaches) *UserUpdate

AddTrackedBreaches adds the "tracked_breaches" edges to the TrackedBreaches entity.

func (*UserUpdate) ClearSearchQueries

func (uu *UserUpdate) ClearSearchQueries() *UserUpdate

ClearSearchQueries clears all "search_queries" edges to the SearchQuery entity.

func (*UserUpdate) ClearTrackedBreaches

func (uu *UserUpdate) ClearTrackedBreaches() *UserUpdate

ClearTrackedBreaches clears all "tracked_breaches" edges to the TrackedBreaches entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveSearchQueries

func (uu *UserUpdate) RemoveSearchQueries(s ...*SearchQuery) *UserUpdate

RemoveSearchQueries removes "search_queries" edges to SearchQuery entities.

func (*UserUpdate) RemoveSearchQueryIDs

func (uu *UserUpdate) RemoveSearchQueryIDs(ids ...uuid.UUID) *UserUpdate

RemoveSearchQueryIDs removes the "search_queries" edge to SearchQuery entities by IDs.

func (*UserUpdate) RemoveTrackedBreachIDs

func (uu *UserUpdate) RemoveTrackedBreachIDs(ids ...uuid.UUID) *UserUpdate

RemoveTrackedBreachIDs removes the "tracked_breaches" edge to TrackedBreaches entities by IDs.

func (*UserUpdate) RemoveTrackedBreaches

func (uu *UserUpdate) RemoveTrackedBreaches(t ...*TrackedBreaches) *UserUpdate

RemoveTrackedBreaches removes "tracked_breaches" edges to TrackedBreaches entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetIsActive

func (uu *UserUpdate) SetIsActive(b bool) *UserUpdate

SetIsActive sets the "is_active" field.

func (*UserUpdate) SetIsAdmin

func (uu *UserUpdate) SetIsAdmin(b bool) *UserUpdate

SetIsAdmin sets the "is_admin" field.

func (*UserUpdate) SetLastLogin

func (uu *UserUpdate) SetLastLogin(t time.Time) *UserUpdate

SetLastLogin sets the "last_login" field.

func (*UserUpdate) SetNillableIsActive

func (uu *UserUpdate) SetNillableIsActive(b *bool) *UserUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserUpdate) SetNillableIsAdmin

func (uu *UserUpdate) SetNillableIsAdmin(b *bool) *UserUpdate

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserUpdate) SetNillableLastLogin

func (uu *UserUpdate) SetNillableLastLogin(t *time.Time) *UserUpdate

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(b []byte) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddSearchQueries

func (uuo *UserUpdateOne) AddSearchQueries(s ...*SearchQuery) *UserUpdateOne

AddSearchQueries adds the "search_queries" edges to the SearchQuery entity.

func (*UserUpdateOne) AddSearchQueryIDs

func (uuo *UserUpdateOne) AddSearchQueryIDs(ids ...uuid.UUID) *UserUpdateOne

AddSearchQueryIDs adds the "search_queries" edge to the SearchQuery entity by IDs.

func (*UserUpdateOne) AddTrackedBreachIDs

func (uuo *UserUpdateOne) AddTrackedBreachIDs(ids ...uuid.UUID) *UserUpdateOne

AddTrackedBreachIDs adds the "tracked_breaches" edge to the TrackedBreaches entity by IDs.

func (*UserUpdateOne) AddTrackedBreaches

func (uuo *UserUpdateOne) AddTrackedBreaches(t ...*TrackedBreaches) *UserUpdateOne

AddTrackedBreaches adds the "tracked_breaches" edges to the TrackedBreaches entity.

func (*UserUpdateOne) ClearSearchQueries

func (uuo *UserUpdateOne) ClearSearchQueries() *UserUpdateOne

ClearSearchQueries clears all "search_queries" edges to the SearchQuery entity.

func (*UserUpdateOne) ClearTrackedBreaches

func (uuo *UserUpdateOne) ClearTrackedBreaches() *UserUpdateOne

ClearTrackedBreaches clears all "tracked_breaches" edges to the TrackedBreaches entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveSearchQueries

func (uuo *UserUpdateOne) RemoveSearchQueries(s ...*SearchQuery) *UserUpdateOne

RemoveSearchQueries removes "search_queries" edges to SearchQuery entities.

func (*UserUpdateOne) RemoveSearchQueryIDs

func (uuo *UserUpdateOne) RemoveSearchQueryIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveSearchQueryIDs removes the "search_queries" edge to SearchQuery entities by IDs.

func (*UserUpdateOne) RemoveTrackedBreachIDs

func (uuo *UserUpdateOne) RemoveTrackedBreachIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveTrackedBreachIDs removes the "tracked_breaches" edge to TrackedBreaches entities by IDs.

func (*UserUpdateOne) RemoveTrackedBreaches

func (uuo *UserUpdateOne) RemoveTrackedBreaches(t ...*TrackedBreaches) *UserUpdateOne

RemoveTrackedBreaches removes "tracked_breaches" edges to TrackedBreaches entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetIsActive

func (uuo *UserUpdateOne) SetIsActive(b bool) *UserUpdateOne

SetIsActive sets the "is_active" field.

func (*UserUpdateOne) SetIsAdmin

func (uuo *UserUpdateOne) SetIsAdmin(b bool) *UserUpdateOne

SetIsAdmin sets the "is_admin" field.

func (*UserUpdateOne) SetLastLogin

func (uuo *UserUpdateOne) SetLastLogin(t time.Time) *UserUpdateOne

SetLastLogin sets the "last_login" field.

func (*UserUpdateOne) SetNillableIsActive

func (uuo *UserUpdateOne) SetNillableIsActive(b *bool) *UserUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsAdmin

func (uuo *UserUpdateOne) SetNillableIsAdmin(b *bool) *UserUpdateOne

SetNillableIsAdmin sets the "is_admin" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastLogin

func (uuo *UserUpdateOne) SetNillableLastLogin(t *time.Time) *UserUpdateOne

SetNillableLastLogin sets the "last_login" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(b []byte) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL