ent

package
v0.0.0-...-34fc03e Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: AGPL-3.0 Imports: 25 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.
	TypeActor    = "Actor"
	TypeEvent    = "Event"
	TypeGroup    = "Group"
	TypeReaction = "Reaction"
	TypeServer   = "Server"
	TypeSession  = "Session"
	TypeStatus   = "Status"
)

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.

func ServeEntviz

func ServeEntviz() http.Handler

func WithTx

func WithTx(ctx context.Context, client *Client, fn func(tx *Tx) error) error

Types

type Actor

type Actor struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// The type of account. All accounts are AP actors
	Type actor.Type `json:"type,omitempty"`
	// The Actor's username
	Name string `json:"name,omitempty"`
	// The Actor's displayed 'friendly' name
	DisplayName string `json:"display_name,omitempty"`
	// Actor note, AKA description
	Note string `json:"note,omitempty"`
	// Actor account is locked if unconfirmed or explicitly locked
	Locked bool `json:"locked,omitempty"`
	// Actor account is memorialized
	Memorial bool `json:"memorial,omitempty"`
	// Actor URL
	URL string `json:"url,omitempty"`
	// Actor public key
	Pubkey []byte `json:"pubkey,omitempty"`
	// Actor private key
	Privkey *[]byte `json:"-"`
	// URL of the Actor's remote avatar
	AvatarRemoteURL *string `json:"avatar_remote_url,omitempty"`
	// The Actor's local avatar file
	AvatarLocalFile *string `json:"avatar_local_file,omitempty"`
	// The time the Actor's (local) avatar was last updated
	AvatarUpdatedAt *time.Time `json:"avatar_updated_at,omitempty"`
	// URL of user header
	HeaderURL *string `json:"header_url,omitempty"`
	// The Actor's local header file
	HeaderLocalFile *string `json:"header_local_file,omitempty"`
	// The time the Actor's header was last updated
	HeaderUpdatedAt *time.Time `json:"header_updated_at,omitempty"`
	// The time the Actor's account was last discovered with webfinger
	LastWebfingerAt *time.Time `json:"last_webfinger_at,omitempty"`
	// The Actor's ActivityPub Inbox IRI
	InboxURL string `json:"inbox_url,omitempty"`
	// The Actor's ActivityPub Inbox IRI
	OutboxURL string `json:"outbox_url,omitempty"`
	// The Actor's ActivityPub Inbox IRI
	SharedInboxURL string `json:"shared_inbox_url,omitempty"`
	// The Actor's ActivityPub Inbox IRI
	FollowersURL string `json:"followers_url,omitempty"`
	// The Actor's id, if it has moved
	MovedToID *uint64 `json:"moved_to_id,omitempty"`
	// The Actor's featured items
	FeaturedCollectionURL *string `json:"featured_collection_url,omitempty"`
	// The time the Actor was silenced
	SilencedAt *time.Time `json:"silenced_at,omitempty"`
	// The time the Actor was silenced
	SuspendedAt *time.Time `json:"suspended_at,omitempty"`
	// Actor bcrypt password hash
	PasswordHash *[]byte `json:"-"`
	// local Actor password recovery code generated during account creation
	RecoveryCode *string `json:"-"`
	// local Actor role
	Role uint64 `json:"role,omitempty"`
	// local Actor badge
	Badge uint64 `json:"badge,omitempty"`
	// local Actor locale
	Locale actor.Locale `json:"locale,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ActorQuery when eager-loading is set.
	Edges ActorEdges `json:"edges"`
	// contains filtered or unexported fields
}

Actor is the model entity for the Actor schema.

func (*Actor) QueryEvents

func (a *Actor) QueryEvents() *EventQuery

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

func (*Actor) QueryFollowers

func (a *Actor) QueryFollowers() *ActorQuery

QueryFollowers queries the "followers" edge of the Actor entity.

func (*Actor) QueryFollowing

func (a *Actor) QueryFollowing() *ActorQuery

QueryFollowing queries the "following" edge of the Actor entity.

func (*Actor) QueryGroups

func (a *Actor) QueryGroups() *ActorQuery

QueryGroups queries the "groups" edge of the Actor entity.

func (*Actor) QueryMembers

func (a *Actor) QueryMembers() *ActorQuery

QueryMembers queries the "members" edge of the Actor entity.

func (*Actor) QueryModerating

func (a *Actor) QueryModerating() *ActorQuery

QueryModerating queries the "moderating" edge of the Actor entity.

func (*Actor) QueryModerators

func (a *Actor) QueryModerators() *ActorQuery

QueryModerators queries the "moderators" edge of the Actor entity.

func (*Actor) QueryOrganizerOf

func (a *Actor) QueryOrganizerOf() *EventQuery

QueryOrganizerOf queries the "organizer_of" edge of the Actor entity.

func (*Actor) QueryReactedStatuses

func (a *Actor) QueryReactedStatuses() *StatusQuery

QueryReactedStatuses queries the "reacted_statuses" edge of the Actor entity.

func (*Actor) QueryReactions

func (a *Actor) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the Actor entity.

func (*Actor) QueryServer

func (a *Actor) QueryServer() *ServerQuery

QueryServer queries the "server" edge of the Actor entity.

func (*Actor) QuerySessions

func (a *Actor) QuerySessions() *SessionQuery

QuerySessions queries the "sessions" edge of the Actor entity.

func (*Actor) QueryStatuses

func (a *Actor) QueryStatuses() *StatusQuery

QueryStatuses queries the "statuses" edge of the Actor entity.

func (*Actor) String

func (a *Actor) String() string

String implements the fmt.Stringer.

func (*Actor) Unwrap

func (a *Actor) Unwrap() *Actor

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

func (a *Actor) Update() *ActorUpdateOne

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

type ActorClient

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

ActorClient is a client for the Actor schema.

func NewActorClient

func NewActorClient(c config) *ActorClient

NewActorClient returns a client for the Actor from the given config.

func (*ActorClient) Create

func (c *ActorClient) Create() *ActorCreate

Create returns a builder for creating a Actor entity.

func (*ActorClient) CreateBulk

func (c *ActorClient) CreateBulk(builders ...*ActorCreate) *ActorCreateBulk

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

func (*ActorClient) Delete

func (c *ActorClient) Delete() *ActorDelete

Delete returns a delete builder for Actor.

func (*ActorClient) DeleteOne

func (c *ActorClient) DeleteOne(a *Actor) *ActorDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ActorClient) DeleteOneID

func (c *ActorClient) DeleteOneID(id uint64) *ActorDeleteOne

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

func (*ActorClient) Get

func (c *ActorClient) Get(ctx context.Context, id uint64) (*Actor, error)

Get returns a Actor entity by its id.

func (*ActorClient) GetX

func (c *ActorClient) GetX(ctx context.Context, id uint64) *Actor

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

func (*ActorClient) Hooks

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

Hooks returns the client hooks.

func (*ActorClient) Query

func (c *ActorClient) Query() *ActorQuery

Query returns a query builder for Actor.

func (*ActorClient) QueryEvents

func (c *ActorClient) QueryEvents(a *Actor) *EventQuery

QueryEvents queries the events edge of a Actor.

func (*ActorClient) QueryFollowers

func (c *ActorClient) QueryFollowers(a *Actor) *ActorQuery

QueryFollowers queries the followers edge of a Actor.

func (*ActorClient) QueryFollowing

func (c *ActorClient) QueryFollowing(a *Actor) *ActorQuery

QueryFollowing queries the following edge of a Actor.

func (*ActorClient) QueryGroups

func (c *ActorClient) QueryGroups(a *Actor) *ActorQuery

QueryGroups queries the groups edge of a Actor.

func (*ActorClient) QueryMembers

func (c *ActorClient) QueryMembers(a *Actor) *ActorQuery

QueryMembers queries the members edge of a Actor.

func (*ActorClient) QueryModerating

func (c *ActorClient) QueryModerating(a *Actor) *ActorQuery

QueryModerating queries the moderating edge of a Actor.

func (*ActorClient) QueryModerators

func (c *ActorClient) QueryModerators(a *Actor) *ActorQuery

QueryModerators queries the moderators edge of a Actor.

func (*ActorClient) QueryOrganizerOf

func (c *ActorClient) QueryOrganizerOf(a *Actor) *EventQuery

QueryOrganizerOf queries the organizer_of edge of a Actor.

func (*ActorClient) QueryReactedStatuses

func (c *ActorClient) QueryReactedStatuses(a *Actor) *StatusQuery

QueryReactedStatuses queries the reacted_statuses edge of a Actor.

func (*ActorClient) QueryReactions

func (c *ActorClient) QueryReactions(a *Actor) *ReactionQuery

QueryReactions queries the reactions edge of a Actor.

func (*ActorClient) QueryServer

func (c *ActorClient) QueryServer(a *Actor) *ServerQuery

QueryServer queries the server edge of a Actor.

func (*ActorClient) QuerySessions

func (c *ActorClient) QuerySessions(a *Actor) *SessionQuery

QuerySessions queries the sessions edge of a Actor.

func (*ActorClient) QueryStatuses

func (c *ActorClient) QueryStatuses(a *Actor) *StatusQuery

QueryStatuses queries the statuses edge of a Actor.

func (*ActorClient) Update

func (c *ActorClient) Update() *ActorUpdate

Update returns an update builder for Actor.

func (*ActorClient) UpdateOne

func (c *ActorClient) UpdateOne(a *Actor) *ActorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ActorClient) UpdateOneID

func (c *ActorClient) UpdateOneID(id uint64) *ActorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ActorClient) Use

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

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

type ActorCreate

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

ActorCreate is the builder for creating a Actor entity.

func (*ActorCreate) AddEventIDs

func (ac *ActorCreate) AddEventIDs(ids ...uint64) *ActorCreate

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

func (*ActorCreate) AddEvents

func (ac *ActorCreate) AddEvents(e ...*Event) *ActorCreate

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

func (*ActorCreate) AddFollowerIDs

func (ac *ActorCreate) AddFollowerIDs(ids ...uint64) *ActorCreate

AddFollowerIDs adds the "followers" edge to the Actor entity by IDs.

func (*ActorCreate) AddFollowers

func (ac *ActorCreate) AddFollowers(a ...*Actor) *ActorCreate

AddFollowers adds the "followers" edges to the Actor entity.

func (*ActorCreate) AddFollowing

func (ac *ActorCreate) AddFollowing(a ...*Actor) *ActorCreate

AddFollowing adds the "following" edges to the Actor entity.

func (*ActorCreate) AddFollowingIDs

func (ac *ActorCreate) AddFollowingIDs(ids ...uint64) *ActorCreate

AddFollowingIDs adds the "following" edge to the Actor entity by IDs.

func (*ActorCreate) AddGroupIDs

func (ac *ActorCreate) AddGroupIDs(ids ...uint64) *ActorCreate

AddGroupIDs adds the "groups" edge to the Actor entity by IDs.

func (*ActorCreate) AddGroups

func (ac *ActorCreate) AddGroups(a ...*Actor) *ActorCreate

AddGroups adds the "groups" edges to the Actor entity.

func (*ActorCreate) AddMemberIDs

func (ac *ActorCreate) AddMemberIDs(ids ...uint64) *ActorCreate

AddMemberIDs adds the "members" edge to the Actor entity by IDs.

func (*ActorCreate) AddMembers

func (ac *ActorCreate) AddMembers(a ...*Actor) *ActorCreate

AddMembers adds the "members" edges to the Actor entity.

func (*ActorCreate) AddModerating

func (ac *ActorCreate) AddModerating(a ...*Actor) *ActorCreate

AddModerating adds the "moderating" edges to the Actor entity.

func (*ActorCreate) AddModeratingIDs

func (ac *ActorCreate) AddModeratingIDs(ids ...uint64) *ActorCreate

AddModeratingIDs adds the "moderating" edge to the Actor entity by IDs.

func (*ActorCreate) AddModeratorIDs

func (ac *ActorCreate) AddModeratorIDs(ids ...uint64) *ActorCreate

AddModeratorIDs adds the "moderators" edge to the Actor entity by IDs.

func (*ActorCreate) AddModerators

func (ac *ActorCreate) AddModerators(a ...*Actor) *ActorCreate

AddModerators adds the "moderators" edges to the Actor entity.

func (*ActorCreate) AddOrganizerOf

func (ac *ActorCreate) AddOrganizerOf(e ...*Event) *ActorCreate

AddOrganizerOf adds the "organizer_of" edges to the Event entity.

func (*ActorCreate) AddOrganizerOfIDs

func (ac *ActorCreate) AddOrganizerOfIDs(ids ...uint64) *ActorCreate

AddOrganizerOfIDs adds the "organizer_of" edge to the Event entity by IDs.

func (*ActorCreate) AddReactedStatusIDs

func (ac *ActorCreate) AddReactedStatusIDs(ids ...uint64) *ActorCreate

AddReactedStatusIDs adds the "reacted_statuses" edge to the Status entity by IDs.

func (*ActorCreate) AddReactedStatuses

func (ac *ActorCreate) AddReactedStatuses(s ...*Status) *ActorCreate

AddReactedStatuses adds the "reacted_statuses" edges to the Status entity.

func (*ActorCreate) AddSessionIDs

func (ac *ActorCreate) AddSessionIDs(ids ...uint64) *ActorCreate

AddSessionIDs adds the "sessions" edge to the Session entity by IDs.

func (*ActorCreate) AddSessions

func (ac *ActorCreate) AddSessions(s ...*Session) *ActorCreate

AddSessions adds the "sessions" edges to the Session entity.

func (*ActorCreate) AddStatusIDs

func (ac *ActorCreate) AddStatusIDs(ids ...uint64) *ActorCreate

AddStatusIDs adds the "statuses" edge to the Status entity by IDs.

func (*ActorCreate) AddStatuses

func (ac *ActorCreate) AddStatuses(s ...*Status) *ActorCreate

AddStatuses adds the "statuses" edges to the Status entity.

func (*ActorCreate) Exec

func (ac *ActorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ActorCreate) ExecX

func (ac *ActorCreate) ExecX(ctx context.Context)

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

func (*ActorCreate) Mutation

func (ac *ActorCreate) Mutation() *ActorMutation

Mutation returns the ActorMutation object of the builder.

func (*ActorCreate) Save

func (ac *ActorCreate) Save(ctx context.Context) (*Actor, error)

Save creates the Actor in the database.

func (*ActorCreate) SaveX

func (ac *ActorCreate) SaveX(ctx context.Context) *Actor

SaveX calls Save and panics if Save returns an error.

func (*ActorCreate) SetAvatarLocalFile

func (ac *ActorCreate) SetAvatarLocalFile(s string) *ActorCreate

SetAvatarLocalFile sets the "avatar_local_file" field.

func (*ActorCreate) SetAvatarRemoteURL

func (ac *ActorCreate) SetAvatarRemoteURL(s string) *ActorCreate

SetAvatarRemoteURL sets the "avatar_remote_url" field.

func (*ActorCreate) SetAvatarUpdatedAt

func (ac *ActorCreate) SetAvatarUpdatedAt(t time.Time) *ActorCreate

SetAvatarUpdatedAt sets the "avatar_updated_at" field.

func (*ActorCreate) SetBadge

func (ac *ActorCreate) SetBadge(u uint64) *ActorCreate

SetBadge sets the "badge" field.

func (*ActorCreate) SetCreatedAt

func (ac *ActorCreate) SetCreatedAt(t time.Time) *ActorCreate

SetCreatedAt sets the "created_at" field.

func (*ActorCreate) SetCreatedBy

func (ac *ActorCreate) SetCreatedBy(i int) *ActorCreate

SetCreatedBy sets the "created_by" field.

func (*ActorCreate) SetDisplayName

func (ac *ActorCreate) SetDisplayName(s string) *ActorCreate

SetDisplayName sets the "display_name" field.

func (*ActorCreate) SetFeaturedCollectionURL

func (ac *ActorCreate) SetFeaturedCollectionURL(s string) *ActorCreate

SetFeaturedCollectionURL sets the "featured_collection_url" field.

func (*ActorCreate) SetFollowersURL

func (ac *ActorCreate) SetFollowersURL(s string) *ActorCreate

SetFollowersURL sets the "followers_url" field.

func (*ActorCreate) SetHeaderLocalFile

func (ac *ActorCreate) SetHeaderLocalFile(s string) *ActorCreate

SetHeaderLocalFile sets the "header_local_file" field.

func (*ActorCreate) SetHeaderURL

func (ac *ActorCreate) SetHeaderURL(s string) *ActorCreate

SetHeaderURL sets the "header_url" field.

func (*ActorCreate) SetHeaderUpdatedAt

func (ac *ActorCreate) SetHeaderUpdatedAt(t time.Time) *ActorCreate

SetHeaderUpdatedAt sets the "header_updated_at" field.

func (*ActorCreate) SetID

func (ac *ActorCreate) SetID(u uint64) *ActorCreate

SetID sets the "id" field.

func (*ActorCreate) SetInboxURL

func (ac *ActorCreate) SetInboxURL(s string) *ActorCreate

SetInboxURL sets the "inbox_url" field.

func (*ActorCreate) SetLastWebfingerAt

func (ac *ActorCreate) SetLastWebfingerAt(t time.Time) *ActorCreate

SetLastWebfingerAt sets the "last_webfinger_at" field.

func (*ActorCreate) SetLocale

func (ac *ActorCreate) SetLocale(a actor.Locale) *ActorCreate

SetLocale sets the "locale" field.

func (*ActorCreate) SetLocked

func (ac *ActorCreate) SetLocked(b bool) *ActorCreate

SetLocked sets the "locked" field.

func (*ActorCreate) SetMemorial

func (ac *ActorCreate) SetMemorial(b bool) *ActorCreate

SetMemorial sets the "memorial" field.

func (*ActorCreate) SetMovedToID

func (ac *ActorCreate) SetMovedToID(u uint64) *ActorCreate

SetMovedToID sets the "moved_to_id" field.

func (*ActorCreate) SetName

func (ac *ActorCreate) SetName(s string) *ActorCreate

SetName sets the "name" field.

func (*ActorCreate) SetNillableAvatarLocalFile

func (ac *ActorCreate) SetNillableAvatarLocalFile(s *string) *ActorCreate

SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil.

func (*ActorCreate) SetNillableAvatarRemoteURL

func (ac *ActorCreate) SetNillableAvatarRemoteURL(s *string) *ActorCreate

SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil.

func (*ActorCreate) SetNillableAvatarUpdatedAt

func (ac *ActorCreate) SetNillableAvatarUpdatedAt(t *time.Time) *ActorCreate

SetNillableAvatarUpdatedAt sets the "avatar_updated_at" field if the given value is not nil.

func (*ActorCreate) SetNillableBadge

func (ac *ActorCreate) SetNillableBadge(u *uint64) *ActorCreate

SetNillableBadge sets the "badge" field if the given value is not nil.

func (*ActorCreate) SetNillableCreatedAt

func (ac *ActorCreate) SetNillableCreatedAt(t *time.Time) *ActorCreate

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

func (*ActorCreate) SetNillableCreatedBy

func (ac *ActorCreate) SetNillableCreatedBy(i *int) *ActorCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ActorCreate) SetNillableDisplayName

func (ac *ActorCreate) SetNillableDisplayName(s *string) *ActorCreate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ActorCreate) SetNillableFeaturedCollectionURL

func (ac *ActorCreate) SetNillableFeaturedCollectionURL(s *string) *ActorCreate

SetNillableFeaturedCollectionURL sets the "featured_collection_url" field if the given value is not nil.

func (*ActorCreate) SetNillableHeaderLocalFile

func (ac *ActorCreate) SetNillableHeaderLocalFile(s *string) *ActorCreate

SetNillableHeaderLocalFile sets the "header_local_file" field if the given value is not nil.

func (*ActorCreate) SetNillableHeaderURL

func (ac *ActorCreate) SetNillableHeaderURL(s *string) *ActorCreate

SetNillableHeaderURL sets the "header_url" field if the given value is not nil.

func (*ActorCreate) SetNillableHeaderUpdatedAt

func (ac *ActorCreate) SetNillableHeaderUpdatedAt(t *time.Time) *ActorCreate

SetNillableHeaderUpdatedAt sets the "header_updated_at" field if the given value is not nil.

func (*ActorCreate) SetNillableLastWebfingerAt

func (ac *ActorCreate) SetNillableLastWebfingerAt(t *time.Time) *ActorCreate

SetNillableLastWebfingerAt sets the "last_webfinger_at" field if the given value is not nil.

func (*ActorCreate) SetNillableLocked

func (ac *ActorCreate) SetNillableLocked(b *bool) *ActorCreate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*ActorCreate) SetNillableMemorial

func (ac *ActorCreate) SetNillableMemorial(b *bool) *ActorCreate

SetNillableMemorial sets the "memorial" field if the given value is not nil.

func (*ActorCreate) SetNillableMovedToID

func (ac *ActorCreate) SetNillableMovedToID(u *uint64) *ActorCreate

SetNillableMovedToID sets the "moved_to_id" field if the given value is not nil.

func (*ActorCreate) SetNillableNote

func (ac *ActorCreate) SetNillableNote(s *string) *ActorCreate

SetNillableNote sets the "note" field if the given value is not nil.

func (*ActorCreate) SetNillableRecoveryCode

func (ac *ActorCreate) SetNillableRecoveryCode(s *string) *ActorCreate

SetNillableRecoveryCode sets the "recovery_code" field if the given value is not nil.

func (*ActorCreate) SetNillableRole

func (ac *ActorCreate) SetNillableRole(u *uint64) *ActorCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*ActorCreate) SetNillableSilencedAt

func (ac *ActorCreate) SetNillableSilencedAt(t *time.Time) *ActorCreate

SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil.

func (*ActorCreate) SetNillableSuspendedAt

func (ac *ActorCreate) SetNillableSuspendedAt(t *time.Time) *ActorCreate

SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil.

func (*ActorCreate) SetNillableUpdatedAt

func (ac *ActorCreate) SetNillableUpdatedAt(t *time.Time) *ActorCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ActorCreate) SetNillableUpdatedBy

func (ac *ActorCreate) SetNillableUpdatedBy(i *int) *ActorCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ActorCreate) SetNote

func (ac *ActorCreate) SetNote(s string) *ActorCreate

SetNote sets the "note" field.

func (*ActorCreate) SetOutboxURL

func (ac *ActorCreate) SetOutboxURL(s string) *ActorCreate

SetOutboxURL sets the "outbox_url" field.

func (*ActorCreate) SetPasswordHash

func (ac *ActorCreate) SetPasswordHash(b []byte) *ActorCreate

SetPasswordHash sets the "passwordHash" field.

func (*ActorCreate) SetPrivkey

func (ac *ActorCreate) SetPrivkey(b []byte) *ActorCreate

SetPrivkey sets the "privkey" field.

func (*ActorCreate) SetPubkey

func (ac *ActorCreate) SetPubkey(b []byte) *ActorCreate

SetPubkey sets the "pubkey" field.

func (*ActorCreate) SetRecoveryCode

func (ac *ActorCreate) SetRecoveryCode(s string) *ActorCreate

SetRecoveryCode sets the "recovery_code" field.

func (*ActorCreate) SetRole

func (ac *ActorCreate) SetRole(u uint64) *ActorCreate

SetRole sets the "role" field.

func (*ActorCreate) SetServer

func (ac *ActorCreate) SetServer(s *Server) *ActorCreate

SetServer sets the "server" edge to the Server entity.

func (*ActorCreate) SetServerID

func (ac *ActorCreate) SetServerID(id uint64) *ActorCreate

SetServerID sets the "server" edge to the Server entity by ID.

func (*ActorCreate) SetSharedInboxURL

func (ac *ActorCreate) SetSharedInboxURL(s string) *ActorCreate

SetSharedInboxURL sets the "shared_inbox_url" field.

func (*ActorCreate) SetSilencedAt

func (ac *ActorCreate) SetSilencedAt(t time.Time) *ActorCreate

SetSilencedAt sets the "silenced_at" field.

func (*ActorCreate) SetSuspendedAt

func (ac *ActorCreate) SetSuspendedAt(t time.Time) *ActorCreate

SetSuspendedAt sets the "suspended_at" field.

func (*ActorCreate) SetType

func (ac *ActorCreate) SetType(a actor.Type) *ActorCreate

SetType sets the "type" field.

func (*ActorCreate) SetURL

func (ac *ActorCreate) SetURL(s string) *ActorCreate

SetURL sets the "url" field.

func (*ActorCreate) SetUpdatedAt

func (ac *ActorCreate) SetUpdatedAt(t time.Time) *ActorCreate

SetUpdatedAt sets the "updated_at" field.

func (*ActorCreate) SetUpdatedBy

func (ac *ActorCreate) SetUpdatedBy(i int) *ActorCreate

SetUpdatedBy sets the "updated_by" field.

type ActorCreateBulk

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

ActorCreateBulk is the builder for creating many Actor entities in bulk.

func (*ActorCreateBulk) Exec

func (acb *ActorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ActorCreateBulk) ExecX

func (acb *ActorCreateBulk) ExecX(ctx context.Context)

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

func (*ActorCreateBulk) Save

func (acb *ActorCreateBulk) Save(ctx context.Context) ([]*Actor, error)

Save creates the Actor entities in the database.

func (*ActorCreateBulk) SaveX

func (acb *ActorCreateBulk) SaveX(ctx context.Context) []*Actor

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

type ActorDelete

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

ActorDelete is the builder for deleting a Actor entity.

func (*ActorDelete) Exec

func (ad *ActorDelete) Exec(ctx context.Context) (int, error)

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

func (*ActorDelete) ExecX

func (ad *ActorDelete) ExecX(ctx context.Context) int

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

func (*ActorDelete) Where

func (ad *ActorDelete) Where(ps ...predicate.Actor) *ActorDelete

Where appends a list predicates to the ActorDelete builder.

type ActorDeleteOne

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

ActorDeleteOne is the builder for deleting a single Actor entity.

func (*ActorDeleteOne) Exec

func (ado *ActorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ActorDeleteOne) ExecX

func (ado *ActorDeleteOne) ExecX(ctx context.Context)

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

type ActorEdges

type ActorEdges struct {
	// Actor belong to a Server rooted at a domain (FQDN)
	Server *Server `json:"server,omitempty"`
	// Actor can belong to one or more events
	Events []*Event `json:"events,omitempty"`
	// Users can organize events
	OrganizerOf []*Event `json:"organizer_of,omitempty"`
	// Actor can have zero or many statuses
	Statuses []*Status `json:"statuses,omitempty"`
	// Actor can be followed by zero or more accounts
	Followers []*Actor `json:"followers,omitempty"`
	// Following holds the value of the following edge.
	Following []*Actor `json:"following,omitempty"`
	// Actor can react to many statuses
	ReactedStatuses []*Status `json:"reacted_statuses,omitempty"`
	// Group Actor can have zero or more moderators
	Moderators []*Actor `json:"moderators,omitempty"`
	// Moderating holds the value of the moderating edge.
	Moderating []*Actor `json:"moderating,omitempty"`
	// User Actor can belong to groups
	Members []*Actor `json:"members,omitempty"`
	// Groups holds the value of the groups edge.
	Groups []*Actor `json:"groups,omitempty"`
	// Sessions are owned by a single User Actor which may have many sessions
	Sessions []*Session `json:"sessions,omitempty"`
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// contains filtered or unexported fields
}

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

func (ActorEdges) EventsOrErr

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

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

func (ActorEdges) FollowersOrErr

func (e ActorEdges) FollowersOrErr() ([]*Actor, error)

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

func (ActorEdges) FollowingOrErr

func (e ActorEdges) FollowingOrErr() ([]*Actor, error)

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

func (ActorEdges) GroupsOrErr

func (e ActorEdges) GroupsOrErr() ([]*Actor, error)

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

func (ActorEdges) MembersOrErr

func (e ActorEdges) MembersOrErr() ([]*Actor, error)

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

func (ActorEdges) ModeratingOrErr

func (e ActorEdges) ModeratingOrErr() ([]*Actor, error)

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

func (ActorEdges) ModeratorsOrErr

func (e ActorEdges) ModeratorsOrErr() ([]*Actor, error)

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

func (ActorEdges) OrganizerOfOrErr

func (e ActorEdges) OrganizerOfOrErr() ([]*Event, error)

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

func (ActorEdges) ReactedStatusesOrErr

func (e ActorEdges) ReactedStatusesOrErr() ([]*Status, error)

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

func (ActorEdges) ReactionsOrErr

func (e ActorEdges) ReactionsOrErr() ([]*Reaction, error)

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

func (ActorEdges) ServerOrErr

func (e ActorEdges) ServerOrErr() (*Server, error)

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

func (ActorEdges) SessionsOrErr

func (e ActorEdges) SessionsOrErr() ([]*Session, error)

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

func (ActorEdges) StatusesOrErr

func (e ActorEdges) StatusesOrErr() ([]*Status, error)

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

type ActorGroupBy

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

ActorGroupBy is the group-by builder for Actor entities.

func (*ActorGroupBy) Aggregate

func (agb *ActorGroupBy) Aggregate(fns ...AggregateFunc) *ActorGroupBy

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

func (*ActorGroupBy) Bool

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

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

func (*ActorGroupBy) BoolX

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

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

func (*ActorGroupBy) Bools

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

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

func (*ActorGroupBy) BoolsX

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

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

func (*ActorGroupBy) Float64

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

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

func (*ActorGroupBy) Float64X

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

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

func (*ActorGroupBy) Float64s

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

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

func (*ActorGroupBy) Float64sX

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

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

func (*ActorGroupBy) Int

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

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

func (*ActorGroupBy) IntX

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

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

func (*ActorGroupBy) Ints

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

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

func (*ActorGroupBy) IntsX

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

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

func (*ActorGroupBy) Scan

func (agb *ActorGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ActorGroupBy) ScanX

func (s *ActorGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ActorGroupBy) String

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

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

func (*ActorGroupBy) StringX

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

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

func (*ActorGroupBy) Strings

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

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

func (*ActorGroupBy) StringsX

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

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

type ActorMutation

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

ActorMutation represents an operation that mutates the Actor nodes in the graph.

func (*ActorMutation) AddBadge

func (m *ActorMutation) AddBadge(u int64)

AddBadge adds u to the "badge" field.

func (*ActorMutation) AddCreatedBy

func (m *ActorMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

func (*ActorMutation) AddEventIDs

func (m *ActorMutation) AddEventIDs(ids ...uint64)

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

func (*ActorMutation) AddField

func (m *ActorMutation) 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 (*ActorMutation) AddFollowerIDs

func (m *ActorMutation) AddFollowerIDs(ids ...uint64)

AddFollowerIDs adds the "followers" edge to the Actor entity by ids.

func (*ActorMutation) AddFollowingIDs

func (m *ActorMutation) AddFollowingIDs(ids ...uint64)

AddFollowingIDs adds the "following" edge to the Actor entity by ids.

func (*ActorMutation) AddGroupIDs

func (m *ActorMutation) AddGroupIDs(ids ...uint64)

AddGroupIDs adds the "groups" edge to the Actor entity by ids.

func (*ActorMutation) AddMemberIDs

func (m *ActorMutation) AddMemberIDs(ids ...uint64)

AddMemberIDs adds the "members" edge to the Actor entity by ids.

func (*ActorMutation) AddModeratingIDs

func (m *ActorMutation) AddModeratingIDs(ids ...uint64)

AddModeratingIDs adds the "moderating" edge to the Actor entity by ids.

func (*ActorMutation) AddModeratorIDs

func (m *ActorMutation) AddModeratorIDs(ids ...uint64)

AddModeratorIDs adds the "moderators" edge to the Actor entity by ids.

func (*ActorMutation) AddMovedToID

func (m *ActorMutation) AddMovedToID(u int64)

AddMovedToID adds u to the "moved_to_id" field.

func (*ActorMutation) AddOrganizerOfIDs

func (m *ActorMutation) AddOrganizerOfIDs(ids ...uint64)

AddOrganizerOfIDs adds the "organizer_of" edge to the Event entity by ids.

func (*ActorMutation) AddReactedStatusIDs

func (m *ActorMutation) AddReactedStatusIDs(ids ...uint64)

AddReactedStatusIDs adds the "reacted_statuses" edge to the Status entity by ids.

func (*ActorMutation) AddRole

func (m *ActorMutation) AddRole(u int64)

AddRole adds u to the "role" field.

func (*ActorMutation) AddSessionIDs

func (m *ActorMutation) AddSessionIDs(ids ...uint64)

AddSessionIDs adds the "sessions" edge to the Session entity by ids.

func (*ActorMutation) AddStatusIDs

func (m *ActorMutation) AddStatusIDs(ids ...uint64)

AddStatusIDs adds the "statuses" edge to the Status entity by ids.

func (*ActorMutation) AddUpdatedBy

func (m *ActorMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*ActorMutation) AddedBadge

func (m *ActorMutation) AddedBadge() (r int64, exists bool)

AddedBadge returns the value that was added to the "badge" field in this mutation.

func (*ActorMutation) AddedCreatedBy

func (m *ActorMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*ActorMutation) AddedEdges

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

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

func (*ActorMutation) AddedField

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

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

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

func (*ActorMutation) AddedIDs

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

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

func (*ActorMutation) AddedMovedToID

func (m *ActorMutation) AddedMovedToID() (r int64, exists bool)

AddedMovedToID returns the value that was added to the "moved_to_id" field in this mutation.

func (*ActorMutation) AddedRole

func (m *ActorMutation) AddedRole() (r int64, exists bool)

AddedRole returns the value that was added to the "role" field in this mutation.

func (*ActorMutation) AddedUpdatedBy

func (m *ActorMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*ActorMutation) AvatarLocalFile

func (m *ActorMutation) AvatarLocalFile() (r string, exists bool)

AvatarLocalFile returns the value of the "avatar_local_file" field in the mutation.

func (*ActorMutation) AvatarLocalFileCleared

func (m *ActorMutation) AvatarLocalFileCleared() bool

AvatarLocalFileCleared returns if the "avatar_local_file" field was cleared in this mutation.

func (*ActorMutation) AvatarRemoteURL

func (m *ActorMutation) AvatarRemoteURL() (r string, exists bool)

AvatarRemoteURL returns the value of the "avatar_remote_url" field in the mutation.

func (*ActorMutation) AvatarRemoteURLCleared

func (m *ActorMutation) AvatarRemoteURLCleared() bool

AvatarRemoteURLCleared returns if the "avatar_remote_url" field was cleared in this mutation.

func (*ActorMutation) AvatarUpdatedAt

func (m *ActorMutation) AvatarUpdatedAt() (r time.Time, exists bool)

AvatarUpdatedAt returns the value of the "avatar_updated_at" field in the mutation.

func (*ActorMutation) AvatarUpdatedAtCleared

func (m *ActorMutation) AvatarUpdatedAtCleared() bool

AvatarUpdatedAtCleared returns if the "avatar_updated_at" field was cleared in this mutation.

func (*ActorMutation) Badge

func (m *ActorMutation) Badge() (r uint64, exists bool)

Badge returns the value of the "badge" field in the mutation.

func (*ActorMutation) BadgeCleared

func (m *ActorMutation) BadgeCleared() bool

BadgeCleared returns if the "badge" field was cleared in this mutation.

func (*ActorMutation) ClearAvatarLocalFile

func (m *ActorMutation) ClearAvatarLocalFile()

ClearAvatarLocalFile clears the value of the "avatar_local_file" field.

func (*ActorMutation) ClearAvatarRemoteURL

func (m *ActorMutation) ClearAvatarRemoteURL()

ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field.

func (*ActorMutation) ClearAvatarUpdatedAt

func (m *ActorMutation) ClearAvatarUpdatedAt()

ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field.

func (*ActorMutation) ClearBadge

func (m *ActorMutation) ClearBadge()

ClearBadge clears the value of the "badge" field.

func (*ActorMutation) ClearCreatedBy

func (m *ActorMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*ActorMutation) ClearEdge

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

func (m *ActorMutation) ClearEvents()

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

func (*ActorMutation) ClearFeaturedCollectionURL

func (m *ActorMutation) ClearFeaturedCollectionURL()

ClearFeaturedCollectionURL clears the value of the "featured_collection_url" field.

func (*ActorMutation) ClearField

func (m *ActorMutation) 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 (*ActorMutation) ClearFollowers

func (m *ActorMutation) ClearFollowers()

ClearFollowers clears the "followers" edge to the Actor entity.

func (*ActorMutation) ClearFollowing

func (m *ActorMutation) ClearFollowing()

ClearFollowing clears the "following" edge to the Actor entity.

func (*ActorMutation) ClearGroups

func (m *ActorMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Actor entity.

func (*ActorMutation) ClearHeaderLocalFile

func (m *ActorMutation) ClearHeaderLocalFile()

ClearHeaderLocalFile clears the value of the "header_local_file" field.

func (*ActorMutation) ClearHeaderURL

func (m *ActorMutation) ClearHeaderURL()

ClearHeaderURL clears the value of the "header_url" field.

func (*ActorMutation) ClearHeaderUpdatedAt

func (m *ActorMutation) ClearHeaderUpdatedAt()

ClearHeaderUpdatedAt clears the value of the "header_updated_at" field.

func (*ActorMutation) ClearLastWebfingerAt

func (m *ActorMutation) ClearLastWebfingerAt()

ClearLastWebfingerAt clears the value of the "last_webfinger_at" field.

func (*ActorMutation) ClearMembers

func (m *ActorMutation) ClearMembers()

ClearMembers clears the "members" edge to the Actor entity.

func (*ActorMutation) ClearModerating

func (m *ActorMutation) ClearModerating()

ClearModerating clears the "moderating" edge to the Actor entity.

func (*ActorMutation) ClearModerators

func (m *ActorMutation) ClearModerators()

ClearModerators clears the "moderators" edge to the Actor entity.

func (*ActorMutation) ClearMovedToID

func (m *ActorMutation) ClearMovedToID()

ClearMovedToID clears the value of the "moved_to_id" field.

func (*ActorMutation) ClearOrganizerOf

func (m *ActorMutation) ClearOrganizerOf()

ClearOrganizerOf clears the "organizer_of" edge to the Event entity.

func (*ActorMutation) ClearPasswordHash

func (m *ActorMutation) ClearPasswordHash()

ClearPasswordHash clears the value of the "passwordHash" field.

func (*ActorMutation) ClearPrivkey

func (m *ActorMutation) ClearPrivkey()

ClearPrivkey clears the value of the "privkey" field.

func (*ActorMutation) ClearReactedStatuses

func (m *ActorMutation) ClearReactedStatuses()

ClearReactedStatuses clears the "reacted_statuses" edge to the Status entity.

func (*ActorMutation) ClearRecoveryCode

func (m *ActorMutation) ClearRecoveryCode()

ClearRecoveryCode clears the value of the "recovery_code" field.

func (*ActorMutation) ClearRole

func (m *ActorMutation) ClearRole()

ClearRole clears the value of the "role" field.

func (*ActorMutation) ClearServer

func (m *ActorMutation) ClearServer()

ClearServer clears the "server" edge to the Server entity.

func (*ActorMutation) ClearSessions

func (m *ActorMutation) ClearSessions()

ClearSessions clears the "sessions" edge to the Session entity.

func (*ActorMutation) ClearSilencedAt

func (m *ActorMutation) ClearSilencedAt()

ClearSilencedAt clears the value of the "silenced_at" field.

func (*ActorMutation) ClearStatuses

func (m *ActorMutation) ClearStatuses()

ClearStatuses clears the "statuses" edge to the Status entity.

func (*ActorMutation) ClearSuspendedAt

func (m *ActorMutation) ClearSuspendedAt()

ClearSuspendedAt clears the value of the "suspended_at" field.

func (*ActorMutation) ClearUpdatedBy

func (m *ActorMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ActorMutation) ClearedEdges

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

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

func (*ActorMutation) ClearedFields

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

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

func (ActorMutation) Client

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

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

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

func (*ActorMutation) CreatedBy

func (m *ActorMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*ActorMutation) CreatedByCleared

func (m *ActorMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*ActorMutation) DisplayName

func (m *ActorMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*ActorMutation) EdgeCleared

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

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

func (*ActorMutation) EventsCleared

func (m *ActorMutation) EventsCleared() bool

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

func (*ActorMutation) EventsIDs

func (m *ActorMutation) EventsIDs() (ids []uint64)

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

func (*ActorMutation) FeaturedCollectionURL

func (m *ActorMutation) FeaturedCollectionURL() (r string, exists bool)

FeaturedCollectionURL returns the value of the "featured_collection_url" field in the mutation.

func (*ActorMutation) FeaturedCollectionURLCleared

func (m *ActorMutation) FeaturedCollectionURLCleared() bool

FeaturedCollectionURLCleared returns if the "featured_collection_url" field was cleared in this mutation.

func (*ActorMutation) Field

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

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

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

func (*ActorMutation) Fields

func (m *ActorMutation) 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 (*ActorMutation) FollowersCleared

func (m *ActorMutation) FollowersCleared() bool

FollowersCleared reports if the "followers" edge to the Actor entity was cleared.

func (*ActorMutation) FollowersIDs

func (m *ActorMutation) FollowersIDs() (ids []uint64)

FollowersIDs returns the "followers" edge IDs in the mutation.

func (*ActorMutation) FollowersURL

func (m *ActorMutation) FollowersURL() (r string, exists bool)

FollowersURL returns the value of the "followers_url" field in the mutation.

func (*ActorMutation) FollowingCleared

func (m *ActorMutation) FollowingCleared() bool

FollowingCleared reports if the "following" edge to the Actor entity was cleared.

func (*ActorMutation) FollowingIDs

func (m *ActorMutation) FollowingIDs() (ids []uint64)

FollowingIDs returns the "following" edge IDs in the mutation.

func (*ActorMutation) GetType

func (m *ActorMutation) GetType() (r actor.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ActorMutation) GroupsCleared

func (m *ActorMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Actor entity was cleared.

func (*ActorMutation) GroupsIDs

func (m *ActorMutation) GroupsIDs() (ids []uint64)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*ActorMutation) HeaderLocalFile

func (m *ActorMutation) HeaderLocalFile() (r string, exists bool)

HeaderLocalFile returns the value of the "header_local_file" field in the mutation.

func (*ActorMutation) HeaderLocalFileCleared

func (m *ActorMutation) HeaderLocalFileCleared() bool

HeaderLocalFileCleared returns if the "header_local_file" field was cleared in this mutation.

func (*ActorMutation) HeaderURL

func (m *ActorMutation) HeaderURL() (r string, exists bool)

HeaderURL returns the value of the "header_url" field in the mutation.

func (*ActorMutation) HeaderURLCleared

func (m *ActorMutation) HeaderURLCleared() bool

HeaderURLCleared returns if the "header_url" field was cleared in this mutation.

func (*ActorMutation) HeaderUpdatedAt

func (m *ActorMutation) HeaderUpdatedAt() (r time.Time, exists bool)

HeaderUpdatedAt returns the value of the "header_updated_at" field in the mutation.

func (*ActorMutation) HeaderUpdatedAtCleared

func (m *ActorMutation) HeaderUpdatedAtCleared() bool

HeaderUpdatedAtCleared returns if the "header_updated_at" field was cleared in this mutation.

func (*ActorMutation) ID

func (m *ActorMutation) ID() (id uint64, 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 (*ActorMutation) IDs

func (m *ActorMutation) IDs(ctx context.Context) ([]uint64, 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 (*ActorMutation) InboxURL

func (m *ActorMutation) InboxURL() (r string, exists bool)

InboxURL returns the value of the "inbox_url" field in the mutation.

func (*ActorMutation) LastWebfingerAt

func (m *ActorMutation) LastWebfingerAt() (r time.Time, exists bool)

LastWebfingerAt returns the value of the "last_webfinger_at" field in the mutation.

func (*ActorMutation) LastWebfingerAtCleared

func (m *ActorMutation) LastWebfingerAtCleared() bool

LastWebfingerAtCleared returns if the "last_webfinger_at" field was cleared in this mutation.

func (*ActorMutation) Locale

func (m *ActorMutation) Locale() (r actor.Locale, exists bool)

Locale returns the value of the "locale" field in the mutation.

func (*ActorMutation) Locked

func (m *ActorMutation) Locked() (r bool, exists bool)

Locked returns the value of the "locked" field in the mutation.

func (*ActorMutation) MembersCleared

func (m *ActorMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the Actor entity was cleared.

func (*ActorMutation) MembersIDs

func (m *ActorMutation) MembersIDs() (ids []uint64)

MembersIDs returns the "members" edge IDs in the mutation.

func (*ActorMutation) Memorial

func (m *ActorMutation) Memorial() (r bool, exists bool)

Memorial returns the value of the "memorial" field in the mutation.

func (*ActorMutation) ModeratingCleared

func (m *ActorMutation) ModeratingCleared() bool

ModeratingCleared reports if the "moderating" edge to the Actor entity was cleared.

func (*ActorMutation) ModeratingIDs

func (m *ActorMutation) ModeratingIDs() (ids []uint64)

ModeratingIDs returns the "moderating" edge IDs in the mutation.

func (*ActorMutation) ModeratorsCleared

func (m *ActorMutation) ModeratorsCleared() bool

ModeratorsCleared reports if the "moderators" edge to the Actor entity was cleared.

func (*ActorMutation) ModeratorsIDs

func (m *ActorMutation) ModeratorsIDs() (ids []uint64)

ModeratorsIDs returns the "moderators" edge IDs in the mutation.

func (*ActorMutation) MovedToID

func (m *ActorMutation) MovedToID() (r uint64, exists bool)

MovedToID returns the value of the "moved_to_id" field in the mutation.

func (*ActorMutation) MovedToIDCleared

func (m *ActorMutation) MovedToIDCleared() bool

MovedToIDCleared returns if the "moved_to_id" field was cleared in this mutation.

func (*ActorMutation) Name

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

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

func (*ActorMutation) Note

func (m *ActorMutation) Note() (r string, exists bool)

Note returns the value of the "note" field in the mutation.

func (*ActorMutation) OldAvatarLocalFile

func (m *ActorMutation) OldAvatarLocalFile(ctx context.Context) (v *string, err error)

OldAvatarLocalFile returns the old "avatar_local_file" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldAvatarRemoteURL

func (m *ActorMutation) OldAvatarRemoteURL(ctx context.Context) (v *string, err error)

OldAvatarRemoteURL returns the old "avatar_remote_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldAvatarUpdatedAt

func (m *ActorMutation) OldAvatarUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldAvatarUpdatedAt returns the old "avatar_updated_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldBadge

func (m *ActorMutation) OldBadge(ctx context.Context) (v uint64, err error)

OldBadge returns the old "badge" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldCreatedBy

func (m *ActorMutation) OldCreatedBy(ctx context.Context) (v int, err error)

OldCreatedBy returns the old "created_by" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldDisplayName

func (m *ActorMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldFeaturedCollectionURL

func (m *ActorMutation) OldFeaturedCollectionURL(ctx context.Context) (v *string, err error)

OldFeaturedCollectionURL returns the old "featured_collection_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldField

func (m *ActorMutation) 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 (*ActorMutation) OldFollowersURL

func (m *ActorMutation) OldFollowersURL(ctx context.Context) (v string, err error)

OldFollowersURL returns the old "followers_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldHeaderLocalFile

func (m *ActorMutation) OldHeaderLocalFile(ctx context.Context) (v *string, err error)

OldHeaderLocalFile returns the old "header_local_file" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldHeaderURL

func (m *ActorMutation) OldHeaderURL(ctx context.Context) (v *string, err error)

OldHeaderURL returns the old "header_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldHeaderUpdatedAt

func (m *ActorMutation) OldHeaderUpdatedAt(ctx context.Context) (v *time.Time, err error)

OldHeaderUpdatedAt returns the old "header_updated_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldInboxURL

func (m *ActorMutation) OldInboxURL(ctx context.Context) (v string, err error)

OldInboxURL returns the old "inbox_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldLastWebfingerAt

func (m *ActorMutation) OldLastWebfingerAt(ctx context.Context) (v *time.Time, err error)

OldLastWebfingerAt returns the old "last_webfinger_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldLocale

func (m *ActorMutation) OldLocale(ctx context.Context) (v actor.Locale, err error)

OldLocale returns the old "locale" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldLocked

func (m *ActorMutation) OldLocked(ctx context.Context) (v bool, err error)

OldLocked returns the old "locked" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldMemorial

func (m *ActorMutation) OldMemorial(ctx context.Context) (v bool, err error)

OldMemorial returns the old "memorial" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldMovedToID

func (m *ActorMutation) OldMovedToID(ctx context.Context) (v *uint64, err error)

OldMovedToID returns the old "moved_to_id" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldName

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

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

func (m *ActorMutation) OldNote(ctx context.Context) (v string, err error)

OldNote returns the old "note" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldOutboxURL

func (m *ActorMutation) OldOutboxURL(ctx context.Context) (v string, err error)

OldOutboxURL returns the old "outbox_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldPasswordHash

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

OldPasswordHash returns the old "passwordHash" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldPrivkey

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

OldPrivkey returns the old "privkey" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldPubkey

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

OldPubkey returns the old "pubkey" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldRecoveryCode

func (m *ActorMutation) OldRecoveryCode(ctx context.Context) (v *string, err error)

OldRecoveryCode returns the old "recovery_code" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldRole

func (m *ActorMutation) OldRole(ctx context.Context) (v uint64, err error)

OldRole returns the old "role" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldSharedInboxURL

func (m *ActorMutation) OldSharedInboxURL(ctx context.Context) (v string, err error)

OldSharedInboxURL returns the old "shared_inbox_url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldSilencedAt

func (m *ActorMutation) OldSilencedAt(ctx context.Context) (v *time.Time, err error)

OldSilencedAt returns the old "silenced_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldSuspendedAt

func (m *ActorMutation) OldSuspendedAt(ctx context.Context) (v *time.Time, err error)

OldSuspendedAt returns the old "suspended_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldType

func (m *ActorMutation) OldType(ctx context.Context) (v actor.Type, err error)

OldType returns the old "type" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldURL

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

OldURL returns the old "url" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldUpdatedAt

func (m *ActorMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Actor entity. If the Actor 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 (*ActorMutation) OldUpdatedBy

func (m *ActorMutation) OldUpdatedBy(ctx context.Context) (v int, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Actor entity. If the Actor 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 (*ActorMutation) Op

func (m *ActorMutation) Op() Op

Op returns the operation name.

func (*ActorMutation) OrganizerOfCleared

func (m *ActorMutation) OrganizerOfCleared() bool

OrganizerOfCleared reports if the "organizer_of" edge to the Event entity was cleared.

func (*ActorMutation) OrganizerOfIDs

func (m *ActorMutation) OrganizerOfIDs() (ids []uint64)

OrganizerOfIDs returns the "organizer_of" edge IDs in the mutation.

func (*ActorMutation) OutboxURL

func (m *ActorMutation) OutboxURL() (r string, exists bool)

OutboxURL returns the value of the "outbox_url" field in the mutation.

func (*ActorMutation) PasswordHash

func (m *ActorMutation) PasswordHash() (r []byte, exists bool)

PasswordHash returns the value of the "passwordHash" field in the mutation.

func (*ActorMutation) PasswordHashCleared

func (m *ActorMutation) PasswordHashCleared() bool

PasswordHashCleared returns if the "passwordHash" field was cleared in this mutation.

func (*ActorMutation) Privkey

func (m *ActorMutation) Privkey() (r []byte, exists bool)

Privkey returns the value of the "privkey" field in the mutation.

func (*ActorMutation) PrivkeyCleared

func (m *ActorMutation) PrivkeyCleared() bool

PrivkeyCleared returns if the "privkey" field was cleared in this mutation.

func (*ActorMutation) Pubkey

func (m *ActorMutation) Pubkey() (r []byte, exists bool)

Pubkey returns the value of the "pubkey" field in the mutation.

func (*ActorMutation) ReactedStatusesCleared

func (m *ActorMutation) ReactedStatusesCleared() bool

ReactedStatusesCleared reports if the "reacted_statuses" edge to the Status entity was cleared.

func (*ActorMutation) ReactedStatusesIDs

func (m *ActorMutation) ReactedStatusesIDs() (ids []uint64)

ReactedStatusesIDs returns the "reacted_statuses" edge IDs in the mutation.

func (*ActorMutation) RecoveryCode

func (m *ActorMutation) RecoveryCode() (r string, exists bool)

RecoveryCode returns the value of the "recovery_code" field in the mutation.

func (*ActorMutation) RecoveryCodeCleared

func (m *ActorMutation) RecoveryCodeCleared() bool

RecoveryCodeCleared returns if the "recovery_code" field was cleared in this mutation.

func (*ActorMutation) RemoveEventIDs

func (m *ActorMutation) RemoveEventIDs(ids ...uint64)

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

func (*ActorMutation) RemoveFollowerIDs

func (m *ActorMutation) RemoveFollowerIDs(ids ...uint64)

RemoveFollowerIDs removes the "followers" edge to the Actor entity by IDs.

func (*ActorMutation) RemoveFollowingIDs

func (m *ActorMutation) RemoveFollowingIDs(ids ...uint64)

RemoveFollowingIDs removes the "following" edge to the Actor entity by IDs.

func (*ActorMutation) RemoveGroupIDs

func (m *ActorMutation) RemoveGroupIDs(ids ...uint64)

RemoveGroupIDs removes the "groups" edge to the Actor entity by IDs.

func (*ActorMutation) RemoveMemberIDs

func (m *ActorMutation) RemoveMemberIDs(ids ...uint64)

RemoveMemberIDs removes the "members" edge to the Actor entity by IDs.

func (*ActorMutation) RemoveModeratingIDs

func (m *ActorMutation) RemoveModeratingIDs(ids ...uint64)

RemoveModeratingIDs removes the "moderating" edge to the Actor entity by IDs.

func (*ActorMutation) RemoveModeratorIDs

func (m *ActorMutation) RemoveModeratorIDs(ids ...uint64)

RemoveModeratorIDs removes the "moderators" edge to the Actor entity by IDs.

func (*ActorMutation) RemoveOrganizerOfIDs

func (m *ActorMutation) RemoveOrganizerOfIDs(ids ...uint64)

RemoveOrganizerOfIDs removes the "organizer_of" edge to the Event entity by IDs.

func (*ActorMutation) RemoveReactedStatusIDs

func (m *ActorMutation) RemoveReactedStatusIDs(ids ...uint64)

RemoveReactedStatusIDs removes the "reacted_statuses" edge to the Status entity by IDs.

func (*ActorMutation) RemoveSessionIDs

func (m *ActorMutation) RemoveSessionIDs(ids ...uint64)

RemoveSessionIDs removes the "sessions" edge to the Session entity by IDs.

func (*ActorMutation) RemoveStatusIDs

func (m *ActorMutation) RemoveStatusIDs(ids ...uint64)

RemoveStatusIDs removes the "statuses" edge to the Status entity by IDs.

func (*ActorMutation) RemovedEdges

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

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

func (*ActorMutation) RemovedEventsIDs

func (m *ActorMutation) RemovedEventsIDs() (ids []uint64)

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

func (*ActorMutation) RemovedFollowersIDs

func (m *ActorMutation) RemovedFollowersIDs() (ids []uint64)

RemovedFollowers returns the removed IDs of the "followers" edge to the Actor entity.

func (*ActorMutation) RemovedFollowingIDs

func (m *ActorMutation) RemovedFollowingIDs() (ids []uint64)

RemovedFollowing returns the removed IDs of the "following" edge to the Actor entity.

func (*ActorMutation) RemovedGroupsIDs

func (m *ActorMutation) RemovedGroupsIDs() (ids []uint64)

RemovedGroups returns the removed IDs of the "groups" edge to the Actor entity.

func (*ActorMutation) RemovedIDs

func (m *ActorMutation) 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 (*ActorMutation) RemovedMembersIDs

func (m *ActorMutation) RemovedMembersIDs() (ids []uint64)

RemovedMembers returns the removed IDs of the "members" edge to the Actor entity.

func (*ActorMutation) RemovedModeratingIDs

func (m *ActorMutation) RemovedModeratingIDs() (ids []uint64)

RemovedModerating returns the removed IDs of the "moderating" edge to the Actor entity.

func (*ActorMutation) RemovedModeratorsIDs

func (m *ActorMutation) RemovedModeratorsIDs() (ids []uint64)

RemovedModerators returns the removed IDs of the "moderators" edge to the Actor entity.

func (*ActorMutation) RemovedOrganizerOfIDs

func (m *ActorMutation) RemovedOrganizerOfIDs() (ids []uint64)

RemovedOrganizerOf returns the removed IDs of the "organizer_of" edge to the Event entity.

func (*ActorMutation) RemovedReactedStatusesIDs

func (m *ActorMutation) RemovedReactedStatusesIDs() (ids []uint64)

RemovedReactedStatuses returns the removed IDs of the "reacted_statuses" edge to the Status entity.

func (*ActorMutation) RemovedSessionsIDs

func (m *ActorMutation) RemovedSessionsIDs() (ids []uint64)

RemovedSessions returns the removed IDs of the "sessions" edge to the Session entity.

func (*ActorMutation) RemovedStatusesIDs

func (m *ActorMutation) RemovedStatusesIDs() (ids []uint64)

RemovedStatuses returns the removed IDs of the "statuses" edge to the Status entity.

func (*ActorMutation) ResetAvatarLocalFile

func (m *ActorMutation) ResetAvatarLocalFile()

ResetAvatarLocalFile resets all changes to the "avatar_local_file" field.

func (*ActorMutation) ResetAvatarRemoteURL

func (m *ActorMutation) ResetAvatarRemoteURL()

ResetAvatarRemoteURL resets all changes to the "avatar_remote_url" field.

func (*ActorMutation) ResetAvatarUpdatedAt

func (m *ActorMutation) ResetAvatarUpdatedAt()

ResetAvatarUpdatedAt resets all changes to the "avatar_updated_at" field.

func (*ActorMutation) ResetBadge

func (m *ActorMutation) ResetBadge()

ResetBadge resets all changes to the "badge" field.

func (*ActorMutation) ResetCreatedAt

func (m *ActorMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ActorMutation) ResetCreatedBy

func (m *ActorMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*ActorMutation) ResetDisplayName

func (m *ActorMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*ActorMutation) ResetEdge

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

func (m *ActorMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*ActorMutation) ResetFeaturedCollectionURL

func (m *ActorMutation) ResetFeaturedCollectionURL()

ResetFeaturedCollectionURL resets all changes to the "featured_collection_url" field.

func (*ActorMutation) ResetField

func (m *ActorMutation) 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 (*ActorMutation) ResetFollowers

func (m *ActorMutation) ResetFollowers()

ResetFollowers resets all changes to the "followers" edge.

func (*ActorMutation) ResetFollowersURL

func (m *ActorMutation) ResetFollowersURL()

ResetFollowersURL resets all changes to the "followers_url" field.

func (*ActorMutation) ResetFollowing

func (m *ActorMutation) ResetFollowing()

ResetFollowing resets all changes to the "following" edge.

func (*ActorMutation) ResetGroups

func (m *ActorMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*ActorMutation) ResetHeaderLocalFile

func (m *ActorMutation) ResetHeaderLocalFile()

ResetHeaderLocalFile resets all changes to the "header_local_file" field.

func (*ActorMutation) ResetHeaderURL

func (m *ActorMutation) ResetHeaderURL()

ResetHeaderURL resets all changes to the "header_url" field.

func (*ActorMutation) ResetHeaderUpdatedAt

func (m *ActorMutation) ResetHeaderUpdatedAt()

ResetHeaderUpdatedAt resets all changes to the "header_updated_at" field.

func (*ActorMutation) ResetInboxURL

func (m *ActorMutation) ResetInboxURL()

ResetInboxURL resets all changes to the "inbox_url" field.

func (*ActorMutation) ResetLastWebfingerAt

func (m *ActorMutation) ResetLastWebfingerAt()

ResetLastWebfingerAt resets all changes to the "last_webfinger_at" field.

func (*ActorMutation) ResetLocale

func (m *ActorMutation) ResetLocale()

ResetLocale resets all changes to the "locale" field.

func (*ActorMutation) ResetLocked

func (m *ActorMutation) ResetLocked()

ResetLocked resets all changes to the "locked" field.

func (*ActorMutation) ResetMembers

func (m *ActorMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*ActorMutation) ResetMemorial

func (m *ActorMutation) ResetMemorial()

ResetMemorial resets all changes to the "memorial" field.

func (*ActorMutation) ResetModerating

func (m *ActorMutation) ResetModerating()

ResetModerating resets all changes to the "moderating" edge.

func (*ActorMutation) ResetModerators

func (m *ActorMutation) ResetModerators()

ResetModerators resets all changes to the "moderators" edge.

func (*ActorMutation) ResetMovedToID

func (m *ActorMutation) ResetMovedToID()

ResetMovedToID resets all changes to the "moved_to_id" field.

func (*ActorMutation) ResetName

func (m *ActorMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ActorMutation) ResetNote

func (m *ActorMutation) ResetNote()

ResetNote resets all changes to the "note" field.

func (*ActorMutation) ResetOrganizerOf

func (m *ActorMutation) ResetOrganizerOf()

ResetOrganizerOf resets all changes to the "organizer_of" edge.

func (*ActorMutation) ResetOutboxURL

func (m *ActorMutation) ResetOutboxURL()

ResetOutboxURL resets all changes to the "outbox_url" field.

func (*ActorMutation) ResetPasswordHash

func (m *ActorMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "passwordHash" field.

func (*ActorMutation) ResetPrivkey

func (m *ActorMutation) ResetPrivkey()

ResetPrivkey resets all changes to the "privkey" field.

func (*ActorMutation) ResetPubkey

func (m *ActorMutation) ResetPubkey()

ResetPubkey resets all changes to the "pubkey" field.

func (*ActorMutation) ResetReactedStatuses

func (m *ActorMutation) ResetReactedStatuses()

ResetReactedStatuses resets all changes to the "reacted_statuses" edge.

func (*ActorMutation) ResetRecoveryCode

func (m *ActorMutation) ResetRecoveryCode()

ResetRecoveryCode resets all changes to the "recovery_code" field.

func (*ActorMutation) ResetRole

func (m *ActorMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*ActorMutation) ResetServer

func (m *ActorMutation) ResetServer()

ResetServer resets all changes to the "server" edge.

func (*ActorMutation) ResetSessions

func (m *ActorMutation) ResetSessions()

ResetSessions resets all changes to the "sessions" edge.

func (*ActorMutation) ResetSharedInboxURL

func (m *ActorMutation) ResetSharedInboxURL()

ResetSharedInboxURL resets all changes to the "shared_inbox_url" field.

func (*ActorMutation) ResetSilencedAt

func (m *ActorMutation) ResetSilencedAt()

ResetSilencedAt resets all changes to the "silenced_at" field.

func (*ActorMutation) ResetStatuses

func (m *ActorMutation) ResetStatuses()

ResetStatuses resets all changes to the "statuses" edge.

func (*ActorMutation) ResetSuspendedAt

func (m *ActorMutation) ResetSuspendedAt()

ResetSuspendedAt resets all changes to the "suspended_at" field.

func (*ActorMutation) ResetType

func (m *ActorMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ActorMutation) ResetURL

func (m *ActorMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*ActorMutation) ResetUpdatedAt

func (m *ActorMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ActorMutation) ResetUpdatedBy

func (m *ActorMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*ActorMutation) Role

func (m *ActorMutation) Role() (r uint64, exists bool)

Role returns the value of the "role" field in the mutation.

func (*ActorMutation) RoleCleared

func (m *ActorMutation) RoleCleared() bool

RoleCleared returns if the "role" field was cleared in this mutation.

func (*ActorMutation) ServerCleared

func (m *ActorMutation) ServerCleared() bool

ServerCleared reports if the "server" edge to the Server entity was cleared.

func (*ActorMutation) ServerID

func (m *ActorMutation) ServerID() (id uint64, exists bool)

ServerID returns the "server" edge ID in the mutation.

func (*ActorMutation) ServerIDs

func (m *ActorMutation) ServerIDs() (ids []uint64)

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

func (*ActorMutation) SessionsCleared

func (m *ActorMutation) SessionsCleared() bool

SessionsCleared reports if the "sessions" edge to the Session entity was cleared.

func (*ActorMutation) SessionsIDs

func (m *ActorMutation) SessionsIDs() (ids []uint64)

SessionsIDs returns the "sessions" edge IDs in the mutation.

func (*ActorMutation) SetAvatarLocalFile

func (m *ActorMutation) SetAvatarLocalFile(s string)

SetAvatarLocalFile sets the "avatar_local_file" field.

func (*ActorMutation) SetAvatarRemoteURL

func (m *ActorMutation) SetAvatarRemoteURL(s string)

SetAvatarRemoteURL sets the "avatar_remote_url" field.

func (*ActorMutation) SetAvatarUpdatedAt

func (m *ActorMutation) SetAvatarUpdatedAt(t time.Time)

SetAvatarUpdatedAt sets the "avatar_updated_at" field.

func (*ActorMutation) SetBadge

func (m *ActorMutation) SetBadge(u uint64)

SetBadge sets the "badge" field.

func (*ActorMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ActorMutation) SetCreatedBy

func (m *ActorMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*ActorMutation) SetDisplayName

func (m *ActorMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*ActorMutation) SetFeaturedCollectionURL

func (m *ActorMutation) SetFeaturedCollectionURL(s string)

SetFeaturedCollectionURL sets the "featured_collection_url" field.

func (*ActorMutation) SetField

func (m *ActorMutation) 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 (*ActorMutation) SetFollowersURL

func (m *ActorMutation) SetFollowersURL(s string)

SetFollowersURL sets the "followers_url" field.

func (*ActorMutation) SetHeaderLocalFile

func (m *ActorMutation) SetHeaderLocalFile(s string)

SetHeaderLocalFile sets the "header_local_file" field.

func (*ActorMutation) SetHeaderURL

func (m *ActorMutation) SetHeaderURL(s string)

SetHeaderURL sets the "header_url" field.

func (*ActorMutation) SetHeaderUpdatedAt

func (m *ActorMutation) SetHeaderUpdatedAt(t time.Time)

SetHeaderUpdatedAt sets the "header_updated_at" field.

func (*ActorMutation) SetID

func (m *ActorMutation) SetID(id uint64)

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

func (*ActorMutation) SetInboxURL

func (m *ActorMutation) SetInboxURL(s string)

SetInboxURL sets the "inbox_url" field.

func (*ActorMutation) SetLastWebfingerAt

func (m *ActorMutation) SetLastWebfingerAt(t time.Time)

SetLastWebfingerAt sets the "last_webfinger_at" field.

func (*ActorMutation) SetLocale

func (m *ActorMutation) SetLocale(a actor.Locale)

SetLocale sets the "locale" field.

func (*ActorMutation) SetLocked

func (m *ActorMutation) SetLocked(b bool)

SetLocked sets the "locked" field.

func (*ActorMutation) SetMemorial

func (m *ActorMutation) SetMemorial(b bool)

SetMemorial sets the "memorial" field.

func (*ActorMutation) SetMovedToID

func (m *ActorMutation) SetMovedToID(u uint64)

SetMovedToID sets the "moved_to_id" field.

func (*ActorMutation) SetName

func (m *ActorMutation) SetName(s string)

SetName sets the "name" field.

func (*ActorMutation) SetNote

func (m *ActorMutation) SetNote(s string)

SetNote sets the "note" field.

func (*ActorMutation) SetOutboxURL

func (m *ActorMutation) SetOutboxURL(s string)

SetOutboxURL sets the "outbox_url" field.

func (*ActorMutation) SetPasswordHash

func (m *ActorMutation) SetPasswordHash(b []byte)

SetPasswordHash sets the "passwordHash" field.

func (*ActorMutation) SetPrivkey

func (m *ActorMutation) SetPrivkey(b []byte)

SetPrivkey sets the "privkey" field.

func (*ActorMutation) SetPubkey

func (m *ActorMutation) SetPubkey(b []byte)

SetPubkey sets the "pubkey" field.

func (*ActorMutation) SetRecoveryCode

func (m *ActorMutation) SetRecoveryCode(s string)

SetRecoveryCode sets the "recovery_code" field.

func (*ActorMutation) SetRole

func (m *ActorMutation) SetRole(u uint64)

SetRole sets the "role" field.

func (*ActorMutation) SetServerID

func (m *ActorMutation) SetServerID(id uint64)

SetServerID sets the "server" edge to the Server entity by id.

func (*ActorMutation) SetSharedInboxURL

func (m *ActorMutation) SetSharedInboxURL(s string)

SetSharedInboxURL sets the "shared_inbox_url" field.

func (*ActorMutation) SetSilencedAt

func (m *ActorMutation) SetSilencedAt(t time.Time)

SetSilencedAt sets the "silenced_at" field.

func (*ActorMutation) SetSuspendedAt

func (m *ActorMutation) SetSuspendedAt(t time.Time)

SetSuspendedAt sets the "suspended_at" field.

func (*ActorMutation) SetType

func (m *ActorMutation) SetType(a actor.Type)

SetType sets the "type" field.

func (*ActorMutation) SetURL

func (m *ActorMutation) SetURL(s string)

SetURL sets the "url" field.

func (*ActorMutation) SetUpdatedAt

func (m *ActorMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ActorMutation) SetUpdatedBy

func (m *ActorMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

func (*ActorMutation) SharedInboxURL

func (m *ActorMutation) SharedInboxURL() (r string, exists bool)

SharedInboxURL returns the value of the "shared_inbox_url" field in the mutation.

func (*ActorMutation) SilencedAt

func (m *ActorMutation) SilencedAt() (r time.Time, exists bool)

SilencedAt returns the value of the "silenced_at" field in the mutation.

func (*ActorMutation) SilencedAtCleared

func (m *ActorMutation) SilencedAtCleared() bool

SilencedAtCleared returns if the "silenced_at" field was cleared in this mutation.

func (*ActorMutation) StatusesCleared

func (m *ActorMutation) StatusesCleared() bool

StatusesCleared reports if the "statuses" edge to the Status entity was cleared.

func (*ActorMutation) StatusesIDs

func (m *ActorMutation) StatusesIDs() (ids []uint64)

StatusesIDs returns the "statuses" edge IDs in the mutation.

func (*ActorMutation) SuspendedAt

func (m *ActorMutation) SuspendedAt() (r time.Time, exists bool)

SuspendedAt returns the value of the "suspended_at" field in the mutation.

func (*ActorMutation) SuspendedAtCleared

func (m *ActorMutation) SuspendedAtCleared() bool

SuspendedAtCleared returns if the "suspended_at" field was cleared in this mutation.

func (ActorMutation) Tx

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

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

func (*ActorMutation) Type

func (m *ActorMutation) Type() string

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

func (*ActorMutation) URL

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

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

func (*ActorMutation) UpdatedAt

func (m *ActorMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ActorMutation) UpdatedBy

func (m *ActorMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*ActorMutation) UpdatedByCleared

func (m *ActorMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*ActorMutation) Where

func (m *ActorMutation) Where(ps ...predicate.Actor)

Where appends a list predicates to the ActorMutation builder.

type ActorQuery

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

ActorQuery is the builder for querying Actor entities.

func (*ActorQuery) All

func (aq *ActorQuery) All(ctx context.Context) ([]*Actor, error)

All executes the query and returns a list of Actors.

func (*ActorQuery) AllX

func (aq *ActorQuery) AllX(ctx context.Context) []*Actor

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

func (*ActorQuery) Clone

func (aq *ActorQuery) Clone() *ActorQuery

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

func (*ActorQuery) Count

func (aq *ActorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ActorQuery) CountX

func (aq *ActorQuery) CountX(ctx context.Context) int

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

func (*ActorQuery) Exist

func (aq *ActorQuery) Exist(ctx context.Context) (bool, error)

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

func (*ActorQuery) ExistX

func (aq *ActorQuery) ExistX(ctx context.Context) bool

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

func (*ActorQuery) First

func (aq *ActorQuery) First(ctx context.Context) (*Actor, error)

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

func (*ActorQuery) FirstID

func (aq *ActorQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*ActorQuery) FirstIDX

func (aq *ActorQuery) FirstIDX(ctx context.Context) uint64

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

func (*ActorQuery) FirstX

func (aq *ActorQuery) FirstX(ctx context.Context) *Actor

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

func (*ActorQuery) ForShare

func (aq *ActorQuery) ForShare(opts ...sql.LockOption) *ActorQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ActorQuery) ForUpdate

func (aq *ActorQuery) ForUpdate(opts ...sql.LockOption) *ActorQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ActorQuery) GroupBy

func (aq *ActorQuery) GroupBy(field string, fields ...string) *ActorGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Actor.Query().
	GroupBy(actor.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ActorQuery) IDs

func (aq *ActorQuery) IDs(ctx context.Context) ([]uint64, error)

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

func (*ActorQuery) IDsX

func (aq *ActorQuery) IDsX(ctx context.Context) []uint64

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

func (*ActorQuery) Limit

func (aq *ActorQuery) Limit(limit int) *ActorQuery

Limit adds a limit step to the query.

func (*ActorQuery) Offset

func (aq *ActorQuery) Offset(offset int) *ActorQuery

Offset adds an offset step to the query.

func (*ActorQuery) Only

func (aq *ActorQuery) Only(ctx context.Context) (*Actor, error)

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

func (*ActorQuery) OnlyID

func (aq *ActorQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*ActorQuery) OnlyIDX

func (aq *ActorQuery) OnlyIDX(ctx context.Context) uint64

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

func (*ActorQuery) OnlyX

func (aq *ActorQuery) OnlyX(ctx context.Context) *Actor

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

func (*ActorQuery) Order

func (aq *ActorQuery) Order(o ...OrderFunc) *ActorQuery

Order adds an order step to the query.

func (*ActorQuery) QueryEvents

func (aq *ActorQuery) QueryEvents() *EventQuery

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

func (*ActorQuery) QueryFollowers

func (aq *ActorQuery) QueryFollowers() *ActorQuery

QueryFollowers chains the current query on the "followers" edge.

func (*ActorQuery) QueryFollowing

func (aq *ActorQuery) QueryFollowing() *ActorQuery

QueryFollowing chains the current query on the "following" edge.

func (*ActorQuery) QueryGroups

func (aq *ActorQuery) QueryGroups() *ActorQuery

QueryGroups chains the current query on the "groups" edge.

func (*ActorQuery) QueryMembers

func (aq *ActorQuery) QueryMembers() *ActorQuery

QueryMembers chains the current query on the "members" edge.

func (*ActorQuery) QueryModerating

func (aq *ActorQuery) QueryModerating() *ActorQuery

QueryModerating chains the current query on the "moderating" edge.

func (*ActorQuery) QueryModerators

func (aq *ActorQuery) QueryModerators() *ActorQuery

QueryModerators chains the current query on the "moderators" edge.

func (*ActorQuery) QueryOrganizerOf

func (aq *ActorQuery) QueryOrganizerOf() *EventQuery

QueryOrganizerOf chains the current query on the "organizer_of" edge.

func (*ActorQuery) QueryReactedStatuses

func (aq *ActorQuery) QueryReactedStatuses() *StatusQuery

QueryReactedStatuses chains the current query on the "reacted_statuses" edge.

func (*ActorQuery) QueryReactions

func (aq *ActorQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*ActorQuery) QueryServer

func (aq *ActorQuery) QueryServer() *ServerQuery

QueryServer chains the current query on the "server" edge.

func (*ActorQuery) QuerySessions

func (aq *ActorQuery) QuerySessions() *SessionQuery

QuerySessions chains the current query on the "sessions" edge.

func (*ActorQuery) QueryStatuses

func (aq *ActorQuery) QueryStatuses() *StatusQuery

QueryStatuses chains the current query on the "statuses" edge.

func (*ActorQuery) Select

func (aq *ActorQuery) Select(fields ...string) *ActorSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Actor.Query().
	Select(actor.FieldCreatedAt).
	Scan(ctx, &v)

func (*ActorQuery) Unique

func (aq *ActorQuery) Unique(unique bool) *ActorQuery

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

func (aq *ActorQuery) Where(ps ...predicate.Actor) *ActorQuery

Where adds a new predicate for the ActorQuery builder.

func (*ActorQuery) WithEvents

func (aq *ActorQuery) WithEvents(opts ...func(*EventQuery)) *ActorQuery

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 (*ActorQuery) WithFollowers

func (aq *ActorQuery) WithFollowers(opts ...func(*ActorQuery)) *ActorQuery

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

func (*ActorQuery) WithFollowing

func (aq *ActorQuery) WithFollowing(opts ...func(*ActorQuery)) *ActorQuery

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

func (*ActorQuery) WithGroups

func (aq *ActorQuery) WithGroups(opts ...func(*ActorQuery)) *ActorQuery

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

func (*ActorQuery) WithMembers

func (aq *ActorQuery) WithMembers(opts ...func(*ActorQuery)) *ActorQuery

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

func (*ActorQuery) WithModerating

func (aq *ActorQuery) WithModerating(opts ...func(*ActorQuery)) *ActorQuery

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

func (*ActorQuery) WithModerators

func (aq *ActorQuery) WithModerators(opts ...func(*ActorQuery)) *ActorQuery

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

func (*ActorQuery) WithOrganizerOf

func (aq *ActorQuery) WithOrganizerOf(opts ...func(*EventQuery)) *ActorQuery

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

func (*ActorQuery) WithReactedStatuses

func (aq *ActorQuery) WithReactedStatuses(opts ...func(*StatusQuery)) *ActorQuery

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

func (*ActorQuery) WithReactions

func (aq *ActorQuery) WithReactions(opts ...func(*ReactionQuery)) *ActorQuery

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

func (*ActorQuery) WithServer

func (aq *ActorQuery) WithServer(opts ...func(*ServerQuery)) *ActorQuery

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

func (*ActorQuery) WithSessions

func (aq *ActorQuery) WithSessions(opts ...func(*SessionQuery)) *ActorQuery

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

func (*ActorQuery) WithStatuses

func (aq *ActorQuery) WithStatuses(opts ...func(*StatusQuery)) *ActorQuery

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

type ActorSelect

type ActorSelect struct {
	*ActorQuery
	// contains filtered or unexported fields
}

ActorSelect is the builder for selecting fields of Actor entities.

func (*ActorSelect) Bool

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

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

func (*ActorSelect) BoolX

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

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

func (*ActorSelect) Bools

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

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

func (*ActorSelect) BoolsX

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

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

func (*ActorSelect) Float64

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

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

func (*ActorSelect) Float64X

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

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

func (*ActorSelect) Float64s

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

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

func (*ActorSelect) Float64sX

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

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

func (*ActorSelect) Int

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

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

func (*ActorSelect) IntX

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

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

func (*ActorSelect) Ints

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

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

func (*ActorSelect) IntsX

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

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

func (*ActorSelect) Scan

func (as *ActorSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ActorSelect) ScanX

func (s *ActorSelect) ScanX(ctx context.Context, v interface{})

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

func (*ActorSelect) String

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

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

func (*ActorSelect) StringX

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

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

func (*ActorSelect) Strings

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

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

func (*ActorSelect) StringsX

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

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

type ActorUpdate

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

ActorUpdate is the builder for updating Actor entities.

func (*ActorUpdate) AddBadge

func (au *ActorUpdate) AddBadge(u int64) *ActorUpdate

AddBadge adds u to the "badge" field.

func (*ActorUpdate) AddCreatedBy

func (au *ActorUpdate) AddCreatedBy(i int) *ActorUpdate

AddCreatedBy adds i to the "created_by" field.

func (*ActorUpdate) AddEventIDs

func (au *ActorUpdate) AddEventIDs(ids ...uint64) *ActorUpdate

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

func (*ActorUpdate) AddEvents

func (au *ActorUpdate) AddEvents(e ...*Event) *ActorUpdate

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

func (*ActorUpdate) AddFollowerIDs

func (au *ActorUpdate) AddFollowerIDs(ids ...uint64) *ActorUpdate

AddFollowerIDs adds the "followers" edge to the Actor entity by IDs.

func (*ActorUpdate) AddFollowers

func (au *ActorUpdate) AddFollowers(a ...*Actor) *ActorUpdate

AddFollowers adds the "followers" edges to the Actor entity.

func (*ActorUpdate) AddFollowing

func (au *ActorUpdate) AddFollowing(a ...*Actor) *ActorUpdate

AddFollowing adds the "following" edges to the Actor entity.

func (*ActorUpdate) AddFollowingIDs

func (au *ActorUpdate) AddFollowingIDs(ids ...uint64) *ActorUpdate

AddFollowingIDs adds the "following" edge to the Actor entity by IDs.

func (*ActorUpdate) AddGroupIDs

func (au *ActorUpdate) AddGroupIDs(ids ...uint64) *ActorUpdate

AddGroupIDs adds the "groups" edge to the Actor entity by IDs.

func (*ActorUpdate) AddGroups

func (au *ActorUpdate) AddGroups(a ...*Actor) *ActorUpdate

AddGroups adds the "groups" edges to the Actor entity.

func (*ActorUpdate) AddMemberIDs

func (au *ActorUpdate) AddMemberIDs(ids ...uint64) *ActorUpdate

AddMemberIDs adds the "members" edge to the Actor entity by IDs.

func (*ActorUpdate) AddMembers

func (au *ActorUpdate) AddMembers(a ...*Actor) *ActorUpdate

AddMembers adds the "members" edges to the Actor entity.

func (*ActorUpdate) AddModerating

func (au *ActorUpdate) AddModerating(a ...*Actor) *ActorUpdate

AddModerating adds the "moderating" edges to the Actor entity.

func (*ActorUpdate) AddModeratingIDs

func (au *ActorUpdate) AddModeratingIDs(ids ...uint64) *ActorUpdate

AddModeratingIDs adds the "moderating" edge to the Actor entity by IDs.

func (*ActorUpdate) AddModeratorIDs

func (au *ActorUpdate) AddModeratorIDs(ids ...uint64) *ActorUpdate

AddModeratorIDs adds the "moderators" edge to the Actor entity by IDs.

func (*ActorUpdate) AddModerators

func (au *ActorUpdate) AddModerators(a ...*Actor) *ActorUpdate

AddModerators adds the "moderators" edges to the Actor entity.

func (*ActorUpdate) AddMovedToID

func (au *ActorUpdate) AddMovedToID(u int64) *ActorUpdate

AddMovedToID adds u to the "moved_to_id" field.

func (*ActorUpdate) AddOrganizerOf

func (au *ActorUpdate) AddOrganizerOf(e ...*Event) *ActorUpdate

AddOrganizerOf adds the "organizer_of" edges to the Event entity.

func (*ActorUpdate) AddOrganizerOfIDs

func (au *ActorUpdate) AddOrganizerOfIDs(ids ...uint64) *ActorUpdate

AddOrganizerOfIDs adds the "organizer_of" edge to the Event entity by IDs.

func (*ActorUpdate) AddReactedStatusIDs

func (au *ActorUpdate) AddReactedStatusIDs(ids ...uint64) *ActorUpdate

AddReactedStatusIDs adds the "reacted_statuses" edge to the Status entity by IDs.

func (*ActorUpdate) AddReactedStatuses

func (au *ActorUpdate) AddReactedStatuses(s ...*Status) *ActorUpdate

AddReactedStatuses adds the "reacted_statuses" edges to the Status entity.

func (*ActorUpdate) AddRole

func (au *ActorUpdate) AddRole(u int64) *ActorUpdate

AddRole adds u to the "role" field.

func (*ActorUpdate) AddSessionIDs

func (au *ActorUpdate) AddSessionIDs(ids ...uint64) *ActorUpdate

AddSessionIDs adds the "sessions" edge to the Session entity by IDs.

func (*ActorUpdate) AddSessions

func (au *ActorUpdate) AddSessions(s ...*Session) *ActorUpdate

AddSessions adds the "sessions" edges to the Session entity.

func (*ActorUpdate) AddStatusIDs

func (au *ActorUpdate) AddStatusIDs(ids ...uint64) *ActorUpdate

AddStatusIDs adds the "statuses" edge to the Status entity by IDs.

func (*ActorUpdate) AddStatuses

func (au *ActorUpdate) AddStatuses(s ...*Status) *ActorUpdate

AddStatuses adds the "statuses" edges to the Status entity.

func (*ActorUpdate) AddUpdatedBy

func (au *ActorUpdate) AddUpdatedBy(i int) *ActorUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*ActorUpdate) ClearAvatarLocalFile

func (au *ActorUpdate) ClearAvatarLocalFile() *ActorUpdate

ClearAvatarLocalFile clears the value of the "avatar_local_file" field.

func (*ActorUpdate) ClearAvatarRemoteURL

func (au *ActorUpdate) ClearAvatarRemoteURL() *ActorUpdate

ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field.

func (*ActorUpdate) ClearAvatarUpdatedAt

func (au *ActorUpdate) ClearAvatarUpdatedAt() *ActorUpdate

ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field.

func (*ActorUpdate) ClearBadge

func (au *ActorUpdate) ClearBadge() *ActorUpdate

ClearBadge clears the value of the "badge" field.

func (*ActorUpdate) ClearCreatedBy

func (au *ActorUpdate) ClearCreatedBy() *ActorUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*ActorUpdate) ClearEvents

func (au *ActorUpdate) ClearEvents() *ActorUpdate

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

func (*ActorUpdate) ClearFeaturedCollectionURL

func (au *ActorUpdate) ClearFeaturedCollectionURL() *ActorUpdate

ClearFeaturedCollectionURL clears the value of the "featured_collection_url" field.

func (*ActorUpdate) ClearFollowers

func (au *ActorUpdate) ClearFollowers() *ActorUpdate

ClearFollowers clears all "followers" edges to the Actor entity.

func (*ActorUpdate) ClearFollowing

func (au *ActorUpdate) ClearFollowing() *ActorUpdate

ClearFollowing clears all "following" edges to the Actor entity.

func (*ActorUpdate) ClearGroups

func (au *ActorUpdate) ClearGroups() *ActorUpdate

ClearGroups clears all "groups" edges to the Actor entity.

func (*ActorUpdate) ClearHeaderLocalFile

func (au *ActorUpdate) ClearHeaderLocalFile() *ActorUpdate

ClearHeaderLocalFile clears the value of the "header_local_file" field.

func (*ActorUpdate) ClearHeaderURL

func (au *ActorUpdate) ClearHeaderURL() *ActorUpdate

ClearHeaderURL clears the value of the "header_url" field.

func (*ActorUpdate) ClearHeaderUpdatedAt

func (au *ActorUpdate) ClearHeaderUpdatedAt() *ActorUpdate

ClearHeaderUpdatedAt clears the value of the "header_updated_at" field.

func (*ActorUpdate) ClearLastWebfingerAt

func (au *ActorUpdate) ClearLastWebfingerAt() *ActorUpdate

ClearLastWebfingerAt clears the value of the "last_webfinger_at" field.

func (*ActorUpdate) ClearMembers

func (au *ActorUpdate) ClearMembers() *ActorUpdate

ClearMembers clears all "members" edges to the Actor entity.

func (*ActorUpdate) ClearModerating

func (au *ActorUpdate) ClearModerating() *ActorUpdate

ClearModerating clears all "moderating" edges to the Actor entity.

func (*ActorUpdate) ClearModerators

func (au *ActorUpdate) ClearModerators() *ActorUpdate

ClearModerators clears all "moderators" edges to the Actor entity.

func (*ActorUpdate) ClearMovedToID

func (au *ActorUpdate) ClearMovedToID() *ActorUpdate

ClearMovedToID clears the value of the "moved_to_id" field.

func (*ActorUpdate) ClearOrganizerOf

func (au *ActorUpdate) ClearOrganizerOf() *ActorUpdate

ClearOrganizerOf clears all "organizer_of" edges to the Event entity.

func (*ActorUpdate) ClearPasswordHash

func (au *ActorUpdate) ClearPasswordHash() *ActorUpdate

ClearPasswordHash clears the value of the "passwordHash" field.

func (*ActorUpdate) ClearPrivkey

func (au *ActorUpdate) ClearPrivkey() *ActorUpdate

ClearPrivkey clears the value of the "privkey" field.

func (*ActorUpdate) ClearReactedStatuses

func (au *ActorUpdate) ClearReactedStatuses() *ActorUpdate

ClearReactedStatuses clears all "reacted_statuses" edges to the Status entity.

func (*ActorUpdate) ClearRecoveryCode

func (au *ActorUpdate) ClearRecoveryCode() *ActorUpdate

ClearRecoveryCode clears the value of the "recovery_code" field.

func (*ActorUpdate) ClearRole

func (au *ActorUpdate) ClearRole() *ActorUpdate

ClearRole clears the value of the "role" field.

func (*ActorUpdate) ClearServer

func (au *ActorUpdate) ClearServer() *ActorUpdate

ClearServer clears the "server" edge to the Server entity.

func (*ActorUpdate) ClearSessions

func (au *ActorUpdate) ClearSessions() *ActorUpdate

ClearSessions clears all "sessions" edges to the Session entity.

func (*ActorUpdate) ClearSilencedAt

func (au *ActorUpdate) ClearSilencedAt() *ActorUpdate

ClearSilencedAt clears the value of the "silenced_at" field.

func (*ActorUpdate) ClearStatuses

func (au *ActorUpdate) ClearStatuses() *ActorUpdate

ClearStatuses clears all "statuses" edges to the Status entity.

func (*ActorUpdate) ClearSuspendedAt

func (au *ActorUpdate) ClearSuspendedAt() *ActorUpdate

ClearSuspendedAt clears the value of the "suspended_at" field.

func (*ActorUpdate) ClearUpdatedBy

func (au *ActorUpdate) ClearUpdatedBy() *ActorUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ActorUpdate) Exec

func (au *ActorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ActorUpdate) ExecX

func (au *ActorUpdate) ExecX(ctx context.Context)

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

func (*ActorUpdate) Mutation

func (au *ActorUpdate) Mutation() *ActorMutation

Mutation returns the ActorMutation object of the builder.

func (*ActorUpdate) RemoveEventIDs

func (au *ActorUpdate) RemoveEventIDs(ids ...uint64) *ActorUpdate

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

func (*ActorUpdate) RemoveEvents

func (au *ActorUpdate) RemoveEvents(e ...*Event) *ActorUpdate

RemoveEvents removes "events" edges to Event entities.

func (*ActorUpdate) RemoveFollowerIDs

func (au *ActorUpdate) RemoveFollowerIDs(ids ...uint64) *ActorUpdate

RemoveFollowerIDs removes the "followers" edge to Actor entities by IDs.

func (*ActorUpdate) RemoveFollowers

func (au *ActorUpdate) RemoveFollowers(a ...*Actor) *ActorUpdate

RemoveFollowers removes "followers" edges to Actor entities.

func (*ActorUpdate) RemoveFollowing

func (au *ActorUpdate) RemoveFollowing(a ...*Actor) *ActorUpdate

RemoveFollowing removes "following" edges to Actor entities.

func (*ActorUpdate) RemoveFollowingIDs

func (au *ActorUpdate) RemoveFollowingIDs(ids ...uint64) *ActorUpdate

RemoveFollowingIDs removes the "following" edge to Actor entities by IDs.

func (*ActorUpdate) RemoveGroupIDs

func (au *ActorUpdate) RemoveGroupIDs(ids ...uint64) *ActorUpdate

RemoveGroupIDs removes the "groups" edge to Actor entities by IDs.

func (*ActorUpdate) RemoveGroups

func (au *ActorUpdate) RemoveGroups(a ...*Actor) *ActorUpdate

RemoveGroups removes "groups" edges to Actor entities.

func (*ActorUpdate) RemoveMemberIDs

func (au *ActorUpdate) RemoveMemberIDs(ids ...uint64) *ActorUpdate

RemoveMemberIDs removes the "members" edge to Actor entities by IDs.

func (*ActorUpdate) RemoveMembers

func (au *ActorUpdate) RemoveMembers(a ...*Actor) *ActorUpdate

RemoveMembers removes "members" edges to Actor entities.

func (*ActorUpdate) RemoveModerating

func (au *ActorUpdate) RemoveModerating(a ...*Actor) *ActorUpdate

RemoveModerating removes "moderating" edges to Actor entities.

func (*ActorUpdate) RemoveModeratingIDs

func (au *ActorUpdate) RemoveModeratingIDs(ids ...uint64) *ActorUpdate

RemoveModeratingIDs removes the "moderating" edge to Actor entities by IDs.

func (*ActorUpdate) RemoveModeratorIDs

func (au *ActorUpdate) RemoveModeratorIDs(ids ...uint64) *ActorUpdate

RemoveModeratorIDs removes the "moderators" edge to Actor entities by IDs.

func (*ActorUpdate) RemoveModerators

func (au *ActorUpdate) RemoveModerators(a ...*Actor) *ActorUpdate

RemoveModerators removes "moderators" edges to Actor entities.

func (*ActorUpdate) RemoveOrganizerOf

func (au *ActorUpdate) RemoveOrganizerOf(e ...*Event) *ActorUpdate

RemoveOrganizerOf removes "organizer_of" edges to Event entities.

func (*ActorUpdate) RemoveOrganizerOfIDs

func (au *ActorUpdate) RemoveOrganizerOfIDs(ids ...uint64) *ActorUpdate

RemoveOrganizerOfIDs removes the "organizer_of" edge to Event entities by IDs.

func (*ActorUpdate) RemoveReactedStatusIDs

func (au *ActorUpdate) RemoveReactedStatusIDs(ids ...uint64) *ActorUpdate

RemoveReactedStatusIDs removes the "reacted_statuses" edge to Status entities by IDs.

func (*ActorUpdate) RemoveReactedStatuses

func (au *ActorUpdate) RemoveReactedStatuses(s ...*Status) *ActorUpdate

RemoveReactedStatuses removes "reacted_statuses" edges to Status entities.

func (*ActorUpdate) RemoveSessionIDs

func (au *ActorUpdate) RemoveSessionIDs(ids ...uint64) *ActorUpdate

RemoveSessionIDs removes the "sessions" edge to Session entities by IDs.

func (*ActorUpdate) RemoveSessions

func (au *ActorUpdate) RemoveSessions(s ...*Session) *ActorUpdate

RemoveSessions removes "sessions" edges to Session entities.

func (*ActorUpdate) RemoveStatusIDs

func (au *ActorUpdate) RemoveStatusIDs(ids ...uint64) *ActorUpdate

RemoveStatusIDs removes the "statuses" edge to Status entities by IDs.

func (*ActorUpdate) RemoveStatuses

func (au *ActorUpdate) RemoveStatuses(s ...*Status) *ActorUpdate

RemoveStatuses removes "statuses" edges to Status entities.

func (*ActorUpdate) Save

func (au *ActorUpdate) Save(ctx context.Context) (int, error)

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

func (*ActorUpdate) SaveX

func (au *ActorUpdate) SaveX(ctx context.Context) int

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

func (*ActorUpdate) SetAvatarLocalFile

func (au *ActorUpdate) SetAvatarLocalFile(s string) *ActorUpdate

SetAvatarLocalFile sets the "avatar_local_file" field.

func (*ActorUpdate) SetAvatarRemoteURL

func (au *ActorUpdate) SetAvatarRemoteURL(s string) *ActorUpdate

SetAvatarRemoteURL sets the "avatar_remote_url" field.

func (*ActorUpdate) SetAvatarUpdatedAt

func (au *ActorUpdate) SetAvatarUpdatedAt(t time.Time) *ActorUpdate

SetAvatarUpdatedAt sets the "avatar_updated_at" field.

func (*ActorUpdate) SetBadge

func (au *ActorUpdate) SetBadge(u uint64) *ActorUpdate

SetBadge sets the "badge" field.

func (*ActorUpdate) SetCreatedBy

func (au *ActorUpdate) SetCreatedBy(i int) *ActorUpdate

SetCreatedBy sets the "created_by" field.

func (*ActorUpdate) SetDisplayName

func (au *ActorUpdate) SetDisplayName(s string) *ActorUpdate

SetDisplayName sets the "display_name" field.

func (*ActorUpdate) SetFeaturedCollectionURL

func (au *ActorUpdate) SetFeaturedCollectionURL(s string) *ActorUpdate

SetFeaturedCollectionURL sets the "featured_collection_url" field.

func (*ActorUpdate) SetFollowersURL

func (au *ActorUpdate) SetFollowersURL(s string) *ActorUpdate

SetFollowersURL sets the "followers_url" field.

func (*ActorUpdate) SetHeaderLocalFile

func (au *ActorUpdate) SetHeaderLocalFile(s string) *ActorUpdate

SetHeaderLocalFile sets the "header_local_file" field.

func (*ActorUpdate) SetHeaderURL

func (au *ActorUpdate) SetHeaderURL(s string) *ActorUpdate

SetHeaderURL sets the "header_url" field.

func (*ActorUpdate) SetHeaderUpdatedAt

func (au *ActorUpdate) SetHeaderUpdatedAt(t time.Time) *ActorUpdate

SetHeaderUpdatedAt sets the "header_updated_at" field.

func (*ActorUpdate) SetInboxURL

func (au *ActorUpdate) SetInboxURL(s string) *ActorUpdate

SetInboxURL sets the "inbox_url" field.

func (*ActorUpdate) SetLastWebfingerAt

func (au *ActorUpdate) SetLastWebfingerAt(t time.Time) *ActorUpdate

SetLastWebfingerAt sets the "last_webfinger_at" field.

func (*ActorUpdate) SetLocale

func (au *ActorUpdate) SetLocale(a actor.Locale) *ActorUpdate

SetLocale sets the "locale" field.

func (*ActorUpdate) SetLocked

func (au *ActorUpdate) SetLocked(b bool) *ActorUpdate

SetLocked sets the "locked" field.

func (*ActorUpdate) SetMemorial

func (au *ActorUpdate) SetMemorial(b bool) *ActorUpdate

SetMemorial sets the "memorial" field.

func (*ActorUpdate) SetMovedToID

func (au *ActorUpdate) SetMovedToID(u uint64) *ActorUpdate

SetMovedToID sets the "moved_to_id" field.

func (*ActorUpdate) SetNillableAvatarLocalFile

func (au *ActorUpdate) SetNillableAvatarLocalFile(s *string) *ActorUpdate

SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil.

func (*ActorUpdate) SetNillableAvatarRemoteURL

func (au *ActorUpdate) SetNillableAvatarRemoteURL(s *string) *ActorUpdate

SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil.

func (*ActorUpdate) SetNillableAvatarUpdatedAt

func (au *ActorUpdate) SetNillableAvatarUpdatedAt(t *time.Time) *ActorUpdate

SetNillableAvatarUpdatedAt sets the "avatar_updated_at" field if the given value is not nil.

func (*ActorUpdate) SetNillableBadge

func (au *ActorUpdate) SetNillableBadge(u *uint64) *ActorUpdate

SetNillableBadge sets the "badge" field if the given value is not nil.

func (*ActorUpdate) SetNillableCreatedBy

func (au *ActorUpdate) SetNillableCreatedBy(i *int) *ActorUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ActorUpdate) SetNillableDisplayName

func (au *ActorUpdate) SetNillableDisplayName(s *string) *ActorUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ActorUpdate) SetNillableFeaturedCollectionURL

func (au *ActorUpdate) SetNillableFeaturedCollectionURL(s *string) *ActorUpdate

SetNillableFeaturedCollectionURL sets the "featured_collection_url" field if the given value is not nil.

func (*ActorUpdate) SetNillableHeaderLocalFile

func (au *ActorUpdate) SetNillableHeaderLocalFile(s *string) *ActorUpdate

SetNillableHeaderLocalFile sets the "header_local_file" field if the given value is not nil.

func (*ActorUpdate) SetNillableHeaderURL

func (au *ActorUpdate) SetNillableHeaderURL(s *string) *ActorUpdate

SetNillableHeaderURL sets the "header_url" field if the given value is not nil.

func (*ActorUpdate) SetNillableHeaderUpdatedAt

func (au *ActorUpdate) SetNillableHeaderUpdatedAt(t *time.Time) *ActorUpdate

SetNillableHeaderUpdatedAt sets the "header_updated_at" field if the given value is not nil.

func (*ActorUpdate) SetNillableLastWebfingerAt

func (au *ActorUpdate) SetNillableLastWebfingerAt(t *time.Time) *ActorUpdate

SetNillableLastWebfingerAt sets the "last_webfinger_at" field if the given value is not nil.

func (*ActorUpdate) SetNillableLocked

func (au *ActorUpdate) SetNillableLocked(b *bool) *ActorUpdate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*ActorUpdate) SetNillableMemorial

func (au *ActorUpdate) SetNillableMemorial(b *bool) *ActorUpdate

SetNillableMemorial sets the "memorial" field if the given value is not nil.

func (*ActorUpdate) SetNillableMovedToID

func (au *ActorUpdate) SetNillableMovedToID(u *uint64) *ActorUpdate

SetNillableMovedToID sets the "moved_to_id" field if the given value is not nil.

func (*ActorUpdate) SetNillableNote

func (au *ActorUpdate) SetNillableNote(s *string) *ActorUpdate

SetNillableNote sets the "note" field if the given value is not nil.

func (*ActorUpdate) SetNillableRecoveryCode

func (au *ActorUpdate) SetNillableRecoveryCode(s *string) *ActorUpdate

SetNillableRecoveryCode sets the "recovery_code" field if the given value is not nil.

func (*ActorUpdate) SetNillableRole

func (au *ActorUpdate) SetNillableRole(u *uint64) *ActorUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*ActorUpdate) SetNillableSilencedAt

func (au *ActorUpdate) SetNillableSilencedAt(t *time.Time) *ActorUpdate

SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil.

func (*ActorUpdate) SetNillableSuspendedAt

func (au *ActorUpdate) SetNillableSuspendedAt(t *time.Time) *ActorUpdate

SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil.

func (*ActorUpdate) SetNillableUpdatedBy

func (au *ActorUpdate) SetNillableUpdatedBy(i *int) *ActorUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ActorUpdate) SetNote

func (au *ActorUpdate) SetNote(s string) *ActorUpdate

SetNote sets the "note" field.

func (*ActorUpdate) SetOutboxURL

func (au *ActorUpdate) SetOutboxURL(s string) *ActorUpdate

SetOutboxURL sets the "outbox_url" field.

func (*ActorUpdate) SetPasswordHash

func (au *ActorUpdate) SetPasswordHash(b []byte) *ActorUpdate

SetPasswordHash sets the "passwordHash" field.

func (*ActorUpdate) SetPrivkey

func (au *ActorUpdate) SetPrivkey(b []byte) *ActorUpdate

SetPrivkey sets the "privkey" field.

func (*ActorUpdate) SetPubkey

func (au *ActorUpdate) SetPubkey(b []byte) *ActorUpdate

SetPubkey sets the "pubkey" field.

func (*ActorUpdate) SetRecoveryCode

func (au *ActorUpdate) SetRecoveryCode(s string) *ActorUpdate

SetRecoveryCode sets the "recovery_code" field.

func (*ActorUpdate) SetRole

func (au *ActorUpdate) SetRole(u uint64) *ActorUpdate

SetRole sets the "role" field.

func (*ActorUpdate) SetServer

func (au *ActorUpdate) SetServer(s *Server) *ActorUpdate

SetServer sets the "server" edge to the Server entity.

func (*ActorUpdate) SetServerID

func (au *ActorUpdate) SetServerID(id uint64) *ActorUpdate

SetServerID sets the "server" edge to the Server entity by ID.

func (*ActorUpdate) SetSharedInboxURL

func (au *ActorUpdate) SetSharedInboxURL(s string) *ActorUpdate

SetSharedInboxURL sets the "shared_inbox_url" field.

func (*ActorUpdate) SetSilencedAt

func (au *ActorUpdate) SetSilencedAt(t time.Time) *ActorUpdate

SetSilencedAt sets the "silenced_at" field.

func (*ActorUpdate) SetSuspendedAt

func (au *ActorUpdate) SetSuspendedAt(t time.Time) *ActorUpdate

SetSuspendedAt sets the "suspended_at" field.

func (*ActorUpdate) SetType

func (au *ActorUpdate) SetType(a actor.Type) *ActorUpdate

SetType sets the "type" field.

func (*ActorUpdate) SetURL

func (au *ActorUpdate) SetURL(s string) *ActorUpdate

SetURL sets the "url" field.

func (*ActorUpdate) SetUpdatedAt

func (au *ActorUpdate) SetUpdatedAt(t time.Time) *ActorUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ActorUpdate) SetUpdatedBy

func (au *ActorUpdate) SetUpdatedBy(i int) *ActorUpdate

SetUpdatedBy sets the "updated_by" field.

func (*ActorUpdate) Where

func (au *ActorUpdate) Where(ps ...predicate.Actor) *ActorUpdate

Where appends a list predicates to the ActorUpdate builder.

type ActorUpdateOne

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

ActorUpdateOne is the builder for updating a single Actor entity.

func (*ActorUpdateOne) AddBadge

func (auo *ActorUpdateOne) AddBadge(u int64) *ActorUpdateOne

AddBadge adds u to the "badge" field.

func (*ActorUpdateOne) AddCreatedBy

func (auo *ActorUpdateOne) AddCreatedBy(i int) *ActorUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*ActorUpdateOne) AddEventIDs

func (auo *ActorUpdateOne) AddEventIDs(ids ...uint64) *ActorUpdateOne

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

func (*ActorUpdateOne) AddEvents

func (auo *ActorUpdateOne) AddEvents(e ...*Event) *ActorUpdateOne

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

func (*ActorUpdateOne) AddFollowerIDs

func (auo *ActorUpdateOne) AddFollowerIDs(ids ...uint64) *ActorUpdateOne

AddFollowerIDs adds the "followers" edge to the Actor entity by IDs.

func (*ActorUpdateOne) AddFollowers

func (auo *ActorUpdateOne) AddFollowers(a ...*Actor) *ActorUpdateOne

AddFollowers adds the "followers" edges to the Actor entity.

func (*ActorUpdateOne) AddFollowing

func (auo *ActorUpdateOne) AddFollowing(a ...*Actor) *ActorUpdateOne

AddFollowing adds the "following" edges to the Actor entity.

func (*ActorUpdateOne) AddFollowingIDs

func (auo *ActorUpdateOne) AddFollowingIDs(ids ...uint64) *ActorUpdateOne

AddFollowingIDs adds the "following" edge to the Actor entity by IDs.

func (*ActorUpdateOne) AddGroupIDs

func (auo *ActorUpdateOne) AddGroupIDs(ids ...uint64) *ActorUpdateOne

AddGroupIDs adds the "groups" edge to the Actor entity by IDs.

func (*ActorUpdateOne) AddGroups

func (auo *ActorUpdateOne) AddGroups(a ...*Actor) *ActorUpdateOne

AddGroups adds the "groups" edges to the Actor entity.

func (*ActorUpdateOne) AddMemberIDs

func (auo *ActorUpdateOne) AddMemberIDs(ids ...uint64) *ActorUpdateOne

AddMemberIDs adds the "members" edge to the Actor entity by IDs.

func (*ActorUpdateOne) AddMembers

func (auo *ActorUpdateOne) AddMembers(a ...*Actor) *ActorUpdateOne

AddMembers adds the "members" edges to the Actor entity.

func (*ActorUpdateOne) AddModerating

func (auo *ActorUpdateOne) AddModerating(a ...*Actor) *ActorUpdateOne

AddModerating adds the "moderating" edges to the Actor entity.

func (*ActorUpdateOne) AddModeratingIDs

func (auo *ActorUpdateOne) AddModeratingIDs(ids ...uint64) *ActorUpdateOne

AddModeratingIDs adds the "moderating" edge to the Actor entity by IDs.

func (*ActorUpdateOne) AddModeratorIDs

func (auo *ActorUpdateOne) AddModeratorIDs(ids ...uint64) *ActorUpdateOne

AddModeratorIDs adds the "moderators" edge to the Actor entity by IDs.

func (*ActorUpdateOne) AddModerators

func (auo *ActorUpdateOne) AddModerators(a ...*Actor) *ActorUpdateOne

AddModerators adds the "moderators" edges to the Actor entity.

func (*ActorUpdateOne) AddMovedToID

func (auo *ActorUpdateOne) AddMovedToID(u int64) *ActorUpdateOne

AddMovedToID adds u to the "moved_to_id" field.

func (*ActorUpdateOne) AddOrganizerOf

func (auo *ActorUpdateOne) AddOrganizerOf(e ...*Event) *ActorUpdateOne

AddOrganizerOf adds the "organizer_of" edges to the Event entity.

func (*ActorUpdateOne) AddOrganizerOfIDs

func (auo *ActorUpdateOne) AddOrganizerOfIDs(ids ...uint64) *ActorUpdateOne

AddOrganizerOfIDs adds the "organizer_of" edge to the Event entity by IDs.

func (*ActorUpdateOne) AddReactedStatusIDs

func (auo *ActorUpdateOne) AddReactedStatusIDs(ids ...uint64) *ActorUpdateOne

AddReactedStatusIDs adds the "reacted_statuses" edge to the Status entity by IDs.

func (*ActorUpdateOne) AddReactedStatuses

func (auo *ActorUpdateOne) AddReactedStatuses(s ...*Status) *ActorUpdateOne

AddReactedStatuses adds the "reacted_statuses" edges to the Status entity.

func (*ActorUpdateOne) AddRole

func (auo *ActorUpdateOne) AddRole(u int64) *ActorUpdateOne

AddRole adds u to the "role" field.

func (*ActorUpdateOne) AddSessionIDs

func (auo *ActorUpdateOne) AddSessionIDs(ids ...uint64) *ActorUpdateOne

AddSessionIDs adds the "sessions" edge to the Session entity by IDs.

func (*ActorUpdateOne) AddSessions

func (auo *ActorUpdateOne) AddSessions(s ...*Session) *ActorUpdateOne

AddSessions adds the "sessions" edges to the Session entity.

func (*ActorUpdateOne) AddStatusIDs

func (auo *ActorUpdateOne) AddStatusIDs(ids ...uint64) *ActorUpdateOne

AddStatusIDs adds the "statuses" edge to the Status entity by IDs.

func (*ActorUpdateOne) AddStatuses

func (auo *ActorUpdateOne) AddStatuses(s ...*Status) *ActorUpdateOne

AddStatuses adds the "statuses" edges to the Status entity.

func (*ActorUpdateOne) AddUpdatedBy

func (auo *ActorUpdateOne) AddUpdatedBy(i int) *ActorUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*ActorUpdateOne) ClearAvatarLocalFile

func (auo *ActorUpdateOne) ClearAvatarLocalFile() *ActorUpdateOne

ClearAvatarLocalFile clears the value of the "avatar_local_file" field.

func (*ActorUpdateOne) ClearAvatarRemoteURL

func (auo *ActorUpdateOne) ClearAvatarRemoteURL() *ActorUpdateOne

ClearAvatarRemoteURL clears the value of the "avatar_remote_url" field.

func (*ActorUpdateOne) ClearAvatarUpdatedAt

func (auo *ActorUpdateOne) ClearAvatarUpdatedAt() *ActorUpdateOne

ClearAvatarUpdatedAt clears the value of the "avatar_updated_at" field.

func (*ActorUpdateOne) ClearBadge

func (auo *ActorUpdateOne) ClearBadge() *ActorUpdateOne

ClearBadge clears the value of the "badge" field.

func (*ActorUpdateOne) ClearCreatedBy

func (auo *ActorUpdateOne) ClearCreatedBy() *ActorUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*ActorUpdateOne) ClearEvents

func (auo *ActorUpdateOne) ClearEvents() *ActorUpdateOne

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

func (*ActorUpdateOne) ClearFeaturedCollectionURL

func (auo *ActorUpdateOne) ClearFeaturedCollectionURL() *ActorUpdateOne

ClearFeaturedCollectionURL clears the value of the "featured_collection_url" field.

func (*ActorUpdateOne) ClearFollowers

func (auo *ActorUpdateOne) ClearFollowers() *ActorUpdateOne

ClearFollowers clears all "followers" edges to the Actor entity.

func (*ActorUpdateOne) ClearFollowing

func (auo *ActorUpdateOne) ClearFollowing() *ActorUpdateOne

ClearFollowing clears all "following" edges to the Actor entity.

func (*ActorUpdateOne) ClearGroups

func (auo *ActorUpdateOne) ClearGroups() *ActorUpdateOne

ClearGroups clears all "groups" edges to the Actor entity.

func (*ActorUpdateOne) ClearHeaderLocalFile

func (auo *ActorUpdateOne) ClearHeaderLocalFile() *ActorUpdateOne

ClearHeaderLocalFile clears the value of the "header_local_file" field.

func (*ActorUpdateOne) ClearHeaderURL

func (auo *ActorUpdateOne) ClearHeaderURL() *ActorUpdateOne

ClearHeaderURL clears the value of the "header_url" field.

func (*ActorUpdateOne) ClearHeaderUpdatedAt

func (auo *ActorUpdateOne) ClearHeaderUpdatedAt() *ActorUpdateOne

ClearHeaderUpdatedAt clears the value of the "header_updated_at" field.

func (*ActorUpdateOne) ClearLastWebfingerAt

func (auo *ActorUpdateOne) ClearLastWebfingerAt() *ActorUpdateOne

ClearLastWebfingerAt clears the value of the "last_webfinger_at" field.

func (*ActorUpdateOne) ClearMembers

func (auo *ActorUpdateOne) ClearMembers() *ActorUpdateOne

ClearMembers clears all "members" edges to the Actor entity.

func (*ActorUpdateOne) ClearModerating

func (auo *ActorUpdateOne) ClearModerating() *ActorUpdateOne

ClearModerating clears all "moderating" edges to the Actor entity.

func (*ActorUpdateOne) ClearModerators

func (auo *ActorUpdateOne) ClearModerators() *ActorUpdateOne

ClearModerators clears all "moderators" edges to the Actor entity.

func (*ActorUpdateOne) ClearMovedToID

func (auo *ActorUpdateOne) ClearMovedToID() *ActorUpdateOne

ClearMovedToID clears the value of the "moved_to_id" field.

func (*ActorUpdateOne) ClearOrganizerOf

func (auo *ActorUpdateOne) ClearOrganizerOf() *ActorUpdateOne

ClearOrganizerOf clears all "organizer_of" edges to the Event entity.

func (*ActorUpdateOne) ClearPasswordHash

func (auo *ActorUpdateOne) ClearPasswordHash() *ActorUpdateOne

ClearPasswordHash clears the value of the "passwordHash" field.

func (*ActorUpdateOne) ClearPrivkey

func (auo *ActorUpdateOne) ClearPrivkey() *ActorUpdateOne

ClearPrivkey clears the value of the "privkey" field.

func (*ActorUpdateOne) ClearReactedStatuses

func (auo *ActorUpdateOne) ClearReactedStatuses() *ActorUpdateOne

ClearReactedStatuses clears all "reacted_statuses" edges to the Status entity.

func (*ActorUpdateOne) ClearRecoveryCode

func (auo *ActorUpdateOne) ClearRecoveryCode() *ActorUpdateOne

ClearRecoveryCode clears the value of the "recovery_code" field.

func (*ActorUpdateOne) ClearRole

func (auo *ActorUpdateOne) ClearRole() *ActorUpdateOne

ClearRole clears the value of the "role" field.

func (*ActorUpdateOne) ClearServer

func (auo *ActorUpdateOne) ClearServer() *ActorUpdateOne

ClearServer clears the "server" edge to the Server entity.

func (*ActorUpdateOne) ClearSessions

func (auo *ActorUpdateOne) ClearSessions() *ActorUpdateOne

ClearSessions clears all "sessions" edges to the Session entity.

func (*ActorUpdateOne) ClearSilencedAt

func (auo *ActorUpdateOne) ClearSilencedAt() *ActorUpdateOne

ClearSilencedAt clears the value of the "silenced_at" field.

func (*ActorUpdateOne) ClearStatuses

func (auo *ActorUpdateOne) ClearStatuses() *ActorUpdateOne

ClearStatuses clears all "statuses" edges to the Status entity.

func (*ActorUpdateOne) ClearSuspendedAt

func (auo *ActorUpdateOne) ClearSuspendedAt() *ActorUpdateOne

ClearSuspendedAt clears the value of the "suspended_at" field.

func (*ActorUpdateOne) ClearUpdatedBy

func (auo *ActorUpdateOne) ClearUpdatedBy() *ActorUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ActorUpdateOne) Exec

func (auo *ActorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ActorUpdateOne) ExecX

func (auo *ActorUpdateOne) ExecX(ctx context.Context)

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

func (*ActorUpdateOne) Mutation

func (auo *ActorUpdateOne) Mutation() *ActorMutation

Mutation returns the ActorMutation object of the builder.

func (*ActorUpdateOne) RemoveEventIDs

func (auo *ActorUpdateOne) RemoveEventIDs(ids ...uint64) *ActorUpdateOne

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

func (*ActorUpdateOne) RemoveEvents

func (auo *ActorUpdateOne) RemoveEvents(e ...*Event) *ActorUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*ActorUpdateOne) RemoveFollowerIDs

func (auo *ActorUpdateOne) RemoveFollowerIDs(ids ...uint64) *ActorUpdateOne

RemoveFollowerIDs removes the "followers" edge to Actor entities by IDs.

func (*ActorUpdateOne) RemoveFollowers

func (auo *ActorUpdateOne) RemoveFollowers(a ...*Actor) *ActorUpdateOne

RemoveFollowers removes "followers" edges to Actor entities.

func (*ActorUpdateOne) RemoveFollowing

func (auo *ActorUpdateOne) RemoveFollowing(a ...*Actor) *ActorUpdateOne

RemoveFollowing removes "following" edges to Actor entities.

func (*ActorUpdateOne) RemoveFollowingIDs

func (auo *ActorUpdateOne) RemoveFollowingIDs(ids ...uint64) *ActorUpdateOne

RemoveFollowingIDs removes the "following" edge to Actor entities by IDs.

func (*ActorUpdateOne) RemoveGroupIDs

func (auo *ActorUpdateOne) RemoveGroupIDs(ids ...uint64) *ActorUpdateOne

RemoveGroupIDs removes the "groups" edge to Actor entities by IDs.

func (*ActorUpdateOne) RemoveGroups

func (auo *ActorUpdateOne) RemoveGroups(a ...*Actor) *ActorUpdateOne

RemoveGroups removes "groups" edges to Actor entities.

func (*ActorUpdateOne) RemoveMemberIDs

func (auo *ActorUpdateOne) RemoveMemberIDs(ids ...uint64) *ActorUpdateOne

RemoveMemberIDs removes the "members" edge to Actor entities by IDs.

func (*ActorUpdateOne) RemoveMembers

func (auo *ActorUpdateOne) RemoveMembers(a ...*Actor) *ActorUpdateOne

RemoveMembers removes "members" edges to Actor entities.

func (*ActorUpdateOne) RemoveModerating

func (auo *ActorUpdateOne) RemoveModerating(a ...*Actor) *ActorUpdateOne

RemoveModerating removes "moderating" edges to Actor entities.

func (*ActorUpdateOne) RemoveModeratingIDs

func (auo *ActorUpdateOne) RemoveModeratingIDs(ids ...uint64) *ActorUpdateOne

RemoveModeratingIDs removes the "moderating" edge to Actor entities by IDs.

func (*ActorUpdateOne) RemoveModeratorIDs

func (auo *ActorUpdateOne) RemoveModeratorIDs(ids ...uint64) *ActorUpdateOne

RemoveModeratorIDs removes the "moderators" edge to Actor entities by IDs.

func (*ActorUpdateOne) RemoveModerators

func (auo *ActorUpdateOne) RemoveModerators(a ...*Actor) *ActorUpdateOne

RemoveModerators removes "moderators" edges to Actor entities.

func (*ActorUpdateOne) RemoveOrganizerOf

func (auo *ActorUpdateOne) RemoveOrganizerOf(e ...*Event) *ActorUpdateOne

RemoveOrganizerOf removes "organizer_of" edges to Event entities.

func (*ActorUpdateOne) RemoveOrganizerOfIDs

func (auo *ActorUpdateOne) RemoveOrganizerOfIDs(ids ...uint64) *ActorUpdateOne

RemoveOrganizerOfIDs removes the "organizer_of" edge to Event entities by IDs.

func (*ActorUpdateOne) RemoveReactedStatusIDs

func (auo *ActorUpdateOne) RemoveReactedStatusIDs(ids ...uint64) *ActorUpdateOne

RemoveReactedStatusIDs removes the "reacted_statuses" edge to Status entities by IDs.

func (*ActorUpdateOne) RemoveReactedStatuses

func (auo *ActorUpdateOne) RemoveReactedStatuses(s ...*Status) *ActorUpdateOne

RemoveReactedStatuses removes "reacted_statuses" edges to Status entities.

func (*ActorUpdateOne) RemoveSessionIDs

func (auo *ActorUpdateOne) RemoveSessionIDs(ids ...uint64) *ActorUpdateOne

RemoveSessionIDs removes the "sessions" edge to Session entities by IDs.

func (*ActorUpdateOne) RemoveSessions

func (auo *ActorUpdateOne) RemoveSessions(s ...*Session) *ActorUpdateOne

RemoveSessions removes "sessions" edges to Session entities.

func (*ActorUpdateOne) RemoveStatusIDs

func (auo *ActorUpdateOne) RemoveStatusIDs(ids ...uint64) *ActorUpdateOne

RemoveStatusIDs removes the "statuses" edge to Status entities by IDs.

func (*ActorUpdateOne) RemoveStatuses

func (auo *ActorUpdateOne) RemoveStatuses(s ...*Status) *ActorUpdateOne

RemoveStatuses removes "statuses" edges to Status entities.

func (*ActorUpdateOne) Save

func (auo *ActorUpdateOne) Save(ctx context.Context) (*Actor, error)

Save executes the query and returns the updated Actor entity.

func (*ActorUpdateOne) SaveX

func (auo *ActorUpdateOne) SaveX(ctx context.Context) *Actor

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

func (*ActorUpdateOne) Select

func (auo *ActorUpdateOne) Select(field string, fields ...string) *ActorUpdateOne

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

func (*ActorUpdateOne) SetAvatarLocalFile

func (auo *ActorUpdateOne) SetAvatarLocalFile(s string) *ActorUpdateOne

SetAvatarLocalFile sets the "avatar_local_file" field.

func (*ActorUpdateOne) SetAvatarRemoteURL

func (auo *ActorUpdateOne) SetAvatarRemoteURL(s string) *ActorUpdateOne

SetAvatarRemoteURL sets the "avatar_remote_url" field.

func (*ActorUpdateOne) SetAvatarUpdatedAt

func (auo *ActorUpdateOne) SetAvatarUpdatedAt(t time.Time) *ActorUpdateOne

SetAvatarUpdatedAt sets the "avatar_updated_at" field.

func (*ActorUpdateOne) SetBadge

func (auo *ActorUpdateOne) SetBadge(u uint64) *ActorUpdateOne

SetBadge sets the "badge" field.

func (*ActorUpdateOne) SetCreatedBy

func (auo *ActorUpdateOne) SetCreatedBy(i int) *ActorUpdateOne

SetCreatedBy sets the "created_by" field.

func (*ActorUpdateOne) SetDisplayName

func (auo *ActorUpdateOne) SetDisplayName(s string) *ActorUpdateOne

SetDisplayName sets the "display_name" field.

func (*ActorUpdateOne) SetFeaturedCollectionURL

func (auo *ActorUpdateOne) SetFeaturedCollectionURL(s string) *ActorUpdateOne

SetFeaturedCollectionURL sets the "featured_collection_url" field.

func (*ActorUpdateOne) SetFollowersURL

func (auo *ActorUpdateOne) SetFollowersURL(s string) *ActorUpdateOne

SetFollowersURL sets the "followers_url" field.

func (*ActorUpdateOne) SetHeaderLocalFile

func (auo *ActorUpdateOne) SetHeaderLocalFile(s string) *ActorUpdateOne

SetHeaderLocalFile sets the "header_local_file" field.

func (*ActorUpdateOne) SetHeaderURL

func (auo *ActorUpdateOne) SetHeaderURL(s string) *ActorUpdateOne

SetHeaderURL sets the "header_url" field.

func (*ActorUpdateOne) SetHeaderUpdatedAt

func (auo *ActorUpdateOne) SetHeaderUpdatedAt(t time.Time) *ActorUpdateOne

SetHeaderUpdatedAt sets the "header_updated_at" field.

func (*ActorUpdateOne) SetInboxURL

func (auo *ActorUpdateOne) SetInboxURL(s string) *ActorUpdateOne

SetInboxURL sets the "inbox_url" field.

func (*ActorUpdateOne) SetLastWebfingerAt

func (auo *ActorUpdateOne) SetLastWebfingerAt(t time.Time) *ActorUpdateOne

SetLastWebfingerAt sets the "last_webfinger_at" field.

func (*ActorUpdateOne) SetLocale

func (auo *ActorUpdateOne) SetLocale(a actor.Locale) *ActorUpdateOne

SetLocale sets the "locale" field.

func (*ActorUpdateOne) SetLocked

func (auo *ActorUpdateOne) SetLocked(b bool) *ActorUpdateOne

SetLocked sets the "locked" field.

func (*ActorUpdateOne) SetMemorial

func (auo *ActorUpdateOne) SetMemorial(b bool) *ActorUpdateOne

SetMemorial sets the "memorial" field.

func (*ActorUpdateOne) SetMovedToID

func (auo *ActorUpdateOne) SetMovedToID(u uint64) *ActorUpdateOne

SetMovedToID sets the "moved_to_id" field.

func (*ActorUpdateOne) SetNillableAvatarLocalFile

func (auo *ActorUpdateOne) SetNillableAvatarLocalFile(s *string) *ActorUpdateOne

SetNillableAvatarLocalFile sets the "avatar_local_file" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableAvatarRemoteURL

func (auo *ActorUpdateOne) SetNillableAvatarRemoteURL(s *string) *ActorUpdateOne

SetNillableAvatarRemoteURL sets the "avatar_remote_url" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableAvatarUpdatedAt

func (auo *ActorUpdateOne) SetNillableAvatarUpdatedAt(t *time.Time) *ActorUpdateOne

SetNillableAvatarUpdatedAt sets the "avatar_updated_at" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableBadge

func (auo *ActorUpdateOne) SetNillableBadge(u *uint64) *ActorUpdateOne

SetNillableBadge sets the "badge" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableCreatedBy

func (auo *ActorUpdateOne) SetNillableCreatedBy(i *int) *ActorUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableDisplayName

func (auo *ActorUpdateOne) SetNillableDisplayName(s *string) *ActorUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableFeaturedCollectionURL

func (auo *ActorUpdateOne) SetNillableFeaturedCollectionURL(s *string) *ActorUpdateOne

SetNillableFeaturedCollectionURL sets the "featured_collection_url" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableHeaderLocalFile

func (auo *ActorUpdateOne) SetNillableHeaderLocalFile(s *string) *ActorUpdateOne

SetNillableHeaderLocalFile sets the "header_local_file" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableHeaderURL

func (auo *ActorUpdateOne) SetNillableHeaderURL(s *string) *ActorUpdateOne

SetNillableHeaderURL sets the "header_url" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableHeaderUpdatedAt

func (auo *ActorUpdateOne) SetNillableHeaderUpdatedAt(t *time.Time) *ActorUpdateOne

SetNillableHeaderUpdatedAt sets the "header_updated_at" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableLastWebfingerAt

func (auo *ActorUpdateOne) SetNillableLastWebfingerAt(t *time.Time) *ActorUpdateOne

SetNillableLastWebfingerAt sets the "last_webfinger_at" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableLocked

func (auo *ActorUpdateOne) SetNillableLocked(b *bool) *ActorUpdateOne

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableMemorial

func (auo *ActorUpdateOne) SetNillableMemorial(b *bool) *ActorUpdateOne

SetNillableMemorial sets the "memorial" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableMovedToID

func (auo *ActorUpdateOne) SetNillableMovedToID(u *uint64) *ActorUpdateOne

SetNillableMovedToID sets the "moved_to_id" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableNote

func (auo *ActorUpdateOne) SetNillableNote(s *string) *ActorUpdateOne

SetNillableNote sets the "note" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableRecoveryCode

func (auo *ActorUpdateOne) SetNillableRecoveryCode(s *string) *ActorUpdateOne

SetNillableRecoveryCode sets the "recovery_code" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableRole

func (auo *ActorUpdateOne) SetNillableRole(u *uint64) *ActorUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableSilencedAt

func (auo *ActorUpdateOne) SetNillableSilencedAt(t *time.Time) *ActorUpdateOne

SetNillableSilencedAt sets the "silenced_at" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableSuspendedAt

func (auo *ActorUpdateOne) SetNillableSuspendedAt(t *time.Time) *ActorUpdateOne

SetNillableSuspendedAt sets the "suspended_at" field if the given value is not nil.

func (*ActorUpdateOne) SetNillableUpdatedBy

func (auo *ActorUpdateOne) SetNillableUpdatedBy(i *int) *ActorUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ActorUpdateOne) SetNote

func (auo *ActorUpdateOne) SetNote(s string) *ActorUpdateOne

SetNote sets the "note" field.

func (*ActorUpdateOne) SetOutboxURL

func (auo *ActorUpdateOne) SetOutboxURL(s string) *ActorUpdateOne

SetOutboxURL sets the "outbox_url" field.

func (*ActorUpdateOne) SetPasswordHash

func (auo *ActorUpdateOne) SetPasswordHash(b []byte) *ActorUpdateOne

SetPasswordHash sets the "passwordHash" field.

func (*ActorUpdateOne) SetPrivkey

func (auo *ActorUpdateOne) SetPrivkey(b []byte) *ActorUpdateOne

SetPrivkey sets the "privkey" field.

func (*ActorUpdateOne) SetPubkey

func (auo *ActorUpdateOne) SetPubkey(b []byte) *ActorUpdateOne

SetPubkey sets the "pubkey" field.

func (*ActorUpdateOne) SetRecoveryCode

func (auo *ActorUpdateOne) SetRecoveryCode(s string) *ActorUpdateOne

SetRecoveryCode sets the "recovery_code" field.

func (*ActorUpdateOne) SetRole

func (auo *ActorUpdateOne) SetRole(u uint64) *ActorUpdateOne

SetRole sets the "role" field.

func (*ActorUpdateOne) SetServer

func (auo *ActorUpdateOne) SetServer(s *Server) *ActorUpdateOne

SetServer sets the "server" edge to the Server entity.

func (*ActorUpdateOne) SetServerID

func (auo *ActorUpdateOne) SetServerID(id uint64) *ActorUpdateOne

SetServerID sets the "server" edge to the Server entity by ID.

func (*ActorUpdateOne) SetSharedInboxURL

func (auo *ActorUpdateOne) SetSharedInboxURL(s string) *ActorUpdateOne

SetSharedInboxURL sets the "shared_inbox_url" field.

func (*ActorUpdateOne) SetSilencedAt

func (auo *ActorUpdateOne) SetSilencedAt(t time.Time) *ActorUpdateOne

SetSilencedAt sets the "silenced_at" field.

func (*ActorUpdateOne) SetSuspendedAt

func (auo *ActorUpdateOne) SetSuspendedAt(t time.Time) *ActorUpdateOne

SetSuspendedAt sets the "suspended_at" field.

func (*ActorUpdateOne) SetType

func (auo *ActorUpdateOne) SetType(a actor.Type) *ActorUpdateOne

SetType sets the "type" field.

func (*ActorUpdateOne) SetURL

func (auo *ActorUpdateOne) SetURL(s string) *ActorUpdateOne

SetURL sets the "url" field.

func (*ActorUpdateOne) SetUpdatedAt

func (auo *ActorUpdateOne) SetUpdatedAt(t time.Time) *ActorUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ActorUpdateOne) SetUpdatedBy

func (auo *ActorUpdateOne) SetUpdatedBy(i int) *ActorUpdateOne

SetUpdatedBy sets the "updated_by" field.

type Actors

type Actors []*Actor

Actors is a parsable slice of Actor.

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
	// Actor is the client for interacting with the Actor builders.
	Actor *ActorClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// Server is the client for interacting with the Server builders.
	Server *ServerClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// Status is the client for interacting with the Status builders.
	Status *StatusClient
	// 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().
	Actor.
	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 uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// The event's 'friendly' name
	DisplayName string `json:"display_name,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) QueryAttendees

func (e *Event) QueryAttendees() *ActorQuery

QueryAttendees queries the "attendees" edge of the Event entity.

func (*Event) QueryOrganizer

func (e *Event) QueryOrganizer() *ActorQuery

QueryOrganizer queries the "organizer" 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.

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 builder for creating a Event entity.

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 builder for deleting the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id uint64) *EventDeleteOne

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

func (*EventClient) Get

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

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id uint64) *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) QueryAttendees

func (c *EventClient) QueryAttendees(e *Event) *ActorQuery

QueryAttendees queries the attendees edge of a Event.

func (*EventClient) QueryOrganizer

func (c *EventClient) QueryOrganizer(e *Event) *ActorQuery

QueryOrganizer queries the organizer 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 uint64) *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) AddAttendeeIDs

func (ec *EventCreate) AddAttendeeIDs(ids ...uint64) *EventCreate

AddAttendeeIDs adds the "attendees" edge to the Actor entity by IDs.

func (*EventCreate) AddAttendees

func (ec *EventCreate) AddAttendees(a ...*Actor) *EventCreate

AddAttendees adds the "attendees" edges to the Actor 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) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*EventCreate) SetCreatedBy

func (ec *EventCreate) SetCreatedBy(i int) *EventCreate

SetCreatedBy sets the "created_by" field.

func (*EventCreate) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*EventCreate) SetID

func (ec *EventCreate) SetID(u uint64) *EventCreate

SetID sets the "id" field.

func (*EventCreate) SetNillableCreatedAt

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

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

func (*EventCreate) SetNillableCreatedBy

func (ec *EventCreate) SetNillableCreatedBy(i *int) *EventCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*EventCreate) SetNillableUpdatedAt

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

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*EventCreate) SetNillableUpdatedBy

func (ec *EventCreate) SetNillableUpdatedBy(i *int) *EventCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*EventCreate) SetOrganizer

func (ec *EventCreate) SetOrganizer(a *Actor) *EventCreate

SetOrganizer sets the "organizer" edge to the Actor entity.

func (*EventCreate) SetOrganizerID

func (ec *EventCreate) SetOrganizerID(id uint64) *EventCreate

SetOrganizerID sets the "organizer" edge to the Actor entity by ID.

func (*EventCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*EventCreate) SetUpdatedBy

func (ec *EventCreate) SetUpdatedBy(i int) *EventCreate

SetUpdatedBy sets the "updated_by" 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 {
	// Accounts which have RSVP'd to the event
	Attendees []*Actor `json:"attendees,omitempty"`
	// Events belong to an Account who organizes the event
	Organizer *Actor `json:"organizer,omitempty"`
	// contains filtered or unexported fields
}

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

func (EventEdges) AttendeesOrErr

func (e EventEdges) AttendeesOrErr() ([]*Actor, error)

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

func (EventEdges) OrganizerOrErr

func (e EventEdges) OrganizerOrErr() (*Actor, error)

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

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 (s *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventGroupBy) BoolX

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

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

func (*EventGroupBy) Bools

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

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

func (*EventGroupBy) BoolsX

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

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

func (*EventGroupBy) Float64

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

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

func (*EventGroupBy) Float64X

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

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

func (*EventGroupBy) Float64s

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

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

func (*EventGroupBy) Float64sX

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

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

func (*EventGroupBy) Int

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

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

func (*EventGroupBy) IntX

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

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

func (*EventGroupBy) Ints

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

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

func (*EventGroupBy) IntsX

func (s *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 (s *EventGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*EventGroupBy) String

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

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

func (*EventGroupBy) StringX

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

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

func (*EventGroupBy) Strings

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

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

func (*EventGroupBy) StringsX

func (s *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) AddAttendeeIDs

func (m *EventMutation) AddAttendeeIDs(ids ...uint64)

AddAttendeeIDs adds the "attendees" edge to the Actor entity by ids.

func (*EventMutation) AddCreatedBy

func (m *EventMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

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

func (m *EventMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*EventMutation) AddedCreatedBy

func (m *EventMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

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

func (m *EventMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*EventMutation) AttendeesCleared

func (m *EventMutation) AttendeesCleared() bool

AttendeesCleared reports if the "attendees" edge to the Actor entity was cleared.

func (*EventMutation) AttendeesIDs

func (m *EventMutation) AttendeesIDs() (ids []uint64)

AttendeesIDs returns the "attendees" edge IDs in the mutation.

func (*EventMutation) ClearAttendees

func (m *EventMutation) ClearAttendees()

ClearAttendees clears the "attendees" edge to the Actor entity.

func (*EventMutation) ClearCreatedBy

func (m *EventMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" 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) ClearOrganizer

func (m *EventMutation) ClearOrganizer()

ClearOrganizer clears the "organizer" edge to the Actor entity.

func (*EventMutation) ClearUpdatedBy

func (m *EventMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" 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 "created_at" field in the mutation.

func (*EventMutation) CreatedBy

func (m *EventMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*EventMutation) CreatedByCleared

func (m *EventMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*EventMutation) DisplayName

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

DisplayName returns the value of the "display_name" field in the 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) 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 uint64, 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) ([]uint64, 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) OldCreatedAt

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

OldCreatedAt returns the old "created_at" 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) OldCreatedBy

func (m *EventMutation) OldCreatedBy(ctx context.Context) (v int, err error)

OldCreatedBy returns the old "created_by" 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) OldDisplayName

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

OldDisplayName returns the old "display_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) 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) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" 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) OldUpdatedBy

func (m *EventMutation) OldUpdatedBy(ctx context.Context) (v int, err error)

OldUpdatedBy returns the old "updated_by" 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) OrganizerCleared

func (m *EventMutation) OrganizerCleared() bool

OrganizerCleared reports if the "organizer" edge to the Actor entity was cleared.

func (*EventMutation) OrganizerID

func (m *EventMutation) OrganizerID() (id uint64, exists bool)

OrganizerID returns the "organizer" edge ID in the mutation.

func (*EventMutation) OrganizerIDs

func (m *EventMutation) OrganizerIDs() (ids []uint64)

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

func (*EventMutation) RemoveAttendeeIDs

func (m *EventMutation) RemoveAttendeeIDs(ids ...uint64)

RemoveAttendeeIDs removes the "attendees" edge to the Actor entity by IDs.

func (*EventMutation) RemovedAttendeesIDs

func (m *EventMutation) RemovedAttendeesIDs() (ids []uint64)

RemovedAttendees returns the removed IDs of the "attendees" edge to the Actor entity.

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

func (m *EventMutation) ResetAttendees()

ResetAttendees resets all changes to the "attendees" edge.

func (*EventMutation) ResetCreatedAt

func (m *EventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EventMutation) ResetCreatedBy

func (m *EventMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*EventMutation) ResetDisplayName

func (m *EventMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" 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) 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) ResetOrganizer

func (m *EventMutation) ResetOrganizer()

ResetOrganizer resets all changes to the "organizer" edge.

func (*EventMutation) ResetUpdatedAt

func (m *EventMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*EventMutation) ResetUpdatedBy

func (m *EventMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*EventMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*EventMutation) SetCreatedBy

func (m *EventMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*EventMutation) SetDisplayName

func (m *EventMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" 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 uint64)

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

func (*EventMutation) SetOrganizerID

func (m *EventMutation) SetOrganizerID(id uint64)

SetOrganizerID sets the "organizer" edge to the Actor entity by id.

func (*EventMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*EventMutation) SetUpdatedBy

func (m *EventMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

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

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

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*EventMutation) UpdatedBy

func (m *EventMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*EventMutation) UpdatedByCleared

func (m *EventMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" 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 uint64, 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) uint64

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

func (eq *EventQuery) ForShare(opts ...sql.LockOption) *EventQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*EventQuery) ForUpdate

func (eq *EventQuery) ForUpdate(opts ...sql.LockOption) *EventQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

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

func (*EventQuery) IDs

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

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

func (*EventQuery) IDsX

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

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 uint64, 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) uint64

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

func (eq *EventQuery) QueryAttendees() *ActorQuery

QueryAttendees chains the current query on the "attendees" edge.

func (*EventQuery) QueryOrganizer

func (eq *EventQuery) QueryOrganizer() *ActorQuery

QueryOrganizer chains the current query on the "organizer" 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Event.Query().
	Select(event.FieldCreatedAt).
	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) WithAttendees

func (eq *EventQuery) WithAttendees(opts ...func(*ActorQuery)) *EventQuery

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

func (*EventQuery) WithOrganizer

func (eq *EventQuery) WithOrganizer(opts ...func(*ActorQuery)) *EventQuery

WithOrganizer tells the query-builder to eager-load the nodes that are connected to the "organizer" 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 (s *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 (s *EventSelect) BoolX(ctx context.Context) bool

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

func (*EventSelect) Bools

func (s *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 (s *EventSelect) BoolsX(ctx context.Context) []bool

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

func (*EventSelect) Float64

func (s *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 (s *EventSelect) Float64X(ctx context.Context) float64

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

func (*EventSelect) Float64s

func (s *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 (s *EventSelect) Float64sX(ctx context.Context) []float64

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

func (*EventSelect) Int

func (s *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 (s *EventSelect) IntX(ctx context.Context) int

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

func (*EventSelect) Ints

func (s *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 (s *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 (s *EventSelect) ScanX(ctx context.Context, v interface{})

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

func (*EventSelect) String

func (s *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 (s *EventSelect) StringX(ctx context.Context) string

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

func (*EventSelect) Strings

func (s *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 (s *EventSelect) StringsX(ctx context.Context) []string

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

type EventUpdate

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

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) AddAttendeeIDs

func (eu *EventUpdate) AddAttendeeIDs(ids ...uint64) *EventUpdate

AddAttendeeIDs adds the "attendees" edge to the Actor entity by IDs.

func (*EventUpdate) AddAttendees

func (eu *EventUpdate) AddAttendees(a ...*Actor) *EventUpdate

AddAttendees adds the "attendees" edges to the Actor entity.

func (*EventUpdate) AddCreatedBy

func (eu *EventUpdate) AddCreatedBy(i int) *EventUpdate

AddCreatedBy adds i to the "created_by" field.

func (*EventUpdate) AddUpdatedBy

func (eu *EventUpdate) AddUpdatedBy(i int) *EventUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*EventUpdate) ClearAttendees

func (eu *EventUpdate) ClearAttendees() *EventUpdate

ClearAttendees clears all "attendees" edges to the Actor entity.

func (*EventUpdate) ClearCreatedBy

func (eu *EventUpdate) ClearCreatedBy() *EventUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*EventUpdate) ClearOrganizer

func (eu *EventUpdate) ClearOrganizer() *EventUpdate

ClearOrganizer clears the "organizer" edge to the Actor entity.

func (*EventUpdate) ClearUpdatedBy

func (eu *EventUpdate) ClearUpdatedBy() *EventUpdate

ClearUpdatedBy clears the value of the "updated_by" 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) RemoveAttendeeIDs

func (eu *EventUpdate) RemoveAttendeeIDs(ids ...uint64) *EventUpdate

RemoveAttendeeIDs removes the "attendees" edge to Actor entities by IDs.

func (*EventUpdate) RemoveAttendees

func (eu *EventUpdate) RemoveAttendees(a ...*Actor) *EventUpdate

RemoveAttendees removes "attendees" edges to Actor 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) SetCreatedBy

func (eu *EventUpdate) SetCreatedBy(i int) *EventUpdate

SetCreatedBy sets the "created_by" field.

func (*EventUpdate) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*EventUpdate) SetNillableCreatedBy

func (eu *EventUpdate) SetNillableCreatedBy(i *int) *EventUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*EventUpdate) SetNillableUpdatedBy

func (eu *EventUpdate) SetNillableUpdatedBy(i *int) *EventUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*EventUpdate) SetOrganizer

func (eu *EventUpdate) SetOrganizer(a *Actor) *EventUpdate

SetOrganizer sets the "organizer" edge to the Actor entity.

func (*EventUpdate) SetOrganizerID

func (eu *EventUpdate) SetOrganizerID(id uint64) *EventUpdate

SetOrganizerID sets the "organizer" edge to the Actor entity by ID.

func (*EventUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*EventUpdate) SetUpdatedBy

func (eu *EventUpdate) SetUpdatedBy(i int) *EventUpdate

SetUpdatedBy sets the "updated_by" 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) AddAttendeeIDs

func (euo *EventUpdateOne) AddAttendeeIDs(ids ...uint64) *EventUpdateOne

AddAttendeeIDs adds the "attendees" edge to the Actor entity by IDs.

func (*EventUpdateOne) AddAttendees

func (euo *EventUpdateOne) AddAttendees(a ...*Actor) *EventUpdateOne

AddAttendees adds the "attendees" edges to the Actor entity.

func (*EventUpdateOne) AddCreatedBy

func (euo *EventUpdateOne) AddCreatedBy(i int) *EventUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*EventUpdateOne) AddUpdatedBy

func (euo *EventUpdateOne) AddUpdatedBy(i int) *EventUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*EventUpdateOne) ClearAttendees

func (euo *EventUpdateOne) ClearAttendees() *EventUpdateOne

ClearAttendees clears all "attendees" edges to the Actor entity.

func (*EventUpdateOne) ClearCreatedBy

func (euo *EventUpdateOne) ClearCreatedBy() *EventUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*EventUpdateOne) ClearOrganizer

func (euo *EventUpdateOne) ClearOrganizer() *EventUpdateOne

ClearOrganizer clears the "organizer" edge to the Actor entity.

func (*EventUpdateOne) ClearUpdatedBy

func (euo *EventUpdateOne) ClearUpdatedBy() *EventUpdateOne

ClearUpdatedBy clears the value of the "updated_by" 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) RemoveAttendeeIDs

func (euo *EventUpdateOne) RemoveAttendeeIDs(ids ...uint64) *EventUpdateOne

RemoveAttendeeIDs removes the "attendees" edge to Actor entities by IDs.

func (*EventUpdateOne) RemoveAttendees

func (euo *EventUpdateOne) RemoveAttendees(a ...*Actor) *EventUpdateOne

RemoveAttendees removes "attendees" edges to Actor 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) SetCreatedBy

func (euo *EventUpdateOne) SetCreatedBy(i int) *EventUpdateOne

SetCreatedBy sets the "created_by" field.

func (*EventUpdateOne) SetDisplayName

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

SetDisplayName sets the "display_name" field.

func (*EventUpdateOne) SetNillableCreatedBy

func (euo *EventUpdateOne) SetNillableCreatedBy(i *int) *EventUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*EventUpdateOne) SetNillableUpdatedBy

func (euo *EventUpdateOne) SetNillableUpdatedBy(i *int) *EventUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*EventUpdateOne) SetOrganizer

func (euo *EventUpdateOne) SetOrganizer(a *Actor) *EventUpdateOne

SetOrganizer sets the "organizer" edge to the Actor entity.

func (*EventUpdateOne) SetOrganizerID

func (euo *EventUpdateOne) SetOrganizerID(id uint64) *EventUpdateOne

SetOrganizerID sets the "organizer" edge to the Actor entity by ID.

func (*EventUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*EventUpdateOne) SetUpdatedBy

func (euo *EventUpdateOne) SetUpdatedBy(i int) *EventUpdateOne

SetUpdatedBy sets the "updated_by" field.

type Events

type Events []*Event

Events is a parsable slice of Event.

type Group

type Group struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) QueryActors

func (gr *Group) QueryActors() *ActorQuery

QueryActors queries the "actors" edge of the Group entity.

func (*Group) QueryOwners

func (gr *Group) QueryOwners() *ActorQuery

QueryOwners queries the "owners" edge of the Group entity.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

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

func (gr *Group) Update() *GroupUpdateOne

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id uint64) *GroupDeleteOne

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

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id uint64) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id uint64) *Group

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryActors

func (c *GroupClient) QueryActors(gr *Group) *ActorQuery

QueryActors queries the actors edge of a Group.

func (*GroupClient) QueryOwners

func (c *GroupClient) QueryOwners(gr *Group) *ActorQuery

QueryOwners queries the owners edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id uint64) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) Exec

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetActors

func (gc *GroupCreate) SetActors(a *Actor) *GroupCreate

SetActors sets the "actors" edge to the Actor entity.

func (*GroupCreate) SetActorsID

func (gc *GroupCreate) SetActorsID(id uint64) *GroupCreate

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*GroupCreate) SetCreatedAt

func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate

SetCreatedAt sets the "created_at" field.

func (*GroupCreate) SetCreatedBy

func (gc *GroupCreate) SetCreatedBy(i int) *GroupCreate

SetCreatedBy sets the "created_by" field.

func (*GroupCreate) SetID

func (gc *GroupCreate) SetID(u uint64) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetNillableCreatedAt

func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableCreatedBy

func (gc *GroupCreate) SetNillableCreatedBy(i *int) *GroupCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupCreate) SetNillableUpdatedAt

func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GroupCreate) SetNillableUpdatedBy

func (gc *GroupCreate) SetNillableUpdatedBy(i *int) *GroupCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupCreate) SetOwners

func (gc *GroupCreate) SetOwners(a *Actor) *GroupCreate

SetOwners sets the "owners" edge to the Actor entity.

func (*GroupCreate) SetOwnersID

func (gc *GroupCreate) SetOwnersID(id uint64) *GroupCreate

SetOwnersID sets the "owners" edge to the Actor entity by ID.

func (*GroupCreate) SetUpdatedAt

func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate

SetUpdatedAt sets the "updated_at" field.

func (*GroupCreate) SetUpdatedBy

func (gc *GroupCreate) SetUpdatedBy(i int) *GroupCreate

SetUpdatedBy sets the "updated_by" field.

type GroupCreateBulk

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

type GroupEdges

type GroupEdges struct {
	// Actors holds the value of the actors edge.
	Actors *Actor `json:"actors,omitempty"`
	// Owners holds the value of the owners edge.
	Owners *Actor `json:"owners,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroupEdges) ActorsOrErr

func (e GroupEdges) ActorsOrErr() (*Actor, error)

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

func (GroupEdges) OwnersOrErr

func (e GroupEdges) OwnersOrErr() (*Actor, error)

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

type GroupGroupBy

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool

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

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

func (*GroupGroupBy) BoolX

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

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

func (*GroupGroupBy) Bools

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

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

func (*GroupGroupBy) BoolsX

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

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

func (*GroupGroupBy) Float64

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

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

func (*GroupGroupBy) Float64X

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

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

func (*GroupGroupBy) Float64s

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

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

func (*GroupGroupBy) Float64sX

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

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

func (*GroupGroupBy) Int

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

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

func (*GroupGroupBy) IntX

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

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

func (*GroupGroupBy) Ints

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

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

func (*GroupGroupBy) IntsX

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

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

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*GroupGroupBy) ScanX

func (s *GroupGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*GroupGroupBy) String

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

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

func (*GroupGroupBy) StringX

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

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

func (*GroupGroupBy) Strings

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

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

func (*GroupGroupBy) StringsX

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

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

type GroupMutation

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) ActorsCleared

func (m *GroupMutation) ActorsCleared() bool

ActorsCleared reports if the "actors" edge to the Actor entity was cleared.

func (*GroupMutation) ActorsID

func (m *GroupMutation) ActorsID() (id uint64, exists bool)

ActorsID returns the "actors" edge ID in the mutation.

func (*GroupMutation) ActorsIDs

func (m *GroupMutation) ActorsIDs() (ids []uint64)

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

func (*GroupMutation) AddCreatedBy

func (m *GroupMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

func (*GroupMutation) AddField

func (m *GroupMutation) 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 (*GroupMutation) AddUpdatedBy

func (m *GroupMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*GroupMutation) AddedCreatedBy

func (m *GroupMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*GroupMutation) AddedEdges

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

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

func (*GroupMutation) AddedField

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

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

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

func (*GroupMutation) AddedIDs

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

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

func (*GroupMutation) AddedUpdatedBy

func (m *GroupMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*GroupMutation) ClearActors

func (m *GroupMutation) ClearActors()

ClearActors clears the "actors" edge to the Actor entity.

func (*GroupMutation) ClearCreatedBy

func (m *GroupMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupMutation) ClearEdge

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

func (m *GroupMutation) 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 (*GroupMutation) ClearOwners

func (m *GroupMutation) ClearOwners()

ClearOwners clears the "owners" edge to the Actor entity.

func (*GroupMutation) ClearUpdatedBy

func (m *GroupMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupMutation) ClearedEdges

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

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

func (*GroupMutation) ClearedFields

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

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

func (GroupMutation) Client

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

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

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

func (*GroupMutation) CreatedBy

func (m *GroupMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*GroupMutation) CreatedByCleared

func (m *GroupMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*GroupMutation) EdgeCleared

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

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

func (*GroupMutation) Field

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

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

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

func (*GroupMutation) Fields

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

func (m *GroupMutation) ID() (id uint64, 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 (*GroupMutation) IDs

func (m *GroupMutation) IDs(ctx context.Context) ([]uint64, 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 (*GroupMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Group entity. If the Group 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 (*GroupMutation) OldCreatedBy

func (m *GroupMutation) OldCreatedBy(ctx context.Context) (v int, err error)

OldCreatedBy returns the old "created_by" field's value of the Group entity. If the Group 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 (*GroupMutation) OldField

func (m *GroupMutation) 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 (*GroupMutation) OldUpdatedAt

func (m *GroupMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Group entity. If the Group 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 (*GroupMutation) OldUpdatedBy

func (m *GroupMutation) OldUpdatedBy(ctx context.Context) (v int, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Group entity. If the Group 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 (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) OwnersCleared

func (m *GroupMutation) OwnersCleared() bool

OwnersCleared reports if the "owners" edge to the Actor entity was cleared.

func (*GroupMutation) OwnersID

func (m *GroupMutation) OwnersID() (id uint64, exists bool)

OwnersID returns the "owners" edge ID in the mutation.

func (*GroupMutation) OwnersIDs

func (m *GroupMutation) OwnersIDs() (ids []uint64)

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

func (*GroupMutation) RemovedEdges

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

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

func (*GroupMutation) RemovedIDs

func (m *GroupMutation) 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 (*GroupMutation) ResetActors

func (m *GroupMutation) ResetActors()

ResetActors resets all changes to the "actors" edge.

func (*GroupMutation) ResetCreatedAt

func (m *GroupMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupMutation) ResetCreatedBy

func (m *GroupMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GroupMutation) ResetEdge

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

func (m *GroupMutation) 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 (*GroupMutation) ResetOwners

func (m *GroupMutation) ResetOwners()

ResetOwners resets all changes to the "owners" edge.

func (*GroupMutation) ResetUpdatedAt

func (m *GroupMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupMutation) ResetUpdatedBy

func (m *GroupMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GroupMutation) SetActorsID

func (m *GroupMutation) SetActorsID(id uint64)

SetActorsID sets the "actors" edge to the Actor entity by id.

func (*GroupMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GroupMutation) SetCreatedBy

func (m *GroupMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*GroupMutation) SetField

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

func (m *GroupMutation) SetID(id uint64)

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

func (*GroupMutation) SetOwnersID

func (m *GroupMutation) SetOwnersID(id uint64)

SetOwnersID sets the "owners" edge to the Actor entity by id.

func (*GroupMutation) SetUpdatedAt

func (m *GroupMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GroupMutation) SetUpdatedBy

func (m *GroupMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

func (GroupMutation) Tx

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

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

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UpdatedAt

func (m *GroupMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GroupMutation) UpdatedBy

func (m *GroupMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*GroupMutation) UpdatedByCleared

func (m *GroupMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

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

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

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

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

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

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) uint64

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

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) ForShare

func (gq *GroupQuery) ForShare(opts ...sql.LockOption) *GroupQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GroupQuery) ForUpdate

func (gq *GroupQuery) ForUpdate(opts ...sql.LockOption) *GroupQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Group.Query().
	GroupBy(group.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

func (gq *GroupQuery) IDs(ctx context.Context) ([]uint64, error)

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

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []uint64

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

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit adds a limit step to the query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset adds an offset step to the query.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

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

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) uint64

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

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery

Order adds an order step to the query.

func (*GroupQuery) QueryActors

func (gq *GroupQuery) QueryActors() *ActorQuery

QueryActors chains the current query on the "actors" edge.

func (*GroupQuery) QueryOwners

func (gq *GroupQuery) QueryOwners() *ActorQuery

QueryOwners chains the current query on the "owners" edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Group.Query().
	Select(group.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithActors

func (gq *GroupQuery) WithActors(opts ...func(*ActorQuery)) *GroupQuery

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

func (*GroupQuery) WithOwners

func (gq *GroupQuery) WithOwners(opts ...func(*ActorQuery)) *GroupQuery

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

type GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Bool

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

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

func (*GroupSelect) BoolX

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

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

func (*GroupSelect) Bools

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

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

func (*GroupSelect) BoolsX

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

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

func (*GroupSelect) Float64

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

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

func (*GroupSelect) Float64X

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

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

func (*GroupSelect) Float64s

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

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

func (*GroupSelect) Float64sX

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

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

func (*GroupSelect) Int

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

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

func (*GroupSelect) IntX

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

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

func (*GroupSelect) Ints

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

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

func (*GroupSelect) IntsX

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

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

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GroupSelect) ScanX

func (s *GroupSelect) ScanX(ctx context.Context, v interface{})

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

func (*GroupSelect) String

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

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

func (*GroupSelect) StringX

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

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

func (*GroupSelect) Strings

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

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

func (*GroupSelect) StringsX

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

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

type GroupUpdate

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

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddCreatedBy

func (gu *GroupUpdate) AddCreatedBy(i int) *GroupUpdate

AddCreatedBy adds i to the "created_by" field.

func (*GroupUpdate) AddUpdatedBy

func (gu *GroupUpdate) AddUpdatedBy(i int) *GroupUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*GroupUpdate) ClearActors

func (gu *GroupUpdate) ClearActors() *GroupUpdate

ClearActors clears the "actors" edge to the Actor entity.

func (*GroupUpdate) ClearCreatedBy

func (gu *GroupUpdate) ClearCreatedBy() *GroupUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupUpdate) ClearOwners

func (gu *GroupUpdate) ClearOwners() *GroupUpdate

ClearOwners clears the "owners" edge to the Actor entity.

func (*GroupUpdate) ClearUpdatedBy

func (gu *GroupUpdate) ClearUpdatedBy() *GroupUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

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

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

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

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

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

func (*GroupUpdate) SetActors

func (gu *GroupUpdate) SetActors(a *Actor) *GroupUpdate

SetActors sets the "actors" edge to the Actor entity.

func (*GroupUpdate) SetActorsID

func (gu *GroupUpdate) SetActorsID(id uint64) *GroupUpdate

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*GroupUpdate) SetCreatedBy

func (gu *GroupUpdate) SetCreatedBy(i int) *GroupUpdate

SetCreatedBy sets the "created_by" field.

func (*GroupUpdate) SetNillableCreatedBy

func (gu *GroupUpdate) SetNillableCreatedBy(i *int) *GroupUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupUpdate) SetNillableUpdatedBy

func (gu *GroupUpdate) SetNillableUpdatedBy(i *int) *GroupUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupUpdate) SetOwners

func (gu *GroupUpdate) SetOwners(a *Actor) *GroupUpdate

SetOwners sets the "owners" edge to the Actor entity.

func (*GroupUpdate) SetOwnersID

func (gu *GroupUpdate) SetOwnersID(id uint64) *GroupUpdate

SetOwnersID sets the "owners" edge to the Actor entity by ID.

func (*GroupUpdate) SetUpdatedAt

func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdate) SetUpdatedBy

func (gu *GroupUpdate) SetUpdatedBy(i int) *GroupUpdate

SetUpdatedBy sets the "updated_by" field.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

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

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddCreatedBy

func (guo *GroupUpdateOne) AddCreatedBy(i int) *GroupUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*GroupUpdateOne) AddUpdatedBy

func (guo *GroupUpdateOne) AddUpdatedBy(i int) *GroupUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*GroupUpdateOne) ClearActors

func (guo *GroupUpdateOne) ClearActors() *GroupUpdateOne

ClearActors clears the "actors" edge to the Actor entity.

func (*GroupUpdateOne) ClearCreatedBy

func (guo *GroupUpdateOne) ClearCreatedBy() *GroupUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*GroupUpdateOne) ClearOwners

func (guo *GroupUpdateOne) ClearOwners() *GroupUpdateOne

ClearOwners clears the "owners" edge to the Actor entity.

func (*GroupUpdateOne) ClearUpdatedBy

func (guo *GroupUpdateOne) ClearUpdatedBy() *GroupUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

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

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

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

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetActors

func (guo *GroupUpdateOne) SetActors(a *Actor) *GroupUpdateOne

SetActors sets the "actors" edge to the Actor entity.

func (*GroupUpdateOne) SetActorsID

func (guo *GroupUpdateOne) SetActorsID(id uint64) *GroupUpdateOne

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*GroupUpdateOne) SetCreatedBy

func (guo *GroupUpdateOne) SetCreatedBy(i int) *GroupUpdateOne

SetCreatedBy sets the "created_by" field.

func (*GroupUpdateOne) SetNillableCreatedBy

func (guo *GroupUpdateOne) SetNillableCreatedBy(i *int) *GroupUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableUpdatedBy

func (guo *GroupUpdateOne) SetNillableUpdatedBy(i *int) *GroupUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GroupUpdateOne) SetOwners

func (guo *GroupUpdateOne) SetOwners(a *Actor) *GroupUpdateOne

SetOwners sets the "owners" edge to the Actor entity.

func (*GroupUpdateOne) SetOwnersID

func (guo *GroupUpdateOne) SetOwnersID(id uint64) *GroupUpdateOne

SetOwnersID sets the "owners" edge to the Actor entity by ID.

func (*GroupUpdateOne) SetUpdatedAt

func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdateOne) SetUpdatedBy

func (guo *GroupUpdateOne) SetUpdatedBy(i int) *GroupUpdateOne

SetUpdatedBy sets the "updated_by" field.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

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 Reaction

type Reaction struct {

	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// ActorID holds the value of the "actor_id" field.
	ActorID uint64 `json:"actor_id,omitempty"`
	// StatusID holds the value of the "status_id" field.
	StatusID uint64 `json:"status_id,omitempty"`
	// Reactions can be likes, boosts, bookmarks, or other 'static' responses (not quote posts)
	Type reaction.Type `json:"type,omitempty"`
	// Dat is an extra argument field used by some types of rections (emotes)
	Dat uint64 `json:"dat,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReactionQuery when eager-loading is set.
	Edges ReactionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reaction is the model entity for the Reaction schema.

func (*Reaction) QueryActors

func (r *Reaction) QueryActors() *ActorQuery

QueryActors queries the "actors" edge of the Reaction entity.

func (*Reaction) QueryStatus

func (r *Reaction) QueryStatus() *StatusQuery

QueryStatus queries the "status" edge of the Reaction entity.

func (*Reaction) String

func (r *Reaction) String() string

String implements the fmt.Stringer.

func (*Reaction) Unwrap

func (r *Reaction) Unwrap() *Reaction

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

func (r *Reaction) Update() *ReactionUpdateOne

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

type ReactionClient

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

ReactionClient is a client for the Reaction schema.

func NewReactionClient

func NewReactionClient(c config) *ReactionClient

NewReactionClient returns a client for the Reaction from the given config.

func (*ReactionClient) Create

func (c *ReactionClient) Create() *ReactionCreate

Create returns a builder for creating a Reaction entity.

func (*ReactionClient) CreateBulk

func (c *ReactionClient) CreateBulk(builders ...*ReactionCreate) *ReactionCreateBulk

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

func (*ReactionClient) Delete

func (c *ReactionClient) Delete() *ReactionDelete

Delete returns a delete builder for Reaction.

func (*ReactionClient) Hooks

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

Hooks returns the client hooks.

func (*ReactionClient) Query

func (c *ReactionClient) Query() *ReactionQuery

Query returns a query builder for Reaction.

func (*ReactionClient) QueryActors

func (c *ReactionClient) QueryActors(r *Reaction) *ActorQuery

QueryActors queries the actors edge of a Reaction.

func (*ReactionClient) QueryStatus

func (c *ReactionClient) QueryStatus(r *Reaction) *StatusQuery

QueryStatus queries the status edge of a Reaction.

func (*ReactionClient) Update

func (c *ReactionClient) Update() *ReactionUpdate

Update returns an update builder for Reaction.

func (*ReactionClient) UpdateOne

func (c *ReactionClient) UpdateOne(r *Reaction) *ReactionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReactionClient) Use

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

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

type ReactionCreate

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

ReactionCreate is the builder for creating a Reaction entity.

func (*ReactionCreate) Exec

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

Exec executes the query.

func (*ReactionCreate) ExecX

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

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

func (*ReactionCreate) Mutation

func (rc *ReactionCreate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionCreate) Save

func (rc *ReactionCreate) Save(ctx context.Context) (*Reaction, error)

Save creates the Reaction in the database.

func (*ReactionCreate) SaveX

func (rc *ReactionCreate) SaveX(ctx context.Context) *Reaction

SaveX calls Save and panics if Save returns an error.

func (*ReactionCreate) SetActorID

func (rc *ReactionCreate) SetActorID(u uint64) *ReactionCreate

SetActorID sets the "actor_id" field.

func (*ReactionCreate) SetActors

func (rc *ReactionCreate) SetActors(a *Actor) *ReactionCreate

SetActors sets the "actors" edge to the Actor entity.

func (*ReactionCreate) SetActorsID

func (rc *ReactionCreate) SetActorsID(id uint64) *ReactionCreate

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*ReactionCreate) SetCreatedAt

func (rc *ReactionCreate) SetCreatedAt(t time.Time) *ReactionCreate

SetCreatedAt sets the "created_at" field.

func (*ReactionCreate) SetCreatedBy

func (rc *ReactionCreate) SetCreatedBy(i int) *ReactionCreate

SetCreatedBy sets the "created_by" field.

func (*ReactionCreate) SetDat

func (rc *ReactionCreate) SetDat(u uint64) *ReactionCreate

SetDat sets the "dat" field.

func (*ReactionCreate) SetNillableCreatedAt

func (rc *ReactionCreate) SetNillableCreatedAt(t *time.Time) *ReactionCreate

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

func (*ReactionCreate) SetNillableCreatedBy

func (rc *ReactionCreate) SetNillableCreatedBy(i *int) *ReactionCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ReactionCreate) SetNillableUpdatedAt

func (rc *ReactionCreate) SetNillableUpdatedAt(t *time.Time) *ReactionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ReactionCreate) SetNillableUpdatedBy

func (rc *ReactionCreate) SetNillableUpdatedBy(i *int) *ReactionCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ReactionCreate) SetStatus

func (rc *ReactionCreate) SetStatus(s *Status) *ReactionCreate

SetStatus sets the "status" edge to the Status entity.

func (*ReactionCreate) SetStatusID

func (rc *ReactionCreate) SetStatusID(u uint64) *ReactionCreate

SetStatusID sets the "status_id" field.

func (*ReactionCreate) SetType

func (rc *ReactionCreate) SetType(r reaction.Type) *ReactionCreate

SetType sets the "type" field.

func (*ReactionCreate) SetUpdatedAt

func (rc *ReactionCreate) SetUpdatedAt(t time.Time) *ReactionCreate

SetUpdatedAt sets the "updated_at" field.

func (*ReactionCreate) SetUpdatedBy

func (rc *ReactionCreate) SetUpdatedBy(i int) *ReactionCreate

SetUpdatedBy sets the "updated_by" field.

type ReactionCreateBulk

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

ReactionCreateBulk is the builder for creating many Reaction entities in bulk.

func (*ReactionCreateBulk) Exec

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

Exec executes the query.

func (*ReactionCreateBulk) ExecX

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

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

func (*ReactionCreateBulk) Save

func (rcb *ReactionCreateBulk) Save(ctx context.Context) ([]*Reaction, error)

Save creates the Reaction entities in the database.

func (*ReactionCreateBulk) SaveX

func (rcb *ReactionCreateBulk) SaveX(ctx context.Context) []*Reaction

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

type ReactionDelete

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

ReactionDelete is the builder for deleting a Reaction entity.

func (*ReactionDelete) Exec

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

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

func (*ReactionDelete) ExecX

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

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

func (*ReactionDelete) Where

func (rd *ReactionDelete) Where(ps ...predicate.Reaction) *ReactionDelete

Where appends a list predicates to the ReactionDelete builder.

type ReactionDeleteOne

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

ReactionDeleteOne is the builder for deleting a single Reaction entity.

func (*ReactionDeleteOne) Exec

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

Exec executes the deletion query.

func (*ReactionDeleteOne) ExecX

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

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

type ReactionEdges

type ReactionEdges struct {
	// Actors holds the value of the actors edge.
	Actors *Actor `json:"actors,omitempty"`
	// Status holds the value of the status edge.
	Status *Status `json:"status,omitempty"`
	// contains filtered or unexported fields
}

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

func (ReactionEdges) ActorsOrErr

func (e ReactionEdges) ActorsOrErr() (*Actor, error)

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

func (ReactionEdges) StatusOrErr

func (e ReactionEdges) StatusOrErr() (*Status, error)

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

type ReactionGroupBy

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

ReactionGroupBy is the group-by builder for Reaction entities.

func (*ReactionGroupBy) Aggregate

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

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

func (*ReactionGroupBy) Bool

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

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

func (*ReactionGroupBy) BoolX

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

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

func (*ReactionGroupBy) Bools

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

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

func (*ReactionGroupBy) BoolsX

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

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

func (*ReactionGroupBy) Float64

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

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

func (*ReactionGroupBy) Float64X

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

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

func (*ReactionGroupBy) Float64s

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

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

func (*ReactionGroupBy) Float64sX

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

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

func (*ReactionGroupBy) Int

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

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

func (*ReactionGroupBy) IntX

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

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

func (*ReactionGroupBy) Ints

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

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

func (*ReactionGroupBy) IntsX

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

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

func (*ReactionGroupBy) Scan

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

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

func (*ReactionGroupBy) ScanX

func (s *ReactionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ReactionGroupBy) String

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

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

func (*ReactionGroupBy) StringX

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

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

func (*ReactionGroupBy) Strings

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

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

func (*ReactionGroupBy) StringsX

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

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

type ReactionMutation

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

ReactionMutation represents an operation that mutates the Reaction nodes in the graph.

func (*ReactionMutation) ActorID

func (m *ReactionMutation) ActorID() (r uint64, exists bool)

ActorID returns the value of the "actor_id" field in the mutation.

func (*ReactionMutation) ActorsCleared

func (m *ReactionMutation) ActorsCleared() bool

ActorsCleared reports if the "actors" edge to the Actor entity was cleared.

func (*ReactionMutation) ActorsID

func (m *ReactionMutation) ActorsID() (id uint64, exists bool)

ActorsID returns the "actors" edge ID in the mutation.

func (*ReactionMutation) ActorsIDs

func (m *ReactionMutation) ActorsIDs() (ids []uint64)

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

func (*ReactionMutation) AddCreatedBy

func (m *ReactionMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

func (*ReactionMutation) AddDat

func (m *ReactionMutation) AddDat(u int64)

AddDat adds u to the "dat" field.

func (*ReactionMutation) AddField

func (m *ReactionMutation) 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 (*ReactionMutation) AddUpdatedBy

func (m *ReactionMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*ReactionMutation) AddedCreatedBy

func (m *ReactionMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*ReactionMutation) AddedDat

func (m *ReactionMutation) AddedDat() (r int64, exists bool)

AddedDat returns the value that was added to the "dat" field in this mutation.

func (*ReactionMutation) AddedEdges

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

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

func (*ReactionMutation) AddedField

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

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

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

func (*ReactionMutation) AddedIDs

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

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

func (*ReactionMutation) AddedUpdatedBy

func (m *ReactionMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*ReactionMutation) ClearActors

func (m *ReactionMutation) ClearActors()

ClearActors clears the "actors" edge to the Actor entity.

func (*ReactionMutation) ClearCreatedBy

func (m *ReactionMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*ReactionMutation) ClearEdge

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

func (m *ReactionMutation) 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 (*ReactionMutation) ClearStatus

func (m *ReactionMutation) ClearStatus()

ClearStatus clears the "status" edge to the Status entity.

func (*ReactionMutation) ClearUpdatedBy

func (m *ReactionMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ReactionMutation) ClearedEdges

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

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

func (*ReactionMutation) ClearedFields

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

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

func (ReactionMutation) Client

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

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

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

func (*ReactionMutation) CreatedBy

func (m *ReactionMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*ReactionMutation) CreatedByCleared

func (m *ReactionMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*ReactionMutation) Dat

func (m *ReactionMutation) Dat() (r uint64, exists bool)

Dat returns the value of the "dat" field in the mutation.

func (*ReactionMutation) EdgeCleared

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

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

func (*ReactionMutation) Field

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

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

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

func (*ReactionMutation) Fields

func (m *ReactionMutation) 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 (*ReactionMutation) GetType

func (m *ReactionMutation) GetType() (r reaction.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ReactionMutation) OldField

func (m *ReactionMutation) 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 (*ReactionMutation) Op

func (m *ReactionMutation) Op() Op

Op returns the operation name.

func (*ReactionMutation) RemovedEdges

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

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

func (*ReactionMutation) RemovedIDs

func (m *ReactionMutation) 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 (*ReactionMutation) ResetActorID

func (m *ReactionMutation) ResetActorID()

ResetActorID resets all changes to the "actor_id" field.

func (*ReactionMutation) ResetActors

func (m *ReactionMutation) ResetActors()

ResetActors resets all changes to the "actors" edge.

func (*ReactionMutation) ResetCreatedAt

func (m *ReactionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReactionMutation) ResetCreatedBy

func (m *ReactionMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*ReactionMutation) ResetDat

func (m *ReactionMutation) ResetDat()

ResetDat resets all changes to the "dat" field.

func (*ReactionMutation) ResetEdge

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

func (m *ReactionMutation) 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 (*ReactionMutation) ResetStatus

func (m *ReactionMutation) ResetStatus()

ResetStatus resets all changes to the "status" edge.

func (*ReactionMutation) ResetStatusID

func (m *ReactionMutation) ResetStatusID()

ResetStatusID resets all changes to the "status_id" field.

func (*ReactionMutation) ResetType

func (m *ReactionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ReactionMutation) ResetUpdatedAt

func (m *ReactionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ReactionMutation) ResetUpdatedBy

func (m *ReactionMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*ReactionMutation) SetActorID

func (m *ReactionMutation) SetActorID(u uint64)

SetActorID sets the "actor_id" field.

func (*ReactionMutation) SetActorsID

func (m *ReactionMutation) SetActorsID(id uint64)

SetActorsID sets the "actors" edge to the Actor entity by id.

func (*ReactionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ReactionMutation) SetCreatedBy

func (m *ReactionMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*ReactionMutation) SetDat

func (m *ReactionMutation) SetDat(u uint64)

SetDat sets the "dat" field.

func (*ReactionMutation) SetField

func (m *ReactionMutation) 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 (*ReactionMutation) SetStatusID

func (m *ReactionMutation) SetStatusID(u uint64)

SetStatusID sets the "status_id" field.

func (*ReactionMutation) SetType

func (m *ReactionMutation) SetType(r reaction.Type)

SetType sets the "type" field.

func (*ReactionMutation) SetUpdatedAt

func (m *ReactionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ReactionMutation) SetUpdatedBy

func (m *ReactionMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

func (*ReactionMutation) StatusCleared

func (m *ReactionMutation) StatusCleared() bool

StatusCleared reports if the "status" edge to the Status entity was cleared.

func (*ReactionMutation) StatusID

func (m *ReactionMutation) StatusID() (r uint64, exists bool)

StatusID returns the value of the "status_id" field in the mutation.

func (*ReactionMutation) StatusIDs

func (m *ReactionMutation) StatusIDs() (ids []uint64)

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

func (ReactionMutation) Tx

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

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

func (*ReactionMutation) Type

func (m *ReactionMutation) Type() string

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

func (*ReactionMutation) UpdatedAt

func (m *ReactionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ReactionMutation) UpdatedBy

func (m *ReactionMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*ReactionMutation) UpdatedByCleared

func (m *ReactionMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*ReactionMutation) Where

func (m *ReactionMutation) Where(ps ...predicate.Reaction)

Where appends a list predicates to the ReactionMutation builder.

type ReactionQuery

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

ReactionQuery is the builder for querying Reaction entities.

func (*ReactionQuery) All

func (rq *ReactionQuery) All(ctx context.Context) ([]*Reaction, error)

All executes the query and returns a list of Reactions.

func (*ReactionQuery) AllX

func (rq *ReactionQuery) AllX(ctx context.Context) []*Reaction

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

func (*ReactionQuery) Clone

func (rq *ReactionQuery) Clone() *ReactionQuery

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

func (*ReactionQuery) Count

func (rq *ReactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReactionQuery) CountX

func (rq *ReactionQuery) CountX(ctx context.Context) int

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

func (*ReactionQuery) Exist

func (rq *ReactionQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReactionQuery) ExistX

func (rq *ReactionQuery) ExistX(ctx context.Context) bool

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

func (*ReactionQuery) First

func (rq *ReactionQuery) First(ctx context.Context) (*Reaction, error)

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

func (*ReactionQuery) FirstX

func (rq *ReactionQuery) FirstX(ctx context.Context) *Reaction

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

func (*ReactionQuery) ForShare

func (rq *ReactionQuery) ForShare(opts ...sql.LockOption) *ReactionQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ReactionQuery) ForUpdate

func (rq *ReactionQuery) ForUpdate(opts ...sql.LockOption) *ReactionQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ReactionQuery) GroupBy

func (rq *ReactionQuery) GroupBy(field string, fields ...string) *ReactionGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reaction.Query().
	GroupBy(reaction.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReactionQuery) Limit

func (rq *ReactionQuery) Limit(limit int) *ReactionQuery

Limit adds a limit step to the query.

func (*ReactionQuery) Offset

func (rq *ReactionQuery) Offset(offset int) *ReactionQuery

Offset adds an offset step to the query.

func (*ReactionQuery) Only

func (rq *ReactionQuery) Only(ctx context.Context) (*Reaction, error)

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

func (*ReactionQuery) OnlyX

func (rq *ReactionQuery) OnlyX(ctx context.Context) *Reaction

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

func (*ReactionQuery) Order

func (rq *ReactionQuery) Order(o ...OrderFunc) *ReactionQuery

Order adds an order step to the query.

func (*ReactionQuery) QueryActors

func (rq *ReactionQuery) QueryActors() *ActorQuery

QueryActors chains the current query on the "actors" edge.

func (*ReactionQuery) QueryStatus

func (rq *ReactionQuery) QueryStatus() *StatusQuery

QueryStatus chains the current query on the "status" edge.

func (*ReactionQuery) Select

func (rq *ReactionQuery) Select(fields ...string) *ReactionSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Reaction.Query().
	Select(reaction.FieldCreatedAt).
	Scan(ctx, &v)

func (*ReactionQuery) Unique

func (rq *ReactionQuery) Unique(unique bool) *ReactionQuery

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

func (rq *ReactionQuery) Where(ps ...predicate.Reaction) *ReactionQuery

Where adds a new predicate for the ReactionQuery builder.

func (*ReactionQuery) WithActors

func (rq *ReactionQuery) WithActors(opts ...func(*ActorQuery)) *ReactionQuery

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

func (*ReactionQuery) WithStatus

func (rq *ReactionQuery) WithStatus(opts ...func(*StatusQuery)) *ReactionQuery

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

type ReactionSelect

type ReactionSelect struct {
	*ReactionQuery
	// contains filtered or unexported fields
}

ReactionSelect is the builder for selecting fields of Reaction entities.

func (*ReactionSelect) Bool

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

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

func (*ReactionSelect) BoolX

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

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

func (*ReactionSelect) Bools

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

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

func (*ReactionSelect) BoolsX

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

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

func (*ReactionSelect) Float64

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

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

func (*ReactionSelect) Float64X

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

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

func (*ReactionSelect) Float64s

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

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

func (*ReactionSelect) Float64sX

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

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

func (*ReactionSelect) Int

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

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

func (*ReactionSelect) IntX

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

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

func (*ReactionSelect) Ints

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

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

func (*ReactionSelect) IntsX

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

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

func (*ReactionSelect) Scan

func (rs *ReactionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ReactionSelect) ScanX

func (s *ReactionSelect) ScanX(ctx context.Context, v interface{})

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

func (*ReactionSelect) String

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

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

func (*ReactionSelect) StringX

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

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

func (*ReactionSelect) Strings

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

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

func (*ReactionSelect) StringsX

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

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

type ReactionUpdate

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

ReactionUpdate is the builder for updating Reaction entities.

func (*ReactionUpdate) AddCreatedBy

func (ru *ReactionUpdate) AddCreatedBy(i int) *ReactionUpdate

AddCreatedBy adds i to the "created_by" field.

func (*ReactionUpdate) AddDat

func (ru *ReactionUpdate) AddDat(u int64) *ReactionUpdate

AddDat adds u to the "dat" field.

func (*ReactionUpdate) AddUpdatedBy

func (ru *ReactionUpdate) AddUpdatedBy(i int) *ReactionUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*ReactionUpdate) ClearActors

func (ru *ReactionUpdate) ClearActors() *ReactionUpdate

ClearActors clears the "actors" edge to the Actor entity.

func (*ReactionUpdate) ClearCreatedBy

func (ru *ReactionUpdate) ClearCreatedBy() *ReactionUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*ReactionUpdate) ClearStatus

func (ru *ReactionUpdate) ClearStatus() *ReactionUpdate

ClearStatus clears the "status" edge to the Status entity.

func (*ReactionUpdate) ClearUpdatedBy

func (ru *ReactionUpdate) ClearUpdatedBy() *ReactionUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ReactionUpdate) Exec

func (ru *ReactionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionUpdate) ExecX

func (ru *ReactionUpdate) ExecX(ctx context.Context)

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

func (*ReactionUpdate) Mutation

func (ru *ReactionUpdate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdate) Save

func (ru *ReactionUpdate) Save(ctx context.Context) (int, error)

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

func (*ReactionUpdate) SaveX

func (ru *ReactionUpdate) SaveX(ctx context.Context) int

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

func (*ReactionUpdate) SetActorID

func (ru *ReactionUpdate) SetActorID(u uint64) *ReactionUpdate

SetActorID sets the "actor_id" field.

func (*ReactionUpdate) SetActors

func (ru *ReactionUpdate) SetActors(a *Actor) *ReactionUpdate

SetActors sets the "actors" edge to the Actor entity.

func (*ReactionUpdate) SetActorsID

func (ru *ReactionUpdate) SetActorsID(id uint64) *ReactionUpdate

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*ReactionUpdate) SetCreatedBy

func (ru *ReactionUpdate) SetCreatedBy(i int) *ReactionUpdate

SetCreatedBy sets the "created_by" field.

func (*ReactionUpdate) SetDat

func (ru *ReactionUpdate) SetDat(u uint64) *ReactionUpdate

SetDat sets the "dat" field.

func (*ReactionUpdate) SetNillableCreatedBy

func (ru *ReactionUpdate) SetNillableCreatedBy(i *int) *ReactionUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ReactionUpdate) SetNillableUpdatedBy

func (ru *ReactionUpdate) SetNillableUpdatedBy(i *int) *ReactionUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ReactionUpdate) SetStatus

func (ru *ReactionUpdate) SetStatus(s *Status) *ReactionUpdate

SetStatus sets the "status" edge to the Status entity.

func (*ReactionUpdate) SetStatusID

func (ru *ReactionUpdate) SetStatusID(u uint64) *ReactionUpdate

SetStatusID sets the "status_id" field.

func (*ReactionUpdate) SetType

func (ru *ReactionUpdate) SetType(r reaction.Type) *ReactionUpdate

SetType sets the "type" field.

func (*ReactionUpdate) SetUpdatedAt

func (ru *ReactionUpdate) SetUpdatedAt(t time.Time) *ReactionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ReactionUpdate) SetUpdatedBy

func (ru *ReactionUpdate) SetUpdatedBy(i int) *ReactionUpdate

SetUpdatedBy sets the "updated_by" field.

func (*ReactionUpdate) Where

func (ru *ReactionUpdate) Where(ps ...predicate.Reaction) *ReactionUpdate

Where appends a list predicates to the ReactionUpdate builder.

type ReactionUpdateOne

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

ReactionUpdateOne is the builder for updating a single Reaction entity.

func (*ReactionUpdateOne) AddCreatedBy

func (ruo *ReactionUpdateOne) AddCreatedBy(i int) *ReactionUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*ReactionUpdateOne) AddDat

func (ruo *ReactionUpdateOne) AddDat(u int64) *ReactionUpdateOne

AddDat adds u to the "dat" field.

func (*ReactionUpdateOne) AddUpdatedBy

func (ruo *ReactionUpdateOne) AddUpdatedBy(i int) *ReactionUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*ReactionUpdateOne) ClearActors

func (ruo *ReactionUpdateOne) ClearActors() *ReactionUpdateOne

ClearActors clears the "actors" edge to the Actor entity.

func (*ReactionUpdateOne) ClearCreatedBy

func (ruo *ReactionUpdateOne) ClearCreatedBy() *ReactionUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*ReactionUpdateOne) ClearStatus

func (ruo *ReactionUpdateOne) ClearStatus() *ReactionUpdateOne

ClearStatus clears the "status" edge to the Status entity.

func (*ReactionUpdateOne) ClearUpdatedBy

func (ruo *ReactionUpdateOne) ClearUpdatedBy() *ReactionUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ReactionUpdateOne) Exec

func (ruo *ReactionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReactionUpdateOne) ExecX

func (ruo *ReactionUpdateOne) ExecX(ctx context.Context)

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

func (*ReactionUpdateOne) Mutation

func (ruo *ReactionUpdateOne) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdateOne) Save

func (ruo *ReactionUpdateOne) Save(ctx context.Context) (*Reaction, error)

Save executes the query and returns the updated Reaction entity.

func (*ReactionUpdateOne) SaveX

func (ruo *ReactionUpdateOne) SaveX(ctx context.Context) *Reaction

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

func (*ReactionUpdateOne) Select

func (ruo *ReactionUpdateOne) Select(field string, fields ...string) *ReactionUpdateOne

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

func (*ReactionUpdateOne) SetActorID

func (ruo *ReactionUpdateOne) SetActorID(u uint64) *ReactionUpdateOne

SetActorID sets the "actor_id" field.

func (*ReactionUpdateOne) SetActors

func (ruo *ReactionUpdateOne) SetActors(a *Actor) *ReactionUpdateOne

SetActors sets the "actors" edge to the Actor entity.

func (*ReactionUpdateOne) SetActorsID

func (ruo *ReactionUpdateOne) SetActorsID(id uint64) *ReactionUpdateOne

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*ReactionUpdateOne) SetCreatedBy

func (ruo *ReactionUpdateOne) SetCreatedBy(i int) *ReactionUpdateOne

SetCreatedBy sets the "created_by" field.

func (*ReactionUpdateOne) SetDat

func (ruo *ReactionUpdateOne) SetDat(u uint64) *ReactionUpdateOne

SetDat sets the "dat" field.

func (*ReactionUpdateOne) SetNillableCreatedBy

func (ruo *ReactionUpdateOne) SetNillableCreatedBy(i *int) *ReactionUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillableUpdatedBy

func (ruo *ReactionUpdateOne) SetNillableUpdatedBy(i *int) *ReactionUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ReactionUpdateOne) SetStatus

func (ruo *ReactionUpdateOne) SetStatus(s *Status) *ReactionUpdateOne

SetStatus sets the "status" edge to the Status entity.

func (*ReactionUpdateOne) SetStatusID

func (ruo *ReactionUpdateOne) SetStatusID(u uint64) *ReactionUpdateOne

SetStatusID sets the "status_id" field.

func (*ReactionUpdateOne) SetType

SetType sets the "type" field.

func (*ReactionUpdateOne) SetUpdatedAt

func (ruo *ReactionUpdateOne) SetUpdatedAt(t time.Time) *ReactionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ReactionUpdateOne) SetUpdatedBy

func (ruo *ReactionUpdateOne) SetUpdatedBy(i int) *ReactionUpdateOne

SetUpdatedBy sets the "updated_by" field.

type Reactions

type Reactions []*Reaction

Reactions is a parsable slice of Reaction.

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 Server

type Server struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// The ActivityPub server's domain
	Domain string `json:"domain,omitempty"`
	// The last time a valid response or message was recieved from this Server
	LastSeen time.Time `json:"last_seen,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ServerQuery when eager-loading is set.
	Edges ServerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Server is the model entity for the Server schema.

func (*Server) QueryActors

func (s *Server) QueryActors() *ActorQuery

QueryActors queries the "actors" edge of the Server entity.

func (*Server) String

func (s *Server) String() string

String implements the fmt.Stringer.

func (*Server) Unwrap

func (s *Server) Unwrap() *Server

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

func (s *Server) Update() *ServerUpdateOne

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

type ServerClient

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

ServerClient is a client for the Server schema.

func NewServerClient

func NewServerClient(c config) *ServerClient

NewServerClient returns a client for the Server from the given config.

func (*ServerClient) Create

func (c *ServerClient) Create() *ServerCreate

Create returns a builder for creating a Server entity.

func (*ServerClient) CreateBulk

func (c *ServerClient) CreateBulk(builders ...*ServerCreate) *ServerCreateBulk

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

func (*ServerClient) Delete

func (c *ServerClient) Delete() *ServerDelete

Delete returns a delete builder for Server.

func (*ServerClient) DeleteOne

func (c *ServerClient) DeleteOne(s *Server) *ServerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ServerClient) DeleteOneID

func (c *ServerClient) DeleteOneID(id uint64) *ServerDeleteOne

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

func (*ServerClient) Get

func (c *ServerClient) Get(ctx context.Context, id uint64) (*Server, error)

Get returns a Server entity by its id.

func (*ServerClient) GetX

func (c *ServerClient) GetX(ctx context.Context, id uint64) *Server

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

func (*ServerClient) Hooks

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

Hooks returns the client hooks.

func (*ServerClient) Query

func (c *ServerClient) Query() *ServerQuery

Query returns a query builder for Server.

func (*ServerClient) QueryActors

func (c *ServerClient) QueryActors(s *Server) *ActorQuery

QueryActors queries the actors edge of a Server.

func (*ServerClient) Update

func (c *ServerClient) Update() *ServerUpdate

Update returns an update builder for Server.

func (*ServerClient) UpdateOne

func (c *ServerClient) UpdateOne(s *Server) *ServerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ServerClient) UpdateOneID

func (c *ServerClient) UpdateOneID(id uint64) *ServerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ServerClient) Use

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

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

type ServerCreate

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

ServerCreate is the builder for creating a Server entity.

func (*ServerCreate) AddActorIDs

func (sc *ServerCreate) AddActorIDs(ids ...uint64) *ServerCreate

AddActorIDs adds the "actors" edge to the Actor entity by IDs.

func (*ServerCreate) AddActors

func (sc *ServerCreate) AddActors(a ...*Actor) *ServerCreate

AddActors adds the "actors" edges to the Actor entity.

func (*ServerCreate) Exec

func (sc *ServerCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServerCreate) ExecX

func (sc *ServerCreate) ExecX(ctx context.Context)

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

func (*ServerCreate) Mutation

func (sc *ServerCreate) Mutation() *ServerMutation

Mutation returns the ServerMutation object of the builder.

func (*ServerCreate) Save

func (sc *ServerCreate) Save(ctx context.Context) (*Server, error)

Save creates the Server in the database.

func (*ServerCreate) SaveX

func (sc *ServerCreate) SaveX(ctx context.Context) *Server

SaveX calls Save and panics if Save returns an error.

func (*ServerCreate) SetCreatedAt

func (sc *ServerCreate) SetCreatedAt(t time.Time) *ServerCreate

SetCreatedAt sets the "created_at" field.

func (*ServerCreate) SetCreatedBy

func (sc *ServerCreate) SetCreatedBy(i int) *ServerCreate

SetCreatedBy sets the "created_by" field.

func (*ServerCreate) SetDomain

func (sc *ServerCreate) SetDomain(s string) *ServerCreate

SetDomain sets the "domain" field.

func (*ServerCreate) SetID

func (sc *ServerCreate) SetID(u uint64) *ServerCreate

SetID sets the "id" field.

func (*ServerCreate) SetLastSeen

func (sc *ServerCreate) SetLastSeen(t time.Time) *ServerCreate

SetLastSeen sets the "last_seen" field.

func (*ServerCreate) SetNillableCreatedAt

func (sc *ServerCreate) SetNillableCreatedAt(t *time.Time) *ServerCreate

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

func (*ServerCreate) SetNillableCreatedBy

func (sc *ServerCreate) SetNillableCreatedBy(i *int) *ServerCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ServerCreate) SetNillableLastSeen

func (sc *ServerCreate) SetNillableLastSeen(t *time.Time) *ServerCreate

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*ServerCreate) SetNillableUpdatedAt

func (sc *ServerCreate) SetNillableUpdatedAt(t *time.Time) *ServerCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ServerCreate) SetNillableUpdatedBy

func (sc *ServerCreate) SetNillableUpdatedBy(i *int) *ServerCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ServerCreate) SetUpdatedAt

func (sc *ServerCreate) SetUpdatedAt(t time.Time) *ServerCreate

SetUpdatedAt sets the "updated_at" field.

func (*ServerCreate) SetUpdatedBy

func (sc *ServerCreate) SetUpdatedBy(i int) *ServerCreate

SetUpdatedBy sets the "updated_by" field.

type ServerCreateBulk

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

ServerCreateBulk is the builder for creating many Server entities in bulk.

func (*ServerCreateBulk) Exec

func (scb *ServerCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ServerCreateBulk) ExecX

func (scb *ServerCreateBulk) ExecX(ctx context.Context)

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

func (*ServerCreateBulk) Save

func (scb *ServerCreateBulk) Save(ctx context.Context) ([]*Server, error)

Save creates the Server entities in the database.

func (*ServerCreateBulk) SaveX

func (scb *ServerCreateBulk) SaveX(ctx context.Context) []*Server

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

type ServerDelete

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

ServerDelete is the builder for deleting a Server entity.

func (*ServerDelete) Exec

func (sd *ServerDelete) Exec(ctx context.Context) (int, error)

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

func (*ServerDelete) ExecX

func (sd *ServerDelete) ExecX(ctx context.Context) int

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

func (*ServerDelete) Where

func (sd *ServerDelete) Where(ps ...predicate.Server) *ServerDelete

Where appends a list predicates to the ServerDelete builder.

type ServerDeleteOne

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

ServerDeleteOne is the builder for deleting a single Server entity.

func (*ServerDeleteOne) Exec

func (sdo *ServerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ServerDeleteOne) ExecX

func (sdo *ServerDeleteOne) ExecX(ctx context.Context)

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

type ServerEdges

type ServerEdges struct {
	// Actors belong to a server
	Actors []*Actor `json:"actors,omitempty"`
	// contains filtered or unexported fields
}

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

func (ServerEdges) ActorsOrErr

func (e ServerEdges) ActorsOrErr() ([]*Actor, error)

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

type ServerGroupBy

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

ServerGroupBy is the group-by builder for Server entities.

func (*ServerGroupBy) Aggregate

func (sgb *ServerGroupBy) Aggregate(fns ...AggregateFunc) *ServerGroupBy

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

func (*ServerGroupBy) Bool

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

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

func (*ServerGroupBy) BoolX

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

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

func (*ServerGroupBy) Bools

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

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

func (*ServerGroupBy) BoolsX

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

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

func (*ServerGroupBy) Float64

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

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

func (*ServerGroupBy) Float64X

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

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

func (*ServerGroupBy) Float64s

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

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

func (*ServerGroupBy) Float64sX

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

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

func (*ServerGroupBy) Int

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

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

func (*ServerGroupBy) IntX

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

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

func (*ServerGroupBy) Ints

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

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

func (*ServerGroupBy) IntsX

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

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

func (*ServerGroupBy) Scan

func (sgb *ServerGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ServerGroupBy) ScanX

func (s *ServerGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ServerGroupBy) String

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

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

func (*ServerGroupBy) StringX

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

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

func (*ServerGroupBy) Strings

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

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

func (*ServerGroupBy) StringsX

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

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

type ServerMutation

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

ServerMutation represents an operation that mutates the Server nodes in the graph.

func (*ServerMutation) ActorsCleared

func (m *ServerMutation) ActorsCleared() bool

ActorsCleared reports if the "actors" edge to the Actor entity was cleared.

func (*ServerMutation) ActorsIDs

func (m *ServerMutation) ActorsIDs() (ids []uint64)

ActorsIDs returns the "actors" edge IDs in the mutation.

func (*ServerMutation) AddActorIDs

func (m *ServerMutation) AddActorIDs(ids ...uint64)

AddActorIDs adds the "actors" edge to the Actor entity by ids.

func (*ServerMutation) AddCreatedBy

func (m *ServerMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

func (*ServerMutation) AddField

func (m *ServerMutation) 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 (*ServerMutation) AddUpdatedBy

func (m *ServerMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*ServerMutation) AddedCreatedBy

func (m *ServerMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*ServerMutation) AddedEdges

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

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

func (*ServerMutation) AddedField

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

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

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

func (*ServerMutation) AddedIDs

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

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

func (*ServerMutation) AddedUpdatedBy

func (m *ServerMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*ServerMutation) ClearActors

func (m *ServerMutation) ClearActors()

ClearActors clears the "actors" edge to the Actor entity.

func (*ServerMutation) ClearCreatedBy

func (m *ServerMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*ServerMutation) ClearEdge

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

func (m *ServerMutation) 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 (*ServerMutation) ClearUpdatedBy

func (m *ServerMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ServerMutation) ClearedEdges

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

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

func (*ServerMutation) ClearedFields

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

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

func (ServerMutation) Client

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

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

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

func (*ServerMutation) CreatedBy

func (m *ServerMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*ServerMutation) CreatedByCleared

func (m *ServerMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*ServerMutation) Domain

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

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

func (*ServerMutation) EdgeCleared

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

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

func (*ServerMutation) Field

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

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

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

func (*ServerMutation) Fields

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

func (m *ServerMutation) ID() (id uint64, 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 (*ServerMutation) IDs

func (m *ServerMutation) IDs(ctx context.Context) ([]uint64, 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 (*ServerMutation) LastSeen

func (m *ServerMutation) LastSeen() (r time.Time, exists bool)

LastSeen returns the value of the "last_seen" field in the mutation.

func (*ServerMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Server entity. If the Server 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 (*ServerMutation) OldCreatedBy

func (m *ServerMutation) OldCreatedBy(ctx context.Context) (v int, err error)

OldCreatedBy returns the old "created_by" field's value of the Server entity. If the Server 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 (*ServerMutation) OldDomain

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

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

func (m *ServerMutation) 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 (*ServerMutation) OldLastSeen

func (m *ServerMutation) OldLastSeen(ctx context.Context) (v time.Time, err error)

OldLastSeen returns the old "last_seen" field's value of the Server entity. If the Server 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 (*ServerMutation) OldUpdatedAt

func (m *ServerMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Server entity. If the Server 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 (*ServerMutation) OldUpdatedBy

func (m *ServerMutation) OldUpdatedBy(ctx context.Context) (v int, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Server entity. If the Server 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 (*ServerMutation) Op

func (m *ServerMutation) Op() Op

Op returns the operation name.

func (*ServerMutation) RemoveActorIDs

func (m *ServerMutation) RemoveActorIDs(ids ...uint64)

RemoveActorIDs removes the "actors" edge to the Actor entity by IDs.

func (*ServerMutation) RemovedActorsIDs

func (m *ServerMutation) RemovedActorsIDs() (ids []uint64)

RemovedActors returns the removed IDs of the "actors" edge to the Actor entity.

func (*ServerMutation) RemovedEdges

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

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

func (*ServerMutation) RemovedIDs

func (m *ServerMutation) 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 (*ServerMutation) ResetActors

func (m *ServerMutation) ResetActors()

ResetActors resets all changes to the "actors" edge.

func (*ServerMutation) ResetCreatedAt

func (m *ServerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ServerMutation) ResetCreatedBy

func (m *ServerMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*ServerMutation) ResetDomain

func (m *ServerMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*ServerMutation) ResetEdge

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

func (m *ServerMutation) 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 (*ServerMutation) ResetLastSeen

func (m *ServerMutation) ResetLastSeen()

ResetLastSeen resets all changes to the "last_seen" field.

func (*ServerMutation) ResetUpdatedAt

func (m *ServerMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ServerMutation) ResetUpdatedBy

func (m *ServerMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*ServerMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ServerMutation) SetCreatedBy

func (m *ServerMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*ServerMutation) SetDomain

func (m *ServerMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*ServerMutation) SetField

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

func (m *ServerMutation) SetID(id uint64)

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

func (*ServerMutation) SetLastSeen

func (m *ServerMutation) SetLastSeen(t time.Time)

SetLastSeen sets the "last_seen" field.

func (*ServerMutation) SetUpdatedAt

func (m *ServerMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ServerMutation) SetUpdatedBy

func (m *ServerMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

func (ServerMutation) Tx

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

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

func (*ServerMutation) Type

func (m *ServerMutation) Type() string

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

func (*ServerMutation) UpdatedAt

func (m *ServerMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ServerMutation) UpdatedBy

func (m *ServerMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*ServerMutation) UpdatedByCleared

func (m *ServerMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*ServerMutation) Where

func (m *ServerMutation) Where(ps ...predicate.Server)

Where appends a list predicates to the ServerMutation builder.

type ServerQuery

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

ServerQuery is the builder for querying Server entities.

func (*ServerQuery) All

func (sq *ServerQuery) All(ctx context.Context) ([]*Server, error)

All executes the query and returns a list of Servers.

func (*ServerQuery) AllX

func (sq *ServerQuery) AllX(ctx context.Context) []*Server

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

func (*ServerQuery) Clone

func (sq *ServerQuery) Clone() *ServerQuery

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

func (*ServerQuery) Count

func (sq *ServerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ServerQuery) CountX

func (sq *ServerQuery) CountX(ctx context.Context) int

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

func (*ServerQuery) Exist

func (sq *ServerQuery) Exist(ctx context.Context) (bool, error)

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

func (*ServerQuery) ExistX

func (sq *ServerQuery) ExistX(ctx context.Context) bool

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

func (*ServerQuery) First

func (sq *ServerQuery) First(ctx context.Context) (*Server, error)

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

func (*ServerQuery) FirstID

func (sq *ServerQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*ServerQuery) FirstIDX

func (sq *ServerQuery) FirstIDX(ctx context.Context) uint64

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

func (*ServerQuery) FirstX

func (sq *ServerQuery) FirstX(ctx context.Context) *Server

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

func (*ServerQuery) ForShare

func (sq *ServerQuery) ForShare(opts ...sql.LockOption) *ServerQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ServerQuery) ForUpdate

func (sq *ServerQuery) ForUpdate(opts ...sql.LockOption) *ServerQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ServerQuery) GroupBy

func (sq *ServerQuery) GroupBy(field string, fields ...string) *ServerGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Server.Query().
	GroupBy(server.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ServerQuery) IDs

func (sq *ServerQuery) IDs(ctx context.Context) ([]uint64, error)

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

func (*ServerQuery) IDsX

func (sq *ServerQuery) IDsX(ctx context.Context) []uint64

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

func (*ServerQuery) Limit

func (sq *ServerQuery) Limit(limit int) *ServerQuery

Limit adds a limit step to the query.

func (*ServerQuery) Offset

func (sq *ServerQuery) Offset(offset int) *ServerQuery

Offset adds an offset step to the query.

func (*ServerQuery) Only

func (sq *ServerQuery) Only(ctx context.Context) (*Server, error)

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

func (*ServerQuery) OnlyID

func (sq *ServerQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*ServerQuery) OnlyIDX

func (sq *ServerQuery) OnlyIDX(ctx context.Context) uint64

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

func (*ServerQuery) OnlyX

func (sq *ServerQuery) OnlyX(ctx context.Context) *Server

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

func (*ServerQuery) Order

func (sq *ServerQuery) Order(o ...OrderFunc) *ServerQuery

Order adds an order step to the query.

func (*ServerQuery) QueryActors

func (sq *ServerQuery) QueryActors() *ActorQuery

QueryActors chains the current query on the "actors" edge.

func (*ServerQuery) Select

func (sq *ServerQuery) Select(fields ...string) *ServerSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Server.Query().
	Select(server.FieldCreatedAt).
	Scan(ctx, &v)

func (*ServerQuery) Unique

func (sq *ServerQuery) Unique(unique bool) *ServerQuery

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

func (sq *ServerQuery) Where(ps ...predicate.Server) *ServerQuery

Where adds a new predicate for the ServerQuery builder.

func (*ServerQuery) WithActors

func (sq *ServerQuery) WithActors(opts ...func(*ActorQuery)) *ServerQuery

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

type ServerSelect

type ServerSelect struct {
	*ServerQuery
	// contains filtered or unexported fields
}

ServerSelect is the builder for selecting fields of Server entities.

func (*ServerSelect) Bool

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

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

func (*ServerSelect) BoolX

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

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

func (*ServerSelect) Bools

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

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

func (*ServerSelect) BoolsX

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

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

func (*ServerSelect) Float64

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

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

func (*ServerSelect) Float64X

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

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

func (*ServerSelect) Float64s

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

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

func (*ServerSelect) Float64sX

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

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

func (*ServerSelect) Int

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

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

func (*ServerSelect) IntX

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

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

func (*ServerSelect) Ints

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

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

func (*ServerSelect) IntsX

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

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

func (*ServerSelect) Scan

func (ss *ServerSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ServerSelect) ScanX

func (s *ServerSelect) ScanX(ctx context.Context, v interface{})

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

func (*ServerSelect) String

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

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

func (*ServerSelect) StringX

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

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

func (*ServerSelect) Strings

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

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

func (*ServerSelect) StringsX

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

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

type ServerUpdate

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

ServerUpdate is the builder for updating Server entities.

func (*ServerUpdate) AddActorIDs

func (su *ServerUpdate) AddActorIDs(ids ...uint64) *ServerUpdate

AddActorIDs adds the "actors" edge to the Actor entity by IDs.

func (*ServerUpdate) AddActors

func (su *ServerUpdate) AddActors(a ...*Actor) *ServerUpdate

AddActors adds the "actors" edges to the Actor entity.

func (*ServerUpdate) AddCreatedBy

func (su *ServerUpdate) AddCreatedBy(i int) *ServerUpdate

AddCreatedBy adds i to the "created_by" field.

func (*ServerUpdate) AddUpdatedBy

func (su *ServerUpdate) AddUpdatedBy(i int) *ServerUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*ServerUpdate) ClearActors

func (su *ServerUpdate) ClearActors() *ServerUpdate

ClearActors clears all "actors" edges to the Actor entity.

func (*ServerUpdate) ClearCreatedBy

func (su *ServerUpdate) ClearCreatedBy() *ServerUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*ServerUpdate) ClearUpdatedBy

func (su *ServerUpdate) ClearUpdatedBy() *ServerUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ServerUpdate) Exec

func (su *ServerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServerUpdate) ExecX

func (su *ServerUpdate) ExecX(ctx context.Context)

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

func (*ServerUpdate) Mutation

func (su *ServerUpdate) Mutation() *ServerMutation

Mutation returns the ServerMutation object of the builder.

func (*ServerUpdate) RemoveActorIDs

func (su *ServerUpdate) RemoveActorIDs(ids ...uint64) *ServerUpdate

RemoveActorIDs removes the "actors" edge to Actor entities by IDs.

func (*ServerUpdate) RemoveActors

func (su *ServerUpdate) RemoveActors(a ...*Actor) *ServerUpdate

RemoveActors removes "actors" edges to Actor entities.

func (*ServerUpdate) Save

func (su *ServerUpdate) Save(ctx context.Context) (int, error)

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

func (*ServerUpdate) SaveX

func (su *ServerUpdate) SaveX(ctx context.Context) int

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

func (*ServerUpdate) SetCreatedBy

func (su *ServerUpdate) SetCreatedBy(i int) *ServerUpdate

SetCreatedBy sets the "created_by" field.

func (*ServerUpdate) SetLastSeen

func (su *ServerUpdate) SetLastSeen(t time.Time) *ServerUpdate

SetLastSeen sets the "last_seen" field.

func (*ServerUpdate) SetNillableCreatedBy

func (su *ServerUpdate) SetNillableCreatedBy(i *int) *ServerUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ServerUpdate) SetNillableLastSeen

func (su *ServerUpdate) SetNillableLastSeen(t *time.Time) *ServerUpdate

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*ServerUpdate) SetNillableUpdatedBy

func (su *ServerUpdate) SetNillableUpdatedBy(i *int) *ServerUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ServerUpdate) SetUpdatedAt

func (su *ServerUpdate) SetUpdatedAt(t time.Time) *ServerUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ServerUpdate) SetUpdatedBy

func (su *ServerUpdate) SetUpdatedBy(i int) *ServerUpdate

SetUpdatedBy sets the "updated_by" field.

func (*ServerUpdate) Where

func (su *ServerUpdate) Where(ps ...predicate.Server) *ServerUpdate

Where appends a list predicates to the ServerUpdate builder.

type ServerUpdateOne

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

ServerUpdateOne is the builder for updating a single Server entity.

func (*ServerUpdateOne) AddActorIDs

func (suo *ServerUpdateOne) AddActorIDs(ids ...uint64) *ServerUpdateOne

AddActorIDs adds the "actors" edge to the Actor entity by IDs.

func (*ServerUpdateOne) AddActors

func (suo *ServerUpdateOne) AddActors(a ...*Actor) *ServerUpdateOne

AddActors adds the "actors" edges to the Actor entity.

func (*ServerUpdateOne) AddCreatedBy

func (suo *ServerUpdateOne) AddCreatedBy(i int) *ServerUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*ServerUpdateOne) AddUpdatedBy

func (suo *ServerUpdateOne) AddUpdatedBy(i int) *ServerUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*ServerUpdateOne) ClearActors

func (suo *ServerUpdateOne) ClearActors() *ServerUpdateOne

ClearActors clears all "actors" edges to the Actor entity.

func (*ServerUpdateOne) ClearCreatedBy

func (suo *ServerUpdateOne) ClearCreatedBy() *ServerUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*ServerUpdateOne) ClearUpdatedBy

func (suo *ServerUpdateOne) ClearUpdatedBy() *ServerUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*ServerUpdateOne) Exec

func (suo *ServerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ServerUpdateOne) ExecX

func (suo *ServerUpdateOne) ExecX(ctx context.Context)

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

func (*ServerUpdateOne) Mutation

func (suo *ServerUpdateOne) Mutation() *ServerMutation

Mutation returns the ServerMutation object of the builder.

func (*ServerUpdateOne) RemoveActorIDs

func (suo *ServerUpdateOne) RemoveActorIDs(ids ...uint64) *ServerUpdateOne

RemoveActorIDs removes the "actors" edge to Actor entities by IDs.

func (*ServerUpdateOne) RemoveActors

func (suo *ServerUpdateOne) RemoveActors(a ...*Actor) *ServerUpdateOne

RemoveActors removes "actors" edges to Actor entities.

func (*ServerUpdateOne) Save

func (suo *ServerUpdateOne) Save(ctx context.Context) (*Server, error)

Save executes the query and returns the updated Server entity.

func (*ServerUpdateOne) SaveX

func (suo *ServerUpdateOne) SaveX(ctx context.Context) *Server

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

func (*ServerUpdateOne) Select

func (suo *ServerUpdateOne) Select(field string, fields ...string) *ServerUpdateOne

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

func (*ServerUpdateOne) SetCreatedBy

func (suo *ServerUpdateOne) SetCreatedBy(i int) *ServerUpdateOne

SetCreatedBy sets the "created_by" field.

func (*ServerUpdateOne) SetLastSeen

func (suo *ServerUpdateOne) SetLastSeen(t time.Time) *ServerUpdateOne

SetLastSeen sets the "last_seen" field.

func (*ServerUpdateOne) SetNillableCreatedBy

func (suo *ServerUpdateOne) SetNillableCreatedBy(i *int) *ServerUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*ServerUpdateOne) SetNillableLastSeen

func (suo *ServerUpdateOne) SetNillableLastSeen(t *time.Time) *ServerUpdateOne

SetNillableLastSeen sets the "last_seen" field if the given value is not nil.

func (*ServerUpdateOne) SetNillableUpdatedBy

func (suo *ServerUpdateOne) SetNillableUpdatedBy(i *int) *ServerUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*ServerUpdateOne) SetUpdatedAt

func (suo *ServerUpdateOne) SetUpdatedAt(t time.Time) *ServerUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ServerUpdateOne) SetUpdatedBy

func (suo *ServerUpdateOne) SetUpdatedBy(i int) *ServerUpdateOne

SetUpdatedBy sets the "updated_by" field.

type Servers

type Servers []*Server

Servers is a parsable slice of Server.

type Session

type Session struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// Sessions can derrive from the local (password auth), oauth, or app_password
	Type session.Type `json:"type,omitempty"`
	// The session may be disabled by the user or by automatic security policy
	Disabled bool `json:"disabled,omitempty"`
	// random 32 bytes encoded as base64
	Token string `json:"token,omitempty"`
	// The last known user-agent
	UserAgent string `json:"user_agent,omitempty"`
	// All IPs that have been associated with this session. Reverse-chornological order. The current IP is the first item in the slice
	Ips string `json:"ips,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SessionQuery when eager-loading is set.
	Edges SessionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Session is the model entity for the Session schema.

func (*Session) QueryAccounts

func (s *Session) QueryAccounts() *ActorQuery

QueryAccounts queries the "accounts" edge of the Session entity.

func (*Session) String

func (s *Session) String() string

String implements the fmt.Stringer.

func (*Session) Unwrap

func (s *Session) Unwrap() *Session

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

func (s *Session) Update() *SessionUpdateOne

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

type SessionClient

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

SessionClient is a client for the Session schema.

func NewSessionClient

func NewSessionClient(c config) *SessionClient

NewSessionClient returns a client for the Session from the given config.

func (*SessionClient) Create

func (c *SessionClient) Create() *SessionCreate

Create returns a builder for creating a Session entity.

func (*SessionClient) CreateBulk

func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk

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

func (*SessionClient) Delete

func (c *SessionClient) Delete() *SessionDelete

Delete returns a delete builder for Session.

func (*SessionClient) DeleteOne

func (c *SessionClient) DeleteOne(s *Session) *SessionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SessionClient) DeleteOneID

func (c *SessionClient) DeleteOneID(id uint64) *SessionDeleteOne

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

func (*SessionClient) Get

func (c *SessionClient) Get(ctx context.Context, id uint64) (*Session, error)

Get returns a Session entity by its id.

func (*SessionClient) GetX

func (c *SessionClient) GetX(ctx context.Context, id uint64) *Session

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

func (*SessionClient) Hooks

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

Hooks returns the client hooks.

func (*SessionClient) Query

func (c *SessionClient) Query() *SessionQuery

Query returns a query builder for Session.

func (*SessionClient) QueryAccounts

func (c *SessionClient) QueryAccounts(s *Session) *ActorQuery

QueryAccounts queries the accounts edge of a Session.

func (*SessionClient) Update

func (c *SessionClient) Update() *SessionUpdate

Update returns an update builder for Session.

func (*SessionClient) UpdateOne

func (c *SessionClient) UpdateOne(s *Session) *SessionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SessionClient) UpdateOneID

func (c *SessionClient) UpdateOneID(id uint64) *SessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SessionClient) Use

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

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

type SessionCreate

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

SessionCreate is the builder for creating a Session entity.

func (*SessionCreate) Exec

func (sc *SessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreate) ExecX

func (sc *SessionCreate) ExecX(ctx context.Context)

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

func (*SessionCreate) Mutation

func (sc *SessionCreate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionCreate) Save

func (sc *SessionCreate) Save(ctx context.Context) (*Session, error)

Save creates the Session in the database.

func (*SessionCreate) SaveX

func (sc *SessionCreate) SaveX(ctx context.Context) *Session

SaveX calls Save and panics if Save returns an error.

func (*SessionCreate) SetAccounts

func (sc *SessionCreate) SetAccounts(a *Actor) *SessionCreate

SetAccounts sets the "accounts" edge to the Actor entity.

func (*SessionCreate) SetAccountsID

func (sc *SessionCreate) SetAccountsID(id uint64) *SessionCreate

SetAccountsID sets the "accounts" edge to the Actor entity by ID.

func (*SessionCreate) SetCreatedAt

func (sc *SessionCreate) SetCreatedAt(t time.Time) *SessionCreate

SetCreatedAt sets the "created_at" field.

func (*SessionCreate) SetCreatedBy

func (sc *SessionCreate) SetCreatedBy(i int) *SessionCreate

SetCreatedBy sets the "created_by" field.

func (*SessionCreate) SetDisabled

func (sc *SessionCreate) SetDisabled(b bool) *SessionCreate

SetDisabled sets the "disabled" field.

func (*SessionCreate) SetID

func (sc *SessionCreate) SetID(u uint64) *SessionCreate

SetID sets the "id" field.

func (*SessionCreate) SetIps

func (sc *SessionCreate) SetIps(s string) *SessionCreate

SetIps sets the "ips" field.

func (*SessionCreate) SetNillableAccountsID

func (sc *SessionCreate) SetNillableAccountsID(id *uint64) *SessionCreate

SetNillableAccountsID sets the "accounts" edge to the Actor entity by ID if the given value is not nil.

func (*SessionCreate) SetNillableCreatedAt

func (sc *SessionCreate) SetNillableCreatedAt(t *time.Time) *SessionCreate

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

func (*SessionCreate) SetNillableCreatedBy

func (sc *SessionCreate) SetNillableCreatedBy(i *int) *SessionCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SessionCreate) SetNillableToken

func (sc *SessionCreate) SetNillableToken(s *string) *SessionCreate

SetNillableToken sets the "token" field if the given value is not nil.

func (*SessionCreate) SetNillableUpdatedAt

func (sc *SessionCreate) SetNillableUpdatedAt(t *time.Time) *SessionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SessionCreate) SetNillableUpdatedBy

func (sc *SessionCreate) SetNillableUpdatedBy(i *int) *SessionCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*SessionCreate) SetNillableUserAgent

func (sc *SessionCreate) SetNillableUserAgent(s *string) *SessionCreate

SetNillableUserAgent sets the "user_agent" field if the given value is not nil.

func (*SessionCreate) SetToken

func (sc *SessionCreate) SetToken(s string) *SessionCreate

SetToken sets the "token" field.

func (*SessionCreate) SetType

func (sc *SessionCreate) SetType(s session.Type) *SessionCreate

SetType sets the "type" field.

func (*SessionCreate) SetUpdatedAt

func (sc *SessionCreate) SetUpdatedAt(t time.Time) *SessionCreate

SetUpdatedAt sets the "updated_at" field.

func (*SessionCreate) SetUpdatedBy

func (sc *SessionCreate) SetUpdatedBy(i int) *SessionCreate

SetUpdatedBy sets the "updated_by" field.

func (*SessionCreate) SetUserAgent

func (sc *SessionCreate) SetUserAgent(s string) *SessionCreate

SetUserAgent sets the "user_agent" field.

type SessionCreateBulk

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

SessionCreateBulk is the builder for creating many Session entities in bulk.

func (*SessionCreateBulk) Exec

func (scb *SessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreateBulk) ExecX

func (scb *SessionCreateBulk) ExecX(ctx context.Context)

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

func (*SessionCreateBulk) Save

func (scb *SessionCreateBulk) Save(ctx context.Context) ([]*Session, error)

Save creates the Session entities in the database.

func (*SessionCreateBulk) SaveX

func (scb *SessionCreateBulk) SaveX(ctx context.Context) []*Session

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

type SessionDelete

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

SessionDelete is the builder for deleting a Session entity.

func (*SessionDelete) Exec

func (sd *SessionDelete) Exec(ctx context.Context) (int, error)

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

func (*SessionDelete) ExecX

func (sd *SessionDelete) ExecX(ctx context.Context) int

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

func (*SessionDelete) Where

func (sd *SessionDelete) Where(ps ...predicate.Session) *SessionDelete

Where appends a list predicates to the SessionDelete builder.

type SessionDeleteOne

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

SessionDeleteOne is the builder for deleting a single Session entity.

func (*SessionDeleteOne) Exec

func (sdo *SessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SessionDeleteOne) ExecX

func (sdo *SessionDeleteOne) ExecX(ctx context.Context)

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

type SessionEdges

type SessionEdges struct {
	// Sessions belong to Accounts
	Accounts *Actor `json:"accounts,omitempty"`
	// contains filtered or unexported fields
}

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

func (SessionEdges) AccountsOrErr

func (e SessionEdges) AccountsOrErr() (*Actor, error)

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

type SessionGroupBy

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

SessionGroupBy is the group-by builder for Session entities.

func (*SessionGroupBy) Aggregate

func (sgb *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy

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

func (*SessionGroupBy) Bool

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

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

func (*SessionGroupBy) BoolX

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

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

func (*SessionGroupBy) Bools

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

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

func (*SessionGroupBy) BoolsX

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

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

func (*SessionGroupBy) Float64

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

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

func (*SessionGroupBy) Float64X

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

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

func (*SessionGroupBy) Float64s

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

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

func (*SessionGroupBy) Float64sX

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

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

func (*SessionGroupBy) Int

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

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

func (*SessionGroupBy) IntX

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

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

func (*SessionGroupBy) Ints

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

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

func (*SessionGroupBy) IntsX

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

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

func (*SessionGroupBy) Scan

func (sgb *SessionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SessionGroupBy) ScanX

func (s *SessionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SessionGroupBy) String

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

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

func (*SessionGroupBy) StringX

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

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

func (*SessionGroupBy) Strings

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

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

func (*SessionGroupBy) StringsX

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

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

type SessionMutation

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

SessionMutation represents an operation that mutates the Session nodes in the graph.

func (*SessionMutation) AccountsCleared

func (m *SessionMutation) AccountsCleared() bool

AccountsCleared reports if the "accounts" edge to the Actor entity was cleared.

func (*SessionMutation) AccountsID

func (m *SessionMutation) AccountsID() (id uint64, exists bool)

AccountsID returns the "accounts" edge ID in the mutation.

func (*SessionMutation) AccountsIDs

func (m *SessionMutation) AccountsIDs() (ids []uint64)

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

func (*SessionMutation) AddCreatedBy

func (m *SessionMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

func (*SessionMutation) AddField

func (m *SessionMutation) 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 (*SessionMutation) AddUpdatedBy

func (m *SessionMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*SessionMutation) AddedCreatedBy

func (m *SessionMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*SessionMutation) AddedEdges

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

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

func (*SessionMutation) AddedField

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

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

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

func (*SessionMutation) AddedIDs

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

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SessionMutation) AddedUpdatedBy

func (m *SessionMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*SessionMutation) ClearAccounts

func (m *SessionMutation) ClearAccounts()

ClearAccounts clears the "accounts" edge to the Actor entity.

func (*SessionMutation) ClearCreatedBy

func (m *SessionMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*SessionMutation) ClearEdge

func (m *SessionMutation) 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 (*SessionMutation) ClearField

func (m *SessionMutation) 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 (*SessionMutation) ClearUpdatedBy

func (m *SessionMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*SessionMutation) ClearUserAgent

func (m *SessionMutation) ClearUserAgent()

ClearUserAgent clears the value of the "user_agent" field.

func (*SessionMutation) ClearedEdges

func (m *SessionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SessionMutation) ClearedFields

func (m *SessionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SessionMutation) Client

func (m SessionMutation) 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 (*SessionMutation) CreatedAt

func (m *SessionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SessionMutation) CreatedBy

func (m *SessionMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*SessionMutation) CreatedByCleared

func (m *SessionMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*SessionMutation) Disabled

func (m *SessionMutation) Disabled() (r bool, exists bool)

Disabled returns the value of the "disabled" field in the mutation.

func (*SessionMutation) EdgeCleared

func (m *SessionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SessionMutation) Field

func (m *SessionMutation) 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 (*SessionMutation) FieldCleared

func (m *SessionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SessionMutation) Fields

func (m *SessionMutation) 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 (*SessionMutation) GetType

func (m *SessionMutation) GetType() (r session.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*SessionMutation) ID

func (m *SessionMutation) ID() (id uint64, 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 (*SessionMutation) IDs

func (m *SessionMutation) IDs(ctx context.Context) ([]uint64, 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 (*SessionMutation) Ips

func (m *SessionMutation) Ips() (r string, exists bool)

Ips returns the value of the "ips" field in the mutation.

func (*SessionMutation) OldCreatedAt

func (m *SessionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Session entity. If the Session 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 (*SessionMutation) OldCreatedBy

func (m *SessionMutation) OldCreatedBy(ctx context.Context) (v int, err error)

OldCreatedBy returns the old "created_by" field's value of the Session entity. If the Session 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 (*SessionMutation) OldDisabled

func (m *SessionMutation) OldDisabled(ctx context.Context) (v bool, err error)

OldDisabled returns the old "disabled" field's value of the Session entity. If the Session 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 (*SessionMutation) OldField

func (m *SessionMutation) 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 (*SessionMutation) OldIps

func (m *SessionMutation) OldIps(ctx context.Context) (v string, err error)

OldIps returns the old "ips" field's value of the Session entity. If the Session 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 (*SessionMutation) OldToken

func (m *SessionMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Session entity. If the Session 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 (*SessionMutation) OldType

func (m *SessionMutation) OldType(ctx context.Context) (v session.Type, err error)

OldType returns the old "type" field's value of the Session entity. If the Session 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 (*SessionMutation) OldUpdatedAt

func (m *SessionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Session entity. If the Session 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 (*SessionMutation) OldUpdatedBy

func (m *SessionMutation) OldUpdatedBy(ctx context.Context) (v int, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Session entity. If the Session 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 (*SessionMutation) OldUserAgent

func (m *SessionMutation) OldUserAgent(ctx context.Context) (v string, err error)

OldUserAgent returns the old "user_agent" field's value of the Session entity. If the Session 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 (*SessionMutation) Op

func (m *SessionMutation) Op() Op

Op returns the operation name.

func (*SessionMutation) RemovedEdges

func (m *SessionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SessionMutation) RemovedIDs

func (m *SessionMutation) 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 (*SessionMutation) ResetAccounts

func (m *SessionMutation) ResetAccounts()

ResetAccounts resets all changes to the "accounts" edge.

func (*SessionMutation) ResetCreatedAt

func (m *SessionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SessionMutation) ResetCreatedBy

func (m *SessionMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*SessionMutation) ResetDisabled

func (m *SessionMutation) ResetDisabled()

ResetDisabled resets all changes to the "disabled" field.

func (*SessionMutation) ResetEdge

func (m *SessionMutation) 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 (*SessionMutation) ResetField

func (m *SessionMutation) 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 (*SessionMutation) ResetIps

func (m *SessionMutation) ResetIps()

ResetIps resets all changes to the "ips" field.

func (*SessionMutation) ResetToken

func (m *SessionMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*SessionMutation) ResetType

func (m *SessionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*SessionMutation) ResetUpdatedAt

func (m *SessionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SessionMutation) ResetUpdatedBy

func (m *SessionMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*SessionMutation) ResetUserAgent

func (m *SessionMutation) ResetUserAgent()

ResetUserAgent resets all changes to the "user_agent" field.

func (*SessionMutation) SetAccountsID

func (m *SessionMutation) SetAccountsID(id uint64)

SetAccountsID sets the "accounts" edge to the Actor entity by id.

func (*SessionMutation) SetCreatedAt

func (m *SessionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SessionMutation) SetCreatedBy

func (m *SessionMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*SessionMutation) SetDisabled

func (m *SessionMutation) SetDisabled(b bool)

SetDisabled sets the "disabled" field.

func (*SessionMutation) SetField

func (m *SessionMutation) 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 (*SessionMutation) SetID

func (m *SessionMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Session entities.

func (*SessionMutation) SetIps

func (m *SessionMutation) SetIps(s string)

SetIps sets the "ips" field.

func (*SessionMutation) SetToken

func (m *SessionMutation) SetToken(s string)

SetToken sets the "token" field.

func (*SessionMutation) SetType

func (m *SessionMutation) SetType(s session.Type)

SetType sets the "type" field.

func (*SessionMutation) SetUpdatedAt

func (m *SessionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SessionMutation) SetUpdatedBy

func (m *SessionMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

func (*SessionMutation) SetUserAgent

func (m *SessionMutation) SetUserAgent(s string)

SetUserAgent sets the "user_agent" field.

func (*SessionMutation) Token

func (m *SessionMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (SessionMutation) Tx

func (m SessionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SessionMutation) Type

func (m *SessionMutation) Type() string

Type returns the node type of this mutation (Session).

func (*SessionMutation) UpdatedAt

func (m *SessionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SessionMutation) UpdatedBy

func (m *SessionMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*SessionMutation) UpdatedByCleared

func (m *SessionMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*SessionMutation) UserAgent

func (m *SessionMutation) UserAgent() (r string, exists bool)

UserAgent returns the value of the "user_agent" field in the mutation.

func (*SessionMutation) UserAgentCleared

func (m *SessionMutation) UserAgentCleared() bool

UserAgentCleared returns if the "user_agent" field was cleared in this mutation.

func (*SessionMutation) Where

func (m *SessionMutation) Where(ps ...predicate.Session)

Where appends a list predicates to the SessionMutation builder.

type SessionQuery

type SessionQuery struct {
	// contains filtered or unexported fields
}

SessionQuery is the builder for querying Session entities.

func (*SessionQuery) All

func (sq *SessionQuery) All(ctx context.Context) ([]*Session, error)

All executes the query and returns a list of Sessions.

func (*SessionQuery) AllX

func (sq *SessionQuery) AllX(ctx context.Context) []*Session

AllX is like All, but panics if an error occurs.

func (*SessionQuery) Clone

func (sq *SessionQuery) Clone() *SessionQuery

Clone returns a duplicate of the SessionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SessionQuery) Count

func (sq *SessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SessionQuery) CountX

func (sq *SessionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SessionQuery) Exist

func (sq *SessionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SessionQuery) ExistX

func (sq *SessionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SessionQuery) First

func (sq *SessionQuery) First(ctx context.Context) (*Session, error)

First returns the first Session entity from the query. Returns a *NotFoundError when no Session was found.

func (*SessionQuery) FirstID

func (sq *SessionQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Session ID from the query. Returns a *NotFoundError when no Session ID was found.

func (*SessionQuery) FirstIDX

func (sq *SessionQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*SessionQuery) FirstX

func (sq *SessionQuery) FirstX(ctx context.Context) *Session

FirstX is like First, but panics if an error occurs.

func (*SessionQuery) ForShare

func (sq *SessionQuery) ForShare(opts ...sql.LockOption) *SessionQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*SessionQuery) ForUpdate

func (sq *SessionQuery) ForUpdate(opts ...sql.LockOption) *SessionQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*SessionQuery) GroupBy

func (sq *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Session.Query().
	GroupBy(session.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SessionQuery) IDs

func (sq *SessionQuery) IDs(ctx context.Context) ([]uint64, error)

IDs executes the query and returns a list of Session IDs.

func (*SessionQuery) IDsX

func (sq *SessionQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*SessionQuery) Limit

func (sq *SessionQuery) Limit(limit int) *SessionQuery

Limit adds a limit step to the query.

func (*SessionQuery) Offset

func (sq *SessionQuery) Offset(offset int) *SessionQuery

Offset adds an offset step to the query.

func (*SessionQuery) Only

func (sq *SessionQuery) Only(ctx context.Context) (*Session, error)

Only returns a single Session entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Session entity is found. Returns a *NotFoundError when no Session entities are found.

func (*SessionQuery) OnlyID

func (sq *SessionQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Session ID in the query. Returns a *NotSingularError when more than one Session ID is found. Returns a *NotFoundError when no entities are found.

func (*SessionQuery) OnlyIDX

func (sq *SessionQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SessionQuery) OnlyX

func (sq *SessionQuery) OnlyX(ctx context.Context) *Session

OnlyX is like Only, but panics if an error occurs.

func (*SessionQuery) Order

func (sq *SessionQuery) Order(o ...OrderFunc) *SessionQuery

Order adds an order step to the query.

func (*SessionQuery) QueryAccounts

func (sq *SessionQuery) QueryAccounts() *ActorQuery

QueryAccounts chains the current query on the "accounts" edge.

func (*SessionQuery) Select

func (sq *SessionQuery) Select(fields ...string) *SessionSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Session.Query().
	Select(session.FieldCreatedAt).
	Scan(ctx, &v)

func (*SessionQuery) Unique

func (sq *SessionQuery) Unique(unique bool) *SessionQuery

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 (*SessionQuery) Where

func (sq *SessionQuery) Where(ps ...predicate.Session) *SessionQuery

Where adds a new predicate for the SessionQuery builder.

func (*SessionQuery) WithAccounts

func (sq *SessionQuery) WithAccounts(opts ...func(*ActorQuery)) *SessionQuery

WithAccounts tells the query-builder to eager-load the nodes that are connected to the "accounts" edge. The optional arguments are used to configure the query builder of the edge.

type SessionSelect

type SessionSelect struct {
	*SessionQuery
	// contains filtered or unexported fields
}

SessionSelect is the builder for selecting fields of Session entities.

func (*SessionSelect) Bool

func (s *SessionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolX

func (s *SessionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SessionSelect) Bools

func (s *SessionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SessionSelect) BoolsX

func (s *SessionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SessionSelect) Float64

func (s *SessionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64X

func (s *SessionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SessionSelect) Float64s

func (s *SessionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SessionSelect) Float64sX

func (s *SessionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SessionSelect) Int

func (s *SessionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntX

func (s *SessionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SessionSelect) Ints

func (s *SessionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SessionSelect) IntsX

func (s *SessionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SessionSelect) Scan

func (ss *SessionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*SessionSelect) ScanX

func (s *SessionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SessionSelect) String

func (s *SessionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringX

func (s *SessionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SessionSelect) Strings

func (s *SessionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SessionSelect) StringsX

func (s *SessionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SessionUpdate

type SessionUpdate struct {
	// contains filtered or unexported fields
}

SessionUpdate is the builder for updating Session entities.

func (*SessionUpdate) AddCreatedBy

func (su *SessionUpdate) AddCreatedBy(i int) *SessionUpdate

AddCreatedBy adds i to the "created_by" field.

func (*SessionUpdate) AddUpdatedBy

func (su *SessionUpdate) AddUpdatedBy(i int) *SessionUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*SessionUpdate) ClearAccounts

func (su *SessionUpdate) ClearAccounts() *SessionUpdate

ClearAccounts clears the "accounts" edge to the Actor entity.

func (*SessionUpdate) ClearCreatedBy

func (su *SessionUpdate) ClearCreatedBy() *SessionUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*SessionUpdate) ClearUpdatedBy

func (su *SessionUpdate) ClearUpdatedBy() *SessionUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*SessionUpdate) ClearUserAgent

func (su *SessionUpdate) ClearUserAgent() *SessionUpdate

ClearUserAgent clears the value of the "user_agent" field.

func (*SessionUpdate) Exec

func (su *SessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpdate) ExecX

func (su *SessionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdate) Mutation

func (su *SessionUpdate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdate) Save

func (su *SessionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SessionUpdate) SaveX

func (su *SessionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdate) SetAccounts

func (su *SessionUpdate) SetAccounts(a *Actor) *SessionUpdate

SetAccounts sets the "accounts" edge to the Actor entity.

func (*SessionUpdate) SetAccountsID

func (su *SessionUpdate) SetAccountsID(id uint64) *SessionUpdate

SetAccountsID sets the "accounts" edge to the Actor entity by ID.

func (*SessionUpdate) SetCreatedBy

func (su *SessionUpdate) SetCreatedBy(i int) *SessionUpdate

SetCreatedBy sets the "created_by" field.

func (*SessionUpdate) SetDisabled

func (su *SessionUpdate) SetDisabled(b bool) *SessionUpdate

SetDisabled sets the "disabled" field.

func (*SessionUpdate) SetIps

func (su *SessionUpdate) SetIps(s string) *SessionUpdate

SetIps sets the "ips" field.

func (*SessionUpdate) SetNillableAccountsID

func (su *SessionUpdate) SetNillableAccountsID(id *uint64) *SessionUpdate

SetNillableAccountsID sets the "accounts" edge to the Actor entity by ID if the given value is not nil.

func (*SessionUpdate) SetNillableCreatedBy

func (su *SessionUpdate) SetNillableCreatedBy(i *int) *SessionUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SessionUpdate) SetNillableUpdatedBy

func (su *SessionUpdate) SetNillableUpdatedBy(i *int) *SessionUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*SessionUpdate) SetNillableUserAgent

func (su *SessionUpdate) SetNillableUserAgent(s *string) *SessionUpdate

SetNillableUserAgent sets the "user_agent" field if the given value is not nil.

func (*SessionUpdate) SetUpdatedAt

func (su *SessionUpdate) SetUpdatedAt(t time.Time) *SessionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SessionUpdate) SetUpdatedBy

func (su *SessionUpdate) SetUpdatedBy(i int) *SessionUpdate

SetUpdatedBy sets the "updated_by" field.

func (*SessionUpdate) SetUserAgent

func (su *SessionUpdate) SetUserAgent(s string) *SessionUpdate

SetUserAgent sets the "user_agent" field.

func (*SessionUpdate) Where

func (su *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate

Where appends a list predicates to the SessionUpdate builder.

type SessionUpdateOne

type SessionUpdateOne struct {
	// contains filtered or unexported fields
}

SessionUpdateOne is the builder for updating a single Session entity.

func (*SessionUpdateOne) AddCreatedBy

func (suo *SessionUpdateOne) AddCreatedBy(i int) *SessionUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*SessionUpdateOne) AddUpdatedBy

func (suo *SessionUpdateOne) AddUpdatedBy(i int) *SessionUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*SessionUpdateOne) ClearAccounts

func (suo *SessionUpdateOne) ClearAccounts() *SessionUpdateOne

ClearAccounts clears the "accounts" edge to the Actor entity.

func (*SessionUpdateOne) ClearCreatedBy

func (suo *SessionUpdateOne) ClearCreatedBy() *SessionUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*SessionUpdateOne) ClearUpdatedBy

func (suo *SessionUpdateOne) ClearUpdatedBy() *SessionUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*SessionUpdateOne) ClearUserAgent

func (suo *SessionUpdateOne) ClearUserAgent() *SessionUpdateOne

ClearUserAgent clears the value of the "user_agent" field.

func (*SessionUpdateOne) Exec

func (suo *SessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SessionUpdateOne) ExecX

func (suo *SessionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SessionUpdateOne) Mutation

func (suo *SessionUpdateOne) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdateOne) Save

func (suo *SessionUpdateOne) Save(ctx context.Context) (*Session, error)

Save executes the query and returns the updated Session entity.

func (*SessionUpdateOne) SaveX

func (suo *SessionUpdateOne) SaveX(ctx context.Context) *Session

SaveX is like Save, but panics if an error occurs.

func (*SessionUpdateOne) Select

func (suo *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SessionUpdateOne) SetAccounts

func (suo *SessionUpdateOne) SetAccounts(a *Actor) *SessionUpdateOne

SetAccounts sets the "accounts" edge to the Actor entity.

func (*SessionUpdateOne) SetAccountsID

func (suo *SessionUpdateOne) SetAccountsID(id uint64) *SessionUpdateOne

SetAccountsID sets the "accounts" edge to the Actor entity by ID.

func (*SessionUpdateOne) SetCreatedBy

func (suo *SessionUpdateOne) SetCreatedBy(i int) *SessionUpdateOne

SetCreatedBy sets the "created_by" field.

func (*SessionUpdateOne) SetDisabled

func (suo *SessionUpdateOne) SetDisabled(b bool) *SessionUpdateOne

SetDisabled sets the "disabled" field.

func (*SessionUpdateOne) SetIps

func (suo *SessionUpdateOne) SetIps(s string) *SessionUpdateOne

SetIps sets the "ips" field.

func (*SessionUpdateOne) SetNillableAccountsID

func (suo *SessionUpdateOne) SetNillableAccountsID(id *uint64) *SessionUpdateOne

SetNillableAccountsID sets the "accounts" edge to the Actor entity by ID if the given value is not nil.

func (*SessionUpdateOne) SetNillableCreatedBy

func (suo *SessionUpdateOne) SetNillableCreatedBy(i *int) *SessionUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableUpdatedBy

func (suo *SessionUpdateOne) SetNillableUpdatedBy(i *int) *SessionUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableUserAgent

func (suo *SessionUpdateOne) SetNillableUserAgent(s *string) *SessionUpdateOne

SetNillableUserAgent sets the "user_agent" field if the given value is not nil.

func (*SessionUpdateOne) SetUpdatedAt

func (suo *SessionUpdateOne) SetUpdatedAt(t time.Time) *SessionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SessionUpdateOne) SetUpdatedBy

func (suo *SessionUpdateOne) SetUpdatedBy(i int) *SessionUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*SessionUpdateOne) SetUserAgent

func (suo *SessionUpdateOne) SetUserAgent(s string) *SessionUpdateOne

SetUserAgent sets the "user_agent" field.

type Sessions

type Sessions []*Session

Sessions is a parsable slice of Session.

type Status

type Status struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int `json:"created_by,omitempty"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int `json:"updated_by,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the StatusQuery when eager-loading is set.
	Edges StatusEdges `json:"edges"`
	// contains filtered or unexported fields
}

Status is the model entity for the Status schema.

func (*Status) QueryActors

func (s *Status) QueryActors() *ActorQuery

QueryActors queries the "actors" edge of the Status entity.

func (*Status) QueryReactedActors

func (s *Status) QueryReactedActors() *ActorQuery

QueryReactedActors queries the "reacted_actors" edge of the Status entity.

func (*Status) QueryReactions

func (s *Status) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the Status entity.

func (*Status) String

func (s *Status) String() string

String implements the fmt.Stringer.

func (*Status) Unwrap

func (s *Status) Unwrap() *Status

Unwrap unwraps the Status 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 (*Status) Update

func (s *Status) Update() *StatusUpdateOne

Update returns a builder for updating this Status. Note that you need to call Status.Unwrap() before calling this method if this Status was returned from a transaction, and the transaction was committed or rolled back.

type StatusClient

type StatusClient struct {
	// contains filtered or unexported fields
}

StatusClient is a client for the Status schema.

func NewStatusClient

func NewStatusClient(c config) *StatusClient

NewStatusClient returns a client for the Status from the given config.

func (*StatusClient) Create

func (c *StatusClient) Create() *StatusCreate

Create returns a builder for creating a Status entity.

func (*StatusClient) CreateBulk

func (c *StatusClient) CreateBulk(builders ...*StatusCreate) *StatusCreateBulk

CreateBulk returns a builder for creating a bulk of Status entities.

func (*StatusClient) Delete

func (c *StatusClient) Delete() *StatusDelete

Delete returns a delete builder for Status.

func (*StatusClient) DeleteOne

func (c *StatusClient) DeleteOne(s *Status) *StatusDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StatusClient) DeleteOneID

func (c *StatusClient) DeleteOneID(id uint64) *StatusDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*StatusClient) Get

func (c *StatusClient) Get(ctx context.Context, id uint64) (*Status, error)

Get returns a Status entity by its id.

func (*StatusClient) GetX

func (c *StatusClient) GetX(ctx context.Context, id uint64) *Status

GetX is like Get, but panics if an error occurs.

func (*StatusClient) Hooks

func (c *StatusClient) Hooks() []Hook

Hooks returns the client hooks.

func (*StatusClient) Query

func (c *StatusClient) Query() *StatusQuery

Query returns a query builder for Status.

func (*StatusClient) QueryActors

func (c *StatusClient) QueryActors(s *Status) *ActorQuery

QueryActors queries the actors edge of a Status.

func (*StatusClient) QueryReactedActors

func (c *StatusClient) QueryReactedActors(s *Status) *ActorQuery

QueryReactedActors queries the reacted_actors edge of a Status.

func (*StatusClient) QueryReactions

func (c *StatusClient) QueryReactions(s *Status) *ReactionQuery

QueryReactions queries the reactions edge of a Status.

func (*StatusClient) Update

func (c *StatusClient) Update() *StatusUpdate

Update returns an update builder for Status.

func (*StatusClient) UpdateOne

func (c *StatusClient) UpdateOne(s *Status) *StatusUpdateOne

UpdateOne returns an update builder for the given entity.

func (*StatusClient) UpdateOneID

func (c *StatusClient) UpdateOneID(id uint64) *StatusUpdateOne

UpdateOneID returns an update builder for the given id.

func (*StatusClient) Use

func (c *StatusClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `status.Hooks(f(g(h())))`.

type StatusCreate

type StatusCreate struct {
	// contains filtered or unexported fields
}

StatusCreate is the builder for creating a Status entity.

func (*StatusCreate) AddReactedActorIDs

func (sc *StatusCreate) AddReactedActorIDs(ids ...uint64) *StatusCreate

AddReactedActorIDs adds the "reacted_actors" edge to the Actor entity by IDs.

func (*StatusCreate) AddReactedActors

func (sc *StatusCreate) AddReactedActors(a ...*Actor) *StatusCreate

AddReactedActors adds the "reacted_actors" edges to the Actor entity.

func (*StatusCreate) Exec

func (sc *StatusCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusCreate) ExecX

func (sc *StatusCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusCreate) Mutation

func (sc *StatusCreate) Mutation() *StatusMutation

Mutation returns the StatusMutation object of the builder.

func (*StatusCreate) Save

func (sc *StatusCreate) Save(ctx context.Context) (*Status, error)

Save creates the Status in the database.

func (*StatusCreate) SaveX

func (sc *StatusCreate) SaveX(ctx context.Context) *Status

SaveX calls Save and panics if Save returns an error.

func (*StatusCreate) SetActors

func (sc *StatusCreate) SetActors(a *Actor) *StatusCreate

SetActors sets the "actors" edge to the Actor entity.

func (*StatusCreate) SetActorsID

func (sc *StatusCreate) SetActorsID(id uint64) *StatusCreate

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*StatusCreate) SetCreatedAt

func (sc *StatusCreate) SetCreatedAt(t time.Time) *StatusCreate

SetCreatedAt sets the "created_at" field.

func (*StatusCreate) SetCreatedBy

func (sc *StatusCreate) SetCreatedBy(i int) *StatusCreate

SetCreatedBy sets the "created_by" field.

func (*StatusCreate) SetID

func (sc *StatusCreate) SetID(u uint64) *StatusCreate

SetID sets the "id" field.

func (*StatusCreate) SetNillableCreatedAt

func (sc *StatusCreate) SetNillableCreatedAt(t *time.Time) *StatusCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*StatusCreate) SetNillableCreatedBy

func (sc *StatusCreate) SetNillableCreatedBy(i *int) *StatusCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*StatusCreate) SetNillableUpdatedAt

func (sc *StatusCreate) SetNillableUpdatedAt(t *time.Time) *StatusCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*StatusCreate) SetNillableUpdatedBy

func (sc *StatusCreate) SetNillableUpdatedBy(i *int) *StatusCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*StatusCreate) SetUpdatedAt

func (sc *StatusCreate) SetUpdatedAt(t time.Time) *StatusCreate

SetUpdatedAt sets the "updated_at" field.

func (*StatusCreate) SetUpdatedBy

func (sc *StatusCreate) SetUpdatedBy(i int) *StatusCreate

SetUpdatedBy sets the "updated_by" field.

type StatusCreateBulk

type StatusCreateBulk struct {
	// contains filtered or unexported fields
}

StatusCreateBulk is the builder for creating many Status entities in bulk.

func (*StatusCreateBulk) Exec

func (scb *StatusCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusCreateBulk) ExecX

func (scb *StatusCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusCreateBulk) Save

func (scb *StatusCreateBulk) Save(ctx context.Context) ([]*Status, error)

Save creates the Status entities in the database.

func (*StatusCreateBulk) SaveX

func (scb *StatusCreateBulk) SaveX(ctx context.Context) []*Status

SaveX is like Save, but panics if an error occurs.

type StatusDelete

type StatusDelete struct {
	// contains filtered or unexported fields
}

StatusDelete is the builder for deleting a Status entity.

func (*StatusDelete) Exec

func (sd *StatusDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StatusDelete) ExecX

func (sd *StatusDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StatusDelete) Where

func (sd *StatusDelete) Where(ps ...predicate.Status) *StatusDelete

Where appends a list predicates to the StatusDelete builder.

type StatusDeleteOne

type StatusDeleteOne struct {
	// contains filtered or unexported fields
}

StatusDeleteOne is the builder for deleting a single Status entity.

func (*StatusDeleteOne) Exec

func (sdo *StatusDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StatusDeleteOne) ExecX

func (sdo *StatusDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type StatusEdges

type StatusEdges struct {
	// Statuses belong to an Account
	Actors *Actor `json:"actors,omitempty"`
	// ReactedActors holds the value of the reacted_actors edge.
	ReactedActors []*Actor `json:"reacted_actors,omitempty"`
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// contains filtered or unexported fields
}

StatusEdges holds the relations/edges for other nodes in the graph.

func (StatusEdges) ActorsOrErr

func (e StatusEdges) ActorsOrErr() (*Actor, error)

ActorsOrErr returns the Actors value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StatusEdges) ReactedActorsOrErr

func (e StatusEdges) ReactedActorsOrErr() ([]*Actor, error)

ReactedActorsOrErr returns the ReactedActors value or an error if the edge was not loaded in eager-loading.

func (StatusEdges) ReactionsOrErr

func (e StatusEdges) ReactionsOrErr() ([]*Reaction, error)

ReactionsOrErr returns the Reactions value or an error if the edge was not loaded in eager-loading.

type StatusGroupBy

type StatusGroupBy struct {
	// contains filtered or unexported fields
}

StatusGroupBy is the group-by builder for Status entities.

func (*StatusGroupBy) Aggregate

func (sgb *StatusGroupBy) Aggregate(fns ...AggregateFunc) *StatusGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*StatusGroupBy) Bool

func (s *StatusGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) BoolX

func (s *StatusGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StatusGroupBy) Bools

func (s *StatusGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) BoolsX

func (s *StatusGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StatusGroupBy) Float64

func (s *StatusGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) Float64X

func (s *StatusGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StatusGroupBy) Float64s

func (s *StatusGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) Float64sX

func (s *StatusGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StatusGroupBy) Int

func (s *StatusGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) IntX

func (s *StatusGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StatusGroupBy) Ints

func (s *StatusGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) IntsX

func (s *StatusGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StatusGroupBy) Scan

func (sgb *StatusGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*StatusGroupBy) ScanX

func (s *StatusGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*StatusGroupBy) String

func (s *StatusGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) StringX

func (s *StatusGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StatusGroupBy) Strings

func (s *StatusGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StatusGroupBy) StringsX

func (s *StatusGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StatusMutation

type StatusMutation struct {
	// contains filtered or unexported fields
}

StatusMutation represents an operation that mutates the Status nodes in the graph.

func (*StatusMutation) ActorsCleared

func (m *StatusMutation) ActorsCleared() bool

ActorsCleared reports if the "actors" edge to the Actor entity was cleared.

func (*StatusMutation) ActorsID

func (m *StatusMutation) ActorsID() (id uint64, exists bool)

ActorsID returns the "actors" edge ID in the mutation.

func (*StatusMutation) ActorsIDs

func (m *StatusMutation) ActorsIDs() (ids []uint64)

ActorsIDs returns the "actors" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ActorsID instead. It exists only for internal usage by the builders.

func (*StatusMutation) AddCreatedBy

func (m *StatusMutation) AddCreatedBy(i int)

AddCreatedBy adds i to the "created_by" field.

func (*StatusMutation) AddField

func (m *StatusMutation) 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 (*StatusMutation) AddReactedActorIDs

func (m *StatusMutation) AddReactedActorIDs(ids ...uint64)

AddReactedActorIDs adds the "reacted_actors" edge to the Actor entity by ids.

func (*StatusMutation) AddUpdatedBy

func (m *StatusMutation) AddUpdatedBy(i int)

AddUpdatedBy adds i to the "updated_by" field.

func (*StatusMutation) AddedCreatedBy

func (m *StatusMutation) AddedCreatedBy() (r int, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*StatusMutation) AddedEdges

func (m *StatusMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StatusMutation) AddedField

func (m *StatusMutation) 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 (*StatusMutation) AddedFields

func (m *StatusMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StatusMutation) AddedIDs

func (m *StatusMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StatusMutation) AddedUpdatedBy

func (m *StatusMutation) AddedUpdatedBy() (r int, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*StatusMutation) ClearActors

func (m *StatusMutation) ClearActors()

ClearActors clears the "actors" edge to the Actor entity.

func (*StatusMutation) ClearCreatedBy

func (m *StatusMutation) ClearCreatedBy()

ClearCreatedBy clears the value of the "created_by" field.

func (*StatusMutation) ClearEdge

func (m *StatusMutation) 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 (*StatusMutation) ClearField

func (m *StatusMutation) 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 (*StatusMutation) ClearReactedActors

func (m *StatusMutation) ClearReactedActors()

ClearReactedActors clears the "reacted_actors" edge to the Actor entity.

func (*StatusMutation) ClearUpdatedBy

func (m *StatusMutation) ClearUpdatedBy()

ClearUpdatedBy clears the value of the "updated_by" field.

func (*StatusMutation) ClearedEdges

func (m *StatusMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StatusMutation) ClearedFields

func (m *StatusMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StatusMutation) Client

func (m StatusMutation) 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 (*StatusMutation) CreatedAt

func (m *StatusMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*StatusMutation) CreatedBy

func (m *StatusMutation) CreatedBy() (r int, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*StatusMutation) CreatedByCleared

func (m *StatusMutation) CreatedByCleared() bool

CreatedByCleared returns if the "created_by" field was cleared in this mutation.

func (*StatusMutation) EdgeCleared

func (m *StatusMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StatusMutation) Field

func (m *StatusMutation) 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 (*StatusMutation) FieldCleared

func (m *StatusMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StatusMutation) Fields

func (m *StatusMutation) 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 (*StatusMutation) ID

func (m *StatusMutation) ID() (id uint64, 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 (*StatusMutation) IDs

func (m *StatusMutation) IDs(ctx context.Context) ([]uint64, 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 (*StatusMutation) OldCreatedAt

func (m *StatusMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Status entity. If the Status 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 (*StatusMutation) OldCreatedBy

func (m *StatusMutation) OldCreatedBy(ctx context.Context) (v int, err error)

OldCreatedBy returns the old "created_by" field's value of the Status entity. If the Status 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 (*StatusMutation) OldField

func (m *StatusMutation) 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 (*StatusMutation) OldUpdatedAt

func (m *StatusMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Status entity. If the Status 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 (*StatusMutation) OldUpdatedBy

func (m *StatusMutation) OldUpdatedBy(ctx context.Context) (v int, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Status entity. If the Status 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 (*StatusMutation) Op

func (m *StatusMutation) Op() Op

Op returns the operation name.

func (*StatusMutation) ReactedActorsCleared

func (m *StatusMutation) ReactedActorsCleared() bool

ReactedActorsCleared reports if the "reacted_actors" edge to the Actor entity was cleared.

func (*StatusMutation) ReactedActorsIDs

func (m *StatusMutation) ReactedActorsIDs() (ids []uint64)

ReactedActorsIDs returns the "reacted_actors" edge IDs in the mutation.

func (*StatusMutation) RemoveReactedActorIDs

func (m *StatusMutation) RemoveReactedActorIDs(ids ...uint64)

RemoveReactedActorIDs removes the "reacted_actors" edge to the Actor entity by IDs.

func (*StatusMutation) RemovedEdges

func (m *StatusMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StatusMutation) RemovedIDs

func (m *StatusMutation) 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 (*StatusMutation) RemovedReactedActorsIDs

func (m *StatusMutation) RemovedReactedActorsIDs() (ids []uint64)

RemovedReactedActors returns the removed IDs of the "reacted_actors" edge to the Actor entity.

func (*StatusMutation) ResetActors

func (m *StatusMutation) ResetActors()

ResetActors resets all changes to the "actors" edge.

func (*StatusMutation) ResetCreatedAt

func (m *StatusMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*StatusMutation) ResetCreatedBy

func (m *StatusMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*StatusMutation) ResetEdge

func (m *StatusMutation) 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 (*StatusMutation) ResetField

func (m *StatusMutation) 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 (*StatusMutation) ResetReactedActors

func (m *StatusMutation) ResetReactedActors()

ResetReactedActors resets all changes to the "reacted_actors" edge.

func (*StatusMutation) ResetUpdatedAt

func (m *StatusMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*StatusMutation) ResetUpdatedBy

func (m *StatusMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*StatusMutation) SetActorsID

func (m *StatusMutation) SetActorsID(id uint64)

SetActorsID sets the "actors" edge to the Actor entity by id.

func (*StatusMutation) SetCreatedAt

func (m *StatusMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*StatusMutation) SetCreatedBy

func (m *StatusMutation) SetCreatedBy(i int)

SetCreatedBy sets the "created_by" field.

func (*StatusMutation) SetField

func (m *StatusMutation) 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 (*StatusMutation) SetID

func (m *StatusMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Status entities.

func (*StatusMutation) SetUpdatedAt

func (m *StatusMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*StatusMutation) SetUpdatedBy

func (m *StatusMutation) SetUpdatedBy(i int)

SetUpdatedBy sets the "updated_by" field.

func (StatusMutation) Tx

func (m StatusMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StatusMutation) Type

func (m *StatusMutation) Type() string

Type returns the node type of this mutation (Status).

func (*StatusMutation) UpdatedAt

func (m *StatusMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*StatusMutation) UpdatedBy

func (m *StatusMutation) UpdatedBy() (r int, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*StatusMutation) UpdatedByCleared

func (m *StatusMutation) UpdatedByCleared() bool

UpdatedByCleared returns if the "updated_by" field was cleared in this mutation.

func (*StatusMutation) Where

func (m *StatusMutation) Where(ps ...predicate.Status)

Where appends a list predicates to the StatusMutation builder.

type StatusQuery

type StatusQuery struct {
	// contains filtered or unexported fields
}

StatusQuery is the builder for querying Status entities.

func (*StatusQuery) All

func (sq *StatusQuery) All(ctx context.Context) ([]*Status, error)

All executes the query and returns a list of StatusSlice.

func (*StatusQuery) AllX

func (sq *StatusQuery) AllX(ctx context.Context) []*Status

AllX is like All, but panics if an error occurs.

func (*StatusQuery) Clone

func (sq *StatusQuery) Clone() *StatusQuery

Clone returns a duplicate of the StatusQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StatusQuery) Count

func (sq *StatusQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StatusQuery) CountX

func (sq *StatusQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StatusQuery) Exist

func (sq *StatusQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StatusQuery) ExistX

func (sq *StatusQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StatusQuery) First

func (sq *StatusQuery) First(ctx context.Context) (*Status, error)

First returns the first Status entity from the query. Returns a *NotFoundError when no Status was found.

func (*StatusQuery) FirstID

func (sq *StatusQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Status ID from the query. Returns a *NotFoundError when no Status ID was found.

func (*StatusQuery) FirstIDX

func (sq *StatusQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*StatusQuery) FirstX

func (sq *StatusQuery) FirstX(ctx context.Context) *Status

FirstX is like First, but panics if an error occurs.

func (*StatusQuery) ForShare

func (sq *StatusQuery) ForShare(opts ...sql.LockOption) *StatusQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*StatusQuery) ForUpdate

func (sq *StatusQuery) ForUpdate(opts ...sql.LockOption) *StatusQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*StatusQuery) GroupBy

func (sq *StatusQuery) GroupBy(field string, fields ...string) *StatusGroupBy

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Status.Query().
	GroupBy(status.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StatusQuery) IDs

func (sq *StatusQuery) IDs(ctx context.Context) ([]uint64, error)

IDs executes the query and returns a list of Status IDs.

func (*StatusQuery) IDsX

func (sq *StatusQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*StatusQuery) Limit

func (sq *StatusQuery) Limit(limit int) *StatusQuery

Limit adds a limit step to the query.

func (*StatusQuery) Offset

func (sq *StatusQuery) Offset(offset int) *StatusQuery

Offset adds an offset step to the query.

func (*StatusQuery) Only

func (sq *StatusQuery) Only(ctx context.Context) (*Status, error)

Only returns a single Status entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Status entity is found. Returns a *NotFoundError when no Status entities are found.

func (*StatusQuery) OnlyID

func (sq *StatusQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Status ID in the query. Returns a *NotSingularError when more than one Status ID is found. Returns a *NotFoundError when no entities are found.

func (*StatusQuery) OnlyIDX

func (sq *StatusQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StatusQuery) OnlyX

func (sq *StatusQuery) OnlyX(ctx context.Context) *Status

OnlyX is like Only, but panics if an error occurs.

func (*StatusQuery) Order

func (sq *StatusQuery) Order(o ...OrderFunc) *StatusQuery

Order adds an order step to the query.

func (*StatusQuery) QueryActors

func (sq *StatusQuery) QueryActors() *ActorQuery

QueryActors chains the current query on the "actors" edge.

func (*StatusQuery) QueryReactedActors

func (sq *StatusQuery) QueryReactedActors() *ActorQuery

QueryReactedActors chains the current query on the "reacted_actors" edge.

func (*StatusQuery) QueryReactions

func (sq *StatusQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*StatusQuery) Select

func (sq *StatusQuery) Select(fields ...string) *StatusSelect

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Status.Query().
	Select(status.FieldCreatedAt).
	Scan(ctx, &v)

func (*StatusQuery) Unique

func (sq *StatusQuery) Unique(unique bool) *StatusQuery

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 (*StatusQuery) Where

func (sq *StatusQuery) Where(ps ...predicate.Status) *StatusQuery

Where adds a new predicate for the StatusQuery builder.

func (*StatusQuery) WithActors

func (sq *StatusQuery) WithActors(opts ...func(*ActorQuery)) *StatusQuery

WithActors tells the query-builder to eager-load the nodes that are connected to the "actors" edge. The optional arguments are used to configure the query builder of the edge.

func (*StatusQuery) WithReactedActors

func (sq *StatusQuery) WithReactedActors(opts ...func(*ActorQuery)) *StatusQuery

WithReactedActors tells the query-builder to eager-load the nodes that are connected to the "reacted_actors" edge. The optional arguments are used to configure the query builder of the edge.

func (*StatusQuery) WithReactions

func (sq *StatusQuery) WithReactions(opts ...func(*ReactionQuery)) *StatusQuery

WithReactions tells the query-builder to eager-load the nodes that are connected to the "reactions" edge. The optional arguments are used to configure the query builder of the edge.

type StatusSelect

type StatusSelect struct {
	*StatusQuery
	// contains filtered or unexported fields
}

StatusSelect is the builder for selecting fields of Status entities.

func (*StatusSelect) Bool

func (s *StatusSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StatusSelect) BoolX

func (s *StatusSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StatusSelect) Bools

func (s *StatusSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StatusSelect) BoolsX

func (s *StatusSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StatusSelect) Float64

func (s *StatusSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StatusSelect) Float64X

func (s *StatusSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StatusSelect) Float64s

func (s *StatusSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StatusSelect) Float64sX

func (s *StatusSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StatusSelect) Int

func (s *StatusSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StatusSelect) IntX

func (s *StatusSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StatusSelect) Ints

func (s *StatusSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StatusSelect) IntsX

func (s *StatusSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StatusSelect) Scan

func (ss *StatusSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*StatusSelect) ScanX

func (s *StatusSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*StatusSelect) String

func (s *StatusSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StatusSelect) StringX

func (s *StatusSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StatusSelect) Strings

func (s *StatusSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StatusSelect) StringsX

func (s *StatusSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StatusSlice

type StatusSlice []*Status

StatusSlice is a parsable slice of Status.

type StatusUpdate

type StatusUpdate struct {
	// contains filtered or unexported fields
}

StatusUpdate is the builder for updating Status entities.

func (*StatusUpdate) AddCreatedBy

func (su *StatusUpdate) AddCreatedBy(i int) *StatusUpdate

AddCreatedBy adds i to the "created_by" field.

func (*StatusUpdate) AddReactedActorIDs

func (su *StatusUpdate) AddReactedActorIDs(ids ...uint64) *StatusUpdate

AddReactedActorIDs adds the "reacted_actors" edge to the Actor entity by IDs.

func (*StatusUpdate) AddReactedActors

func (su *StatusUpdate) AddReactedActors(a ...*Actor) *StatusUpdate

AddReactedActors adds the "reacted_actors" edges to the Actor entity.

func (*StatusUpdate) AddUpdatedBy

func (su *StatusUpdate) AddUpdatedBy(i int) *StatusUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*StatusUpdate) ClearActors

func (su *StatusUpdate) ClearActors() *StatusUpdate

ClearActors clears the "actors" edge to the Actor entity.

func (*StatusUpdate) ClearCreatedBy

func (su *StatusUpdate) ClearCreatedBy() *StatusUpdate

ClearCreatedBy clears the value of the "created_by" field.

func (*StatusUpdate) ClearReactedActors

func (su *StatusUpdate) ClearReactedActors() *StatusUpdate

ClearReactedActors clears all "reacted_actors" edges to the Actor entity.

func (*StatusUpdate) ClearUpdatedBy

func (su *StatusUpdate) ClearUpdatedBy() *StatusUpdate

ClearUpdatedBy clears the value of the "updated_by" field.

func (*StatusUpdate) Exec

func (su *StatusUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StatusUpdate) ExecX

func (su *StatusUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusUpdate) Mutation

func (su *StatusUpdate) Mutation() *StatusMutation

Mutation returns the StatusMutation object of the builder.

func (*StatusUpdate) RemoveReactedActorIDs

func (su *StatusUpdate) RemoveReactedActorIDs(ids ...uint64) *StatusUpdate

RemoveReactedActorIDs removes the "reacted_actors" edge to Actor entities by IDs.

func (*StatusUpdate) RemoveReactedActors

func (su *StatusUpdate) RemoveReactedActors(a ...*Actor) *StatusUpdate

RemoveReactedActors removes "reacted_actors" edges to Actor entities.

func (*StatusUpdate) Save

func (su *StatusUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StatusUpdate) SaveX

func (su *StatusUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StatusUpdate) SetActors

func (su *StatusUpdate) SetActors(a *Actor) *StatusUpdate

SetActors sets the "actors" edge to the Actor entity.

func (*StatusUpdate) SetActorsID

func (su *StatusUpdate) SetActorsID(id uint64) *StatusUpdate

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*StatusUpdate) SetCreatedBy

func (su *StatusUpdate) SetCreatedBy(i int) *StatusUpdate

SetCreatedBy sets the "created_by" field.

func (*StatusUpdate) SetNillableCreatedBy

func (su *StatusUpdate) SetNillableCreatedBy(i *int) *StatusUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*StatusUpdate) SetNillableUpdatedBy

func (su *StatusUpdate) SetNillableUpdatedBy(i *int) *StatusUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*StatusUpdate) SetUpdatedAt

func (su *StatusUpdate) SetUpdatedAt(t time.Time) *StatusUpdate

SetUpdatedAt sets the "updated_at" field.

func (*StatusUpdate) SetUpdatedBy

func (su *StatusUpdate) SetUpdatedBy(i int) *StatusUpdate

SetUpdatedBy sets the "updated_by" field.

func (*StatusUpdate) Where

func (su *StatusUpdate) Where(ps ...predicate.Status) *StatusUpdate

Where appends a list predicates to the StatusUpdate builder.

type StatusUpdateOne

type StatusUpdateOne struct {
	// contains filtered or unexported fields
}

StatusUpdateOne is the builder for updating a single Status entity.

func (*StatusUpdateOne) AddCreatedBy

func (suo *StatusUpdateOne) AddCreatedBy(i int) *StatusUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*StatusUpdateOne) AddReactedActorIDs

func (suo *StatusUpdateOne) AddReactedActorIDs(ids ...uint64) *StatusUpdateOne

AddReactedActorIDs adds the "reacted_actors" edge to the Actor entity by IDs.

func (*StatusUpdateOne) AddReactedActors

func (suo *StatusUpdateOne) AddReactedActors(a ...*Actor) *StatusUpdateOne

AddReactedActors adds the "reacted_actors" edges to the Actor entity.

func (*StatusUpdateOne) AddUpdatedBy

func (suo *StatusUpdateOne) AddUpdatedBy(i int) *StatusUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*StatusUpdateOne) ClearActors

func (suo *StatusUpdateOne) ClearActors() *StatusUpdateOne

ClearActors clears the "actors" edge to the Actor entity.

func (*StatusUpdateOne) ClearCreatedBy

func (suo *StatusUpdateOne) ClearCreatedBy() *StatusUpdateOne

ClearCreatedBy clears the value of the "created_by" field.

func (*StatusUpdateOne) ClearReactedActors

func (suo *StatusUpdateOne) ClearReactedActors() *StatusUpdateOne

ClearReactedActors clears all "reacted_actors" edges to the Actor entity.

func (*StatusUpdateOne) ClearUpdatedBy

func (suo *StatusUpdateOne) ClearUpdatedBy() *StatusUpdateOne

ClearUpdatedBy clears the value of the "updated_by" field.

func (*StatusUpdateOne) Exec

func (suo *StatusUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StatusUpdateOne) ExecX

func (suo *StatusUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StatusUpdateOne) Mutation

func (suo *StatusUpdateOne) Mutation() *StatusMutation

Mutation returns the StatusMutation object of the builder.

func (*StatusUpdateOne) RemoveReactedActorIDs

func (suo *StatusUpdateOne) RemoveReactedActorIDs(ids ...uint64) *StatusUpdateOne

RemoveReactedActorIDs removes the "reacted_actors" edge to Actor entities by IDs.

func (*StatusUpdateOne) RemoveReactedActors

func (suo *StatusUpdateOne) RemoveReactedActors(a ...*Actor) *StatusUpdateOne

RemoveReactedActors removes "reacted_actors" edges to Actor entities.

func (*StatusUpdateOne) Save

func (suo *StatusUpdateOne) Save(ctx context.Context) (*Status, error)

Save executes the query and returns the updated Status entity.

func (*StatusUpdateOne) SaveX

func (suo *StatusUpdateOne) SaveX(ctx context.Context) *Status

SaveX is like Save, but panics if an error occurs.

func (*StatusUpdateOne) Select

func (suo *StatusUpdateOne) Select(field string, fields ...string) *StatusUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StatusUpdateOne) SetActors

func (suo *StatusUpdateOne) SetActors(a *Actor) *StatusUpdateOne

SetActors sets the "actors" edge to the Actor entity.

func (*StatusUpdateOne) SetActorsID

func (suo *StatusUpdateOne) SetActorsID(id uint64) *StatusUpdateOne

SetActorsID sets the "actors" edge to the Actor entity by ID.

func (*StatusUpdateOne) SetCreatedBy

func (suo *StatusUpdateOne) SetCreatedBy(i int) *StatusUpdateOne

SetCreatedBy sets the "created_by" field.

func (*StatusUpdateOne) SetNillableCreatedBy

func (suo *StatusUpdateOne) SetNillableCreatedBy(i *int) *StatusUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*StatusUpdateOne) SetNillableUpdatedBy

func (suo *StatusUpdateOne) SetNillableUpdatedBy(i *int) *StatusUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*StatusUpdateOne) SetUpdatedAt

func (suo *StatusUpdateOne) SetUpdatedAt(t time.Time) *StatusUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*StatusUpdateOne) SetUpdatedBy

func (suo *StatusUpdateOne) SetUpdatedBy(i int) *StatusUpdateOne

SetUpdatedBy sets the "updated_by" field.

type Tx

type Tx struct {

	// Actor is the client for interacting with the Actor builders.
	Actor *ActorClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// Server is the client for interacting with the Server builders.
	Server *ServerClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// Status is the client for interacting with the Status builders.
	Status *StatusClient
	// 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 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