ent

package
v0.0.0-...-e58cecd Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 19 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.
	TypeUrl      = "Url"
	TypeVisitLog = "VisitLog"
)

Variables

This section is empty.

Functions

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 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
	// Url is the client for interacting with the Url builders.
	Url *UrlClient
	// VisitLog is the client for interacting with the VisitLog builders.
	VisitLog *VisitLogClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

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().
	Url.
	Query().
	Count(ctx)

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 Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type 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(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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 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 Tx

type Tx struct {

	// Url is the client for interacting with the Url builders.
	Url *UrlClient
	// VisitLog is the client for interacting with the VisitLog builders.
	VisitLog *VisitLogClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

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 URLCreate

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

URLCreate is the builder for creating a Url entity.

func (*URLCreate) AddLogIDs

func (uc *URLCreate) AddLogIDs(ids ...int) *URLCreate

AddLogIDs adds the "logs" edge to the VisitLog entity by IDs.

func (*URLCreate) AddLogs

func (uc *URLCreate) AddLogs(v ...*VisitLog) *URLCreate

AddLogs adds the "logs" edges to the VisitLog entity.

func (*URLCreate) Exec

func (uc *URLCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*URLCreate) ExecX

func (uc *URLCreate) ExecX(ctx context.Context)

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

func (*URLCreate) Mutation

func (uc *URLCreate) Mutation() *URLMutation

Mutation returns the URLMutation object of the builder.

func (*URLCreate) Save

func (uc *URLCreate) Save(ctx context.Context) (*Url, error)

Save creates the Url in the database.

func (*URLCreate) SaveX

func (uc *URLCreate) SaveX(ctx context.Context) *Url

SaveX calls Save and panics if Save returns an error.

func (*URLCreate) SetCreatedAt

func (uc *URLCreate) SetCreatedAt(t time.Time) *URLCreate

SetCreatedAt sets the "created_at" field.

func (*URLCreate) SetCurrentTimes

func (uc *URLCreate) SetCurrentTimes(i int) *URLCreate

SetCurrentTimes sets the "current_times" field.

func (*URLCreate) SetExpireAt

func (uc *URLCreate) SetExpireAt(t time.Time) *URLCreate

SetExpireAt sets the "expire_at" field.

func (*URLCreate) SetMaxTimes

func (uc *URLCreate) SetMaxTimes(i int) *URLCreate

SetMaxTimes sets the "max_times" field.

func (*URLCreate) SetNillableCreatedAt

func (uc *URLCreate) SetNillableCreatedAt(t *time.Time) *URLCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*URLCreate) SetNillableCurrentTimes

func (uc *URLCreate) SetNillableCurrentTimes(i *int) *URLCreate

SetNillableCurrentTimes sets the "current_times" field if the given value is not nil.

func (*URLCreate) SetNillableExpireAt

func (uc *URLCreate) SetNillableExpireAt(t *time.Time) *URLCreate

SetNillableExpireAt sets the "expire_at" field if the given value is not nil.

func (*URLCreate) SetNillableMaxTimes

func (uc *URLCreate) SetNillableMaxTimes(i *int) *URLCreate

SetNillableMaxTimes sets the "max_times" field if the given value is not nil.

func (*URLCreate) SetPath

func (uc *URLCreate) SetPath(s string) *URLCreate

SetPath sets the "path" field.

func (*URLCreate) SetURL

func (uc *URLCreate) SetURL(s string) *URLCreate

SetURL sets the "url" field.

type URLCreateBulk

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

URLCreateBulk is the builder for creating many Url entities in bulk.

func (*URLCreateBulk) Exec

func (ucb *URLCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*URLCreateBulk) ExecX

func (ucb *URLCreateBulk) ExecX(ctx context.Context)

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

func (*URLCreateBulk) Save

func (ucb *URLCreateBulk) Save(ctx context.Context) ([]*Url, error)

Save creates the Url entities in the database.

func (*URLCreateBulk) SaveX

func (ucb *URLCreateBulk) SaveX(ctx context.Context) []*Url

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

type URLDelete

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

URLDelete is the builder for deleting a Url entity.

func (*URLDelete) Exec

func (ud *URLDelete) Exec(ctx context.Context) (int, error)

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

func (*URLDelete) ExecX

func (ud *URLDelete) ExecX(ctx context.Context) int

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

func (*URLDelete) Where

func (ud *URLDelete) Where(ps ...predicate.Url) *URLDelete

Where appends a list predicates to the URLDelete builder.

type URLDeleteOne

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

URLDeleteOne is the builder for deleting a single Url entity.

func (*URLDeleteOne) Exec

func (udo *URLDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*URLDeleteOne) ExecX

func (udo *URLDeleteOne) ExecX(ctx context.Context)

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

type URLGroupBy

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

URLGroupBy is the group-by builder for Url entities.

func (*URLGroupBy) Aggregate

func (ugb *URLGroupBy) Aggregate(fns ...AggregateFunc) *URLGroupBy

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

func (*URLGroupBy) Bool

func (ugb *URLGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) BoolX

func (ugb *URLGroupBy) BoolX(ctx context.Context) bool

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

func (*URLGroupBy) Bools

func (ugb *URLGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) BoolsX

func (ugb *URLGroupBy) BoolsX(ctx context.Context) []bool

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

func (*URLGroupBy) Float64

func (ugb *URLGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) Float64X

func (ugb *URLGroupBy) Float64X(ctx context.Context) float64

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

func (*URLGroupBy) Float64s

func (ugb *URLGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) Float64sX

func (ugb *URLGroupBy) Float64sX(ctx context.Context) []float64

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

func (*URLGroupBy) Int

func (ugb *URLGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) IntX

func (ugb *URLGroupBy) IntX(ctx context.Context) int

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

func (*URLGroupBy) Ints

func (ugb *URLGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) IntsX

func (ugb *URLGroupBy) IntsX(ctx context.Context) []int

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

func (*URLGroupBy) Scan

func (ugb *URLGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*URLGroupBy) ScanX

func (ugb *URLGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*URLGroupBy) String

func (ugb *URLGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) StringX

func (ugb *URLGroupBy) StringX(ctx context.Context) string

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

func (*URLGroupBy) Strings

func (ugb *URLGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*URLGroupBy) StringsX

func (ugb *URLGroupBy) StringsX(ctx context.Context) []string

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

type URLMutation

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

URLMutation represents an operation that mutates the Url nodes in the graph.

func (*URLMutation) AddCurrentTimes

func (m *URLMutation) AddCurrentTimes(i int)

AddCurrentTimes adds i to the "current_times" field.

func (*URLMutation) AddField

func (m *URLMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*URLMutation) AddLogIDs

func (m *URLMutation) AddLogIDs(ids ...int)

AddLogIDs adds the "logs" edge to the VisitLog entity by ids.

func (*URLMutation) AddMaxTimes

func (m *URLMutation) AddMaxTimes(i int)

AddMaxTimes adds i to the "max_times" field.

func (*URLMutation) AddedCurrentTimes

func (m *URLMutation) AddedCurrentTimes() (r int, exists bool)

AddedCurrentTimes returns the value that was added to the "current_times" field in this mutation.

func (*URLMutation) AddedEdges

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

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

func (*URLMutation) AddedField

func (m *URLMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*URLMutation) AddedFields

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

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

func (*URLMutation) AddedIDs

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

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

func (*URLMutation) AddedMaxTimes

func (m *URLMutation) AddedMaxTimes() (r int, exists bool)

AddedMaxTimes returns the value that was added to the "max_times" field in this mutation.

func (*URLMutation) ClearEdge

func (m *URLMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*URLMutation) ClearExpireAt

func (m *URLMutation) ClearExpireAt()

ClearExpireAt clears the value of the "expire_at" field.

func (*URLMutation) ClearField

func (m *URLMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*URLMutation) ClearLogs

func (m *URLMutation) ClearLogs()

ClearLogs clears the "logs" edge to the VisitLog entity.

func (*URLMutation) ClearedEdges

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

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

func (*URLMutation) ClearedFields

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

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

func (URLMutation) Client

func (m URLMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*URLMutation) CreatedAt

func (m *URLMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*URLMutation) CurrentTimes

func (m *URLMutation) CurrentTimes() (r int, exists bool)

CurrentTimes returns the value of the "current_times" field in the mutation.

func (*URLMutation) EdgeCleared

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

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

func (*URLMutation) ExpireAt

func (m *URLMutation) ExpireAt() (r time.Time, exists bool)

ExpireAt returns the value of the "expire_at" field in the mutation.

func (*URLMutation) ExpireAtCleared

func (m *URLMutation) ExpireAtCleared() bool

ExpireAtCleared returns if the "expire_at" field was cleared in this mutation.

func (*URLMutation) Field

func (m *URLMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*URLMutation) FieldCleared

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

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

func (*URLMutation) Fields

func (m *URLMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*URLMutation) ID

func (m *URLMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*URLMutation) IDs

func (m *URLMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*URLMutation) LogsCleared

func (m *URLMutation) LogsCleared() bool

LogsCleared reports if the "logs" edge to the VisitLog entity was cleared.

func (*URLMutation) LogsIDs

func (m *URLMutation) LogsIDs() (ids []int)

LogsIDs returns the "logs" edge IDs in the mutation.

func (*URLMutation) MaxTimes

func (m *URLMutation) MaxTimes() (r int, exists bool)

MaxTimes returns the value of the "max_times" field in the mutation.

func (*URLMutation) OldCreatedAt

func (m *URLMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Url entity. If the Url object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*URLMutation) OldCurrentTimes

func (m *URLMutation) OldCurrentTimes(ctx context.Context) (v int, err error)

OldCurrentTimes returns the old "current_times" field's value of the Url entity. If the Url object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*URLMutation) OldExpireAt

func (m *URLMutation) OldExpireAt(ctx context.Context) (v *time.Time, err error)

OldExpireAt returns the old "expire_at" field's value of the Url entity. If the Url object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*URLMutation) OldField

func (m *URLMutation) 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 (*URLMutation) OldMaxTimes

func (m *URLMutation) OldMaxTimes(ctx context.Context) (v int, err error)

OldMaxTimes returns the old "max_times" field's value of the Url entity. If the Url object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*URLMutation) OldPath

func (m *URLMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Url entity. If the Url object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*URLMutation) OldURL

func (m *URLMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Url entity. If the Url object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*URLMutation) Op

func (m *URLMutation) Op() Op

Op returns the operation name.

func (*URLMutation) Path

func (m *URLMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*URLMutation) RemoveLogIDs

func (m *URLMutation) RemoveLogIDs(ids ...int)

RemoveLogIDs removes the "logs" edge to the VisitLog entity by IDs.

func (*URLMutation) RemovedEdges

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

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

func (*URLMutation) RemovedIDs

func (m *URLMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*URLMutation) RemovedLogsIDs

func (m *URLMutation) RemovedLogsIDs() (ids []int)

RemovedLogs returns the removed IDs of the "logs" edge to the VisitLog entity.

func (*URLMutation) ResetCreatedAt

func (m *URLMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*URLMutation) ResetCurrentTimes

func (m *URLMutation) ResetCurrentTimes()

ResetCurrentTimes resets all changes to the "current_times" field.

func (*URLMutation) ResetEdge

func (m *URLMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*URLMutation) ResetExpireAt

func (m *URLMutation) ResetExpireAt()

ResetExpireAt resets all changes to the "expire_at" field.

func (*URLMutation) ResetField

func (m *URLMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*URLMutation) ResetLogs

func (m *URLMutation) ResetLogs()

ResetLogs resets all changes to the "logs" edge.

func (*URLMutation) ResetMaxTimes

func (m *URLMutation) ResetMaxTimes()

ResetMaxTimes resets all changes to the "max_times" field.

func (*URLMutation) ResetPath

func (m *URLMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*URLMutation) ResetURL

func (m *URLMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*URLMutation) SetCreatedAt

func (m *URLMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*URLMutation) SetCurrentTimes

func (m *URLMutation) SetCurrentTimes(i int)

SetCurrentTimes sets the "current_times" field.

func (*URLMutation) SetExpireAt

func (m *URLMutation) SetExpireAt(t time.Time)

SetExpireAt sets the "expire_at" field.

func (*URLMutation) SetField

func (m *URLMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*URLMutation) SetMaxTimes

func (m *URLMutation) SetMaxTimes(i int)

SetMaxTimes sets the "max_times" field.

func (*URLMutation) SetPath

func (m *URLMutation) SetPath(s string)

SetPath sets the "path" field.

func (*URLMutation) SetURL

func (m *URLMutation) SetURL(s string)

SetURL sets the "url" field.

func (URLMutation) Tx

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

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

func (*URLMutation) Type

func (m *URLMutation) Type() string

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

func (*URLMutation) URL

func (m *URLMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*URLMutation) Where

func (m *URLMutation) Where(ps ...predicate.Url)

Where appends a list predicates to the URLMutation builder.

type URLQuery

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

URLQuery is the builder for querying Url entities.

func (*URLQuery) All

func (uq *URLQuery) All(ctx context.Context) ([]*Url, error)

All executes the query and returns a list of Urls.

func (*URLQuery) AllX

func (uq *URLQuery) AllX(ctx context.Context) []*Url

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

func (*URLQuery) Clone

func (uq *URLQuery) Clone() *URLQuery

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

func (*URLQuery) Count

func (uq *URLQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*URLQuery) CountX

func (uq *URLQuery) CountX(ctx context.Context) int

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

func (*URLQuery) Exist

func (uq *URLQuery) Exist(ctx context.Context) (bool, error)

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

func (*URLQuery) ExistX

func (uq *URLQuery) ExistX(ctx context.Context) bool

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

func (*URLQuery) First

func (uq *URLQuery) First(ctx context.Context) (*Url, error)

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

func (*URLQuery) FirstID

func (uq *URLQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*URLQuery) FirstIDX

func (uq *URLQuery) FirstIDX(ctx context.Context) int

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

func (*URLQuery) FirstX

func (uq *URLQuery) FirstX(ctx context.Context) *Url

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

func (*URLQuery) GroupBy

func (uq *URLQuery) GroupBy(field string, fields ...string) *URLGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	URL string `json:"url,omitempty"`
	Count int `json:"count,omitempty"`
}

client.URL.Query().
	GroupBy(url.FieldURL).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*URLQuery) IDs

func (uq *URLQuery) IDs(ctx context.Context) ([]int, error)

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

func (*URLQuery) IDsX

func (uq *URLQuery) IDsX(ctx context.Context) []int

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

func (*URLQuery) Limit

func (uq *URLQuery) Limit(limit int) *URLQuery

Limit adds a limit step to the query.

func (*URLQuery) Offset

func (uq *URLQuery) Offset(offset int) *URLQuery

Offset adds an offset step to the query.

func (*URLQuery) Only

func (uq *URLQuery) Only(ctx context.Context) (*Url, error)

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

func (*URLQuery) OnlyID

func (uq *URLQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*URLQuery) OnlyIDX

func (uq *URLQuery) OnlyIDX(ctx context.Context) int

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

func (*URLQuery) OnlyX

func (uq *URLQuery) OnlyX(ctx context.Context) *Url

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

func (*URLQuery) Order

func (uq *URLQuery) Order(o ...OrderFunc) *URLQuery

Order adds an order step to the query.

func (*URLQuery) QueryLogs

func (uq *URLQuery) QueryLogs() *VisitLogQuery

QueryLogs chains the current query on the "logs" edge.

func (*URLQuery) Select

func (uq *URLQuery) Select(fields ...string) *URLSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	URL string `json:"url,omitempty"`
}

client.URL.Query().
	Select(url.FieldURL).
	Scan(ctx, &v)

func (*URLQuery) Unique

func (uq *URLQuery) Unique(unique bool) *URLQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*URLQuery) Where

func (uq *URLQuery) Where(ps ...predicate.Url) *URLQuery

Where adds a new predicate for the URLQuery builder.

func (*URLQuery) WithLogs

func (uq *URLQuery) WithLogs(opts ...func(*VisitLogQuery)) *URLQuery

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

type URLSelect

type URLSelect struct {
	*URLQuery
	// contains filtered or unexported fields
}

URLSelect is the builder for selecting fields of URL entities.

func (*URLSelect) Bool

func (us *URLSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*URLSelect) BoolX

func (us *URLSelect) BoolX(ctx context.Context) bool

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

func (*URLSelect) Bools

func (us *URLSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*URLSelect) BoolsX

func (us *URLSelect) BoolsX(ctx context.Context) []bool

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

func (*URLSelect) Float64

func (us *URLSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*URLSelect) Float64X

func (us *URLSelect) Float64X(ctx context.Context) float64

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

func (*URLSelect) Float64s

func (us *URLSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*URLSelect) Float64sX

func (us *URLSelect) Float64sX(ctx context.Context) []float64

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

func (*URLSelect) Int

func (us *URLSelect) Int(ctx context.Context) (_ int, err error)

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

func (*URLSelect) IntX

func (us *URLSelect) IntX(ctx context.Context) int

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

func (*URLSelect) Ints

func (us *URLSelect) Ints(ctx context.Context) ([]int, error)

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

func (*URLSelect) IntsX

func (us *URLSelect) IntsX(ctx context.Context) []int

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

func (*URLSelect) Scan

func (us *URLSelect) Scan(ctx context.Context, v interface{}) error

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

func (*URLSelect) ScanX

func (us *URLSelect) ScanX(ctx context.Context, v interface{})

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

func (*URLSelect) String

func (us *URLSelect) String(ctx context.Context) (_ string, err error)

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

func (*URLSelect) StringX

func (us *URLSelect) StringX(ctx context.Context) string

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

func (*URLSelect) Strings

func (us *URLSelect) Strings(ctx context.Context) ([]string, error)

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

func (*URLSelect) StringsX

func (us *URLSelect) StringsX(ctx context.Context) []string

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

type URLUpdate

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

URLUpdate is the builder for updating Url entities.

func (*URLUpdate) AddCurrentTimes

func (uu *URLUpdate) AddCurrentTimes(i int) *URLUpdate

AddCurrentTimes adds i to the "current_times" field.

func (*URLUpdate) AddLogIDs

func (uu *URLUpdate) AddLogIDs(ids ...int) *URLUpdate

AddLogIDs adds the "logs" edge to the VisitLog entity by IDs.

func (*URLUpdate) AddLogs

func (uu *URLUpdate) AddLogs(v ...*VisitLog) *URLUpdate

AddLogs adds the "logs" edges to the VisitLog entity.

func (*URLUpdate) AddMaxTimes

func (uu *URLUpdate) AddMaxTimes(i int) *URLUpdate

AddMaxTimes adds i to the "max_times" field.

func (*URLUpdate) ClearExpireAt

func (uu *URLUpdate) ClearExpireAt() *URLUpdate

ClearExpireAt clears the value of the "expire_at" field.

func (*URLUpdate) ClearLogs

func (uu *URLUpdate) ClearLogs() *URLUpdate

ClearLogs clears all "logs" edges to the VisitLog entity.

func (*URLUpdate) Exec

func (uu *URLUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*URLUpdate) ExecX

func (uu *URLUpdate) ExecX(ctx context.Context)

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

func (*URLUpdate) Mutation

func (uu *URLUpdate) Mutation() *URLMutation

Mutation returns the URLMutation object of the builder.

func (*URLUpdate) RemoveLogIDs

func (uu *URLUpdate) RemoveLogIDs(ids ...int) *URLUpdate

RemoveLogIDs removes the "logs" edge to VisitLog entities by IDs.

func (*URLUpdate) RemoveLogs

func (uu *URLUpdate) RemoveLogs(v ...*VisitLog) *URLUpdate

RemoveLogs removes "logs" edges to VisitLog entities.

func (*URLUpdate) Save

func (uu *URLUpdate) Save(ctx context.Context) (int, error)

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

func (*URLUpdate) SaveX

func (uu *URLUpdate) SaveX(ctx context.Context) int

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

func (*URLUpdate) SetCreatedAt

func (uu *URLUpdate) SetCreatedAt(t time.Time) *URLUpdate

SetCreatedAt sets the "created_at" field.

func (*URLUpdate) SetCurrentTimes

func (uu *URLUpdate) SetCurrentTimes(i int) *URLUpdate

SetCurrentTimes sets the "current_times" field.

func (*URLUpdate) SetExpireAt

func (uu *URLUpdate) SetExpireAt(t time.Time) *URLUpdate

SetExpireAt sets the "expire_at" field.

func (*URLUpdate) SetMaxTimes

func (uu *URLUpdate) SetMaxTimes(i int) *URLUpdate

SetMaxTimes sets the "max_times" field.

func (*URLUpdate) SetNillableCreatedAt

func (uu *URLUpdate) SetNillableCreatedAt(t *time.Time) *URLUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*URLUpdate) SetNillableCurrentTimes

func (uu *URLUpdate) SetNillableCurrentTimes(i *int) *URLUpdate

SetNillableCurrentTimes sets the "current_times" field if the given value is not nil.

func (*URLUpdate) SetNillableExpireAt

func (uu *URLUpdate) SetNillableExpireAt(t *time.Time) *URLUpdate

SetNillableExpireAt sets the "expire_at" field if the given value is not nil.

func (*URLUpdate) SetNillableMaxTimes

func (uu *URLUpdate) SetNillableMaxTimes(i *int) *URLUpdate

SetNillableMaxTimes sets the "max_times" field if the given value is not nil.

func (*URLUpdate) SetPath

func (uu *URLUpdate) SetPath(s string) *URLUpdate

SetPath sets the "path" field.

func (*URLUpdate) SetURL

func (uu *URLUpdate) SetURL(s string) *URLUpdate

SetURL sets the "url" field.

func (*URLUpdate) Where

func (uu *URLUpdate) Where(ps ...predicate.Url) *URLUpdate

Where appends a list predicates to the URLUpdate builder.

type URLUpdateOne

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

URLUpdateOne is the builder for updating a single Url entity.

func (*URLUpdateOne) AddCurrentTimes

func (uuo *URLUpdateOne) AddCurrentTimes(i int) *URLUpdateOne

AddCurrentTimes adds i to the "current_times" field.

func (*URLUpdateOne) AddLogIDs

func (uuo *URLUpdateOne) AddLogIDs(ids ...int) *URLUpdateOne

AddLogIDs adds the "logs" edge to the VisitLog entity by IDs.

func (*URLUpdateOne) AddLogs

func (uuo *URLUpdateOne) AddLogs(v ...*VisitLog) *URLUpdateOne

AddLogs adds the "logs" edges to the VisitLog entity.

func (*URLUpdateOne) AddMaxTimes

func (uuo *URLUpdateOne) AddMaxTimes(i int) *URLUpdateOne

AddMaxTimes adds i to the "max_times" field.

func (*URLUpdateOne) ClearExpireAt

func (uuo *URLUpdateOne) ClearExpireAt() *URLUpdateOne

ClearExpireAt clears the value of the "expire_at" field.

func (*URLUpdateOne) ClearLogs

func (uuo *URLUpdateOne) ClearLogs() *URLUpdateOne

ClearLogs clears all "logs" edges to the VisitLog entity.

func (*URLUpdateOne) Exec

func (uuo *URLUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*URLUpdateOne) ExecX

func (uuo *URLUpdateOne) ExecX(ctx context.Context)

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

func (*URLUpdateOne) Mutation

func (uuo *URLUpdateOne) Mutation() *URLMutation

Mutation returns the URLMutation object of the builder.

func (*URLUpdateOne) RemoveLogIDs

func (uuo *URLUpdateOne) RemoveLogIDs(ids ...int) *URLUpdateOne

RemoveLogIDs removes the "logs" edge to VisitLog entities by IDs.

func (*URLUpdateOne) RemoveLogs

func (uuo *URLUpdateOne) RemoveLogs(v ...*VisitLog) *URLUpdateOne

RemoveLogs removes "logs" edges to VisitLog entities.

func (*URLUpdateOne) Save

func (uuo *URLUpdateOne) Save(ctx context.Context) (*Url, error)

Save executes the query and returns the updated Url entity.

func (*URLUpdateOne) SaveX

func (uuo *URLUpdateOne) SaveX(ctx context.Context) *Url

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

func (*URLUpdateOne) Select

func (uuo *URLUpdateOne) Select(field string, fields ...string) *URLUpdateOne

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

func (*URLUpdateOne) SetCreatedAt

func (uuo *URLUpdateOne) SetCreatedAt(t time.Time) *URLUpdateOne

SetCreatedAt sets the "created_at" field.

func (*URLUpdateOne) SetCurrentTimes

func (uuo *URLUpdateOne) SetCurrentTimes(i int) *URLUpdateOne

SetCurrentTimes sets the "current_times" field.

func (*URLUpdateOne) SetExpireAt

func (uuo *URLUpdateOne) SetExpireAt(t time.Time) *URLUpdateOne

SetExpireAt sets the "expire_at" field.

func (*URLUpdateOne) SetMaxTimes

func (uuo *URLUpdateOne) SetMaxTimes(i int) *URLUpdateOne

SetMaxTimes sets the "max_times" field.

func (*URLUpdateOne) SetNillableCreatedAt

func (uuo *URLUpdateOne) SetNillableCreatedAt(t *time.Time) *URLUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*URLUpdateOne) SetNillableCurrentTimes

func (uuo *URLUpdateOne) SetNillableCurrentTimes(i *int) *URLUpdateOne

SetNillableCurrentTimes sets the "current_times" field if the given value is not nil.

func (*URLUpdateOne) SetNillableExpireAt

func (uuo *URLUpdateOne) SetNillableExpireAt(t *time.Time) *URLUpdateOne

SetNillableExpireAt sets the "expire_at" field if the given value is not nil.

func (*URLUpdateOne) SetNillableMaxTimes

func (uuo *URLUpdateOne) SetNillableMaxTimes(i *int) *URLUpdateOne

SetNillableMaxTimes sets the "max_times" field if the given value is not nil.

func (*URLUpdateOne) SetPath

func (uuo *URLUpdateOne) SetPath(s string) *URLUpdateOne

SetPath sets the "path" field.

func (*URLUpdateOne) SetURL

func (uuo *URLUpdateOne) SetURL(s string) *URLUpdateOne

SetURL sets the "url" field.

type Url

type Url struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// CurrentTimes holds the value of the "current_times" field.
	CurrentTimes int `json:"current_times,omitempty"`
	// MaxTimes holds the value of the "max_times" field.
	MaxTimes int `json:"max_times,omitempty"`
	// ExpireAt holds the value of the "expire_at" field.
	ExpireAt *time.Time `json:"expire_at,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UrlQuery when eager-loading is set.
	Edges UrlEdges `json:"edges"`
	// contains filtered or unexported fields
}

Url is the model entity for the Url schema.

func (*Url) QueryLogs

func (u *Url) QueryLogs() *VisitLogQuery

QueryLogs queries the "logs" edge of the Url entity.

func (*Url) String

func (u *Url) String() string

String implements the fmt.Stringer.

func (*Url) Unwrap

func (u *Url) Unwrap() *Url

Unwrap unwraps the Url entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Url) Update

func (u *Url) Update() *URLUpdateOne

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

type UrlClient

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

UrlClient is a client for the Url schema.

func NewUrlClient

func NewUrlClient(c config) *UrlClient

NewUrlClient returns a client for the Url from the given config.

func (*UrlClient) Create

func (c *UrlClient) Create() *URLCreate

Create returns a create builder for Url.

func (*UrlClient) CreateBulk

func (c *UrlClient) CreateBulk(builders ...*URLCreate) *URLCreateBulk

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

func (*UrlClient) Delete

func (c *UrlClient) Delete() *URLDelete

Delete returns a delete builder for Url.

func (*UrlClient) DeleteOne

func (c *UrlClient) DeleteOne(u *Url) *URLDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UrlClient) DeleteOneID

func (c *UrlClient) DeleteOneID(id int) *URLDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UrlClient) Get

func (c *UrlClient) Get(ctx context.Context, id int) (*Url, error)

Get returns a Url entity by its id.

func (*UrlClient) GetX

func (c *UrlClient) GetX(ctx context.Context, id int) *Url

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

func (*UrlClient) Hooks

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

Hooks returns the client hooks.

func (*UrlClient) Query

func (c *UrlClient) Query() *URLQuery

Query returns a query builder for Url.

func (*UrlClient) QueryLogs

func (c *UrlClient) QueryLogs(u *Url) *VisitLogQuery

QueryLogs queries the logs edge of a Url.

func (*UrlClient) Update

func (c *UrlClient) Update() *URLUpdate

Update returns an update builder for Url.

func (*UrlClient) UpdateOne

func (c *UrlClient) UpdateOne(u *Url) *URLUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UrlClient) UpdateOneID

func (c *UrlClient) UpdateOneID(id int) *URLUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UrlClient) Use

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

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

type UrlEdges

type UrlEdges struct {
	// Logs holds the value of the logs edge.
	Logs []*VisitLog `json:"logs,omitempty"`
	// contains filtered or unexported fields
}

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

func (UrlEdges) LogsOrErr

func (e UrlEdges) LogsOrErr() ([]*VisitLog, error)

LogsOrErr returns the Logs value or an error if the edge was not loaded in eager-loading.

type Urls

type Urls []*Url

Urls is a parsable slice of Url.

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.

type VisitLog

type VisitLog struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Platform holds the value of the "platform" field.
	Platform string `json:"platform,omitempty"`
	// Os holds the value of the "os" field.
	Os string `json:"os,omitempty"`
	// IP holds the value of the "ip" field.
	IP string `json:"ip,omitempty"`
	// Referer holds the value of the "referer" field.
	Referer string `json:"referer,omitempty"`
	// EngineName holds the value of the "engine_name" field.
	EngineName string `json:"engine_name,omitempty"`
	// EngineVersion holds the value of the "engine_version" field.
	EngineVersion string `json:"engine_version,omitempty"`
	// BrowserName holds the value of the "browser_name" field.
	BrowserName string `json:"browser_name,omitempty"`
	// BrowserVersion holds the value of the "browser_version" field.
	BrowserVersion string `json:"browser_version,omitempty"`
	// Mozilla holds the value of the "mozilla" field.
	Mozilla string `json:"mozilla,omitempty"`
	// Bot holds the value of the "bot" field.
	Bot bool `json:"bot,omitempty"`
	// Mobile holds the value of the "mobile" field.
	Mobile bool `json:"mobile,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VisitLogQuery when eager-loading is set.
	Edges VisitLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

VisitLog is the model entity for the VisitLog schema.

func (*VisitLog) QueryURL

func (vl *VisitLog) QueryURL() *URLQuery

QueryURL queries the "url" edge of the VisitLog entity.

func (*VisitLog) String

func (vl *VisitLog) String() string

String implements the fmt.Stringer.

func (*VisitLog) Unwrap

func (vl *VisitLog) Unwrap() *VisitLog

Unwrap unwraps the VisitLog entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*VisitLog) Update

func (vl *VisitLog) Update() *VisitLogUpdateOne

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

type VisitLogClient

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

VisitLogClient is a client for the VisitLog schema.

func NewVisitLogClient

func NewVisitLogClient(c config) *VisitLogClient

NewVisitLogClient returns a client for the VisitLog from the given config.

func (*VisitLogClient) Create

func (c *VisitLogClient) Create() *VisitLogCreate

Create returns a create builder for VisitLog.

func (*VisitLogClient) CreateBulk

func (c *VisitLogClient) CreateBulk(builders ...*VisitLogCreate) *VisitLogCreateBulk

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

func (*VisitLogClient) Delete

func (c *VisitLogClient) Delete() *VisitLogDelete

Delete returns a delete builder for VisitLog.

func (*VisitLogClient) DeleteOne

func (c *VisitLogClient) DeleteOne(vl *VisitLog) *VisitLogDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*VisitLogClient) DeleteOneID

func (c *VisitLogClient) DeleteOneID(id int) *VisitLogDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*VisitLogClient) Get

func (c *VisitLogClient) Get(ctx context.Context, id int) (*VisitLog, error)

Get returns a VisitLog entity by its id.

func (*VisitLogClient) GetX

func (c *VisitLogClient) GetX(ctx context.Context, id int) *VisitLog

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

func (*VisitLogClient) Hooks

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

Hooks returns the client hooks.

func (*VisitLogClient) Query

func (c *VisitLogClient) Query() *VisitLogQuery

Query returns a query builder for VisitLog.

func (*VisitLogClient) QueryURL

func (c *VisitLogClient) QueryURL(vl *VisitLog) *URLQuery

QueryURL queries the url edge of a VisitLog.

func (*VisitLogClient) Update

func (c *VisitLogClient) Update() *VisitLogUpdate

Update returns an update builder for VisitLog.

func (*VisitLogClient) UpdateOne

func (c *VisitLogClient) UpdateOne(vl *VisitLog) *VisitLogUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VisitLogClient) UpdateOneID

func (c *VisitLogClient) UpdateOneID(id int) *VisitLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VisitLogClient) Use

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

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

type VisitLogCreate

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

VisitLogCreate is the builder for creating a VisitLog entity.

func (*VisitLogCreate) Exec

func (vlc *VisitLogCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VisitLogCreate) ExecX

func (vlc *VisitLogCreate) ExecX(ctx context.Context)

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

func (*VisitLogCreate) Mutation

func (vlc *VisitLogCreate) Mutation() *VisitLogMutation

Mutation returns the VisitLogMutation object of the builder.

func (*VisitLogCreate) Save

func (vlc *VisitLogCreate) Save(ctx context.Context) (*VisitLog, error)

Save creates the VisitLog in the database.

func (*VisitLogCreate) SaveX

func (vlc *VisitLogCreate) SaveX(ctx context.Context) *VisitLog

SaveX calls Save and panics if Save returns an error.

func (*VisitLogCreate) SetBot

func (vlc *VisitLogCreate) SetBot(b bool) *VisitLogCreate

SetBot sets the "bot" field.

func (*VisitLogCreate) SetBrowserName

func (vlc *VisitLogCreate) SetBrowserName(s string) *VisitLogCreate

SetBrowserName sets the "browser_name" field.

func (*VisitLogCreate) SetBrowserVersion

func (vlc *VisitLogCreate) SetBrowserVersion(s string) *VisitLogCreate

SetBrowserVersion sets the "browser_version" field.

func (*VisitLogCreate) SetCreatedAt

func (vlc *VisitLogCreate) SetCreatedAt(t time.Time) *VisitLogCreate

SetCreatedAt sets the "created_at" field.

func (*VisitLogCreate) SetEngineName

func (vlc *VisitLogCreate) SetEngineName(s string) *VisitLogCreate

SetEngineName sets the "engine_name" field.

func (*VisitLogCreate) SetEngineVersion

func (vlc *VisitLogCreate) SetEngineVersion(s string) *VisitLogCreate

SetEngineVersion sets the "engine_version" field.

func (*VisitLogCreate) SetIP

func (vlc *VisitLogCreate) SetIP(s string) *VisitLogCreate

SetIP sets the "ip" field.

func (*VisitLogCreate) SetMobile

func (vlc *VisitLogCreate) SetMobile(b bool) *VisitLogCreate

SetMobile sets the "mobile" field.

func (*VisitLogCreate) SetMozilla

func (vlc *VisitLogCreate) SetMozilla(s string) *VisitLogCreate

SetMozilla sets the "mozilla" field.

func (*VisitLogCreate) SetNillableCreatedAt

func (vlc *VisitLogCreate) SetNillableCreatedAt(t *time.Time) *VisitLogCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*VisitLogCreate) SetNillableURLID

func (vlc *VisitLogCreate) SetNillableURLID(id *int) *VisitLogCreate

SetNillableURLID sets the "url" edge to the Url entity by ID if the given value is not nil.

func (*VisitLogCreate) SetOs

func (vlc *VisitLogCreate) SetOs(s string) *VisitLogCreate

SetOs sets the "os" field.

func (*VisitLogCreate) SetPlatform

func (vlc *VisitLogCreate) SetPlatform(s string) *VisitLogCreate

SetPlatform sets the "platform" field.

func (*VisitLogCreate) SetReferer

func (vlc *VisitLogCreate) SetReferer(s string) *VisitLogCreate

SetReferer sets the "referer" field.

func (*VisitLogCreate) SetURL

func (vlc *VisitLogCreate) SetURL(u *Url) *VisitLogCreate

SetURL sets the "url" edge to the Url entity.

func (*VisitLogCreate) SetURLID

func (vlc *VisitLogCreate) SetURLID(id int) *VisitLogCreate

SetURLID sets the "url" edge to the Url entity by ID.

type VisitLogCreateBulk

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

VisitLogCreateBulk is the builder for creating many VisitLog entities in bulk.

func (*VisitLogCreateBulk) Exec

func (vlcb *VisitLogCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VisitLogCreateBulk) ExecX

func (vlcb *VisitLogCreateBulk) ExecX(ctx context.Context)

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

func (*VisitLogCreateBulk) Save

func (vlcb *VisitLogCreateBulk) Save(ctx context.Context) ([]*VisitLog, error)

Save creates the VisitLog entities in the database.

func (*VisitLogCreateBulk) SaveX

func (vlcb *VisitLogCreateBulk) SaveX(ctx context.Context) []*VisitLog

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

type VisitLogDelete

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

VisitLogDelete is the builder for deleting a VisitLog entity.

func (*VisitLogDelete) Exec

func (vld *VisitLogDelete) Exec(ctx context.Context) (int, error)

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

func (*VisitLogDelete) ExecX

func (vld *VisitLogDelete) ExecX(ctx context.Context) int

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

func (*VisitLogDelete) Where

func (vld *VisitLogDelete) Where(ps ...predicate.VisitLog) *VisitLogDelete

Where appends a list predicates to the VisitLogDelete builder.

type VisitLogDeleteOne

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

VisitLogDeleteOne is the builder for deleting a single VisitLog entity.

func (*VisitLogDeleteOne) Exec

func (vldo *VisitLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VisitLogDeleteOne) ExecX

func (vldo *VisitLogDeleteOne) ExecX(ctx context.Context)

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

type VisitLogEdges

type VisitLogEdges struct {
	// URL holds the value of the url edge.
	URL *Url `json:"url,omitempty"`
	// contains filtered or unexported fields
}

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

func (VisitLogEdges) URLOrErr

func (e VisitLogEdges) URLOrErr() (*Url, error)

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

type VisitLogGroupBy

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

VisitLogGroupBy is the group-by builder for VisitLog entities.

func (*VisitLogGroupBy) Aggregate

func (vlgb *VisitLogGroupBy) Aggregate(fns ...AggregateFunc) *VisitLogGroupBy

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

func (*VisitLogGroupBy) Bool

func (vlgb *VisitLogGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) BoolX

func (vlgb *VisitLogGroupBy) BoolX(ctx context.Context) bool

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

func (*VisitLogGroupBy) Bools

func (vlgb *VisitLogGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) BoolsX

func (vlgb *VisitLogGroupBy) BoolsX(ctx context.Context) []bool

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

func (*VisitLogGroupBy) Float64

func (vlgb *VisitLogGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) Float64X

func (vlgb *VisitLogGroupBy) Float64X(ctx context.Context) float64

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

func (*VisitLogGroupBy) Float64s

func (vlgb *VisitLogGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) Float64sX

func (vlgb *VisitLogGroupBy) Float64sX(ctx context.Context) []float64

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

func (*VisitLogGroupBy) Int

func (vlgb *VisitLogGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) IntX

func (vlgb *VisitLogGroupBy) IntX(ctx context.Context) int

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

func (*VisitLogGroupBy) Ints

func (vlgb *VisitLogGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) IntsX

func (vlgb *VisitLogGroupBy) IntsX(ctx context.Context) []int

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

func (*VisitLogGroupBy) Scan

func (vlgb *VisitLogGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*VisitLogGroupBy) ScanX

func (vlgb *VisitLogGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*VisitLogGroupBy) String

func (vlgb *VisitLogGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) StringX

func (vlgb *VisitLogGroupBy) StringX(ctx context.Context) string

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

func (*VisitLogGroupBy) Strings

func (vlgb *VisitLogGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*VisitLogGroupBy) StringsX

func (vlgb *VisitLogGroupBy) StringsX(ctx context.Context) []string

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

type VisitLogMutation

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

VisitLogMutation represents an operation that mutates the VisitLog nodes in the graph.

func (*VisitLogMutation) AddField

func (m *VisitLogMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*VisitLogMutation) AddedEdges

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

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

func (*VisitLogMutation) AddedField

func (m *VisitLogMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*VisitLogMutation) AddedFields

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

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

func (*VisitLogMutation) AddedIDs

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

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

func (*VisitLogMutation) Bot

func (m *VisitLogMutation) Bot() (r bool, exists bool)

Bot returns the value of the "bot" field in the mutation.

func (*VisitLogMutation) BrowserName

func (m *VisitLogMutation) BrowserName() (r string, exists bool)

BrowserName returns the value of the "browser_name" field in the mutation.

func (*VisitLogMutation) BrowserVersion

func (m *VisitLogMutation) BrowserVersion() (r string, exists bool)

BrowserVersion returns the value of the "browser_version" field in the mutation.

func (*VisitLogMutation) ClearEdge

func (m *VisitLogMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*VisitLogMutation) ClearField

func (m *VisitLogMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*VisitLogMutation) ClearURL

func (m *VisitLogMutation) ClearURL()

ClearURL clears the "url" edge to the Url entity.

func (*VisitLogMutation) ClearedEdges

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

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

func (*VisitLogMutation) ClearedFields

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

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

func (VisitLogMutation) Client

func (m VisitLogMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*VisitLogMutation) CreatedAt

func (m *VisitLogMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*VisitLogMutation) EdgeCleared

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

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

func (*VisitLogMutation) EngineName

func (m *VisitLogMutation) EngineName() (r string, exists bool)

EngineName returns the value of the "engine_name" field in the mutation.

func (*VisitLogMutation) EngineVersion

func (m *VisitLogMutation) EngineVersion() (r string, exists bool)

EngineVersion returns the value of the "engine_version" field in the mutation.

func (*VisitLogMutation) Field

func (m *VisitLogMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*VisitLogMutation) FieldCleared

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

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

func (*VisitLogMutation) Fields

func (m *VisitLogMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*VisitLogMutation) ID

func (m *VisitLogMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*VisitLogMutation) IDs

func (m *VisitLogMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*VisitLogMutation) IP

func (m *VisitLogMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*VisitLogMutation) Mobile

func (m *VisitLogMutation) Mobile() (r bool, exists bool)

Mobile returns the value of the "mobile" field in the mutation.

func (*VisitLogMutation) Mozilla

func (m *VisitLogMutation) Mozilla() (r string, exists bool)

Mozilla returns the value of the "mozilla" field in the mutation.

func (*VisitLogMutation) OldBot

func (m *VisitLogMutation) OldBot(ctx context.Context) (v bool, err error)

OldBot returns the old "bot" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldBrowserName

func (m *VisitLogMutation) OldBrowserName(ctx context.Context) (v string, err error)

OldBrowserName returns the old "browser_name" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldBrowserVersion

func (m *VisitLogMutation) OldBrowserVersion(ctx context.Context) (v string, err error)

OldBrowserVersion returns the old "browser_version" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldCreatedAt

func (m *VisitLogMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldEngineName

func (m *VisitLogMutation) OldEngineName(ctx context.Context) (v string, err error)

OldEngineName returns the old "engine_name" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldEngineVersion

func (m *VisitLogMutation) OldEngineVersion(ctx context.Context) (v string, err error)

OldEngineVersion returns the old "engine_version" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldField

func (m *VisitLogMutation) 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 (*VisitLogMutation) OldIP

func (m *VisitLogMutation) OldIP(ctx context.Context) (v string, err error)

OldIP returns the old "ip" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldMobile

func (m *VisitLogMutation) OldMobile(ctx context.Context) (v bool, err error)

OldMobile returns the old "mobile" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldMozilla

func (m *VisitLogMutation) OldMozilla(ctx context.Context) (v string, err error)

OldMozilla returns the old "mozilla" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldOs

func (m *VisitLogMutation) OldOs(ctx context.Context) (v string, err error)

OldOs returns the old "os" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldPlatform

func (m *VisitLogMutation) OldPlatform(ctx context.Context) (v string, err error)

OldPlatform returns the old "platform" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) OldReferer

func (m *VisitLogMutation) OldReferer(ctx context.Context) (v string, err error)

OldReferer returns the old "referer" field's value of the VisitLog entity. If the VisitLog object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*VisitLogMutation) Op

func (m *VisitLogMutation) Op() Op

Op returns the operation name.

func (*VisitLogMutation) Os

func (m *VisitLogMutation) Os() (r string, exists bool)

Os returns the value of the "os" field in the mutation.

func (*VisitLogMutation) Platform

func (m *VisitLogMutation) Platform() (r string, exists bool)

Platform returns the value of the "platform" field in the mutation.

func (*VisitLogMutation) Referer

func (m *VisitLogMutation) Referer() (r string, exists bool)

Referer returns the value of the "referer" field in the mutation.

func (*VisitLogMutation) RemovedEdges

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

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

func (*VisitLogMutation) RemovedIDs

func (m *VisitLogMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*VisitLogMutation) ResetBot

func (m *VisitLogMutation) ResetBot()

ResetBot resets all changes to the "bot" field.

func (*VisitLogMutation) ResetBrowserName

func (m *VisitLogMutation) ResetBrowserName()

ResetBrowserName resets all changes to the "browser_name" field.

func (*VisitLogMutation) ResetBrowserVersion

func (m *VisitLogMutation) ResetBrowserVersion()

ResetBrowserVersion resets all changes to the "browser_version" field.

func (*VisitLogMutation) ResetCreatedAt

func (m *VisitLogMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*VisitLogMutation) ResetEdge

func (m *VisitLogMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*VisitLogMutation) ResetEngineName

func (m *VisitLogMutation) ResetEngineName()

ResetEngineName resets all changes to the "engine_name" field.

func (*VisitLogMutation) ResetEngineVersion

func (m *VisitLogMutation) ResetEngineVersion()

ResetEngineVersion resets all changes to the "engine_version" field.

func (*VisitLogMutation) ResetField

func (m *VisitLogMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*VisitLogMutation) ResetIP

func (m *VisitLogMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*VisitLogMutation) ResetMobile

func (m *VisitLogMutation) ResetMobile()

ResetMobile resets all changes to the "mobile" field.

func (*VisitLogMutation) ResetMozilla

func (m *VisitLogMutation) ResetMozilla()

ResetMozilla resets all changes to the "mozilla" field.

func (*VisitLogMutation) ResetOs

func (m *VisitLogMutation) ResetOs()

ResetOs resets all changes to the "os" field.

func (*VisitLogMutation) ResetPlatform

func (m *VisitLogMutation) ResetPlatform()

ResetPlatform resets all changes to the "platform" field.

func (*VisitLogMutation) ResetReferer

func (m *VisitLogMutation) ResetReferer()

ResetReferer resets all changes to the "referer" field.

func (*VisitLogMutation) ResetURL

func (m *VisitLogMutation) ResetURL()

ResetURL resets all changes to the "url" edge.

func (*VisitLogMutation) SetBot

func (m *VisitLogMutation) SetBot(b bool)

SetBot sets the "bot" field.

func (*VisitLogMutation) SetBrowserName

func (m *VisitLogMutation) SetBrowserName(s string)

SetBrowserName sets the "browser_name" field.

func (*VisitLogMutation) SetBrowserVersion

func (m *VisitLogMutation) SetBrowserVersion(s string)

SetBrowserVersion sets the "browser_version" field.

func (*VisitLogMutation) SetCreatedAt

func (m *VisitLogMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*VisitLogMutation) SetEngineName

func (m *VisitLogMutation) SetEngineName(s string)

SetEngineName sets the "engine_name" field.

func (*VisitLogMutation) SetEngineVersion

func (m *VisitLogMutation) SetEngineVersion(s string)

SetEngineVersion sets the "engine_version" field.

func (*VisitLogMutation) SetField

func (m *VisitLogMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*VisitLogMutation) SetIP

func (m *VisitLogMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*VisitLogMutation) SetMobile

func (m *VisitLogMutation) SetMobile(b bool)

SetMobile sets the "mobile" field.

func (*VisitLogMutation) SetMozilla

func (m *VisitLogMutation) SetMozilla(s string)

SetMozilla sets the "mozilla" field.

func (*VisitLogMutation) SetOs

func (m *VisitLogMutation) SetOs(s string)

SetOs sets the "os" field.

func (*VisitLogMutation) SetPlatform

func (m *VisitLogMutation) SetPlatform(s string)

SetPlatform sets the "platform" field.

func (*VisitLogMutation) SetReferer

func (m *VisitLogMutation) SetReferer(s string)

SetReferer sets the "referer" field.

func (*VisitLogMutation) SetURLID

func (m *VisitLogMutation) SetURLID(id int)

SetURLID sets the "url" edge to the Url entity by id.

func (VisitLogMutation) Tx

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

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

func (*VisitLogMutation) Type

func (m *VisitLogMutation) Type() string

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

func (*VisitLogMutation) URLCleared

func (m *VisitLogMutation) URLCleared() bool

URLCleared reports if the "url" edge to the Url entity was cleared.

func (*VisitLogMutation) URLID

func (m *VisitLogMutation) URLID() (id int, exists bool)

URLID returns the "url" edge ID in the mutation.

func (*VisitLogMutation) URLIDs

func (m *VisitLogMutation) URLIDs() (ids []int)

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

func (*VisitLogMutation) Where

func (m *VisitLogMutation) Where(ps ...predicate.VisitLog)

Where appends a list predicates to the VisitLogMutation builder.

type VisitLogQuery

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

VisitLogQuery is the builder for querying VisitLog entities.

func (*VisitLogQuery) All

func (vlq *VisitLogQuery) All(ctx context.Context) ([]*VisitLog, error)

All executes the query and returns a list of VisitLogs.

func (*VisitLogQuery) AllX

func (vlq *VisitLogQuery) AllX(ctx context.Context) []*VisitLog

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

func (*VisitLogQuery) Clone

func (vlq *VisitLogQuery) Clone() *VisitLogQuery

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

func (*VisitLogQuery) Count

func (vlq *VisitLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VisitLogQuery) CountX

func (vlq *VisitLogQuery) CountX(ctx context.Context) int

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

func (*VisitLogQuery) Exist

func (vlq *VisitLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*VisitLogQuery) ExistX

func (vlq *VisitLogQuery) ExistX(ctx context.Context) bool

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

func (*VisitLogQuery) First

func (vlq *VisitLogQuery) First(ctx context.Context) (*VisitLog, error)

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

func (*VisitLogQuery) FirstID

func (vlq *VisitLogQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*VisitLogQuery) FirstIDX

func (vlq *VisitLogQuery) FirstIDX(ctx context.Context) int

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

func (*VisitLogQuery) FirstX

func (vlq *VisitLogQuery) FirstX(ctx context.Context) *VisitLog

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

func (*VisitLogQuery) GroupBy

func (vlq *VisitLogQuery) GroupBy(field string, fields ...string) *VisitLogGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Platform string `json:"platform,omitempty"`
	Count int `json:"count,omitempty"`
}

client.VisitLog.Query().
	GroupBy(visitlog.FieldPlatform).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VisitLogQuery) IDs

func (vlq *VisitLogQuery) IDs(ctx context.Context) ([]int, error)

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

func (*VisitLogQuery) IDsX

func (vlq *VisitLogQuery) IDsX(ctx context.Context) []int

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

func (*VisitLogQuery) Limit

func (vlq *VisitLogQuery) Limit(limit int) *VisitLogQuery

Limit adds a limit step to the query.

func (*VisitLogQuery) Offset

func (vlq *VisitLogQuery) Offset(offset int) *VisitLogQuery

Offset adds an offset step to the query.

func (*VisitLogQuery) Only

func (vlq *VisitLogQuery) Only(ctx context.Context) (*VisitLog, error)

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

func (*VisitLogQuery) OnlyID

func (vlq *VisitLogQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*VisitLogQuery) OnlyIDX

func (vlq *VisitLogQuery) OnlyIDX(ctx context.Context) int

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

func (*VisitLogQuery) OnlyX

func (vlq *VisitLogQuery) OnlyX(ctx context.Context) *VisitLog

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

func (*VisitLogQuery) Order

func (vlq *VisitLogQuery) Order(o ...OrderFunc) *VisitLogQuery

Order adds an order step to the query.

func (*VisitLogQuery) QueryURL

func (vlq *VisitLogQuery) QueryURL() *URLQuery

QueryURL chains the current query on the "url" edge.

func (*VisitLogQuery) Select

func (vlq *VisitLogQuery) Select(fields ...string) *VisitLogSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Platform string `json:"platform,omitempty"`
}

client.VisitLog.Query().
	Select(visitlog.FieldPlatform).
	Scan(ctx, &v)

func (*VisitLogQuery) Unique

func (vlq *VisitLogQuery) Unique(unique bool) *VisitLogQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*VisitLogQuery) Where

func (vlq *VisitLogQuery) Where(ps ...predicate.VisitLog) *VisitLogQuery

Where adds a new predicate for the VisitLogQuery builder.

func (*VisitLogQuery) WithURL

func (vlq *VisitLogQuery) WithURL(opts ...func(*URLQuery)) *VisitLogQuery

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

type VisitLogSelect

type VisitLogSelect struct {
	*VisitLogQuery
	// contains filtered or unexported fields
}

VisitLogSelect is the builder for selecting fields of VisitLog entities.

func (*VisitLogSelect) Bool

func (vls *VisitLogSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*VisitLogSelect) BoolX

func (vls *VisitLogSelect) BoolX(ctx context.Context) bool

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

func (*VisitLogSelect) Bools

func (vls *VisitLogSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*VisitLogSelect) BoolsX

func (vls *VisitLogSelect) BoolsX(ctx context.Context) []bool

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

func (*VisitLogSelect) Float64

func (vls *VisitLogSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*VisitLogSelect) Float64X

func (vls *VisitLogSelect) Float64X(ctx context.Context) float64

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

func (*VisitLogSelect) Float64s

func (vls *VisitLogSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*VisitLogSelect) Float64sX

func (vls *VisitLogSelect) Float64sX(ctx context.Context) []float64

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

func (*VisitLogSelect) Int

func (vls *VisitLogSelect) Int(ctx context.Context) (_ int, err error)

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

func (*VisitLogSelect) IntX

func (vls *VisitLogSelect) IntX(ctx context.Context) int

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

func (*VisitLogSelect) Ints

func (vls *VisitLogSelect) Ints(ctx context.Context) ([]int, error)

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

func (*VisitLogSelect) IntsX

func (vls *VisitLogSelect) IntsX(ctx context.Context) []int

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

func (*VisitLogSelect) Scan

func (vls *VisitLogSelect) Scan(ctx context.Context, v interface{}) error

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

func (*VisitLogSelect) ScanX

func (vls *VisitLogSelect) ScanX(ctx context.Context, v interface{})

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

func (*VisitLogSelect) String

func (vls *VisitLogSelect) String(ctx context.Context) (_ string, err error)

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

func (*VisitLogSelect) StringX

func (vls *VisitLogSelect) StringX(ctx context.Context) string

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

func (*VisitLogSelect) Strings

func (vls *VisitLogSelect) Strings(ctx context.Context) ([]string, error)

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

func (*VisitLogSelect) StringsX

func (vls *VisitLogSelect) StringsX(ctx context.Context) []string

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

type VisitLogUpdate

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

VisitLogUpdate is the builder for updating VisitLog entities.

func (*VisitLogUpdate) ClearURL

func (vlu *VisitLogUpdate) ClearURL() *VisitLogUpdate

ClearURL clears the "url" edge to the Url entity.

func (*VisitLogUpdate) Exec

func (vlu *VisitLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VisitLogUpdate) ExecX

func (vlu *VisitLogUpdate) ExecX(ctx context.Context)

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

func (*VisitLogUpdate) Mutation

func (vlu *VisitLogUpdate) Mutation() *VisitLogMutation

Mutation returns the VisitLogMutation object of the builder.

func (*VisitLogUpdate) Save

func (vlu *VisitLogUpdate) Save(ctx context.Context) (int, error)

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

func (*VisitLogUpdate) SaveX

func (vlu *VisitLogUpdate) SaveX(ctx context.Context) int

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

func (*VisitLogUpdate) SetBot

func (vlu *VisitLogUpdate) SetBot(b bool) *VisitLogUpdate

SetBot sets the "bot" field.

func (*VisitLogUpdate) SetBrowserName

func (vlu *VisitLogUpdate) SetBrowserName(s string) *VisitLogUpdate

SetBrowserName sets the "browser_name" field.

func (*VisitLogUpdate) SetBrowserVersion

func (vlu *VisitLogUpdate) SetBrowserVersion(s string) *VisitLogUpdate

SetBrowserVersion sets the "browser_version" field.

func (*VisitLogUpdate) SetCreatedAt

func (vlu *VisitLogUpdate) SetCreatedAt(t time.Time) *VisitLogUpdate

SetCreatedAt sets the "created_at" field.

func (*VisitLogUpdate) SetEngineName

func (vlu *VisitLogUpdate) SetEngineName(s string) *VisitLogUpdate

SetEngineName sets the "engine_name" field.

func (*VisitLogUpdate) SetEngineVersion

func (vlu *VisitLogUpdate) SetEngineVersion(s string) *VisitLogUpdate

SetEngineVersion sets the "engine_version" field.

func (*VisitLogUpdate) SetIP

func (vlu *VisitLogUpdate) SetIP(s string) *VisitLogUpdate

SetIP sets the "ip" field.

func (*VisitLogUpdate) SetMobile

func (vlu *VisitLogUpdate) SetMobile(b bool) *VisitLogUpdate

SetMobile sets the "mobile" field.

func (*VisitLogUpdate) SetMozilla

func (vlu *VisitLogUpdate) SetMozilla(s string) *VisitLogUpdate

SetMozilla sets the "mozilla" field.

func (*VisitLogUpdate) SetNillableCreatedAt

func (vlu *VisitLogUpdate) SetNillableCreatedAt(t *time.Time) *VisitLogUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*VisitLogUpdate) SetNillableURLID

func (vlu *VisitLogUpdate) SetNillableURLID(id *int) *VisitLogUpdate

SetNillableURLID sets the "url" edge to the Url entity by ID if the given value is not nil.

func (*VisitLogUpdate) SetOs

func (vlu *VisitLogUpdate) SetOs(s string) *VisitLogUpdate

SetOs sets the "os" field.

func (*VisitLogUpdate) SetPlatform

func (vlu *VisitLogUpdate) SetPlatform(s string) *VisitLogUpdate

SetPlatform sets the "platform" field.

func (*VisitLogUpdate) SetReferer

func (vlu *VisitLogUpdate) SetReferer(s string) *VisitLogUpdate

SetReferer sets the "referer" field.

func (*VisitLogUpdate) SetURL

func (vlu *VisitLogUpdate) SetURL(u *Url) *VisitLogUpdate

SetURL sets the "url" edge to the Url entity.

func (*VisitLogUpdate) SetURLID

func (vlu *VisitLogUpdate) SetURLID(id int) *VisitLogUpdate

SetURLID sets the "url" edge to the Url entity by ID.

func (*VisitLogUpdate) Where

func (vlu *VisitLogUpdate) Where(ps ...predicate.VisitLog) *VisitLogUpdate

Where appends a list predicates to the VisitLogUpdate builder.

type VisitLogUpdateOne

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

VisitLogUpdateOne is the builder for updating a single VisitLog entity.

func (*VisitLogUpdateOne) ClearURL

func (vluo *VisitLogUpdateOne) ClearURL() *VisitLogUpdateOne

ClearURL clears the "url" edge to the Url entity.

func (*VisitLogUpdateOne) Exec

func (vluo *VisitLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VisitLogUpdateOne) ExecX

func (vluo *VisitLogUpdateOne) ExecX(ctx context.Context)

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

func (*VisitLogUpdateOne) Mutation

func (vluo *VisitLogUpdateOne) Mutation() *VisitLogMutation

Mutation returns the VisitLogMutation object of the builder.

func (*VisitLogUpdateOne) Save

func (vluo *VisitLogUpdateOne) Save(ctx context.Context) (*VisitLog, error)

Save executes the query and returns the updated VisitLog entity.

func (*VisitLogUpdateOne) SaveX

func (vluo *VisitLogUpdateOne) SaveX(ctx context.Context) *VisitLog

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

func (*VisitLogUpdateOne) Select

func (vluo *VisitLogUpdateOne) Select(field string, fields ...string) *VisitLogUpdateOne

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

func (*VisitLogUpdateOne) SetBot

func (vluo *VisitLogUpdateOne) SetBot(b bool) *VisitLogUpdateOne

SetBot sets the "bot" field.

func (*VisitLogUpdateOne) SetBrowserName

func (vluo *VisitLogUpdateOne) SetBrowserName(s string) *VisitLogUpdateOne

SetBrowserName sets the "browser_name" field.

func (*VisitLogUpdateOne) SetBrowserVersion

func (vluo *VisitLogUpdateOne) SetBrowserVersion(s string) *VisitLogUpdateOne

SetBrowserVersion sets the "browser_version" field.

func (*VisitLogUpdateOne) SetCreatedAt

func (vluo *VisitLogUpdateOne) SetCreatedAt(t time.Time) *VisitLogUpdateOne

SetCreatedAt sets the "created_at" field.

func (*VisitLogUpdateOne) SetEngineName

func (vluo *VisitLogUpdateOne) SetEngineName(s string) *VisitLogUpdateOne

SetEngineName sets the "engine_name" field.

func (*VisitLogUpdateOne) SetEngineVersion

func (vluo *VisitLogUpdateOne) SetEngineVersion(s string) *VisitLogUpdateOne

SetEngineVersion sets the "engine_version" field.

func (*VisitLogUpdateOne) SetIP

func (vluo *VisitLogUpdateOne) SetIP(s string) *VisitLogUpdateOne

SetIP sets the "ip" field.

func (*VisitLogUpdateOne) SetMobile

func (vluo *VisitLogUpdateOne) SetMobile(b bool) *VisitLogUpdateOne

SetMobile sets the "mobile" field.

func (*VisitLogUpdateOne) SetMozilla

func (vluo *VisitLogUpdateOne) SetMozilla(s string) *VisitLogUpdateOne

SetMozilla sets the "mozilla" field.

func (*VisitLogUpdateOne) SetNillableCreatedAt

func (vluo *VisitLogUpdateOne) SetNillableCreatedAt(t *time.Time) *VisitLogUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*VisitLogUpdateOne) SetNillableURLID

func (vluo *VisitLogUpdateOne) SetNillableURLID(id *int) *VisitLogUpdateOne

SetNillableURLID sets the "url" edge to the Url entity by ID if the given value is not nil.

func (*VisitLogUpdateOne) SetOs

func (vluo *VisitLogUpdateOne) SetOs(s string) *VisitLogUpdateOne

SetOs sets the "os" field.

func (*VisitLogUpdateOne) SetPlatform

func (vluo *VisitLogUpdateOne) SetPlatform(s string) *VisitLogUpdateOne

SetPlatform sets the "platform" field.

func (*VisitLogUpdateOne) SetReferer

func (vluo *VisitLogUpdateOne) SetReferer(s string) *VisitLogUpdateOne

SetReferer sets the "referer" field.

func (*VisitLogUpdateOne) SetURL

func (vluo *VisitLogUpdateOne) SetURL(u *Url) *VisitLogUpdateOne

SetURL sets the "url" edge to the Url entity.

func (*VisitLogUpdateOne) SetURLID

func (vluo *VisitLogUpdateOne) SetURLID(id int) *VisitLogUpdateOne

SetURLID sets the "url" edge to the Url entity by ID.

type VisitLogs

type VisitLogs []*VisitLog

VisitLogs is a parsable slice of VisitLog.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL