ent

package
v0.0.0-...-b394ddd Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 23 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.
	TypeEvent     = "Event"
	TypeEventType = "EventType"
	TypeRole      = "Role"
	TypeUser      = "User"
)

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
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// EventType is the client for interacting with the EventType builders.
	EventType *EventTypeClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

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

type Event struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// TutorsRequired holds the value of the "tutorsRequired" field.
	TutorsRequired *int64 `json:"tutorsRequired,omitempty"`
	// WalletsReward holds the value of the "walletsReward" field.
	WalletsReward *int64 `json:"walletsReward,omitempty"`
	// CreatedAt holds the value of the "createdAt" field.
	CreatedAt time.Time `json:"createdAt,omitempty"`
	// StartAt holds the value of the "startAt" field.
	StartAt time.Time `json:"startAt,omitempty"`
	// EndAt holds the value of the "endAt" field.
	EndAt time.Time `json:"endAt,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventQuery when eager-loading is set.
	Edges EventEdges `json:"edges"`
	// contains filtered or unexported fields
}

Event is the model entity for the Event schema.

func (*Event) ContextValidate

func (e *Event) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate method is implemented to discard code editor errors.

func (*Event) QueryCategory

func (e *Event) QueryCategory() *EventTypeQuery

QueryCategory queries the "category" edge of the Event entity.

func (*Event) QueryUsers

func (e *Event) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Event entity.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

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

func (e *Event) Update() *EventUpdateOne

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

func (*Event) Validate

func (e *Event) Validate(formats strfmt.Registry) error

Validate method is mandatory for Go Swagger generated server code to compile.

type EventClient

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

EventClient is a client for the Event schema.

func NewEventClient

func NewEventClient(c config) *EventClient

NewEventClient returns a client for the Event from the given config.

func (*EventClient) Create

func (c *EventClient) Create() *EventCreate

Create returns a create builder for Event.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

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

func (*EventClient) Delete

func (c *EventClient) Delete() *EventDelete

Delete returns a delete builder for Event.

func (*EventClient) DeleteOne

func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id uuid.UUID) *EventDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*EventClient) Get

func (c *EventClient) Get(ctx context.Context, id uuid.UUID) (*Event, error)

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id uuid.UUID) *Event

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

func (*EventClient) Hooks

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

Hooks returns the client hooks.

func (*EventClient) Query

func (c *EventClient) Query() *EventQuery

Query returns a query builder for Event.

func (*EventClient) QueryCategory

func (c *EventClient) QueryCategory(e *Event) *EventTypeQuery

QueryCategory queries the category edge of a Event.

func (*EventClient) QueryUsers

func (c *EventClient) QueryUsers(e *Event) *UserQuery

QueryUsers queries the users edge of a Event.

func (*EventClient) Update

func (c *EventClient) Update() *EventUpdate

Update returns an update builder for Event.

func (*EventClient) UpdateOne

func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventClient) UpdateOneID

func (c *EventClient) UpdateOneID(id uuid.UUID) *EventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventClient) Use

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

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

type EventCreate

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

EventCreate is the builder for creating a Event entity.

func (*EventCreate) AddUserIDs

func (ec *EventCreate) AddUserIDs(ids ...uuid.UUID) *EventCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*EventCreate) AddUsers

func (ec *EventCreate) AddUsers(u ...*User) *EventCreate

AddUsers adds the "users" edges to the User entity.

func (*EventCreate) Exec

func (ec *EventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreate) ExecX

func (ec *EventCreate) ExecX(ctx context.Context)

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

func (*EventCreate) Mutation

func (ec *EventCreate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventCreate) Save

func (ec *EventCreate) Save(ctx context.Context) (*Event, error)

Save creates the Event in the database.

func (*EventCreate) SaveX

func (ec *EventCreate) SaveX(ctx context.Context) *Event

SaveX calls Save and panics if Save returns an error.

func (*EventCreate) SetCategory

func (ec *EventCreate) SetCategory(e *EventType) *EventCreate

SetCategory sets the "category" edge to the EventType entity.

func (*EventCreate) SetCategoryID

func (ec *EventCreate) SetCategoryID(id uuid.UUID) *EventCreate

SetCategoryID sets the "category" edge to the EventType entity by ID.

func (*EventCreate) SetCreatedAt

func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate

SetCreatedAt sets the "createdAt" field.

func (*EventCreate) SetDescription

func (ec *EventCreate) SetDescription(s string) *EventCreate

SetDescription sets the "description" field.

func (*EventCreate) SetEndAt

func (ec *EventCreate) SetEndAt(t time.Time) *EventCreate

SetEndAt sets the "endAt" field.

func (*EventCreate) SetID

func (ec *EventCreate) SetID(u uuid.UUID) *EventCreate

SetID sets the "id" field.

func (*EventCreate) SetName

func (ec *EventCreate) SetName(s string) *EventCreate

SetName sets the "name" field.

func (*EventCreate) SetNillableCategoryID

func (ec *EventCreate) SetNillableCategoryID(id *uuid.UUID) *EventCreate

SetNillableCategoryID sets the "category" edge to the EventType entity by ID if the given value is not nil.

func (*EventCreate) SetNillableCreatedAt

func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate

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

func (*EventCreate) SetNillableDescription

func (ec *EventCreate) SetNillableDescription(s *string) *EventCreate

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

func (*EventCreate) SetNillableID

func (ec *EventCreate) SetNillableID(u *uuid.UUID) *EventCreate

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

func (*EventCreate) SetNillableTutorsRequired

func (ec *EventCreate) SetNillableTutorsRequired(i *int64) *EventCreate

SetNillableTutorsRequired sets the "tutorsRequired" field if the given value is not nil.

func (*EventCreate) SetNillableWalletsReward

func (ec *EventCreate) SetNillableWalletsReward(i *int64) *EventCreate

SetNillableWalletsReward sets the "walletsReward" field if the given value is not nil.

func (*EventCreate) SetStartAt

func (ec *EventCreate) SetStartAt(t time.Time) *EventCreate

SetStartAt sets the "startAt" field.

func (*EventCreate) SetTutorsRequired

func (ec *EventCreate) SetTutorsRequired(i int64) *EventCreate

SetTutorsRequired sets the "tutorsRequired" field.

func (*EventCreate) SetWalletsReward

func (ec *EventCreate) SetWalletsReward(i int64) *EventCreate

SetWalletsReward sets the "walletsReward" field.

type EventCreateBulk

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

EventCreateBulk is the builder for creating many Event entities in bulk.

func (*EventCreateBulk) Exec

func (ecb *EventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreateBulk) ExecX

func (ecb *EventCreateBulk) ExecX(ctx context.Context)

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

func (*EventCreateBulk) Save

func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error)

Save creates the Event entities in the database.

func (*EventCreateBulk) SaveX

func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event

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

type EventDelete

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

EventDelete is the builder for deleting a Event entity.

func (*EventDelete) Exec

func (ed *EventDelete) Exec(ctx context.Context) (int, error)

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

func (*EventDelete) ExecX

func (ed *EventDelete) ExecX(ctx context.Context) int

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

func (*EventDelete) Where

func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete

Where appends a list predicates to the EventDelete builder.

type EventDeleteOne

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

EventDeleteOne is the builder for deleting a single Event entity.

func (*EventDeleteOne) Exec

func (edo *EventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventDeleteOne) ExecX

func (edo *EventDeleteOne) ExecX(ctx context.Context)

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

type EventEdges

type EventEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Category holds the value of the category edge.
	Category *EventType `json:"category,omitempty"`
	// contains filtered or unexported fields
}

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

func (EventEdges) CategoryOrErr

func (e EventEdges) CategoryOrErr() (*EventType, error)

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

func (EventEdges) UsersOrErr

func (e EventEdges) UsersOrErr() ([]*User, error)

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

type EventGroupBy

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

EventGroupBy is the group-by builder for Event entities.

func (*EventGroupBy) Aggregate

func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy

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

func (*EventGroupBy) Bool

func (egb *EventGroupBy) 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 (*EventGroupBy) BoolX

func (egb *EventGroupBy) BoolX(ctx context.Context) bool

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

func (*EventGroupBy) Bools

func (egb *EventGroupBy) 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 (*EventGroupBy) BoolsX

func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool

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

func (*EventGroupBy) Float64

func (egb *EventGroupBy) 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 (*EventGroupBy) Float64X

func (egb *EventGroupBy) Float64X(ctx context.Context) float64

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

func (*EventGroupBy) Float64s

func (egb *EventGroupBy) 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 (*EventGroupBy) Float64sX

func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64

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

func (*EventGroupBy) Int

func (egb *EventGroupBy) 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 (*EventGroupBy) IntX

func (egb *EventGroupBy) IntX(ctx context.Context) int

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

func (*EventGroupBy) Ints

func (egb *EventGroupBy) 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 (*EventGroupBy) IntsX

func (egb *EventGroupBy) IntsX(ctx context.Context) []int

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

func (*EventGroupBy) Scan

func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*EventGroupBy) ScanX

func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*EventGroupBy) String

func (egb *EventGroupBy) 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 (*EventGroupBy) StringX

func (egb *EventGroupBy) StringX(ctx context.Context) string

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

func (*EventGroupBy) Strings

func (egb *EventGroupBy) 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 (*EventGroupBy) StringsX

func (egb *EventGroupBy) StringsX(ctx context.Context) []string

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

type EventMutation

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

EventMutation represents an operation that mutates the Event nodes in the graph.

func (*EventMutation) AddField

func (m *EventMutation) 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 (*EventMutation) AddTutorsRequired

func (m *EventMutation) AddTutorsRequired(i int64)

AddTutorsRequired adds i to the "tutorsRequired" field.

func (*EventMutation) AddUserIDs

func (m *EventMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*EventMutation) AddWalletsReward

func (m *EventMutation) AddWalletsReward(i int64)

AddWalletsReward adds i to the "walletsReward" field.

func (*EventMutation) AddedEdges

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

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

func (*EventMutation) AddedField

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

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

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

func (*EventMutation) AddedIDs

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

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

func (*EventMutation) AddedTutorsRequired

func (m *EventMutation) AddedTutorsRequired() (r int64, exists bool)

AddedTutorsRequired returns the value that was added to the "tutorsRequired" field in this mutation.

func (*EventMutation) AddedWalletsReward

func (m *EventMutation) AddedWalletsReward() (r int64, exists bool)

AddedWalletsReward returns the value that was added to the "walletsReward" field in this mutation.

func (*EventMutation) CategoryCleared

func (m *EventMutation) CategoryCleared() bool

CategoryCleared reports if the "category" edge to the EventType entity was cleared.

func (*EventMutation) CategoryID

func (m *EventMutation) CategoryID() (id uuid.UUID, exists bool)

CategoryID returns the "category" edge ID in the mutation.

func (*EventMutation) CategoryIDs

func (m *EventMutation) CategoryIDs() (ids []uuid.UUID)

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

func (*EventMutation) ClearCategory

func (m *EventMutation) ClearCategory()

ClearCategory clears the "category" edge to the EventType entity.

func (*EventMutation) ClearDescription

func (m *EventMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*EventMutation) ClearEdge

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

func (m *EventMutation) 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 (*EventMutation) ClearTutorsRequired

func (m *EventMutation) ClearTutorsRequired()

ClearTutorsRequired clears the value of the "tutorsRequired" field.

func (*EventMutation) ClearUsers

func (m *EventMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*EventMutation) ClearWalletsReward

func (m *EventMutation) ClearWalletsReward()

ClearWalletsReward clears the value of the "walletsReward" field.

func (*EventMutation) ClearedEdges

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

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

func (*EventMutation) ClearedFields

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

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

func (EventMutation) Client

func (m EventMutation) 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 (*EventMutation) CreatedAt

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

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

func (*EventMutation) Description

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

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

func (*EventMutation) DescriptionCleared

func (m *EventMutation) DescriptionCleared() bool

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

func (*EventMutation) EdgeCleared

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

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

func (*EventMutation) EndAt

func (m *EventMutation) EndAt() (r time.Time, exists bool)

EndAt returns the value of the "endAt" field in the mutation.

func (*EventMutation) Field

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

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

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

func (*EventMutation) Fields

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

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

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

func (*EventMutation) IDs

func (m *EventMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*EventMutation) Name

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

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

func (*EventMutation) OldCreatedAt

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

OldCreatedAt returns the old "createdAt" field's value of the Event entity. If the Event 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 (*EventMutation) OldDescription

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

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

func (m *EventMutation) OldEndAt(ctx context.Context) (v time.Time, err error)

OldEndAt returns the old "endAt" field's value of the Event entity. If the Event 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 (*EventMutation) OldField

func (m *EventMutation) 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 (*EventMutation) OldName

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

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

func (m *EventMutation) OldStartAt(ctx context.Context) (v time.Time, err error)

OldStartAt returns the old "startAt" field's value of the Event entity. If the Event 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 (*EventMutation) OldTutorsRequired

func (m *EventMutation) OldTutorsRequired(ctx context.Context) (v *int64, err error)

OldTutorsRequired returns the old "tutorsRequired" field's value of the Event entity. If the Event 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 (*EventMutation) OldWalletsReward

func (m *EventMutation) OldWalletsReward(ctx context.Context) (v *int64, err error)

OldWalletsReward returns the old "walletsReward" field's value of the Event entity. If the Event 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 (*EventMutation) Op

func (m *EventMutation) Op() Op

Op returns the operation name.

func (*EventMutation) RemoveUserIDs

func (m *EventMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*EventMutation) RemovedEdges

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

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

func (*EventMutation) RemovedIDs

func (m *EventMutation) 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 (*EventMutation) RemovedUsersIDs

func (m *EventMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*EventMutation) ResetCategory

func (m *EventMutation) ResetCategory()

ResetCategory resets all changes to the "category" edge.

func (*EventMutation) ResetCreatedAt

func (m *EventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "createdAt" field.

func (*EventMutation) ResetDescription

func (m *EventMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*EventMutation) ResetEdge

func (m *EventMutation) 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 (*EventMutation) ResetEndAt

func (m *EventMutation) ResetEndAt()

ResetEndAt resets all changes to the "endAt" field.

func (*EventMutation) ResetField

func (m *EventMutation) 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 (*EventMutation) ResetName

func (m *EventMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EventMutation) ResetStartAt

func (m *EventMutation) ResetStartAt()

ResetStartAt resets all changes to the "startAt" field.

func (*EventMutation) ResetTutorsRequired

func (m *EventMutation) ResetTutorsRequired()

ResetTutorsRequired resets all changes to the "tutorsRequired" field.

func (*EventMutation) ResetUsers

func (m *EventMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*EventMutation) ResetWalletsReward

func (m *EventMutation) ResetWalletsReward()

ResetWalletsReward resets all changes to the "walletsReward" field.

func (*EventMutation) SetCategoryID

func (m *EventMutation) SetCategoryID(id uuid.UUID)

SetCategoryID sets the "category" edge to the EventType entity by id.

func (*EventMutation) SetCreatedAt

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

SetCreatedAt sets the "createdAt" field.

func (*EventMutation) SetDescription

func (m *EventMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*EventMutation) SetEndAt

func (m *EventMutation) SetEndAt(t time.Time)

SetEndAt sets the "endAt" field.

func (*EventMutation) SetField

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

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

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

func (*EventMutation) SetName

func (m *EventMutation) SetName(s string)

SetName sets the "name" field.

func (*EventMutation) SetStartAt

func (m *EventMutation) SetStartAt(t time.Time)

SetStartAt sets the "startAt" field.

func (*EventMutation) SetTutorsRequired

func (m *EventMutation) SetTutorsRequired(i int64)

SetTutorsRequired sets the "tutorsRequired" field.

func (*EventMutation) SetWalletsReward

func (m *EventMutation) SetWalletsReward(i int64)

SetWalletsReward sets the "walletsReward" field.

func (*EventMutation) StartAt

func (m *EventMutation) StartAt() (r time.Time, exists bool)

StartAt returns the value of the "startAt" field in the mutation.

func (*EventMutation) TutorsRequired

func (m *EventMutation) TutorsRequired() (r int64, exists bool)

TutorsRequired returns the value of the "tutorsRequired" field in the mutation.

func (*EventMutation) TutorsRequiredCleared

func (m *EventMutation) TutorsRequiredCleared() bool

TutorsRequiredCleared returns if the "tutorsRequired" field was cleared in this mutation.

func (EventMutation) Tx

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

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

func (*EventMutation) Type

func (m *EventMutation) Type() string

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

func (*EventMutation) UsersCleared

func (m *EventMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*EventMutation) UsersIDs

func (m *EventMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*EventMutation) WalletsReward

func (m *EventMutation) WalletsReward() (r int64, exists bool)

WalletsReward returns the value of the "walletsReward" field in the mutation.

func (*EventMutation) WalletsRewardCleared

func (m *EventMutation) WalletsRewardCleared() bool

WalletsRewardCleared returns if the "walletsReward" field was cleared in this mutation.

func (*EventMutation) Where

func (m *EventMutation) Where(ps ...predicate.Event)

Where appends a list predicates to the EventMutation builder.

type EventQuery

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

EventQuery is the builder for querying Event entities.

func (*EventQuery) All

func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)

All executes the query and returns a list of Events.

func (*EventQuery) AllX

func (eq *EventQuery) AllX(ctx context.Context) []*Event

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

func (*EventQuery) Clone

func (eq *EventQuery) Clone() *EventQuery

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

func (*EventQuery) Count

func (eq *EventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventQuery) CountX

func (eq *EventQuery) CountX(ctx context.Context) int

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

func (*EventQuery) Exist

func (eq *EventQuery) Exist(ctx context.Context) (bool, error)

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

func (*EventQuery) ExistX

func (eq *EventQuery) ExistX(ctx context.Context) bool

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

func (*EventQuery) First

func (eq *EventQuery) First(ctx context.Context) (*Event, error)

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

func (*EventQuery) FirstID

func (eq *EventQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EventQuery) FirstIDX

func (eq *EventQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

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

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

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

Example:

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

client.Event.Query().
	GroupBy(event.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventQuery) IDs

func (eq *EventQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*EventQuery) IDsX

func (eq *EventQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*EventQuery) Limit

func (eq *EventQuery) Limit(limit int) *EventQuery

Limit adds a limit step to the query.

func (*EventQuery) Offset

func (eq *EventQuery) Offset(offset int) *EventQuery

Offset adds an offset step to the query.

func (*EventQuery) Only

func (eq *EventQuery) Only(ctx context.Context) (*Event, error)

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

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EventQuery) OnlyIDX

func (eq *EventQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*EventQuery) OnlyX

func (eq *EventQuery) OnlyX(ctx context.Context) *Event

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

func (*EventQuery) Order

func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery

Order adds an order step to the query.

func (*EventQuery) QueryCategory

func (eq *EventQuery) QueryCategory() *EventTypeQuery

QueryCategory chains the current query on the "category" edge.

func (*EventQuery) QueryUsers

func (eq *EventQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*EventQuery) Select

func (eq *EventQuery) Select(fields ...string) *EventSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Event.Query().
	Select(event.FieldName).
	Scan(ctx, &v)

func (*EventQuery) Unique

func (eq *EventQuery) Unique(unique bool) *EventQuery

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

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the EventQuery builder.

func (*EventQuery) WithCategory

func (eq *EventQuery) WithCategory(opts ...func(*EventTypeQuery)) *EventQuery

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

func (*EventQuery) WithUsers

func (eq *EventQuery) WithUsers(opts ...func(*UserQuery)) *EventQuery

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

type EventSelect

type EventSelect struct {
	*EventQuery
	// contains filtered or unexported fields
}

EventSelect is the builder for selecting fields of Event entities.

func (*EventSelect) Bool

func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventSelect) BoolX

func (es *EventSelect) BoolX(ctx context.Context) bool

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

func (*EventSelect) Bools

func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*EventSelect) BoolsX

func (es *EventSelect) BoolsX(ctx context.Context) []bool

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

func (*EventSelect) Float64

func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventSelect) Float64X

func (es *EventSelect) Float64X(ctx context.Context) float64

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

func (*EventSelect) Float64s

func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventSelect) Float64sX

func (es *EventSelect) Float64sX(ctx context.Context) []float64

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

func (*EventSelect) Int

func (es *EventSelect) Int(ctx context.Context) (_ int, err error)

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

func (*EventSelect) IntX

func (es *EventSelect) IntX(ctx context.Context) int

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

func (*EventSelect) Ints

func (es *EventSelect) Ints(ctx context.Context) ([]int, error)

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

func (*EventSelect) IntsX

func (es *EventSelect) IntsX(ctx context.Context) []int

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

func (*EventSelect) Scan

func (es *EventSelect) Scan(ctx context.Context, v interface{}) error

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

func (*EventSelect) ScanX

func (es *EventSelect) ScanX(ctx context.Context, v interface{})

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

func (*EventSelect) String

func (es *EventSelect) String(ctx context.Context) (_ string, err error)

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

func (*EventSelect) StringX

func (es *EventSelect) StringX(ctx context.Context) string

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

func (*EventSelect) Strings

func (es *EventSelect) Strings(ctx context.Context) ([]string, error)

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

func (*EventSelect) StringsX

func (es *EventSelect) StringsX(ctx context.Context) []string

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

type EventType

type EventType struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Color holds the value of the "color" field.
	Color string `json:"color,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventTypeQuery when eager-loading is set.
	Edges EventTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

EventType is the model entity for the EventType schema.

func (*EventType) ContextValidate

func (et *EventType) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate method is implemented to discard code editor errors.

func (*EventType) QueryEvents

func (et *EventType) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the EventType entity.

func (*EventType) String

func (et *EventType) String() string

String implements the fmt.Stringer.

func (*EventType) Unwrap

func (et *EventType) Unwrap() *EventType

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

func (et *EventType) Update() *EventTypeUpdateOne

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

func (*EventType) Validate

func (et *EventType) Validate(formats strfmt.Registry) error

Validate method is mandatory for Go Swagger generated server code to compile.

type EventTypeClient

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

EventTypeClient is a client for the EventType schema.

func NewEventTypeClient

func NewEventTypeClient(c config) *EventTypeClient

NewEventTypeClient returns a client for the EventType from the given config.

func (*EventTypeClient) Create

func (c *EventTypeClient) Create() *EventTypeCreate

Create returns a create builder for EventType.

func (*EventTypeClient) CreateBulk

func (c *EventTypeClient) CreateBulk(builders ...*EventTypeCreate) *EventTypeCreateBulk

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

func (*EventTypeClient) Delete

func (c *EventTypeClient) Delete() *EventTypeDelete

Delete returns a delete builder for EventType.

func (*EventTypeClient) DeleteOne

func (c *EventTypeClient) DeleteOne(et *EventType) *EventTypeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*EventTypeClient) DeleteOneID

func (c *EventTypeClient) DeleteOneID(id uuid.UUID) *EventTypeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*EventTypeClient) Get

func (c *EventTypeClient) Get(ctx context.Context, id uuid.UUID) (*EventType, error)

Get returns a EventType entity by its id.

func (*EventTypeClient) GetX

func (c *EventTypeClient) GetX(ctx context.Context, id uuid.UUID) *EventType

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

func (*EventTypeClient) Hooks

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

Hooks returns the client hooks.

func (*EventTypeClient) Query

func (c *EventTypeClient) Query() *EventTypeQuery

Query returns a query builder for EventType.

func (*EventTypeClient) QueryEvents

func (c *EventTypeClient) QueryEvents(et *EventType) *EventQuery

QueryEvents queries the events edge of a EventType.

func (*EventTypeClient) Update

func (c *EventTypeClient) Update() *EventTypeUpdate

Update returns an update builder for EventType.

func (*EventTypeClient) UpdateOne

func (c *EventTypeClient) UpdateOne(et *EventType) *EventTypeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventTypeClient) UpdateOneID

func (c *EventTypeClient) UpdateOneID(id uuid.UUID) *EventTypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventTypeClient) Use

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

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

type EventTypeCreate

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

EventTypeCreate is the builder for creating a EventType entity.

func (*EventTypeCreate) AddEventIDs

func (etc *EventTypeCreate) AddEventIDs(ids ...uuid.UUID) *EventTypeCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*EventTypeCreate) AddEvents

func (etc *EventTypeCreate) AddEvents(e ...*Event) *EventTypeCreate

AddEvents adds the "events" edges to the Event entity.

func (*EventTypeCreate) Exec

func (etc *EventTypeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventTypeCreate) ExecX

func (etc *EventTypeCreate) ExecX(ctx context.Context)

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

func (*EventTypeCreate) Mutation

func (etc *EventTypeCreate) Mutation() *EventTypeMutation

Mutation returns the EventTypeMutation object of the builder.

func (*EventTypeCreate) Save

func (etc *EventTypeCreate) Save(ctx context.Context) (*EventType, error)

Save creates the EventType in the database.

func (*EventTypeCreate) SaveX

func (etc *EventTypeCreate) SaveX(ctx context.Context) *EventType

SaveX calls Save and panics if Save returns an error.

func (*EventTypeCreate) SetColor

func (etc *EventTypeCreate) SetColor(s string) *EventTypeCreate

SetColor sets the "color" field.

func (*EventTypeCreate) SetID

func (etc *EventTypeCreate) SetID(u uuid.UUID) *EventTypeCreate

SetID sets the "id" field.

func (*EventTypeCreate) SetName

func (etc *EventTypeCreate) SetName(s string) *EventTypeCreate

SetName sets the "name" field.

func (*EventTypeCreate) SetNillableID

func (etc *EventTypeCreate) SetNillableID(u *uuid.UUID) *EventTypeCreate

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

type EventTypeCreateBulk

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

EventTypeCreateBulk is the builder for creating many EventType entities in bulk.

func (*EventTypeCreateBulk) Exec

func (etcb *EventTypeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventTypeCreateBulk) ExecX

func (etcb *EventTypeCreateBulk) ExecX(ctx context.Context)

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

func (*EventTypeCreateBulk) Save

func (etcb *EventTypeCreateBulk) Save(ctx context.Context) ([]*EventType, error)

Save creates the EventType entities in the database.

func (*EventTypeCreateBulk) SaveX

func (etcb *EventTypeCreateBulk) SaveX(ctx context.Context) []*EventType

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

type EventTypeDelete

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

EventTypeDelete is the builder for deleting a EventType entity.

func (*EventTypeDelete) Exec

func (etd *EventTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*EventTypeDelete) ExecX

func (etd *EventTypeDelete) ExecX(ctx context.Context) int

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

func (*EventTypeDelete) Where

Where appends a list predicates to the EventTypeDelete builder.

type EventTypeDeleteOne

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

EventTypeDeleteOne is the builder for deleting a single EventType entity.

func (*EventTypeDeleteOne) Exec

func (etdo *EventTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventTypeDeleteOne) ExecX

func (etdo *EventTypeDeleteOne) ExecX(ctx context.Context)

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

type EventTypeEdges

type EventTypeEdges struct {
	// Events holds the value of the events edge.
	Events []*Event `json:"events,omitempty"`
	// contains filtered or unexported fields
}

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

func (EventTypeEdges) EventsOrErr

func (e EventTypeEdges) EventsOrErr() ([]*Event, error)

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

type EventTypeGroupBy

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

EventTypeGroupBy is the group-by builder for EventType entities.

func (*EventTypeGroupBy) Aggregate

func (etgb *EventTypeGroupBy) Aggregate(fns ...AggregateFunc) *EventTypeGroupBy

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

func (*EventTypeGroupBy) Bool

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) BoolX

func (etgb *EventTypeGroupBy) BoolX(ctx context.Context) bool

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

func (*EventTypeGroupBy) Bools

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) BoolsX

func (etgb *EventTypeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*EventTypeGroupBy) Float64

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) Float64X

func (etgb *EventTypeGroupBy) Float64X(ctx context.Context) float64

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

func (*EventTypeGroupBy) Float64s

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) Float64sX

func (etgb *EventTypeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*EventTypeGroupBy) Int

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) IntX

func (etgb *EventTypeGroupBy) IntX(ctx context.Context) int

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

func (*EventTypeGroupBy) Ints

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) IntsX

func (etgb *EventTypeGroupBy) IntsX(ctx context.Context) []int

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

func (*EventTypeGroupBy) Scan

func (etgb *EventTypeGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*EventTypeGroupBy) ScanX

func (etgb *EventTypeGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*EventTypeGroupBy) String

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) StringX

func (etgb *EventTypeGroupBy) StringX(ctx context.Context) string

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

func (*EventTypeGroupBy) Strings

func (etgb *EventTypeGroupBy) 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 (*EventTypeGroupBy) StringsX

func (etgb *EventTypeGroupBy) StringsX(ctx context.Context) []string

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

type EventTypeMutation

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

EventTypeMutation represents an operation that mutates the EventType nodes in the graph.

func (*EventTypeMutation) AddEventIDs

func (m *EventTypeMutation) AddEventIDs(ids ...uuid.UUID)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*EventTypeMutation) AddField

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

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

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

func (*EventTypeMutation) AddedField

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

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

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

func (*EventTypeMutation) AddedIDs

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

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

func (*EventTypeMutation) ClearEdge

func (m *EventTypeMutation) 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 (*EventTypeMutation) ClearEvents

func (m *EventTypeMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*EventTypeMutation) ClearField

func (m *EventTypeMutation) 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 (*EventTypeMutation) ClearedEdges

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

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

func (*EventTypeMutation) ClearedFields

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

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

func (EventTypeMutation) Client

func (m EventTypeMutation) 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 (*EventTypeMutation) Color

func (m *EventTypeMutation) Color() (r string, exists bool)

Color returns the value of the "color" field in the mutation.

func (*EventTypeMutation) EdgeCleared

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

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

func (*EventTypeMutation) EventsCleared

func (m *EventTypeMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the Event entity was cleared.

func (*EventTypeMutation) EventsIDs

func (m *EventTypeMutation) EventsIDs() (ids []uuid.UUID)

EventsIDs returns the "events" edge IDs in the mutation.

func (*EventTypeMutation) Field

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

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

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

func (*EventTypeMutation) Fields

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

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

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

func (*EventTypeMutation) IDs

func (m *EventTypeMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*EventTypeMutation) Name

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

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

func (*EventTypeMutation) OldColor

func (m *EventTypeMutation) OldColor(ctx context.Context) (v string, err error)

OldColor returns the old "color" field's value of the EventType entity. If the EventType 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 (*EventTypeMutation) OldField

func (m *EventTypeMutation) 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 (*EventTypeMutation) OldName

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

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

func (m *EventTypeMutation) Op() Op

Op returns the operation name.

func (*EventTypeMutation) RemoveEventIDs

func (m *EventTypeMutation) RemoveEventIDs(ids ...uuid.UUID)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*EventTypeMutation) RemovedEdges

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

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

func (*EventTypeMutation) RemovedEventsIDs

func (m *EventTypeMutation) RemovedEventsIDs() (ids []uuid.UUID)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*EventTypeMutation) RemovedIDs

func (m *EventTypeMutation) 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 (*EventTypeMutation) ResetColor

func (m *EventTypeMutation) ResetColor()

ResetColor resets all changes to the "color" field.

func (*EventTypeMutation) ResetEdge

func (m *EventTypeMutation) 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 (*EventTypeMutation) ResetEvents

func (m *EventTypeMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*EventTypeMutation) ResetField

func (m *EventTypeMutation) 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 (*EventTypeMutation) ResetName

func (m *EventTypeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EventTypeMutation) SetColor

func (m *EventTypeMutation) SetColor(s string)

SetColor sets the "color" field.

func (*EventTypeMutation) SetField

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

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

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

func (*EventTypeMutation) SetName

func (m *EventTypeMutation) SetName(s string)

SetName sets the "name" field.

func (EventTypeMutation) Tx

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

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

func (*EventTypeMutation) Type

func (m *EventTypeMutation) Type() string

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

func (*EventTypeMutation) Where

func (m *EventTypeMutation) Where(ps ...predicate.EventType)

Where appends a list predicates to the EventTypeMutation builder.

type EventTypeQuery

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

EventTypeQuery is the builder for querying EventType entities.

func (*EventTypeQuery) All

func (etq *EventTypeQuery) All(ctx context.Context) ([]*EventType, error)

All executes the query and returns a list of EventTypes.

func (*EventTypeQuery) AllX

func (etq *EventTypeQuery) AllX(ctx context.Context) []*EventType

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

func (*EventTypeQuery) Clone

func (etq *EventTypeQuery) Clone() *EventTypeQuery

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

func (*EventTypeQuery) Count

func (etq *EventTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventTypeQuery) CountX

func (etq *EventTypeQuery) CountX(ctx context.Context) int

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

func (*EventTypeQuery) Exist

func (etq *EventTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*EventTypeQuery) ExistX

func (etq *EventTypeQuery) ExistX(ctx context.Context) bool

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

func (*EventTypeQuery) First

func (etq *EventTypeQuery) First(ctx context.Context) (*EventType, error)

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

func (*EventTypeQuery) FirstID

func (etq *EventTypeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EventTypeQuery) FirstIDX

func (etq *EventTypeQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*EventTypeQuery) FirstX

func (etq *EventTypeQuery) FirstX(ctx context.Context) *EventType

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

func (*EventTypeQuery) GroupBy

func (etq *EventTypeQuery) GroupBy(field string, fields ...string) *EventTypeGroupBy

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

Example:

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

client.EventType.Query().
	GroupBy(eventtype.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventTypeQuery) IDs

func (etq *EventTypeQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*EventTypeQuery) IDsX

func (etq *EventTypeQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*EventTypeQuery) Limit

func (etq *EventTypeQuery) Limit(limit int) *EventTypeQuery

Limit adds a limit step to the query.

func (*EventTypeQuery) Offset

func (etq *EventTypeQuery) Offset(offset int) *EventTypeQuery

Offset adds an offset step to the query.

func (*EventTypeQuery) Only

func (etq *EventTypeQuery) Only(ctx context.Context) (*EventType, error)

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

func (*EventTypeQuery) OnlyID

func (etq *EventTypeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*EventTypeQuery) OnlyIDX

func (etq *EventTypeQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*EventTypeQuery) OnlyX

func (etq *EventTypeQuery) OnlyX(ctx context.Context) *EventType

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

func (*EventTypeQuery) Order

func (etq *EventTypeQuery) Order(o ...OrderFunc) *EventTypeQuery

Order adds an order step to the query.

func (*EventTypeQuery) QueryEvents

func (etq *EventTypeQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*EventTypeQuery) Select

func (etq *EventTypeQuery) Select(fields ...string) *EventTypeSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.EventType.Query().
	Select(eventtype.FieldName).
	Scan(ctx, &v)

func (*EventTypeQuery) Unique

func (etq *EventTypeQuery) Unique(unique bool) *EventTypeQuery

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

func (etq *EventTypeQuery) Where(ps ...predicate.EventType) *EventTypeQuery

Where adds a new predicate for the EventTypeQuery builder.

func (*EventTypeQuery) WithEvents

func (etq *EventTypeQuery) WithEvents(opts ...func(*EventQuery)) *EventTypeQuery

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

type EventTypeSelect

type EventTypeSelect struct {
	*EventTypeQuery
	// contains filtered or unexported fields
}

EventTypeSelect is the builder for selecting fields of EventType entities.

func (*EventTypeSelect) Bool

func (ets *EventTypeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventTypeSelect) BoolX

func (ets *EventTypeSelect) BoolX(ctx context.Context) bool

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

func (*EventTypeSelect) Bools

func (ets *EventTypeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*EventTypeSelect) BoolsX

func (ets *EventTypeSelect) BoolsX(ctx context.Context) []bool

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

func (*EventTypeSelect) Float64

func (ets *EventTypeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventTypeSelect) Float64X

func (ets *EventTypeSelect) Float64X(ctx context.Context) float64

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

func (*EventTypeSelect) Float64s

func (ets *EventTypeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventTypeSelect) Float64sX

func (ets *EventTypeSelect) Float64sX(ctx context.Context) []float64

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

func (*EventTypeSelect) Int

func (ets *EventTypeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*EventTypeSelect) IntX

func (ets *EventTypeSelect) IntX(ctx context.Context) int

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

func (*EventTypeSelect) Ints

func (ets *EventTypeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*EventTypeSelect) IntsX

func (ets *EventTypeSelect) IntsX(ctx context.Context) []int

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

func (*EventTypeSelect) Scan

func (ets *EventTypeSelect) Scan(ctx context.Context, v interface{}) error

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

func (*EventTypeSelect) ScanX

func (ets *EventTypeSelect) ScanX(ctx context.Context, v interface{})

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

func (*EventTypeSelect) String

func (ets *EventTypeSelect) String(ctx context.Context) (_ string, err error)

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

func (*EventTypeSelect) StringX

func (ets *EventTypeSelect) StringX(ctx context.Context) string

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

func (*EventTypeSelect) Strings

func (ets *EventTypeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*EventTypeSelect) StringsX

func (ets *EventTypeSelect) StringsX(ctx context.Context) []string

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

type EventTypeUpdate

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

EventTypeUpdate is the builder for updating EventType entities.

func (*EventTypeUpdate) AddEventIDs

func (etu *EventTypeUpdate) AddEventIDs(ids ...uuid.UUID) *EventTypeUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*EventTypeUpdate) AddEvents

func (etu *EventTypeUpdate) AddEvents(e ...*Event) *EventTypeUpdate

AddEvents adds the "events" edges to the Event entity.

func (*EventTypeUpdate) ClearEvents

func (etu *EventTypeUpdate) ClearEvents() *EventTypeUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*EventTypeUpdate) Exec

func (etu *EventTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventTypeUpdate) ExecX

func (etu *EventTypeUpdate) ExecX(ctx context.Context)

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

func (*EventTypeUpdate) Mutation

func (etu *EventTypeUpdate) Mutation() *EventTypeMutation

Mutation returns the EventTypeMutation object of the builder.

func (*EventTypeUpdate) RemoveEventIDs

func (etu *EventTypeUpdate) RemoveEventIDs(ids ...uuid.UUID) *EventTypeUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*EventTypeUpdate) RemoveEvents

func (etu *EventTypeUpdate) RemoveEvents(e ...*Event) *EventTypeUpdate

RemoveEvents removes "events" edges to Event entities.

func (*EventTypeUpdate) Save

func (etu *EventTypeUpdate) Save(ctx context.Context) (int, error)

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

func (*EventTypeUpdate) SaveX

func (etu *EventTypeUpdate) SaveX(ctx context.Context) int

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

func (*EventTypeUpdate) SetColor

func (etu *EventTypeUpdate) SetColor(s string) *EventTypeUpdate

SetColor sets the "color" field.

func (*EventTypeUpdate) SetName

func (etu *EventTypeUpdate) SetName(s string) *EventTypeUpdate

SetName sets the "name" field.

func (*EventTypeUpdate) Where

Where appends a list predicates to the EventTypeUpdate builder.

type EventTypeUpdateOne

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

EventTypeUpdateOne is the builder for updating a single EventType entity.

func (*EventTypeUpdateOne) AddEventIDs

func (etuo *EventTypeUpdateOne) AddEventIDs(ids ...uuid.UUID) *EventTypeUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*EventTypeUpdateOne) AddEvents

func (etuo *EventTypeUpdateOne) AddEvents(e ...*Event) *EventTypeUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*EventTypeUpdateOne) ClearEvents

func (etuo *EventTypeUpdateOne) ClearEvents() *EventTypeUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*EventTypeUpdateOne) Exec

func (etuo *EventTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventTypeUpdateOne) ExecX

func (etuo *EventTypeUpdateOne) ExecX(ctx context.Context)

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

func (*EventTypeUpdateOne) Mutation

func (etuo *EventTypeUpdateOne) Mutation() *EventTypeMutation

Mutation returns the EventTypeMutation object of the builder.

func (*EventTypeUpdateOne) RemoveEventIDs

func (etuo *EventTypeUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *EventTypeUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*EventTypeUpdateOne) RemoveEvents

func (etuo *EventTypeUpdateOne) RemoveEvents(e ...*Event) *EventTypeUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*EventTypeUpdateOne) Save

func (etuo *EventTypeUpdateOne) Save(ctx context.Context) (*EventType, error)

Save executes the query and returns the updated EventType entity.

func (*EventTypeUpdateOne) SaveX

func (etuo *EventTypeUpdateOne) SaveX(ctx context.Context) *EventType

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

func (*EventTypeUpdateOne) Select

func (etuo *EventTypeUpdateOne) Select(field string, fields ...string) *EventTypeUpdateOne

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

func (*EventTypeUpdateOne) SetColor

func (etuo *EventTypeUpdateOne) SetColor(s string) *EventTypeUpdateOne

SetColor sets the "color" field.

func (*EventTypeUpdateOne) SetName

func (etuo *EventTypeUpdateOne) SetName(s string) *EventTypeUpdateOne

SetName sets the "name" field.

type EventTypes

type EventTypes []*EventType

EventTypes is a parsable slice of EventType.

type EventUpdate

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

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) AddTutorsRequired

func (eu *EventUpdate) AddTutorsRequired(i int64) *EventUpdate

AddTutorsRequired adds i to the "tutorsRequired" field.

func (*EventUpdate) AddUserIDs

func (eu *EventUpdate) AddUserIDs(ids ...uuid.UUID) *EventUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*EventUpdate) AddUsers

func (eu *EventUpdate) AddUsers(u ...*User) *EventUpdate

AddUsers adds the "users" edges to the User entity.

func (*EventUpdate) AddWalletsReward

func (eu *EventUpdate) AddWalletsReward(i int64) *EventUpdate

AddWalletsReward adds i to the "walletsReward" field.

func (*EventUpdate) ClearCategory

func (eu *EventUpdate) ClearCategory() *EventUpdate

ClearCategory clears the "category" edge to the EventType entity.

func (*EventUpdate) ClearDescription

func (eu *EventUpdate) ClearDescription() *EventUpdate

ClearDescription clears the value of the "description" field.

func (*EventUpdate) ClearTutorsRequired

func (eu *EventUpdate) ClearTutorsRequired() *EventUpdate

ClearTutorsRequired clears the value of the "tutorsRequired" field.

func (*EventUpdate) ClearUsers

func (eu *EventUpdate) ClearUsers() *EventUpdate

ClearUsers clears all "users" edges to the User entity.

func (*EventUpdate) ClearWalletsReward

func (eu *EventUpdate) ClearWalletsReward() *EventUpdate

ClearWalletsReward clears the value of the "walletsReward" field.

func (*EventUpdate) Exec

func (eu *EventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpdate) ExecX

func (eu *EventUpdate) ExecX(ctx context.Context)

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

func (*EventUpdate) Mutation

func (eu *EventUpdate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdate) RemoveUserIDs

func (eu *EventUpdate) RemoveUserIDs(ids ...uuid.UUID) *EventUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*EventUpdate) RemoveUsers

func (eu *EventUpdate) RemoveUsers(u ...*User) *EventUpdate

RemoveUsers removes "users" edges to User entities.

func (*EventUpdate) Save

func (eu *EventUpdate) Save(ctx context.Context) (int, error)

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

func (*EventUpdate) SaveX

func (eu *EventUpdate) SaveX(ctx context.Context) int

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

func (*EventUpdate) SetCategory

func (eu *EventUpdate) SetCategory(e *EventType) *EventUpdate

SetCategory sets the "category" edge to the EventType entity.

func (*EventUpdate) SetCategoryID

func (eu *EventUpdate) SetCategoryID(id uuid.UUID) *EventUpdate

SetCategoryID sets the "category" edge to the EventType entity by ID.

func (*EventUpdate) SetDescription

func (eu *EventUpdate) SetDescription(s string) *EventUpdate

SetDescription sets the "description" field.

func (*EventUpdate) SetEndAt

func (eu *EventUpdate) SetEndAt(t time.Time) *EventUpdate

SetEndAt sets the "endAt" field.

func (*EventUpdate) SetName

func (eu *EventUpdate) SetName(s string) *EventUpdate

SetName sets the "name" field.

func (*EventUpdate) SetNillableCategoryID

func (eu *EventUpdate) SetNillableCategoryID(id *uuid.UUID) *EventUpdate

SetNillableCategoryID sets the "category" edge to the EventType entity by ID if the given value is not nil.

func (*EventUpdate) SetNillableDescription

func (eu *EventUpdate) SetNillableDescription(s *string) *EventUpdate

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

func (*EventUpdate) SetNillableTutorsRequired

func (eu *EventUpdate) SetNillableTutorsRequired(i *int64) *EventUpdate

SetNillableTutorsRequired sets the "tutorsRequired" field if the given value is not nil.

func (*EventUpdate) SetNillableWalletsReward

func (eu *EventUpdate) SetNillableWalletsReward(i *int64) *EventUpdate

SetNillableWalletsReward sets the "walletsReward" field if the given value is not nil.

func (*EventUpdate) SetStartAt

func (eu *EventUpdate) SetStartAt(t time.Time) *EventUpdate

SetStartAt sets the "startAt" field.

func (*EventUpdate) SetTutorsRequired

func (eu *EventUpdate) SetTutorsRequired(i int64) *EventUpdate

SetTutorsRequired sets the "tutorsRequired" field.

func (*EventUpdate) SetWalletsReward

func (eu *EventUpdate) SetWalletsReward(i int64) *EventUpdate

SetWalletsReward sets the "walletsReward" field.

func (*EventUpdate) Where

func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate

Where appends a list predicates to the EventUpdate builder.

type EventUpdateOne

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

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) AddTutorsRequired

func (euo *EventUpdateOne) AddTutorsRequired(i int64) *EventUpdateOne

AddTutorsRequired adds i to the "tutorsRequired" field.

func (*EventUpdateOne) AddUserIDs

func (euo *EventUpdateOne) AddUserIDs(ids ...uuid.UUID) *EventUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*EventUpdateOne) AddUsers

func (euo *EventUpdateOne) AddUsers(u ...*User) *EventUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*EventUpdateOne) AddWalletsReward

func (euo *EventUpdateOne) AddWalletsReward(i int64) *EventUpdateOne

AddWalletsReward adds i to the "walletsReward" field.

func (*EventUpdateOne) ClearCategory

func (euo *EventUpdateOne) ClearCategory() *EventUpdateOne

ClearCategory clears the "category" edge to the EventType entity.

func (*EventUpdateOne) ClearDescription

func (euo *EventUpdateOne) ClearDescription() *EventUpdateOne

ClearDescription clears the value of the "description" field.

func (*EventUpdateOne) ClearTutorsRequired

func (euo *EventUpdateOne) ClearTutorsRequired() *EventUpdateOne

ClearTutorsRequired clears the value of the "tutorsRequired" field.

func (*EventUpdateOne) ClearUsers

func (euo *EventUpdateOne) ClearUsers() *EventUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*EventUpdateOne) ClearWalletsReward

func (euo *EventUpdateOne) ClearWalletsReward() *EventUpdateOne

ClearWalletsReward clears the value of the "walletsReward" field.

func (*EventUpdateOne) Exec

func (euo *EventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventUpdateOne) ExecX

func (euo *EventUpdateOne) ExecX(ctx context.Context)

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

func (*EventUpdateOne) Mutation

func (euo *EventUpdateOne) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdateOne) RemoveUserIDs

func (euo *EventUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *EventUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*EventUpdateOne) RemoveUsers

func (euo *EventUpdateOne) RemoveUsers(u ...*User) *EventUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*EventUpdateOne) Save

func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)

Save executes the query and returns the updated Event entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

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

func (*EventUpdateOne) Select

func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne

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

func (*EventUpdateOne) SetCategory

func (euo *EventUpdateOne) SetCategory(e *EventType) *EventUpdateOne

SetCategory sets the "category" edge to the EventType entity.

func (*EventUpdateOne) SetCategoryID

func (euo *EventUpdateOne) SetCategoryID(id uuid.UUID) *EventUpdateOne

SetCategoryID sets the "category" edge to the EventType entity by ID.

func (*EventUpdateOne) SetDescription

func (euo *EventUpdateOne) SetDescription(s string) *EventUpdateOne

SetDescription sets the "description" field.

func (*EventUpdateOne) SetEndAt

func (euo *EventUpdateOne) SetEndAt(t time.Time) *EventUpdateOne

SetEndAt sets the "endAt" field.

func (*EventUpdateOne) SetName

func (euo *EventUpdateOne) SetName(s string) *EventUpdateOne

SetName sets the "name" field.

func (*EventUpdateOne) SetNillableCategoryID

func (euo *EventUpdateOne) SetNillableCategoryID(id *uuid.UUID) *EventUpdateOne

SetNillableCategoryID sets the "category" edge to the EventType entity by ID if the given value is not nil.

func (*EventUpdateOne) SetNillableDescription

func (euo *EventUpdateOne) SetNillableDescription(s *string) *EventUpdateOne

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

func (*EventUpdateOne) SetNillableTutorsRequired

func (euo *EventUpdateOne) SetNillableTutorsRequired(i *int64) *EventUpdateOne

SetNillableTutorsRequired sets the "tutorsRequired" field if the given value is not nil.

func (*EventUpdateOne) SetNillableWalletsReward

func (euo *EventUpdateOne) SetNillableWalletsReward(i *int64) *EventUpdateOne

SetNillableWalletsReward sets the "walletsReward" field if the given value is not nil.

func (*EventUpdateOne) SetStartAt

func (euo *EventUpdateOne) SetStartAt(t time.Time) *EventUpdateOne

SetStartAt sets the "startAt" field.

func (*EventUpdateOne) SetTutorsRequired

func (euo *EventUpdateOne) SetTutorsRequired(i int64) *EventUpdateOne

SetTutorsRequired sets the "tutorsRequired" field.

func (*EventUpdateOne) SetWalletsReward

func (euo *EventUpdateOne) SetWalletsReward(i int64) *EventUpdateOne

SetWalletsReward sets the "walletsReward" field.

type Events

type Events []*Event

Events is a parsable slice of Event.

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 Role

type Role struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Event holds the value of the "event" field.
	Event string `json:"-"`
	// EventWrite holds the value of the "event_write" field.
	EventWrite string `json:"-"`
	// User holds the value of the "user" field.
	User string `json:"-"`
	// UserSubscription holds the value of the "user_subscription" field.
	UserSubscription string `json:"-"`
	// UserWrite holds the value of the "user_write" field.
	UserWrite string `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleQuery when eager-loading is set.
	Edges RoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) ContextValidate

func (r *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate method is implemented to discard code editor errors.

func (*Role) QueryUsers

func (r *Role) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Role entity.

func (*Role) String

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) Unwrap

func (r *Role) Unwrap() *Role

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

func (r *Role) Update() *RoleUpdateOne

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

func (*Role) Validate

func (r *Role) Validate(formats strfmt.Registry) error

Validate method is mandatory for Go Swagger generated server code to compile.

type RoleClient

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

RoleClient is a client for the Role schema.

func NewRoleClient

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create

func (c *RoleClient) Create() *RoleCreate

Create returns a create builder for Role.

func (*RoleClient) CreateBulk

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

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

func (*RoleClient) Delete

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*RoleClient) DeleteOneID

func (c *RoleClient) DeleteOneID(id uuid.UUID) *RoleDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id uuid.UUID) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id uuid.UUID) *Role

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

func (*RoleClient) Hooks

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

Hooks returns the client hooks.

func (*RoleClient) Query

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) QueryUsers

func (c *RoleClient) QueryUsers(r *Role) *UserQuery

QueryUsers queries the users edge of a Role.

func (*RoleClient) Update

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID

func (c *RoleClient) UpdateOneID(id uuid.UUID) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use

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

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

type RoleCreate

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

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) AddUserIDs

func (rc *RoleCreate) AddUserIDs(ids ...uuid.UUID) *RoleCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleCreate) AddUsers

func (rc *RoleCreate) AddUsers(u ...*User) *RoleCreate

AddUsers adds the "users" edges to the User entity.

func (*RoleCreate) Exec

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecX

func (rc *RoleCreate) ExecX(ctx context.Context)

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

func (*RoleCreate) Mutation

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) Save

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

func (*RoleCreate) SetEvent

func (rc *RoleCreate) SetEvent(s string) *RoleCreate

SetEvent sets the "event" field.

func (*RoleCreate) SetEventWrite

func (rc *RoleCreate) SetEventWrite(s string) *RoleCreate

SetEventWrite sets the "event_write" field.

func (*RoleCreate) SetID

func (rc *RoleCreate) SetID(u uuid.UUID) *RoleCreate

SetID sets the "id" field.

func (*RoleCreate) SetName

func (rc *RoleCreate) SetName(s string) *RoleCreate

SetName sets the "name" field.

func (*RoleCreate) SetNillableEvent

func (rc *RoleCreate) SetNillableEvent(s *string) *RoleCreate

SetNillableEvent sets the "event" field if the given value is not nil.

func (*RoleCreate) SetNillableEventWrite

func (rc *RoleCreate) SetNillableEventWrite(s *string) *RoleCreate

SetNillableEventWrite sets the "event_write" field if the given value is not nil.

func (*RoleCreate) SetNillableID

func (rc *RoleCreate) SetNillableID(u *uuid.UUID) *RoleCreate

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

func (*RoleCreate) SetNillableUser

func (rc *RoleCreate) SetNillableUser(s *string) *RoleCreate

SetNillableUser sets the "user" field if the given value is not nil.

func (*RoleCreate) SetNillableUserSubscription

func (rc *RoleCreate) SetNillableUserSubscription(s *string) *RoleCreate

SetNillableUserSubscription sets the "user_subscription" field if the given value is not nil.

func (*RoleCreate) SetNillableUserWrite

func (rc *RoleCreate) SetNillableUserWrite(s *string) *RoleCreate

SetNillableUserWrite sets the "user_write" field if the given value is not nil.

func (*RoleCreate) SetUser

func (rc *RoleCreate) SetUser(s string) *RoleCreate

SetUser sets the "user" field.

func (*RoleCreate) SetUserSubscription

func (rc *RoleCreate) SetUserSubscription(s string) *RoleCreate

SetUserSubscription sets the "user_subscription" field.

func (*RoleCreate) SetUserWrite

func (rc *RoleCreate) SetUserWrite(s string) *RoleCreate

SetUserWrite sets the "user_write" field.

type RoleCreateBulk

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

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

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

func (*RoleCreateBulk) Save

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

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

type RoleDelete

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

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

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

func (*RoleDelete) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

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

func (*RoleDelete) Where

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne

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

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

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

type RoleEdges

type RoleEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

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

func (RoleEdges) UsersOrErr

func (e RoleEdges) UsersOrErr() ([]*User, error)

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

type RoleGroupBy

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

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

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

func (*RoleGroupBy) Bool

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) BoolX

func (rgb *RoleGroupBy) BoolX(ctx context.Context) bool

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

func (*RoleGroupBy) Bools

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) BoolsX

func (rgb *RoleGroupBy) BoolsX(ctx context.Context) []bool

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

func (*RoleGroupBy) Float64

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) Float64X

func (rgb *RoleGroupBy) Float64X(ctx context.Context) float64

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

func (*RoleGroupBy) Float64s

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) Float64sX

func (rgb *RoleGroupBy) Float64sX(ctx context.Context) []float64

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

func (*RoleGroupBy) Int

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) IntX

func (rgb *RoleGroupBy) IntX(ctx context.Context) int

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

func (*RoleGroupBy) Ints

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) IntsX

func (rgb *RoleGroupBy) IntsX(ctx context.Context) []int

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

func (*RoleGroupBy) Scan

func (rgb *RoleGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*RoleGroupBy) ScanX

func (rgb *RoleGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*RoleGroupBy) String

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) StringX

func (rgb *RoleGroupBy) StringX(ctx context.Context) string

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

func (*RoleGroupBy) Strings

func (rgb *RoleGroupBy) 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 (*RoleGroupBy) StringsX

func (rgb *RoleGroupBy) StringsX(ctx context.Context) []string

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

type RoleMutation

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

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddField

func (m *RoleMutation) 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 (*RoleMutation) AddUserIDs

func (m *RoleMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*RoleMutation) AddedEdges

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

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

func (*RoleMutation) AddedField

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

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

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

func (*RoleMutation) AddedIDs

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

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

func (*RoleMutation) ClearEdge

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

func (m *RoleMutation) 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 (*RoleMutation) ClearUsers

func (m *RoleMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*RoleMutation) ClearedEdges

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

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

func (*RoleMutation) ClearedFields

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

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

func (RoleMutation) Client

func (m RoleMutation) 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 (*RoleMutation) EdgeCleared

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

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

func (*RoleMutation) Event

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

Event returns the value of the "event" field in the mutation.

func (*RoleMutation) EventWrite

func (m *RoleMutation) EventWrite() (r string, exists bool)

EventWrite returns the value of the "event_write" field in the mutation.

func (*RoleMutation) Field

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

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

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

func (*RoleMutation) Fields

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

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

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

func (*RoleMutation) IDs

func (m *RoleMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*RoleMutation) Name

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

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

func (*RoleMutation) OldEvent

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

OldEvent returns the old "event" field's value of the Role entity. If the Role 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 (*RoleMutation) OldEventWrite

func (m *RoleMutation) OldEventWrite(ctx context.Context) (v string, err error)

OldEventWrite returns the old "event_write" field's value of the Role entity. If the Role 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 (*RoleMutation) OldField

func (m *RoleMutation) 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 (*RoleMutation) OldName

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

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

func (m *RoleMutation) OldUser(ctx context.Context) (v string, err error)

OldUser returns the old "user" field's value of the Role entity. If the Role 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 (*RoleMutation) OldUserSubscription

func (m *RoleMutation) OldUserSubscription(ctx context.Context) (v string, err error)

OldUserSubscription returns the old "user_subscription" field's value of the Role entity. If the Role 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 (*RoleMutation) OldUserWrite

func (m *RoleMutation) OldUserWrite(ctx context.Context) (v string, err error)

OldUserWrite returns the old "user_write" field's value of the Role entity. If the Role 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 (*RoleMutation) Op

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) RemoveUserIDs

func (m *RoleMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*RoleMutation) RemovedEdges

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

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

func (*RoleMutation) RemovedIDs

func (m *RoleMutation) 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 (*RoleMutation) RemovedUsersIDs

func (m *RoleMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*RoleMutation) ResetEdge

func (m *RoleMutation) 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 (*RoleMutation) ResetEvent

func (m *RoleMutation) ResetEvent()

ResetEvent resets all changes to the "event" field.

func (*RoleMutation) ResetEventWrite

func (m *RoleMutation) ResetEventWrite()

ResetEventWrite resets all changes to the "event_write" field.

func (*RoleMutation) ResetField

func (m *RoleMutation) 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 (*RoleMutation) ResetName

func (m *RoleMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RoleMutation) ResetUser

func (m *RoleMutation) ResetUser()

ResetUser resets all changes to the "user" field.

func (*RoleMutation) ResetUserSubscription

func (m *RoleMutation) ResetUserSubscription()

ResetUserSubscription resets all changes to the "user_subscription" field.

func (*RoleMutation) ResetUserWrite

func (m *RoleMutation) ResetUserWrite()

ResetUserWrite resets all changes to the "user_write" field.

func (*RoleMutation) ResetUsers

func (m *RoleMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*RoleMutation) SetEvent

func (m *RoleMutation) SetEvent(s string)

SetEvent sets the "event" field.

func (*RoleMutation) SetEventWrite

func (m *RoleMutation) SetEventWrite(s string)

SetEventWrite sets the "event_write" field.

func (*RoleMutation) SetField

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

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

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

func (*RoleMutation) SetName

func (m *RoleMutation) SetName(s string)

SetName sets the "name" field.

func (*RoleMutation) SetUser

func (m *RoleMutation) SetUser(s string)

SetUser sets the "user" field.

func (*RoleMutation) SetUserSubscription

func (m *RoleMutation) SetUserSubscription(s string)

SetUserSubscription sets the "user_subscription" field.

func (*RoleMutation) SetUserWrite

func (m *RoleMutation) SetUserWrite(s string)

SetUserWrite sets the "user_write" field.

func (RoleMutation) Tx

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

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

func (*RoleMutation) Type

func (m *RoleMutation) Type() string

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

func (*RoleMutation) User

func (m *RoleMutation) User() (r string, exists bool)

User returns the value of the "user" field in the mutation.

func (*RoleMutation) UserSubscription

func (m *RoleMutation) UserSubscription() (r string, exists bool)

UserSubscription returns the value of the "user_subscription" field in the mutation.

func (*RoleMutation) UserWrite

func (m *RoleMutation) UserWrite() (r string, exists bool)

UserWrite returns the value of the "user_write" field in the mutation.

func (*RoleMutation) UsersCleared

func (m *RoleMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*RoleMutation) UsersIDs

func (m *RoleMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*RoleMutation) Where

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

type RoleQuery

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

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) All

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

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

func (*RoleQuery) Clone

func (rq *RoleQuery) Clone() *RoleQuery

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

func (*RoleQuery) Count

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX

func (rq *RoleQuery) CountX(ctx context.Context) int

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

func (*RoleQuery) Exist

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

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

func (*RoleQuery) ExistX

func (rq *RoleQuery) ExistX(ctx context.Context) bool

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

func (*RoleQuery) First

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

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

func (*RoleQuery) FirstID

func (rq *RoleQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*RoleQuery) FirstIDX

func (rq *RoleQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*RoleQuery) FirstX

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

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

func (*RoleQuery) GroupBy

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

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

Example:

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

client.Role.Query().
	GroupBy(role.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoleQuery) IDs

func (rq *RoleQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*RoleQuery) Limit

func (rq *RoleQuery) Limit(limit int) *RoleQuery

Limit adds a limit step to the query.

func (*RoleQuery) Offset

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset adds an offset step to the query.

func (*RoleQuery) Only

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

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

func (*RoleQuery) OnlyID

func (rq *RoleQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*RoleQuery) OnlyIDX

func (rq *RoleQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*RoleQuery) OnlyX

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

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

func (*RoleQuery) Order

func (rq *RoleQuery) Order(o ...OrderFunc) *RoleQuery

Order adds an order step to the query.

func (*RoleQuery) QueryUsers

func (rq *RoleQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*RoleQuery) Select

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Role.Query().
	Select(role.FieldName).
	Scan(ctx, &v)

func (*RoleQuery) Unique

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

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

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

func (*RoleQuery) WithUsers

func (rq *RoleQuery) WithUsers(opts ...func(*UserQuery)) *RoleQuery

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

type RoleSelect

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Bool

func (rs *RoleSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*RoleSelect) BoolX

func (rs *RoleSelect) BoolX(ctx context.Context) bool

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

func (*RoleSelect) Bools

func (rs *RoleSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*RoleSelect) BoolsX

func (rs *RoleSelect) BoolsX(ctx context.Context) []bool

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

func (*RoleSelect) Float64

func (rs *RoleSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*RoleSelect) Float64X

func (rs *RoleSelect) Float64X(ctx context.Context) float64

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

func (*RoleSelect) Float64s

func (rs *RoleSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*RoleSelect) Float64sX

func (rs *RoleSelect) Float64sX(ctx context.Context) []float64

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

func (*RoleSelect) Int

func (rs *RoleSelect) Int(ctx context.Context) (_ int, err error)

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

func (*RoleSelect) IntX

func (rs *RoleSelect) IntX(ctx context.Context) int

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

func (*RoleSelect) Ints

func (rs *RoleSelect) Ints(ctx context.Context) ([]int, error)

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

func (*RoleSelect) IntsX

func (rs *RoleSelect) IntsX(ctx context.Context) []int

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

func (*RoleSelect) Scan

func (rs *RoleSelect) Scan(ctx context.Context, v interface{}) error

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

func (*RoleSelect) ScanX

func (rs *RoleSelect) ScanX(ctx context.Context, v interface{})

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

func (*RoleSelect) String

func (rs *RoleSelect) String(ctx context.Context) (_ string, err error)

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

func (*RoleSelect) StringX

func (rs *RoleSelect) StringX(ctx context.Context) string

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

func (*RoleSelect) Strings

func (rs *RoleSelect) Strings(ctx context.Context) ([]string, error)

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

func (*RoleSelect) StringsX

func (rs *RoleSelect) StringsX(ctx context.Context) []string

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

type RoleUpdate

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

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) AddUserIDs

func (ru *RoleUpdate) AddUserIDs(ids ...uuid.UUID) *RoleUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleUpdate) AddUsers

func (ru *RoleUpdate) AddUsers(u ...*User) *RoleUpdate

AddUsers adds the "users" edges to the User entity.

func (*RoleUpdate) ClearUsers

func (ru *RoleUpdate) ClearUsers() *RoleUpdate

ClearUsers clears all "users" edges to the User entity.

func (*RoleUpdate) Exec

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

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

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) RemoveUserIDs

func (ru *RoleUpdate) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*RoleUpdate) RemoveUsers

func (ru *RoleUpdate) RemoveUsers(u ...*User) *RoleUpdate

RemoveUsers removes "users" edges to User entities.

func (*RoleUpdate) Save

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

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

func (*RoleUpdate) SaveX

func (ru *RoleUpdate) SaveX(ctx context.Context) int

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

func (*RoleUpdate) SetEvent

func (ru *RoleUpdate) SetEvent(s string) *RoleUpdate

SetEvent sets the "event" field.

func (*RoleUpdate) SetEventWrite

func (ru *RoleUpdate) SetEventWrite(s string) *RoleUpdate

SetEventWrite sets the "event_write" field.

func (*RoleUpdate) SetName

func (ru *RoleUpdate) SetName(s string) *RoleUpdate

SetName sets the "name" field.

func (*RoleUpdate) SetNillableEvent

func (ru *RoleUpdate) SetNillableEvent(s *string) *RoleUpdate

SetNillableEvent sets the "event" field if the given value is not nil.

func (*RoleUpdate) SetNillableEventWrite

func (ru *RoleUpdate) SetNillableEventWrite(s *string) *RoleUpdate

SetNillableEventWrite sets the "event_write" field if the given value is not nil.

func (*RoleUpdate) SetNillableUser

func (ru *RoleUpdate) SetNillableUser(s *string) *RoleUpdate

SetNillableUser sets the "user" field if the given value is not nil.

func (*RoleUpdate) SetNillableUserSubscription

func (ru *RoleUpdate) SetNillableUserSubscription(s *string) *RoleUpdate

SetNillableUserSubscription sets the "user_subscription" field if the given value is not nil.

func (*RoleUpdate) SetNillableUserWrite

func (ru *RoleUpdate) SetNillableUserWrite(s *string) *RoleUpdate

SetNillableUserWrite sets the "user_write" field if the given value is not nil.

func (*RoleUpdate) SetUser

func (ru *RoleUpdate) SetUser(s string) *RoleUpdate

SetUser sets the "user" field.

func (*RoleUpdate) SetUserSubscription

func (ru *RoleUpdate) SetUserSubscription(s string) *RoleUpdate

SetUserSubscription sets the "user_subscription" field.

func (*RoleUpdate) SetUserWrite

func (ru *RoleUpdate) SetUserWrite(s string) *RoleUpdate

SetUserWrite sets the "user_write" field.

func (*RoleUpdate) Where

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne

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

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) AddUserIDs

func (ruo *RoleUpdateOne) AddUserIDs(ids ...uuid.UUID) *RoleUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleUpdateOne) AddUsers

func (ruo *RoleUpdateOne) AddUsers(u ...*User) *RoleUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*RoleUpdateOne) ClearUsers

func (ruo *RoleUpdateOne) ClearUsers() *RoleUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*RoleUpdateOne) Exec

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

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

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) RemoveUserIDs

func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*RoleUpdateOne) RemoveUsers

func (ruo *RoleUpdateOne) RemoveUsers(u ...*User) *RoleUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*RoleUpdateOne) Save

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

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

func (*RoleUpdateOne) Select

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

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

func (*RoleUpdateOne) SetEvent

func (ruo *RoleUpdateOne) SetEvent(s string) *RoleUpdateOne

SetEvent sets the "event" field.

func (*RoleUpdateOne) SetEventWrite

func (ruo *RoleUpdateOne) SetEventWrite(s string) *RoleUpdateOne

SetEventWrite sets the "event_write" field.

func (*RoleUpdateOne) SetName

func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne

SetName sets the "name" field.

func (*RoleUpdateOne) SetNillableEvent

func (ruo *RoleUpdateOne) SetNillableEvent(s *string) *RoleUpdateOne

SetNillableEvent sets the "event" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableEventWrite

func (ruo *RoleUpdateOne) SetNillableEventWrite(s *string) *RoleUpdateOne

SetNillableEventWrite sets the "event_write" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableUser

func (ruo *RoleUpdateOne) SetNillableUser(s *string) *RoleUpdateOne

SetNillableUser sets the "user" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableUserSubscription

func (ruo *RoleUpdateOne) SetNillableUserSubscription(s *string) *RoleUpdateOne

SetNillableUserSubscription sets the "user_subscription" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableUserWrite

func (ruo *RoleUpdateOne) SetNillableUserWrite(s *string) *RoleUpdateOne

SetNillableUserWrite sets the "user_write" field if the given value is not nil.

func (*RoleUpdateOne) SetUser

func (ruo *RoleUpdateOne) SetUser(s string) *RoleUpdateOne

SetUser sets the "user" field.

func (*RoleUpdateOne) SetUserSubscription

func (ruo *RoleUpdateOne) SetUserSubscription(s string) *RoleUpdateOne

SetUserSubscription sets the "user_subscription" field.

func (*RoleUpdateOne) SetUserWrite

func (ruo *RoleUpdateOne) SetUserWrite(s string) *RoleUpdateOne

SetUserWrite sets the "user_write" field.

type Roles

type Roles []*Role

Roles is a parsable slice of Role.

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 {

	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// EventType is the client for interacting with the EventType builders.
	EventType *EventTypeClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Login holds the value of the "login" field.
	Login string `json:"login,omitempty"`
	// FirstName holds the value of the "firstName" field.
	FirstName *string `json:"firstName,omitempty"`
	// LastName holds the value of the "lastName" field.
	LastName *string `json:"lastName,omitempty"`
	// DisplayName holds the value of the "displayName" field.
	DisplayName *string `json:"displayName,omitempty"`
	// ImagePath holds the value of the "imagePath" field.
	ImagePath *string `json:"imagePath,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) ContextValidate

func (u *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate method is implemented to discard code editor errors.

func (*User) QueryEvents

func (u *User) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the User entity.

func (*User) QueryRoles

func (u *User) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

func (*User) Validate

func (u *User) Validate(formats strfmt.Registry) error

Validate method is mandatory for Go Swagger generated server code to compile.

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryEvents

func (c *UserClient) QueryEvents(u *User) *EventQuery

QueryEvents queries the events edge of a User.

func (*UserClient) QueryRoles

func (c *UserClient) QueryRoles(u *User) *RoleQuery

QueryRoles queries the roles edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddEventIDs

func (uc *UserCreate) AddEventIDs(ids ...uuid.UUID) *UserCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*UserCreate) AddEvents

func (uc *UserCreate) AddEvents(e ...*Event) *UserCreate

AddEvents adds the "events" edges to the Event entity.

func (*UserCreate) AddRoleIDs

func (uc *UserCreate) AddRoleIDs(ids ...uuid.UUID) *UserCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserCreate) AddRoles

func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate

AddRoles adds the "roles" edges to the Role entity.

func (*UserCreate) Exec

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

Exec executes the query.

func (*UserCreate) ExecX

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

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetDisplayName

func (uc *UserCreate) SetDisplayName(s string) *UserCreate

SetDisplayName sets the "displayName" field.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "firstName" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetImagePath

func (uc *UserCreate) SetImagePath(s string) *UserCreate

SetImagePath sets the "imagePath" field.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "lastName" field.

func (*UserCreate) SetLogin

func (uc *UserCreate) SetLogin(s string) *UserCreate

SetLogin sets the "login" field.

func (*UserCreate) SetNillableDisplayName

func (uc *UserCreate) SetNillableDisplayName(s *string) *UserCreate

SetNillableDisplayName sets the "displayName" field if the given value is not nil.

func (*UserCreate) SetNillableFirstName

func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate

SetNillableFirstName sets the "firstName" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

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

func (*UserCreate) SetNillableImagePath

func (uc *UserCreate) SetNillableImagePath(s *string) *UserCreate

SetNillableImagePath sets the "imagePath" field if the given value is not nil.

func (*UserCreate) SetNillableLastName

func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate

SetNillableLastName sets the "lastName" field if the given value is not nil.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

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

Exec executes the query.

func (*UserCreateBulk) ExecX

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

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

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

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

func (*UserDelete) ExecX

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

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

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

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

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

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

type UserEdges

type UserEdges struct {
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// Events holds the value of the events edge.
	Events []*Event `json:"events,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) EventsOrErr

func (e UserEdges) EventsOrErr() ([]*Event, error)

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

func (UserEdges) RolesOrErr

func (e UserEdges) RolesOrErr() ([]*Role, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

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

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) 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 (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) 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 (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) 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 (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) 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 (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) 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 (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) 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 (*UserGroupBy) IntsX

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

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

func (*UserGroupBy) Scan

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

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) 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 (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) 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 (*UserGroupBy) StringsX

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

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddEventIDs

func (m *UserMutation) AddEventIDs(ids ...uuid.UUID)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*UserMutation) AddField

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

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

func (*UserMutation) AddRoleIDs

func (m *UserMutation) AddRoleIDs(ids ...uuid.UUID)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

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

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

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) ClearDisplayName

func (m *UserMutation) ClearDisplayName()

ClearDisplayName clears the value of the "displayName" field.

func (*UserMutation) ClearEdge

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

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

func (*UserMutation) ClearEvents

func (m *UserMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*UserMutation) ClearField

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

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

func (*UserMutation) ClearFirstName

func (m *UserMutation) ClearFirstName()

ClearFirstName clears the value of the "firstName" field.

func (*UserMutation) ClearImagePath

func (m *UserMutation) ClearImagePath()

ClearImagePath clears the value of the "imagePath" field.

func (*UserMutation) ClearLastName

func (m *UserMutation) ClearLastName()

ClearLastName clears the value of the "lastName" field.

func (*UserMutation) ClearRoles

func (m *UserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

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

func (*UserMutation) DisplayName

func (m *UserMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "displayName" field in the mutation.

func (*UserMutation) DisplayNameCleared

func (m *UserMutation) DisplayNameCleared() bool

DisplayNameCleared returns if the "displayName" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) EventsCleared

func (m *UserMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the Event entity was cleared.

func (*UserMutation) EventsIDs

func (m *UserMutation) EventsIDs() (ids []uuid.UUID)

EventsIDs returns the "events" edge IDs in the mutation.

func (*UserMutation) Field

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

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

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

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

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

func (*UserMutation) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "firstName" field in the mutation.

func (*UserMutation) FirstNameCleared

func (m *UserMutation) FirstNameCleared() bool

FirstNameCleared returns if the "firstName" field was cleared in this mutation.

func (*UserMutation) ID

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

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

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*UserMutation) ImagePath

func (m *UserMutation) ImagePath() (r string, exists bool)

ImagePath returns the value of the "imagePath" field in the mutation.

func (*UserMutation) ImagePathCleared

func (m *UserMutation) ImagePathCleared() bool

ImagePathCleared returns if the "imagePath" field was cleared in this mutation.

func (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "lastName" field in the mutation.

func (*UserMutation) LastNameCleared

func (m *UserMutation) LastNameCleared() bool

LastNameCleared returns if the "lastName" field was cleared in this mutation.

func (*UserMutation) Login

func (m *UserMutation) Login() (r string, exists bool)

Login returns the value of the "login" field in the mutation.

func (*UserMutation) OldDisplayName

func (m *UserMutation) OldDisplayName(ctx context.Context) (v *string, err error)

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

func (*UserMutation) OldField

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

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v *string, err error)

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

func (*UserMutation) OldImagePath

func (m *UserMutation) OldImagePath(ctx context.Context) (v *string, err error)

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

func (*UserMutation) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v *string, err error)

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

func (*UserMutation) OldLogin

func (m *UserMutation) OldLogin(ctx context.Context) (v string, err error)

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

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) RemoveEventIDs

func (m *UserMutation) RemoveEventIDs(ids ...uuid.UUID)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*UserMutation) RemoveRoleIDs

func (m *UserMutation) RemoveRoleIDs(ids ...uuid.UUID)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedEventsIDs

func (m *UserMutation) RemovedEventsIDs() (ids []uuid.UUID)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*UserMutation) RemovedIDs

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

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

func (*UserMutation) RemovedRolesIDs

func (m *UserMutation) RemovedRolesIDs() (ids []uuid.UUID)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*UserMutation) ResetDisplayName

func (m *UserMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "displayName" field.

func (*UserMutation) ResetEdge

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

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

func (*UserMutation) ResetEvents

func (m *UserMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*UserMutation) ResetField

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

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

func (*UserMutation) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "firstName" field.

func (*UserMutation) ResetImagePath

func (m *UserMutation) ResetImagePath()

ResetImagePath resets all changes to the "imagePath" field.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "lastName" field.

func (*UserMutation) ResetLogin

func (m *UserMutation) ResetLogin()

ResetLogin resets all changes to the "login" field.

func (*UserMutation) ResetRoles

func (m *UserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMutation) RolesCleared

func (m *UserMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (*UserMutation) RolesIDs

func (m *UserMutation) RolesIDs() (ids []uuid.UUID)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*UserMutation) SetDisplayName

func (m *UserMutation) SetDisplayName(s string)

SetDisplayName sets the "displayName" field.

func (*UserMutation) SetField

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

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

func (*UserMutation) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "firstName" field.

func (*UserMutation) SetID

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

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

func (*UserMutation) SetImagePath

func (m *UserMutation) SetImagePath(s string)

SetImagePath sets the "imagePath" field.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "lastName" field.

func (*UserMutation) SetLogin

func (m *UserMutation) SetLogin(s string)

SetLogin sets the "login" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

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

Count returns the count of the given query.

func (*UserQuery) CountX

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

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

func (*UserQuery) Exist

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

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

func (*UserQuery) ExistX

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

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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

Example:

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

client.User.Query().
	GroupBy(user.FieldLogin).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*UserQuery) Limit

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

Limit adds a limit step to the query.

func (*UserQuery) Offset

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

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

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

Order adds an order step to the query.

func (*UserQuery) QueryEvents

func (uq *UserQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*UserQuery) QueryRoles

func (uq *UserQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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

Example:

var v []struct {
	Login string `json:"login,omitempty"`
}

client.User.Query().
	Select(user.FieldLogin).
	Scan(ctx, &v)

func (*UserQuery) Unique

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

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

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithEvents

func (uq *UserQuery) WithEvents(opts ...func(*EventQuery)) *UserQuery

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

func (*UserQuery) WithRoles

func (uq *UserQuery) WithRoles(opts ...func(*RoleQuery)) *UserQuery

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

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

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

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

func (*UserSelect) BoolX

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

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

func (*UserSelect) Bools

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

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

func (*UserSelect) BoolsX

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

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

func (*UserSelect) Float64

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

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

func (*UserSelect) Float64X

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

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

func (*UserSelect) Float64s

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

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

func (*UserSelect) Float64sX

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

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

func (*UserSelect) Int

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

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

func (*UserSelect) IntX

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

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

func (*UserSelect) Ints

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

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

func (*UserSelect) IntsX

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

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

func (*UserSelect) Scan

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

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

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

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

func (*UserSelect) StringX

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

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

func (*UserSelect) Strings

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

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

func (*UserSelect) StringsX

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

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddEventIDs

func (uu *UserUpdate) AddEventIDs(ids ...uuid.UUID) *UserUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*UserUpdate) AddEvents

func (uu *UserUpdate) AddEvents(e ...*Event) *UserUpdate

AddEvents adds the "events" edges to the Event entity.

func (*UserUpdate) AddRoleIDs

func (uu *UserUpdate) AddRoleIDs(ids ...uuid.UUID) *UserUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdate) AddRoles

func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdate) ClearDisplayName

func (uu *UserUpdate) ClearDisplayName() *UserUpdate

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpdate) ClearEvents

func (uu *UserUpdate) ClearEvents() *UserUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*UserUpdate) ClearFirstName

func (uu *UserUpdate) ClearFirstName() *UserUpdate

ClearFirstName clears the value of the "firstName" field.

func (*UserUpdate) ClearImagePath

func (uu *UserUpdate) ClearImagePath() *UserUpdate

ClearImagePath clears the value of the "imagePath" field.

func (*UserUpdate) ClearLastName

func (uu *UserUpdate) ClearLastName() *UserUpdate

ClearLastName clears the value of the "lastName" field.

func (*UserUpdate) ClearRoles

func (uu *UserUpdate) ClearRoles() *UserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdate) Exec

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

Exec executes the query.

func (*UserUpdate) ExecX

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

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveEventIDs

func (uu *UserUpdate) RemoveEventIDs(ids ...uuid.UUID) *UserUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*UserUpdate) RemoveEvents

func (uu *UserUpdate) RemoveEvents(e ...*Event) *UserUpdate

RemoveEvents removes "events" edges to Event entities.

func (*UserUpdate) RemoveRoleIDs

func (uu *UserUpdate) RemoveRoleIDs(ids ...uuid.UUID) *UserUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdate) RemoveRoles

func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdate) Save

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

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

func (*UserUpdate) SaveX

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

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

func (*UserUpdate) SetDisplayName

func (uu *UserUpdate) SetDisplayName(s string) *UserUpdate

SetDisplayName sets the "displayName" field.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "firstName" field.

func (*UserUpdate) SetImagePath

func (uu *UserUpdate) SetImagePath(s string) *UserUpdate

SetImagePath sets the "imagePath" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "lastName" field.

func (*UserUpdate) SetNillableDisplayName

func (uu *UserUpdate) SetNillableDisplayName(s *string) *UserUpdate

SetNillableDisplayName sets the "displayName" field if the given value is not nil.

func (*UserUpdate) SetNillableFirstName

func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate

SetNillableFirstName sets the "firstName" field if the given value is not nil.

func (*UserUpdate) SetNillableImagePath

func (uu *UserUpdate) SetNillableImagePath(s *string) *UserUpdate

SetNillableImagePath sets the "imagePath" field if the given value is not nil.

func (*UserUpdate) SetNillableLastName

func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate

SetNillableLastName sets the "lastName" field if the given value is not nil.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddEventIDs

func (uuo *UserUpdateOne) AddEventIDs(ids ...uuid.UUID) *UserUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*UserUpdateOne) AddEvents

func (uuo *UserUpdateOne) AddEvents(e ...*Event) *UserUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*UserUpdateOne) AddRoleIDs

func (uuo *UserUpdateOne) AddRoleIDs(ids ...uuid.UUID) *UserUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdateOne) AddRoles

func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdateOne) ClearDisplayName

func (uuo *UserUpdateOne) ClearDisplayName() *UserUpdateOne

ClearDisplayName clears the value of the "displayName" field.

func (*UserUpdateOne) ClearEvents

func (uuo *UserUpdateOne) ClearEvents() *UserUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*UserUpdateOne) ClearFirstName

func (uuo *UserUpdateOne) ClearFirstName() *UserUpdateOne

ClearFirstName clears the value of the "firstName" field.

func (*UserUpdateOne) ClearImagePath

func (uuo *UserUpdateOne) ClearImagePath() *UserUpdateOne

ClearImagePath clears the value of the "imagePath" field.

func (*UserUpdateOne) ClearLastName

func (uuo *UserUpdateOne) ClearLastName() *UserUpdateOne

ClearLastName clears the value of the "lastName" field.

func (*UserUpdateOne) ClearRoles

func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdateOne) Exec

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

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

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

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveEventIDs

func (uuo *UserUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*UserUpdateOne) RemoveEvents

func (uuo *UserUpdateOne) RemoveEvents(e ...*Event) *UserUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*UserUpdateOne) RemoveRoleIDs

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdateOne) RemoveRoles

func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

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

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

func (*UserUpdateOne) SetDisplayName

func (uuo *UserUpdateOne) SetDisplayName(s string) *UserUpdateOne

SetDisplayName sets the "displayName" field.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "firstName" field.

func (*UserUpdateOne) SetImagePath

func (uuo *UserUpdateOne) SetImagePath(s string) *UserUpdateOne

SetImagePath sets the "imagePath" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "lastName" field.

func (*UserUpdateOne) SetNillableDisplayName

func (uuo *UserUpdateOne) SetNillableDisplayName(s *string) *UserUpdateOne

SetNillableDisplayName sets the "displayName" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFirstName

func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne

SetNillableFirstName sets the "firstName" field if the given value is not nil.

func (*UserUpdateOne) SetNillableImagePath

func (uuo *UserUpdateOne) SetNillableImagePath(s *string) *UserUpdateOne

SetNillableImagePath sets the "imagePath" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastName

func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne

SetNillableLastName sets the "lastName" field if the given value is not nil.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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