ent

package
v0.0.0-...-6edac6f Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT 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.
	TypeRawEvent = "RawEvent"
)

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 validaton error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks nor 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 Client 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
	// RawEvent is the client for interacting with the RawEvent builders.
	RawEvent *RawEventClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns the Client stored in 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 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().
	RawEvent.
	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(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 Committer 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 conflict in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflict 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 conflict 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 either graph traversal or 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 conflict in user's code.

type Query

type Query = ent.Query

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

type RawEvent

type RawEvent struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// TrackingID holds the value of the "tracking_id" field.
	TrackingID uuid.UUID `json:"tracking_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// Anonymous holds the value of the "anonymous" field.
	Anonymous bool `json:"anonymous,omitempty"`
	// GroupID holds the value of the "group_id" field.
	GroupID string `json:"group_id,omitempty"`
	// SessionID holds the value of the "session_id" field.
	SessionID string `json:"session_id,omitempty"`
	// DeviceID holds the value of the "device_id" field.
	DeviceID string `json:"device_id,omitempty"`
	// Event holds the value of the "event" field.
	Event string `json:"event,omitempty"`
	// NonInteractive holds the value of the "non_interactive" field.
	NonInteractive bool `json:"non_interactive,omitempty"`
	// Channel holds the value of the "channel" field.
	Channel string `json:"channel,omitempty"`
	// Platform holds the value of the "platform" field.
	Platform string `json:"platform,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Context holds the value of the "context" field.
	Context map[string]interface{} `json:"context,omitempty"`
	// contains filtered or unexported fields
}

RawEvent is the model entity for the RawEvent schema.

func (*RawEvent) String

func (re *RawEvent) String() string

String implements the fmt.Stringer.

func (*RawEvent) Unwrap

func (re *RawEvent) Unwrap() *RawEvent

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

func (*RawEvent) Update

func (re *RawEvent) Update() *RawEventUpdateOne

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

type RawEventClient

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

RawEventClient is a client for the RawEvent schema.

func NewRawEventClient

func NewRawEventClient(c config) *RawEventClient

NewRawEventClient returns a client for the RawEvent from the given config.

func (*RawEventClient) Create

func (c *RawEventClient) Create() *RawEventCreate

Create returns a create builder for RawEvent.

func (*RawEventClient) CreateBulk

func (c *RawEventClient) CreateBulk(builders ...*RawEventCreate) *RawEventCreateBulk

BulkCreate returns a builder for creating a bulk of RawEvent entities.

func (*RawEventClient) Delete

func (c *RawEventClient) Delete() *RawEventDelete

Delete returns a delete builder for RawEvent.

func (*RawEventClient) DeleteOne

func (c *RawEventClient) DeleteOne(re *RawEvent) *RawEventDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*RawEventClient) DeleteOneID

func (c *RawEventClient) DeleteOneID(id uuid.UUID) *RawEventDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*RawEventClient) Get

func (c *RawEventClient) Get(ctx context.Context, id uuid.UUID) (*RawEvent, error)

Get returns a RawEvent entity by its id.

func (*RawEventClient) GetX

func (c *RawEventClient) GetX(ctx context.Context, id uuid.UUID) *RawEvent

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

func (*RawEventClient) Hooks

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

Hooks returns the client hooks.

func (*RawEventClient) Query

func (c *RawEventClient) Query() *RawEventQuery

Query returns a query builder for RawEvent.

func (*RawEventClient) Update

func (c *RawEventClient) Update() *RawEventUpdate

Update returns an update builder for RawEvent.

func (*RawEventClient) UpdateOne

func (c *RawEventClient) UpdateOne(re *RawEvent) *RawEventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RawEventClient) UpdateOneID

func (c *RawEventClient) UpdateOneID(id uuid.UUID) *RawEventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RawEventClient) Use

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

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

type RawEventCreate

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

RawEventCreate is the builder for creating a RawEvent entity.

func (*RawEventCreate) Mutation

func (rec *RawEventCreate) Mutation() *RawEventMutation

Mutation returns the RawEventMutation object of the builder.

func (*RawEventCreate) Save

func (rec *RawEventCreate) Save(ctx context.Context) (*RawEvent, error)

Save creates the RawEvent in the database.

func (*RawEventCreate) SaveX

func (rec *RawEventCreate) SaveX(ctx context.Context) *RawEvent

SaveX calls Save and panics if Save returns an error.

func (*RawEventCreate) SetAnonymous

func (rec *RawEventCreate) SetAnonymous(b bool) *RawEventCreate

SetAnonymous sets the anonymous field.

func (*RawEventCreate) SetChannel

func (rec *RawEventCreate) SetChannel(s string) *RawEventCreate

SetChannel sets the channel field.

func (*RawEventCreate) SetContext

func (rec *RawEventCreate) SetContext(m map[string]interface{}) *RawEventCreate

SetContext sets the context field.

func (*RawEventCreate) SetDeviceID

func (rec *RawEventCreate) SetDeviceID(s string) *RawEventCreate

SetDeviceID sets the device_id field.

func (*RawEventCreate) SetEvent

func (rec *RawEventCreate) SetEvent(s string) *RawEventCreate

SetEvent sets the event field.

func (*RawEventCreate) SetGroupID

func (rec *RawEventCreate) SetGroupID(s string) *RawEventCreate

SetGroupID sets the group_id field.

func (*RawEventCreate) SetID

func (rec *RawEventCreate) SetID(u uuid.UUID) *RawEventCreate

SetID sets the id field.

func (*RawEventCreate) SetNillableChannel

func (rec *RawEventCreate) SetNillableChannel(s *string) *RawEventCreate

SetNillableChannel sets the channel field if the given value is not nil.

func (*RawEventCreate) SetNillableDeviceID

func (rec *RawEventCreate) SetNillableDeviceID(s *string) *RawEventCreate

SetNillableDeviceID sets the device_id field if the given value is not nil.

func (*RawEventCreate) SetNillableGroupID

func (rec *RawEventCreate) SetNillableGroupID(s *string) *RawEventCreate

SetNillableGroupID sets the group_id field if the given value is not nil.

func (*RawEventCreate) SetNillablePlatform

func (rec *RawEventCreate) SetNillablePlatform(s *string) *RawEventCreate

SetNillablePlatform sets the platform field if the given value is not nil.

func (*RawEventCreate) SetNillableSessionID

func (rec *RawEventCreate) SetNillableSessionID(s *string) *RawEventCreate

SetNillableSessionID sets the session_id field if the given value is not nil.

func (*RawEventCreate) SetNonInteractive

func (rec *RawEventCreate) SetNonInteractive(b bool) *RawEventCreate

SetNonInteractive sets the non_interactive field.

func (*RawEventCreate) SetPlatform

func (rec *RawEventCreate) SetPlatform(s string) *RawEventCreate

SetPlatform sets the platform field.

func (*RawEventCreate) SetSessionID

func (rec *RawEventCreate) SetSessionID(s string) *RawEventCreate

SetSessionID sets the session_id field.

func (*RawEventCreate) SetTimestamp

func (rec *RawEventCreate) SetTimestamp(t time.Time) *RawEventCreate

SetTimestamp sets the timestamp field.

func (*RawEventCreate) SetTrackingID

func (rec *RawEventCreate) SetTrackingID(u uuid.UUID) *RawEventCreate

SetTrackingID sets the tracking_id field.

func (*RawEventCreate) SetUserID

func (rec *RawEventCreate) SetUserID(s string) *RawEventCreate

SetUserID sets the user_id field.

type RawEventCreateBulk

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

RawEventCreateBulk is the builder for creating a bulk of RawEvent entities.

func (*RawEventCreateBulk) Save

func (recb *RawEventCreateBulk) Save(ctx context.Context) ([]*RawEvent, error)

Save creates the RawEvent entities in the database.

func (*RawEventCreateBulk) SaveX

func (recb *RawEventCreateBulk) SaveX(ctx context.Context) []*RawEvent

SaveX calls Save and panics if Save returns an error.

type RawEventDelete

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

RawEventDelete is the builder for deleting a RawEvent entity.

func (*RawEventDelete) Exec

func (red *RawEventDelete) Exec(ctx context.Context) (int, error)

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

func (*RawEventDelete) ExecX

func (red *RawEventDelete) ExecX(ctx context.Context) int

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

func (*RawEventDelete) Where

func (red *RawEventDelete) Where(ps ...predicate.RawEvent) *RawEventDelete

Where adds a new predicate to the delete builder.

type RawEventDeleteOne

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

RawEventDeleteOne is the builder for deleting a single RawEvent entity.

func (*RawEventDeleteOne) Exec

func (redo *RawEventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RawEventDeleteOne) ExecX

func (redo *RawEventDeleteOne) ExecX(ctx context.Context)

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

type RawEventGroupBy

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

RawEventGroupBy is the builder for group-by RawEvent entities.

func (*RawEventGroupBy) Aggregate

func (regb *RawEventGroupBy) Aggregate(fns ...AggregateFunc) *RawEventGroupBy

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

func (*RawEventGroupBy) Bool

func (regb *RawEventGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*RawEventGroupBy) BoolX

func (regb *RawEventGroupBy) BoolX(ctx context.Context) bool

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

func (*RawEventGroupBy) Bools

func (regb *RawEventGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*RawEventGroupBy) BoolsX

func (regb *RawEventGroupBy) BoolsX(ctx context.Context) []bool

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

func (*RawEventGroupBy) Float64

func (regb *RawEventGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*RawEventGroupBy) Float64X

func (regb *RawEventGroupBy) Float64X(ctx context.Context) float64

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

func (*RawEventGroupBy) Float64s

func (regb *RawEventGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*RawEventGroupBy) Float64sX

func (regb *RawEventGroupBy) Float64sX(ctx context.Context) []float64

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

func (*RawEventGroupBy) Int

func (regb *RawEventGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*RawEventGroupBy) IntX

func (regb *RawEventGroupBy) IntX(ctx context.Context) int

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

func (*RawEventGroupBy) Ints

func (regb *RawEventGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*RawEventGroupBy) IntsX

func (regb *RawEventGroupBy) IntsX(ctx context.Context) []int

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

func (*RawEventGroupBy) Scan

func (regb *RawEventGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*RawEventGroupBy) ScanX

func (regb *RawEventGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*RawEventGroupBy) String

func (regb *RawEventGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*RawEventGroupBy) StringX

func (regb *RawEventGroupBy) StringX(ctx context.Context) string

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

func (*RawEventGroupBy) Strings

func (regb *RawEventGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*RawEventGroupBy) StringsX

func (regb *RawEventGroupBy) StringsX(ctx context.Context) []string

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

type RawEventMutation

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

RawEventMutation represents an operation that mutate the RawEvents nodes in the graph.

func (*RawEventMutation) AddField

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

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

func (*RawEventMutation) AddedEdges

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

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

func (*RawEventMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*RawEventMutation) AddedFields

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

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

func (*RawEventMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*RawEventMutation) Anonymous

func (m *RawEventMutation) Anonymous() (r bool, exists bool)

Anonymous returns the anonymous value in the mutation.

func (*RawEventMutation) Channel

func (m *RawEventMutation) Channel() (r string, exists bool)

Channel returns the channel value in the mutation.

func (*RawEventMutation) ChannelCleared

func (m *RawEventMutation) ChannelCleared() bool

ChannelCleared returns if the field channel was cleared in this mutation.

func (*RawEventMutation) ClearChannel

func (m *RawEventMutation) ClearChannel()

ClearChannel clears the value of channel.

func (*RawEventMutation) ClearDeviceID

func (m *RawEventMutation) ClearDeviceID()

ClearDeviceID clears the value of device_id.

func (*RawEventMutation) ClearEdge

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

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

func (*RawEventMutation) ClearField

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

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

func (*RawEventMutation) ClearGroupID

func (m *RawEventMutation) ClearGroupID()

ClearGroupID clears the value of group_id.

func (*RawEventMutation) ClearPlatform

func (m *RawEventMutation) ClearPlatform()

ClearPlatform clears the value of platform.

func (*RawEventMutation) ClearSessionID

func (m *RawEventMutation) ClearSessionID()

ClearSessionID clears the value of session_id.

func (*RawEventMutation) ClearedEdges

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

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

func (*RawEventMutation) ClearedFields

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

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

func (RawEventMutation) Client

func (m RawEventMutation) 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 (*RawEventMutation) Context

func (m *RawEventMutation) Context() (r map[string]interface{}, exists bool)

Context returns the context value in the mutation.

func (*RawEventMutation) DeviceID

func (m *RawEventMutation) DeviceID() (r string, exists bool)

DeviceID returns the device_id value in the mutation.

func (*RawEventMutation) DeviceIDCleared

func (m *RawEventMutation) DeviceIDCleared() bool

DeviceIDCleared returns if the field device_id was cleared in this mutation.

func (*RawEventMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*RawEventMutation) Event

func (m *RawEventMutation) Event() (r string, exists bool)

Event returns the event value in the mutation.

func (*RawEventMutation) Field

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

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

func (*RawEventMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*RawEventMutation) Fields

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

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

func (*RawEventMutation) GroupID

func (m *RawEventMutation) GroupID() (r string, exists bool)

GroupID returns the group_id value in the mutation.

func (*RawEventMutation) GroupIDCleared

func (m *RawEventMutation) GroupIDCleared() bool

GroupIDCleared returns if the field group_id was cleared in this mutation.

func (*RawEventMutation) ID

func (m *RawEventMutation) ID() (id uuid.UUID, exists bool)

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*RawEventMutation) NonInteractive

func (m *RawEventMutation) NonInteractive() (r bool, exists bool)

NonInteractive returns the non_interactive value in the mutation.

func (*RawEventMutation) OldAnonymous

func (m *RawEventMutation) OldAnonymous(ctx context.Context) (v bool, err error)

OldAnonymous returns the old anonymous value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldChannel

func (m *RawEventMutation) OldChannel(ctx context.Context) (v string, err error)

OldChannel returns the old channel value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldContext

func (m *RawEventMutation) OldContext(ctx context.Context) (v map[string]interface{}, err error)

OldContext returns the old context value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldDeviceID

func (m *RawEventMutation) OldDeviceID(ctx context.Context) (v string, err error)

OldDeviceID returns the old device_id value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldEvent

func (m *RawEventMutation) OldEvent(ctx context.Context) (v string, err error)

OldEvent returns the old event value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldField

func (m *RawEventMutation) 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 was failed.

func (*RawEventMutation) OldGroupID

func (m *RawEventMutation) OldGroupID(ctx context.Context) (v string, err error)

OldGroupID returns the old group_id value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldNonInteractive

func (m *RawEventMutation) OldNonInteractive(ctx context.Context) (v bool, err error)

OldNonInteractive returns the old non_interactive value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldPlatform

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

OldPlatform returns the old platform value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldSessionID

func (m *RawEventMutation) OldSessionID(ctx context.Context) (v string, err error)

OldSessionID returns the old session_id value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldTimestamp

func (m *RawEventMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old timestamp value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldTrackingID

func (m *RawEventMutation) OldTrackingID(ctx context.Context) (v uuid.UUID, err error)

OldTrackingID returns the old tracking_id value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) OldUserID

func (m *RawEventMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old user_id value of the RawEvent. If the RawEvent 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 database query fails.

func (*RawEventMutation) Op

func (m *RawEventMutation) Op() Op

Op returns the operation name.

func (*RawEventMutation) Platform

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

Platform returns the platform value in the mutation.

func (*RawEventMutation) PlatformCleared

func (m *RawEventMutation) PlatformCleared() bool

PlatformCleared returns if the field platform was cleared in this mutation.

func (*RawEventMutation) RemovedEdges

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

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

func (*RawEventMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*RawEventMutation) ResetAnonymous

func (m *RawEventMutation) ResetAnonymous()

ResetAnonymous reset all changes of the "anonymous" field.

func (*RawEventMutation) ResetChannel

func (m *RawEventMutation) ResetChannel()

ResetChannel reset all changes of the "channel" field.

func (*RawEventMutation) ResetContext

func (m *RawEventMutation) ResetContext()

ResetContext reset all changes of the "context" field.

func (*RawEventMutation) ResetDeviceID

func (m *RawEventMutation) ResetDeviceID()

ResetDeviceID reset all changes of the "device_id" field.

func (*RawEventMutation) ResetEdge

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

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

func (*RawEventMutation) ResetEvent

func (m *RawEventMutation) ResetEvent()

ResetEvent reset all changes of the "event" field.

func (*RawEventMutation) ResetField

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

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

func (*RawEventMutation) ResetGroupID

func (m *RawEventMutation) ResetGroupID()

ResetGroupID reset all changes of the "group_id" field.

func (*RawEventMutation) ResetNonInteractive

func (m *RawEventMutation) ResetNonInteractive()

ResetNonInteractive reset all changes of the "non_interactive" field.

func (*RawEventMutation) ResetPlatform

func (m *RawEventMutation) ResetPlatform()

ResetPlatform reset all changes of the "platform" field.

func (*RawEventMutation) ResetSessionID

func (m *RawEventMutation) ResetSessionID()

ResetSessionID reset all changes of the "session_id" field.

func (*RawEventMutation) ResetTimestamp

func (m *RawEventMutation) ResetTimestamp()

ResetTimestamp reset all changes of the "timestamp" field.

func (*RawEventMutation) ResetTrackingID

func (m *RawEventMutation) ResetTrackingID()

ResetTrackingID reset all changes of the "tracking_id" field.

func (*RawEventMutation) ResetUserID

func (m *RawEventMutation) ResetUserID()

ResetUserID reset all changes of the "user_id" field.

func (*RawEventMutation) SessionID

func (m *RawEventMutation) SessionID() (r string, exists bool)

SessionID returns the session_id value in the mutation.

func (*RawEventMutation) SessionIDCleared

func (m *RawEventMutation) SessionIDCleared() bool

SessionIDCleared returns if the field session_id was cleared in this mutation.

func (*RawEventMutation) SetAnonymous

func (m *RawEventMutation) SetAnonymous(b bool)

SetAnonymous sets the anonymous field.

func (*RawEventMutation) SetChannel

func (m *RawEventMutation) SetChannel(s string)

SetChannel sets the channel field.

func (*RawEventMutation) SetContext

func (m *RawEventMutation) SetContext(value map[string]interface{})

SetContext sets the context field.

func (*RawEventMutation) SetDeviceID

func (m *RawEventMutation) SetDeviceID(s string)

SetDeviceID sets the device_id field.

func (*RawEventMutation) SetEvent

func (m *RawEventMutation) SetEvent(s string)

SetEvent sets the event field.

func (*RawEventMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*RawEventMutation) SetGroupID

func (m *RawEventMutation) SetGroupID(s string)

SetGroupID sets the group_id field.

func (*RawEventMutation) SetID

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

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

func (*RawEventMutation) SetNonInteractive

func (m *RawEventMutation) SetNonInteractive(b bool)

SetNonInteractive sets the non_interactive field.

func (*RawEventMutation) SetPlatform

func (m *RawEventMutation) SetPlatform(s string)

SetPlatform sets the platform field.

func (*RawEventMutation) SetSessionID

func (m *RawEventMutation) SetSessionID(s string)

SetSessionID sets the session_id field.

func (*RawEventMutation) SetTimestamp

func (m *RawEventMutation) SetTimestamp(t time.Time)

SetTimestamp sets the timestamp field.

func (*RawEventMutation) SetTrackingID

func (m *RawEventMutation) SetTrackingID(u uuid.UUID)

SetTrackingID sets the tracking_id field.

func (*RawEventMutation) SetUserID

func (m *RawEventMutation) SetUserID(s string)

SetUserID sets the user_id field.

func (*RawEventMutation) Timestamp

func (m *RawEventMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the timestamp value in the mutation.

func (*RawEventMutation) TrackingID

func (m *RawEventMutation) TrackingID() (r uuid.UUID, exists bool)

TrackingID returns the tracking_id value in the mutation.

func (RawEventMutation) Tx

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

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

func (*RawEventMutation) Type

func (m *RawEventMutation) Type() string

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

func (*RawEventMutation) UserID

func (m *RawEventMutation) UserID() (r string, exists bool)

UserID returns the user_id value in the mutation.

type RawEventQuery

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

RawEventQuery is the builder for querying RawEvent entities.

func (*RawEventQuery) All

func (req *RawEventQuery) All(ctx context.Context) ([]*RawEvent, error)

All executes the query and returns a list of RawEvents.

func (*RawEventQuery) AllX

func (req *RawEventQuery) AllX(ctx context.Context) []*RawEvent

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

func (*RawEventQuery) Clone

func (req *RawEventQuery) Clone() *RawEventQuery

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

func (*RawEventQuery) Count

func (req *RawEventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RawEventQuery) CountX

func (req *RawEventQuery) CountX(ctx context.Context) int

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

func (*RawEventQuery) Exist

func (req *RawEventQuery) Exist(ctx context.Context) (bool, error)

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

func (*RawEventQuery) ExistX

func (req *RawEventQuery) ExistX(ctx context.Context) bool

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

func (*RawEventQuery) First

func (req *RawEventQuery) First(ctx context.Context) (*RawEvent, error)

First returns the first RawEvent entity in the query. Returns *NotFoundError when no rawevent was found.

func (*RawEventQuery) FirstID

func (req *RawEventQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first RawEvent id in the query. Returns *NotFoundError when no id was found.

func (*RawEventQuery) FirstX

func (req *RawEventQuery) FirstX(ctx context.Context) *RawEvent

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

func (*RawEventQuery) FirstXID

func (req *RawEventQuery) FirstXID(ctx context.Context) uuid.UUID

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

func (*RawEventQuery) GroupBy

func (req *RawEventQuery) GroupBy(field string, fields ...string) *RawEventGroupBy

GroupBy 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 {
	TrackingID uuid.UUID `json:"tracking_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RawEvent.Query().
	GroupBy(rawevent.FieldTrackingID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RawEventQuery) IDs

func (req *RawEventQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of RawEvent ids.

func (*RawEventQuery) IDsX

func (req *RawEventQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*RawEventQuery) Limit

func (req *RawEventQuery) Limit(limit int) *RawEventQuery

Limit adds a limit step to the query.

func (*RawEventQuery) Offset

func (req *RawEventQuery) Offset(offset int) *RawEventQuery

Offset adds an offset step to the query.

func (*RawEventQuery) Only

func (req *RawEventQuery) Only(ctx context.Context) (*RawEvent, error)

Only returns the only RawEvent entity in the query, returns an error if not exactly one entity was returned.

func (*RawEventQuery) OnlyID

func (req *RawEventQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID returns the only RawEvent id in the query, returns an error if not exactly one id was returned.

func (*RawEventQuery) OnlyIDX

func (req *RawEventQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*RawEventQuery) OnlyX

func (req *RawEventQuery) OnlyX(ctx context.Context) *RawEvent

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

func (*RawEventQuery) Order

func (req *RawEventQuery) Order(o ...OrderFunc) *RawEventQuery

Order adds an order step to the query.

func (*RawEventQuery) Select

func (req *RawEventQuery) Select(field string, fields ...string) *RawEventSelect

Select one or more fields from the given query.

Example:

var v []struct {
	TrackingID uuid.UUID `json:"tracking_id,omitempty"`
}

client.RawEvent.Query().
	Select(rawevent.FieldTrackingID).
	Scan(ctx, &v)

func (*RawEventQuery) Where

func (req *RawEventQuery) Where(ps ...predicate.RawEvent) *RawEventQuery

Where adds a new predicate for the builder.

type RawEventSelect

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

RawEventSelect is the builder for select fields of RawEvent entities.

func (*RawEventSelect) Bool

func (res *RawEventSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*RawEventSelect) BoolX

func (res *RawEventSelect) BoolX(ctx context.Context) bool

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

func (*RawEventSelect) Bools

func (res *RawEventSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*RawEventSelect) BoolsX

func (res *RawEventSelect) BoolsX(ctx context.Context) []bool

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

func (*RawEventSelect) Float64

func (res *RawEventSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*RawEventSelect) Float64X

func (res *RawEventSelect) Float64X(ctx context.Context) float64

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

func (*RawEventSelect) Float64s

func (res *RawEventSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*RawEventSelect) Float64sX

func (res *RawEventSelect) Float64sX(ctx context.Context) []float64

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

func (*RawEventSelect) Int

func (res *RawEventSelect) Int(ctx context.Context) (_ int, err error)

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

func (*RawEventSelect) IntX

func (res *RawEventSelect) IntX(ctx context.Context) int

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

func (*RawEventSelect) Ints

func (res *RawEventSelect) Ints(ctx context.Context) ([]int, error)

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

func (*RawEventSelect) IntsX

func (res *RawEventSelect) IntsX(ctx context.Context) []int

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

func (*RawEventSelect) Scan

func (res *RawEventSelect) Scan(ctx context.Context, v interface{}) error

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

func (*RawEventSelect) ScanX

func (res *RawEventSelect) ScanX(ctx context.Context, v interface{})

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

func (*RawEventSelect) String

func (res *RawEventSelect) String(ctx context.Context) (_ string, err error)

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

func (*RawEventSelect) StringX

func (res *RawEventSelect) StringX(ctx context.Context) string

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

func (*RawEventSelect) Strings

func (res *RawEventSelect) Strings(ctx context.Context) ([]string, error)

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

func (*RawEventSelect) StringsX

func (res *RawEventSelect) StringsX(ctx context.Context) []string

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

type RawEventUpdate

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

RawEventUpdate is the builder for updating RawEvent entities.

func (*RawEventUpdate) ClearChannel

func (reu *RawEventUpdate) ClearChannel() *RawEventUpdate

ClearChannel clears the value of channel.

func (*RawEventUpdate) ClearDeviceID

func (reu *RawEventUpdate) ClearDeviceID() *RawEventUpdate

ClearDeviceID clears the value of device_id.

func (*RawEventUpdate) ClearGroupID

func (reu *RawEventUpdate) ClearGroupID() *RawEventUpdate

ClearGroupID clears the value of group_id.

func (*RawEventUpdate) ClearPlatform

func (reu *RawEventUpdate) ClearPlatform() *RawEventUpdate

ClearPlatform clears the value of platform.

func (*RawEventUpdate) ClearSessionID

func (reu *RawEventUpdate) ClearSessionID() *RawEventUpdate

ClearSessionID clears the value of session_id.

func (*RawEventUpdate) Exec

func (reu *RawEventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RawEventUpdate) ExecX

func (reu *RawEventUpdate) ExecX(ctx context.Context)

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

func (*RawEventUpdate) Mutation

func (reu *RawEventUpdate) Mutation() *RawEventMutation

Mutation returns the RawEventMutation object of the builder.

func (*RawEventUpdate) Save

func (reu *RawEventUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*RawEventUpdate) SaveX

func (reu *RawEventUpdate) SaveX(ctx context.Context) int

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

func (*RawEventUpdate) SetAnonymous

func (reu *RawEventUpdate) SetAnonymous(b bool) *RawEventUpdate

SetAnonymous sets the anonymous field.

func (*RawEventUpdate) SetChannel

func (reu *RawEventUpdate) SetChannel(s string) *RawEventUpdate

SetChannel sets the channel field.

func (*RawEventUpdate) SetContext

func (reu *RawEventUpdate) SetContext(m map[string]interface{}) *RawEventUpdate

SetContext sets the context field.

func (*RawEventUpdate) SetDeviceID

func (reu *RawEventUpdate) SetDeviceID(s string) *RawEventUpdate

SetDeviceID sets the device_id field.

func (*RawEventUpdate) SetEvent

func (reu *RawEventUpdate) SetEvent(s string) *RawEventUpdate

SetEvent sets the event field.

func (*RawEventUpdate) SetGroupID

func (reu *RawEventUpdate) SetGroupID(s string) *RawEventUpdate

SetGroupID sets the group_id field.

func (*RawEventUpdate) SetNillableChannel

func (reu *RawEventUpdate) SetNillableChannel(s *string) *RawEventUpdate

SetNillableChannel sets the channel field if the given value is not nil.

func (*RawEventUpdate) SetNillableDeviceID

func (reu *RawEventUpdate) SetNillableDeviceID(s *string) *RawEventUpdate

SetNillableDeviceID sets the device_id field if the given value is not nil.

func (*RawEventUpdate) SetNillableGroupID

func (reu *RawEventUpdate) SetNillableGroupID(s *string) *RawEventUpdate

SetNillableGroupID sets the group_id field if the given value is not nil.

func (*RawEventUpdate) SetNillablePlatform

func (reu *RawEventUpdate) SetNillablePlatform(s *string) *RawEventUpdate

SetNillablePlatform sets the platform field if the given value is not nil.

func (*RawEventUpdate) SetNillableSessionID

func (reu *RawEventUpdate) SetNillableSessionID(s *string) *RawEventUpdate

SetNillableSessionID sets the session_id field if the given value is not nil.

func (*RawEventUpdate) SetNonInteractive

func (reu *RawEventUpdate) SetNonInteractive(b bool) *RawEventUpdate

SetNonInteractive sets the non_interactive field.

func (*RawEventUpdate) SetPlatform

func (reu *RawEventUpdate) SetPlatform(s string) *RawEventUpdate

SetPlatform sets the platform field.

func (*RawEventUpdate) SetSessionID

func (reu *RawEventUpdate) SetSessionID(s string) *RawEventUpdate

SetSessionID sets the session_id field.

func (*RawEventUpdate) SetTimestamp

func (reu *RawEventUpdate) SetTimestamp(t time.Time) *RawEventUpdate

SetTimestamp sets the timestamp field.

func (*RawEventUpdate) SetTrackingID

func (reu *RawEventUpdate) SetTrackingID(u uuid.UUID) *RawEventUpdate

SetTrackingID sets the tracking_id field.

func (*RawEventUpdate) SetUserID

func (reu *RawEventUpdate) SetUserID(s string) *RawEventUpdate

SetUserID sets the user_id field.

func (*RawEventUpdate) Where

func (reu *RawEventUpdate) Where(ps ...predicate.RawEvent) *RawEventUpdate

Where adds a new predicate for the builder.

type RawEventUpdateOne

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

RawEventUpdateOne is the builder for updating a single RawEvent entity.

func (*RawEventUpdateOne) ClearChannel

func (reuo *RawEventUpdateOne) ClearChannel() *RawEventUpdateOne

ClearChannel clears the value of channel.

func (*RawEventUpdateOne) ClearDeviceID

func (reuo *RawEventUpdateOne) ClearDeviceID() *RawEventUpdateOne

ClearDeviceID clears the value of device_id.

func (*RawEventUpdateOne) ClearGroupID

func (reuo *RawEventUpdateOne) ClearGroupID() *RawEventUpdateOne

ClearGroupID clears the value of group_id.

func (*RawEventUpdateOne) ClearPlatform

func (reuo *RawEventUpdateOne) ClearPlatform() *RawEventUpdateOne

ClearPlatform clears the value of platform.

func (*RawEventUpdateOne) ClearSessionID

func (reuo *RawEventUpdateOne) ClearSessionID() *RawEventUpdateOne

ClearSessionID clears the value of session_id.

func (*RawEventUpdateOne) Exec

func (reuo *RawEventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RawEventUpdateOne) ExecX

func (reuo *RawEventUpdateOne) ExecX(ctx context.Context)

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

func (*RawEventUpdateOne) Mutation

func (reuo *RawEventUpdateOne) Mutation() *RawEventMutation

Mutation returns the RawEventMutation object of the builder.

func (*RawEventUpdateOne) Save

func (reuo *RawEventUpdateOne) Save(ctx context.Context) (*RawEvent, error)

Save executes the query and returns the updated entity.

func (*RawEventUpdateOne) SaveX

func (reuo *RawEventUpdateOne) SaveX(ctx context.Context) *RawEvent

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

func (*RawEventUpdateOne) SetAnonymous

func (reuo *RawEventUpdateOne) SetAnonymous(b bool) *RawEventUpdateOne

SetAnonymous sets the anonymous field.

func (*RawEventUpdateOne) SetChannel

func (reuo *RawEventUpdateOne) SetChannel(s string) *RawEventUpdateOne

SetChannel sets the channel field.

func (*RawEventUpdateOne) SetContext

func (reuo *RawEventUpdateOne) SetContext(m map[string]interface{}) *RawEventUpdateOne

SetContext sets the context field.

func (*RawEventUpdateOne) SetDeviceID

func (reuo *RawEventUpdateOne) SetDeviceID(s string) *RawEventUpdateOne

SetDeviceID sets the device_id field.

func (*RawEventUpdateOne) SetEvent

func (reuo *RawEventUpdateOne) SetEvent(s string) *RawEventUpdateOne

SetEvent sets the event field.

func (*RawEventUpdateOne) SetGroupID

func (reuo *RawEventUpdateOne) SetGroupID(s string) *RawEventUpdateOne

SetGroupID sets the group_id field.

func (*RawEventUpdateOne) SetNillableChannel

func (reuo *RawEventUpdateOne) SetNillableChannel(s *string) *RawEventUpdateOne

SetNillableChannel sets the channel field if the given value is not nil.

func (*RawEventUpdateOne) SetNillableDeviceID

func (reuo *RawEventUpdateOne) SetNillableDeviceID(s *string) *RawEventUpdateOne

SetNillableDeviceID sets the device_id field if the given value is not nil.

func (*RawEventUpdateOne) SetNillableGroupID

func (reuo *RawEventUpdateOne) SetNillableGroupID(s *string) *RawEventUpdateOne

SetNillableGroupID sets the group_id field if the given value is not nil.

func (*RawEventUpdateOne) SetNillablePlatform

func (reuo *RawEventUpdateOne) SetNillablePlatform(s *string) *RawEventUpdateOne

SetNillablePlatform sets the platform field if the given value is not nil.

func (*RawEventUpdateOne) SetNillableSessionID

func (reuo *RawEventUpdateOne) SetNillableSessionID(s *string) *RawEventUpdateOne

SetNillableSessionID sets the session_id field if the given value is not nil.

func (*RawEventUpdateOne) SetNonInteractive

func (reuo *RawEventUpdateOne) SetNonInteractive(b bool) *RawEventUpdateOne

SetNonInteractive sets the non_interactive field.

func (*RawEventUpdateOne) SetPlatform

func (reuo *RawEventUpdateOne) SetPlatform(s string) *RawEventUpdateOne

SetPlatform sets the platform field.

func (*RawEventUpdateOne) SetSessionID

func (reuo *RawEventUpdateOne) SetSessionID(s string) *RawEventUpdateOne

SetSessionID sets the session_id field.

func (*RawEventUpdateOne) SetTimestamp

func (reuo *RawEventUpdateOne) SetTimestamp(t time.Time) *RawEventUpdateOne

SetTimestamp sets the timestamp field.

func (*RawEventUpdateOne) SetTrackingID

func (reuo *RawEventUpdateOne) SetTrackingID(u uuid.UUID) *RawEventUpdateOne

SetTrackingID sets the tracking_id field.

func (*RawEventUpdateOne) SetUserID

func (reuo *RawEventUpdateOne) SetUserID(s string) *RawEventUpdateOne

SetUserID sets the user_id field.

type RawEvents

type RawEvents []*RawEvent

RawEvents is a parsable slice of RawEvent.

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(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 Rollbacker method.

type Tx

type Tx struct {

	// RawEvent is the client for interacting with the RawEvent builders.
	RawEvent *RawEventClient
	// 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 the Tx stored in 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 ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field 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 conflict in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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