ent

package
v0.0.0-...-42c0c98 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 40 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.
	TypeAction         = "Action"
	TypeCompetition    = "Competition"
	TypeProvider       = "Provider"
	TypeServiceAccount = "ServiceAccount"
	TypeServiceToken   = "ServiceToken"
	TypeTeam           = "Team"
	TypeToken          = "Token"
	TypeUser           = "User"
	TypeVmObject       = "VmObject"
)

Variables

View Source
var DefaultActionOrder = &ActionOrder{
	Direction: OrderDirectionAsc,
	Field: &ActionOrderField{
		field: action.FieldID,
		toCursor: func(a *Action) Cursor {
			return Cursor{ID: a.ID}
		},
	},
}

DefaultActionOrder is the default ordering of Action.

View Source
var DefaultCompetitionOrder = &CompetitionOrder{
	Direction: OrderDirectionAsc,
	Field: &CompetitionOrderField{
		field: competition.FieldID,
		toCursor: func(c *Competition) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultCompetitionOrder is the default ordering of Competition.

View Source
var DefaultProviderOrder = &ProviderOrder{
	Direction: OrderDirectionAsc,
	Field: &ProviderOrderField{
		field: provider.FieldID,
		toCursor: func(pr *Provider) Cursor {
			return Cursor{ID: pr.ID}
		},
	},
}

DefaultProviderOrder is the default ordering of Provider.

View Source
var DefaultServiceAccountOrder = &ServiceAccountOrder{
	Direction: OrderDirectionAsc,
	Field: &ServiceAccountOrderField{
		field: serviceaccount.FieldID,
		toCursor: func(sa *ServiceAccount) Cursor {
			return Cursor{ID: sa.ID}
		},
	},
}

DefaultServiceAccountOrder is the default ordering of ServiceAccount.

View Source
var DefaultServiceTokenOrder = &ServiceTokenOrder{
	Direction: OrderDirectionAsc,
	Field: &ServiceTokenOrderField{
		field: servicetoken.FieldID,
		toCursor: func(st *ServiceToken) Cursor {
			return Cursor{ID: st.ID}
		},
	},
}

DefaultServiceTokenOrder is the default ordering of ServiceToken.

View Source
var DefaultTeamOrder = &TeamOrder{
	Direction: OrderDirectionAsc,
	Field: &TeamOrderField{
		field: team.FieldID,
		toCursor: func(t *Team) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTeamOrder is the default ordering of Team.

View Source
var DefaultTokenOrder = &TokenOrder{
	Direction: OrderDirectionAsc,
	Field: &TokenOrderField{
		field: token.FieldID,
		toCursor: func(t *Token) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTokenOrder is the default ordering of Token.

View Source
var DefaultUserOrder = &UserOrder{
	Direction: OrderDirectionAsc,
	Field: &UserOrderField{
		field: user.FieldID,
		toCursor: func(u *User) Cursor {
			return Cursor{ID: u.ID}
		},
	},
}

DefaultUserOrder is the default ordering of User.

View Source
var DefaultVmObjectOrder = &VmObjectOrder{
	Direction: OrderDirectionAsc,
	Field: &VmObjectOrderField{
		field: vmobject.FieldID,
		toCursor: func(vo *VmObject) Cursor {
			return Cursor{ID: vo.ID}
		},
	},
}

DefaultVmObjectOrder is the default ordering of VmObject.

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 OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

Types

type Action

type Action struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// IPAddress holds the value of the "ip_address" field.
	IPAddress string `json:"ip_address,omitempty"`
	// Type holds the value of the "type" field.
	Type action.Type `json:"type,omitempty"`
	// Message holds the value of the "message" field.
	Message string `json:"message,omitempty"`
	// PerformedAt holds the value of the "performed_at" field.
	PerformedAt time.Time `json:"performed_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ActionQuery when eager-loading is set.
	Edges ActionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Action is the model entity for the Action schema.

func (*Action) ActionToServiceAccount

func (a *Action) ActionToServiceAccount(ctx context.Context) (*ServiceAccount, error)

func (*Action) ActionToUser

func (a *Action) ActionToUser(ctx context.Context) (*User, error)

func (*Action) Node

func (a *Action) Node(ctx context.Context) (node *Node, err error)

func (*Action) QueryActionToServiceAccount

func (a *Action) QueryActionToServiceAccount() *ServiceAccountQuery

QueryActionToServiceAccount queries the "ActionToServiceAccount" edge of the Action entity.

func (*Action) QueryActionToUser

func (a *Action) QueryActionToUser() *UserQuery

QueryActionToUser queries the "ActionToUser" edge of the Action entity.

func (*Action) String

func (a *Action) String() string

String implements the fmt.Stringer.

func (*Action) ToEdge

func (a *Action) ToEdge(order *ActionOrder) *ActionEdge

ToEdge converts Action into ActionEdge.

func (*Action) Unwrap

func (a *Action) Unwrap() *Action

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

func (a *Action) Update() *ActionUpdateOne

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

type ActionClient

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

ActionClient is a client for the Action schema.

func NewActionClient

func NewActionClient(c config) *ActionClient

NewActionClient returns a client for the Action from the given config.

func (*ActionClient) Create

func (c *ActionClient) Create() *ActionCreate

Create returns a create builder for Action.

func (*ActionClient) CreateBulk

func (c *ActionClient) CreateBulk(builders ...*ActionCreate) *ActionCreateBulk

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

func (*ActionClient) Delete

func (c *ActionClient) Delete() *ActionDelete

Delete returns a delete builder for Action.

func (*ActionClient) DeleteOne

func (c *ActionClient) DeleteOne(a *Action) *ActionDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ActionClient) DeleteOneID

func (c *ActionClient) DeleteOneID(id uuid.UUID) *ActionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ActionClient) Get

func (c *ActionClient) Get(ctx context.Context, id uuid.UUID) (*Action, error)

Get returns a Action entity by its id.

func (*ActionClient) GetX

func (c *ActionClient) GetX(ctx context.Context, id uuid.UUID) *Action

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

func (*ActionClient) Hooks

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

Hooks returns the client hooks.

func (*ActionClient) Query

func (c *ActionClient) Query() *ActionQuery

Query returns a query builder for Action.

func (*ActionClient) QueryActionToServiceAccount

func (c *ActionClient) QueryActionToServiceAccount(a *Action) *ServiceAccountQuery

QueryActionToServiceAccount queries the ActionToServiceAccount edge of a Action.

func (*ActionClient) QueryActionToUser

func (c *ActionClient) QueryActionToUser(a *Action) *UserQuery

QueryActionToUser queries the ActionToUser edge of a Action.

func (*ActionClient) Update

func (c *ActionClient) Update() *ActionUpdate

Update returns an update builder for Action.

func (*ActionClient) UpdateOne

func (c *ActionClient) UpdateOne(a *Action) *ActionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ActionClient) UpdateOneID

func (c *ActionClient) UpdateOneID(id uuid.UUID) *ActionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ActionClient) Use

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

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

type ActionConnection

type ActionConnection struct {
	Edges      []*ActionEdge `json:"edges"`
	PageInfo   PageInfo      `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

ActionConnection is the connection containing edges to Action.

type ActionCreate

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

ActionCreate is the builder for creating a Action entity.

func (*ActionCreate) Exec

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

Exec executes the query.

func (*ActionCreate) ExecX

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

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

func (*ActionCreate) Mutation

func (ac *ActionCreate) Mutation() *ActionMutation

Mutation returns the ActionMutation object of the builder.

func (*ActionCreate) Save

func (ac *ActionCreate) Save(ctx context.Context) (*Action, error)

Save creates the Action in the database.

func (*ActionCreate) SaveX

func (ac *ActionCreate) SaveX(ctx context.Context) *Action

SaveX calls Save and panics if Save returns an error.

func (*ActionCreate) SetActionToServiceAccount

func (ac *ActionCreate) SetActionToServiceAccount(s *ServiceAccount) *ActionCreate

SetActionToServiceAccount sets the "ActionToServiceAccount" edge to the ServiceAccount entity.

func (*ActionCreate) SetActionToServiceAccountID

func (ac *ActionCreate) SetActionToServiceAccountID(id uuid.UUID) *ActionCreate

SetActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by ID.

func (*ActionCreate) SetActionToUser

func (ac *ActionCreate) SetActionToUser(u *User) *ActionCreate

SetActionToUser sets the "ActionToUser" edge to the User entity.

func (*ActionCreate) SetActionToUserID

func (ac *ActionCreate) SetActionToUserID(id uuid.UUID) *ActionCreate

SetActionToUserID sets the "ActionToUser" edge to the User entity by ID.

func (*ActionCreate) SetID

func (ac *ActionCreate) SetID(u uuid.UUID) *ActionCreate

SetID sets the "id" field.

func (*ActionCreate) SetIPAddress

func (ac *ActionCreate) SetIPAddress(s string) *ActionCreate

SetIPAddress sets the "ip_address" field.

func (*ActionCreate) SetMessage

func (ac *ActionCreate) SetMessage(s string) *ActionCreate

SetMessage sets the "message" field.

func (*ActionCreate) SetNillableActionToServiceAccountID

func (ac *ActionCreate) SetNillableActionToServiceAccountID(id *uuid.UUID) *ActionCreate

SetNillableActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by ID if the given value is not nil.

func (*ActionCreate) SetNillableActionToUserID

func (ac *ActionCreate) SetNillableActionToUserID(id *uuid.UUID) *ActionCreate

SetNillableActionToUserID sets the "ActionToUser" edge to the User entity by ID if the given value is not nil.

func (*ActionCreate) SetNillableID

func (ac *ActionCreate) SetNillableID(u *uuid.UUID) *ActionCreate

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

func (*ActionCreate) SetNillableIPAddress

func (ac *ActionCreate) SetNillableIPAddress(s *string) *ActionCreate

SetNillableIPAddress sets the "ip_address" field if the given value is not nil.

func (*ActionCreate) SetNillablePerformedAt

func (ac *ActionCreate) SetNillablePerformedAt(t *time.Time) *ActionCreate

SetNillablePerformedAt sets the "performed_at" field if the given value is not nil.

func (*ActionCreate) SetPerformedAt

func (ac *ActionCreate) SetPerformedAt(t time.Time) *ActionCreate

SetPerformedAt sets the "performed_at" field.

func (*ActionCreate) SetType

func (ac *ActionCreate) SetType(a action.Type) *ActionCreate

SetType sets the "type" field.

type ActionCreateBulk

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

ActionCreateBulk is the builder for creating many Action entities in bulk.

func (*ActionCreateBulk) Exec

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

Exec executes the query.

func (*ActionCreateBulk) ExecX

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

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

func (*ActionCreateBulk) Save

func (acb *ActionCreateBulk) Save(ctx context.Context) ([]*Action, error)

Save creates the Action entities in the database.

func (*ActionCreateBulk) SaveX

func (acb *ActionCreateBulk) SaveX(ctx context.Context) []*Action

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

type ActionDelete

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

ActionDelete is the builder for deleting a Action entity.

func (*ActionDelete) Exec

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

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

func (*ActionDelete) ExecX

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

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

func (*ActionDelete) Where

func (ad *ActionDelete) Where(ps ...predicate.Action) *ActionDelete

Where appends a list predicates to the ActionDelete builder.

type ActionDeleteOne

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

ActionDeleteOne is the builder for deleting a single Action entity.

func (*ActionDeleteOne) Exec

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

Exec executes the deletion query.

func (*ActionDeleteOne) ExecX

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

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

type ActionEdge

type ActionEdge struct {
	Node   *Action `json:"node"`
	Cursor Cursor  `json:"cursor"`
}

ActionEdge is the edge representation of Action.

type ActionEdges

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

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

func (ActionEdges) ActionToServiceAccountOrErr

func (e ActionEdges) ActionToServiceAccountOrErr() (*ServiceAccount, error)

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

func (ActionEdges) ActionToUserOrErr

func (e ActionEdges) ActionToUserOrErr() (*User, error)

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

type ActionGroupBy

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

ActionGroupBy is the group-by builder for Action entities.

func (*ActionGroupBy) Aggregate

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

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

func (*ActionGroupBy) Bool

func (agb *ActionGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ActionGroupBy) BoolX

func (agb *ActionGroupBy) BoolX(ctx context.Context) bool

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

func (*ActionGroupBy) Bools

func (agb *ActionGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ActionGroupBy) BoolsX

func (agb *ActionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ActionGroupBy) Float64

func (agb *ActionGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ActionGroupBy) Float64X

func (agb *ActionGroupBy) Float64X(ctx context.Context) float64

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

func (*ActionGroupBy) Float64s

func (agb *ActionGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ActionGroupBy) Float64sX

func (agb *ActionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ActionGroupBy) Int

func (agb *ActionGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ActionGroupBy) IntX

func (agb *ActionGroupBy) IntX(ctx context.Context) int

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

func (*ActionGroupBy) Ints

func (agb *ActionGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ActionGroupBy) IntsX

func (agb *ActionGroupBy) IntsX(ctx context.Context) []int

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

func (*ActionGroupBy) Scan

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

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

func (*ActionGroupBy) ScanX

func (agb *ActionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ActionGroupBy) String

func (agb *ActionGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ActionGroupBy) StringX

func (agb *ActionGroupBy) StringX(ctx context.Context) string

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

func (*ActionGroupBy) Strings

func (agb *ActionGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ActionGroupBy) StringsX

func (agb *ActionGroupBy) StringsX(ctx context.Context) []string

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

type ActionMutation

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

ActionMutation represents an operation that mutates the Action nodes in the graph.

func (*ActionMutation) ActionToServiceAccountCleared

func (m *ActionMutation) ActionToServiceAccountCleared() bool

ActionToServiceAccountCleared reports if the "ActionToServiceAccount" edge to the ServiceAccount entity was cleared.

func (*ActionMutation) ActionToServiceAccountID

func (m *ActionMutation) ActionToServiceAccountID() (id uuid.UUID, exists bool)

ActionToServiceAccountID returns the "ActionToServiceAccount" edge ID in the mutation.

func (*ActionMutation) ActionToServiceAccountIDs

func (m *ActionMutation) ActionToServiceAccountIDs() (ids []uuid.UUID)

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

func (*ActionMutation) ActionToUserCleared

func (m *ActionMutation) ActionToUserCleared() bool

ActionToUserCleared reports if the "ActionToUser" edge to the User entity was cleared.

func (*ActionMutation) ActionToUserID

func (m *ActionMutation) ActionToUserID() (id uuid.UUID, exists bool)

ActionToUserID returns the "ActionToUser" edge ID in the mutation.

func (*ActionMutation) ActionToUserIDs

func (m *ActionMutation) ActionToUserIDs() (ids []uuid.UUID)

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

func (*ActionMutation) AddField

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

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

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

func (*ActionMutation) AddedField

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

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

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

func (*ActionMutation) AddedIDs

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

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

func (*ActionMutation) ClearActionToServiceAccount

func (m *ActionMutation) ClearActionToServiceAccount()

ClearActionToServiceAccount clears the "ActionToServiceAccount" edge to the ServiceAccount entity.

func (*ActionMutation) ClearActionToUser

func (m *ActionMutation) ClearActionToUser()

ClearActionToUser clears the "ActionToUser" edge to the User entity.

func (*ActionMutation) ClearEdge

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

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

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

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

func (*ActionMutation) ClearedFields

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

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

func (ActionMutation) Client

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

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

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

func (*ActionMutation) Field

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

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

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

func (*ActionMutation) Fields

func (m *ActionMutation) 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 (*ActionMutation) GetType

func (m *ActionMutation) GetType() (r action.Type, exists bool)

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

func (*ActionMutation) ID

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

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

func (*ActionMutation) IDs

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

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

func (*ActionMutation) IPAddress

func (m *ActionMutation) IPAddress() (r string, exists bool)

IPAddress returns the value of the "ip_address" field in the mutation.

func (*ActionMutation) Message

func (m *ActionMutation) Message() (r string, exists bool)

Message returns the value of the "message" field in the mutation.

func (*ActionMutation) OldField

func (m *ActionMutation) 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 (*ActionMutation) OldIPAddress

func (m *ActionMutation) OldIPAddress(ctx context.Context) (v string, err error)

OldIPAddress returns the old "ip_address" field's value of the Action entity. If the Action 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 (*ActionMutation) OldMessage

func (m *ActionMutation) OldMessage(ctx context.Context) (v string, err error)

OldMessage returns the old "message" field's value of the Action entity. If the Action 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 (*ActionMutation) OldPerformedAt

func (m *ActionMutation) OldPerformedAt(ctx context.Context) (v time.Time, err error)

OldPerformedAt returns the old "performed_at" field's value of the Action entity. If the Action 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 (*ActionMutation) OldType

func (m *ActionMutation) OldType(ctx context.Context) (v action.Type, err error)

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

func (m *ActionMutation) Op() Op

Op returns the operation name.

func (*ActionMutation) PerformedAt

func (m *ActionMutation) PerformedAt() (r time.Time, exists bool)

PerformedAt returns the value of the "performed_at" field in the mutation.

func (*ActionMutation) RemovedEdges

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

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

func (*ActionMutation) RemovedIDs

func (m *ActionMutation) 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 (*ActionMutation) ResetActionToServiceAccount

func (m *ActionMutation) ResetActionToServiceAccount()

ResetActionToServiceAccount resets all changes to the "ActionToServiceAccount" edge.

func (*ActionMutation) ResetActionToUser

func (m *ActionMutation) ResetActionToUser()

ResetActionToUser resets all changes to the "ActionToUser" edge.

func (*ActionMutation) ResetEdge

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

func (m *ActionMutation) 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 (*ActionMutation) ResetIPAddress

func (m *ActionMutation) ResetIPAddress()

ResetIPAddress resets all changes to the "ip_address" field.

func (*ActionMutation) ResetMessage

func (m *ActionMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*ActionMutation) ResetPerformedAt

func (m *ActionMutation) ResetPerformedAt()

ResetPerformedAt resets all changes to the "performed_at" field.

func (*ActionMutation) ResetType

func (m *ActionMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ActionMutation) SetActionToServiceAccountID

func (m *ActionMutation) SetActionToServiceAccountID(id uuid.UUID)

SetActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by id.

func (*ActionMutation) SetActionToUserID

func (m *ActionMutation) SetActionToUserID(id uuid.UUID)

SetActionToUserID sets the "ActionToUser" edge to the User entity by id.

func (*ActionMutation) SetField

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

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

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

func (*ActionMutation) SetIPAddress

func (m *ActionMutation) SetIPAddress(s string)

SetIPAddress sets the "ip_address" field.

func (*ActionMutation) SetMessage

func (m *ActionMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*ActionMutation) SetPerformedAt

func (m *ActionMutation) SetPerformedAt(t time.Time)

SetPerformedAt sets the "performed_at" field.

func (*ActionMutation) SetType

func (m *ActionMutation) SetType(a action.Type)

SetType sets the "type" field.

func (ActionMutation) Tx

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

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

func (*ActionMutation) Type

func (m *ActionMutation) Type() string

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

func (*ActionMutation) Where

func (m *ActionMutation) Where(ps ...predicate.Action)

Where appends a list predicates to the ActionMutation builder.

type ActionOrder

type ActionOrder struct {
	Direction OrderDirection    `json:"direction"`
	Field     *ActionOrderField `json:"field"`
}

ActionOrder defines the ordering of Action.

type ActionOrderField

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

ActionOrderField defines the ordering field of Action.

type ActionPaginateOption

type ActionPaginateOption func(*actionPager) error

ActionPaginateOption enables pagination customization.

func WithActionFilter

func WithActionFilter(filter func(*ActionQuery) (*ActionQuery, error)) ActionPaginateOption

WithActionFilter configures pagination filter.

func WithActionOrder

func WithActionOrder(order *ActionOrder) ActionPaginateOption

WithActionOrder configures pagination ordering.

type ActionQuery

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

ActionQuery is the builder for querying Action entities.

func (*ActionQuery) All

func (aq *ActionQuery) All(ctx context.Context) ([]*Action, error)

All executes the query and returns a list of Actions.

func (*ActionQuery) AllX

func (aq *ActionQuery) AllX(ctx context.Context) []*Action

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

func (*ActionQuery) Clone

func (aq *ActionQuery) Clone() *ActionQuery

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

func (*ActionQuery) CollectFields

func (a *ActionQuery) CollectFields(ctx context.Context, satisfies ...string) *ActionQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ActionQuery) Count

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

Count returns the count of the given query.

func (*ActionQuery) CountX

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

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

func (*ActionQuery) Exist

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

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

func (*ActionQuery) ExistX

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

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

func (*ActionQuery) First

func (aq *ActionQuery) First(ctx context.Context) (*Action, error)

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

func (*ActionQuery) FirstID

func (aq *ActionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ActionQuery) FirstIDX

func (aq *ActionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ActionQuery) FirstX

func (aq *ActionQuery) FirstX(ctx context.Context) *Action

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

func (*ActionQuery) GroupBy

func (aq *ActionQuery) GroupBy(field string, fields ...string) *ActionGroupBy

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 {
	IPAddress string `json:"ip_address,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Action.Query().
	GroupBy(action.FieldIPAddress).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ActionQuery) IDs

func (aq *ActionQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ActionQuery) IDsX

func (aq *ActionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ActionQuery) Limit

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

Limit adds a limit step to the query.

func (*ActionQuery) Offset

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

Offset adds an offset step to the query.

func (*ActionQuery) Only

func (aq *ActionQuery) Only(ctx context.Context) (*Action, error)

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

func (*ActionQuery) OnlyID

func (aq *ActionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ActionQuery) OnlyIDX

func (aq *ActionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ActionQuery) OnlyX

func (aq *ActionQuery) OnlyX(ctx context.Context) *Action

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

func (*ActionQuery) Order

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

Order adds an order step to the query.

func (*ActionQuery) Paginate

func (a *ActionQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ActionPaginateOption,
) (*ActionConnection, error)

Paginate executes the query and returns a relay based cursor connection to Action.

func (*ActionQuery) QueryActionToServiceAccount

func (aq *ActionQuery) QueryActionToServiceAccount() *ServiceAccountQuery

QueryActionToServiceAccount chains the current query on the "ActionToServiceAccount" edge.

func (*ActionQuery) QueryActionToUser

func (aq *ActionQuery) QueryActionToUser() *UserQuery

QueryActionToUser chains the current query on the "ActionToUser" edge.

func (*ActionQuery) Select

func (aq *ActionQuery) Select(fields ...string) *ActionSelect

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 {
	IPAddress string `json:"ip_address,omitempty"`
}

client.Action.Query().
	Select(action.FieldIPAddress).
	Scan(ctx, &v)

func (*ActionQuery) Unique

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

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

func (aq *ActionQuery) Where(ps ...predicate.Action) *ActionQuery

Where adds a new predicate for the ActionQuery builder.

func (*ActionQuery) WithActionToServiceAccount

func (aq *ActionQuery) WithActionToServiceAccount(opts ...func(*ServiceAccountQuery)) *ActionQuery

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

func (*ActionQuery) WithActionToUser

func (aq *ActionQuery) WithActionToUser(opts ...func(*UserQuery)) *ActionQuery

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

type ActionSelect

type ActionSelect struct {
	*ActionQuery
	// contains filtered or unexported fields
}

ActionSelect is the builder for selecting fields of Action entities.

func (*ActionSelect) Bool

func (as *ActionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ActionSelect) BoolX

func (as *ActionSelect) BoolX(ctx context.Context) bool

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

func (*ActionSelect) Bools

func (as *ActionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ActionSelect) BoolsX

func (as *ActionSelect) BoolsX(ctx context.Context) []bool

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

func (*ActionSelect) Float64

func (as *ActionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ActionSelect) Float64X

func (as *ActionSelect) Float64X(ctx context.Context) float64

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

func (*ActionSelect) Float64s

func (as *ActionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ActionSelect) Float64sX

func (as *ActionSelect) Float64sX(ctx context.Context) []float64

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

func (*ActionSelect) Int

func (as *ActionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ActionSelect) IntX

func (as *ActionSelect) IntX(ctx context.Context) int

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

func (*ActionSelect) Ints

func (as *ActionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ActionSelect) IntsX

func (as *ActionSelect) IntsX(ctx context.Context) []int

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

func (*ActionSelect) Scan

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

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

func (*ActionSelect) ScanX

func (as *ActionSelect) ScanX(ctx context.Context, v interface{})

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

func (*ActionSelect) String

func (as *ActionSelect) String(ctx context.Context) (_ string, err error)

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

func (*ActionSelect) StringX

func (as *ActionSelect) StringX(ctx context.Context) string

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

func (*ActionSelect) Strings

func (as *ActionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ActionSelect) StringsX

func (as *ActionSelect) StringsX(ctx context.Context) []string

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

type ActionUpdate

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

ActionUpdate is the builder for updating Action entities.

func (*ActionUpdate) ClearActionToServiceAccount

func (au *ActionUpdate) ClearActionToServiceAccount() *ActionUpdate

ClearActionToServiceAccount clears the "ActionToServiceAccount" edge to the ServiceAccount entity.

func (*ActionUpdate) ClearActionToUser

func (au *ActionUpdate) ClearActionToUser() *ActionUpdate

ClearActionToUser clears the "ActionToUser" edge to the User entity.

func (*ActionUpdate) Exec

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

Exec executes the query.

func (*ActionUpdate) ExecX

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

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

func (*ActionUpdate) Mutation

func (au *ActionUpdate) Mutation() *ActionMutation

Mutation returns the ActionMutation object of the builder.

func (*ActionUpdate) Save

func (au *ActionUpdate) Save(ctx context.Context) (int, error)

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

func (*ActionUpdate) SaveX

func (au *ActionUpdate) SaveX(ctx context.Context) int

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

func (*ActionUpdate) SetActionToServiceAccount

func (au *ActionUpdate) SetActionToServiceAccount(s *ServiceAccount) *ActionUpdate

SetActionToServiceAccount sets the "ActionToServiceAccount" edge to the ServiceAccount entity.

func (*ActionUpdate) SetActionToServiceAccountID

func (au *ActionUpdate) SetActionToServiceAccountID(id uuid.UUID) *ActionUpdate

SetActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by ID.

func (*ActionUpdate) SetActionToUser

func (au *ActionUpdate) SetActionToUser(u *User) *ActionUpdate

SetActionToUser sets the "ActionToUser" edge to the User entity.

func (*ActionUpdate) SetActionToUserID

func (au *ActionUpdate) SetActionToUserID(id uuid.UUID) *ActionUpdate

SetActionToUserID sets the "ActionToUser" edge to the User entity by ID.

func (*ActionUpdate) SetIPAddress

func (au *ActionUpdate) SetIPAddress(s string) *ActionUpdate

SetIPAddress sets the "ip_address" field.

func (*ActionUpdate) SetMessage

func (au *ActionUpdate) SetMessage(s string) *ActionUpdate

SetMessage sets the "message" field.

func (*ActionUpdate) SetNillableActionToServiceAccountID

func (au *ActionUpdate) SetNillableActionToServiceAccountID(id *uuid.UUID) *ActionUpdate

SetNillableActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by ID if the given value is not nil.

func (*ActionUpdate) SetNillableActionToUserID

func (au *ActionUpdate) SetNillableActionToUserID(id *uuid.UUID) *ActionUpdate

SetNillableActionToUserID sets the "ActionToUser" edge to the User entity by ID if the given value is not nil.

func (*ActionUpdate) SetNillableIPAddress

func (au *ActionUpdate) SetNillableIPAddress(s *string) *ActionUpdate

SetNillableIPAddress sets the "ip_address" field if the given value is not nil.

func (*ActionUpdate) SetNillablePerformedAt

func (au *ActionUpdate) SetNillablePerformedAt(t *time.Time) *ActionUpdate

SetNillablePerformedAt sets the "performed_at" field if the given value is not nil.

func (*ActionUpdate) SetPerformedAt

func (au *ActionUpdate) SetPerformedAt(t time.Time) *ActionUpdate

SetPerformedAt sets the "performed_at" field.

func (*ActionUpdate) SetType

func (au *ActionUpdate) SetType(a action.Type) *ActionUpdate

SetType sets the "type" field.

func (*ActionUpdate) Where

func (au *ActionUpdate) Where(ps ...predicate.Action) *ActionUpdate

Where appends a list predicates to the ActionUpdate builder.

type ActionUpdateOne

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

ActionUpdateOne is the builder for updating a single Action entity.

func (*ActionUpdateOne) ClearActionToServiceAccount

func (auo *ActionUpdateOne) ClearActionToServiceAccount() *ActionUpdateOne

ClearActionToServiceAccount clears the "ActionToServiceAccount" edge to the ServiceAccount entity.

func (*ActionUpdateOne) ClearActionToUser

func (auo *ActionUpdateOne) ClearActionToUser() *ActionUpdateOne

ClearActionToUser clears the "ActionToUser" edge to the User entity.

func (*ActionUpdateOne) Exec

func (auo *ActionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ActionUpdateOne) ExecX

func (auo *ActionUpdateOne) ExecX(ctx context.Context)

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

func (*ActionUpdateOne) Mutation

func (auo *ActionUpdateOne) Mutation() *ActionMutation

Mutation returns the ActionMutation object of the builder.

func (*ActionUpdateOne) Save

func (auo *ActionUpdateOne) Save(ctx context.Context) (*Action, error)

Save executes the query and returns the updated Action entity.

func (*ActionUpdateOne) SaveX

func (auo *ActionUpdateOne) SaveX(ctx context.Context) *Action

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

func (*ActionUpdateOne) Select

func (auo *ActionUpdateOne) Select(field string, fields ...string) *ActionUpdateOne

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

func (*ActionUpdateOne) SetActionToServiceAccount

func (auo *ActionUpdateOne) SetActionToServiceAccount(s *ServiceAccount) *ActionUpdateOne

SetActionToServiceAccount sets the "ActionToServiceAccount" edge to the ServiceAccount entity.

func (*ActionUpdateOne) SetActionToServiceAccountID

func (auo *ActionUpdateOne) SetActionToServiceAccountID(id uuid.UUID) *ActionUpdateOne

SetActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by ID.

func (*ActionUpdateOne) SetActionToUser

func (auo *ActionUpdateOne) SetActionToUser(u *User) *ActionUpdateOne

SetActionToUser sets the "ActionToUser" edge to the User entity.

func (*ActionUpdateOne) SetActionToUserID

func (auo *ActionUpdateOne) SetActionToUserID(id uuid.UUID) *ActionUpdateOne

SetActionToUserID sets the "ActionToUser" edge to the User entity by ID.

func (*ActionUpdateOne) SetIPAddress

func (auo *ActionUpdateOne) SetIPAddress(s string) *ActionUpdateOne

SetIPAddress sets the "ip_address" field.

func (*ActionUpdateOne) SetMessage

func (auo *ActionUpdateOne) SetMessage(s string) *ActionUpdateOne

SetMessage sets the "message" field.

func (*ActionUpdateOne) SetNillableActionToServiceAccountID

func (auo *ActionUpdateOne) SetNillableActionToServiceAccountID(id *uuid.UUID) *ActionUpdateOne

SetNillableActionToServiceAccountID sets the "ActionToServiceAccount" edge to the ServiceAccount entity by ID if the given value is not nil.

func (*ActionUpdateOne) SetNillableActionToUserID

func (auo *ActionUpdateOne) SetNillableActionToUserID(id *uuid.UUID) *ActionUpdateOne

SetNillableActionToUserID sets the "ActionToUser" edge to the User entity by ID if the given value is not nil.

func (*ActionUpdateOne) SetNillableIPAddress

func (auo *ActionUpdateOne) SetNillableIPAddress(s *string) *ActionUpdateOne

SetNillableIPAddress sets the "ip_address" field if the given value is not nil.

func (*ActionUpdateOne) SetNillablePerformedAt

func (auo *ActionUpdateOne) SetNillablePerformedAt(t *time.Time) *ActionUpdateOne

SetNillablePerformedAt sets the "performed_at" field if the given value is not nil.

func (*ActionUpdateOne) SetPerformedAt

func (auo *ActionUpdateOne) SetPerformedAt(t time.Time) *ActionUpdateOne

SetPerformedAt sets the "performed_at" field.

func (*ActionUpdateOne) SetType

func (auo *ActionUpdateOne) SetType(a action.Type) *ActionUpdateOne

SetType sets the "type" field.

type Actions

type Actions []*Action

Actions is a parsable slice of Action.

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
	// Action is the client for interacting with the Action builders.
	Action *ActionClient
	// Competition is the client for interacting with the Competition builders.
	Competition *CompetitionClient
	// Provider is the client for interacting with the Provider builders.
	Provider *ProviderClient
	// ServiceAccount is the client for interacting with the ServiceAccount builders.
	ServiceAccount *ServiceAccountClient
	// ServiceToken is the client for interacting with the ServiceToken builders.
	ServiceToken *ServiceTokenClient
	// Team is the client for interacting with the Team builders.
	Team *TeamClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// VmObject is the client for interacting with the VmObject builders.
	VmObject *VmObjectClient
	// 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 PGOpen

func PGOpen(databaseURL string) *Client

PGOpen Open new PostGres connection

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

func (*Client) Node

func (c *Client) Node(ctx context.Context, id uuid.UUID) (*Node, error)

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id uuid.UUID, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(pet.Table))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []uuid.UUID, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

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 Competition

type Competition struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	// [REQUIRED] The unique name (aka. slug) for the competition.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CompetitionQuery when eager-loading is set.
	Edges CompetitionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Competition is the model entity for the Competition schema.

func (*Competition) CompetitionToProvider

func (c *Competition) CompetitionToProvider(ctx context.Context) (*Provider, error)

func (*Competition) CompetitionToTeams

func (c *Competition) CompetitionToTeams(ctx context.Context) ([]*Team, error)

func (*Competition) Node

func (c *Competition) Node(ctx context.Context) (node *Node, err error)

func (*Competition) QueryCompetitionToProvider

func (c *Competition) QueryCompetitionToProvider() *ProviderQuery

QueryCompetitionToProvider queries the "CompetitionToProvider" edge of the Competition entity.

func (*Competition) QueryCompetitionToTeams

func (c *Competition) QueryCompetitionToTeams() *TeamQuery

QueryCompetitionToTeams queries the "CompetitionToTeams" edge of the Competition entity.

func (*Competition) String

func (c *Competition) String() string

String implements the fmt.Stringer.

func (*Competition) ToEdge

func (c *Competition) ToEdge(order *CompetitionOrder) *CompetitionEdge

ToEdge converts Competition into CompetitionEdge.

func (*Competition) Unwrap

func (c *Competition) Unwrap() *Competition

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

func (c *Competition) Update() *CompetitionUpdateOne

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

type CompetitionClient

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

CompetitionClient is a client for the Competition schema.

func NewCompetitionClient

func NewCompetitionClient(c config) *CompetitionClient

NewCompetitionClient returns a client for the Competition from the given config.

func (*CompetitionClient) Create

func (c *CompetitionClient) Create() *CompetitionCreate

Create returns a create builder for Competition.

func (*CompetitionClient) CreateBulk

func (c *CompetitionClient) CreateBulk(builders ...*CompetitionCreate) *CompetitionCreateBulk

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

func (*CompetitionClient) Delete

func (c *CompetitionClient) Delete() *CompetitionDelete

Delete returns a delete builder for Competition.

func (*CompetitionClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*CompetitionClient) DeleteOneID

func (c *CompetitionClient) DeleteOneID(id uuid.UUID) *CompetitionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*CompetitionClient) Get

Get returns a Competition entity by its id.

func (*CompetitionClient) GetX

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

func (*CompetitionClient) Hooks

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

Hooks returns the client hooks.

func (*CompetitionClient) Query

func (c *CompetitionClient) Query() *CompetitionQuery

Query returns a query builder for Competition.

func (*CompetitionClient) QueryCompetitionToProvider

func (c *CompetitionClient) QueryCompetitionToProvider(co *Competition) *ProviderQuery

QueryCompetitionToProvider queries the CompetitionToProvider edge of a Competition.

func (*CompetitionClient) QueryCompetitionToTeams

func (c *CompetitionClient) QueryCompetitionToTeams(co *Competition) *TeamQuery

QueryCompetitionToTeams queries the CompetitionToTeams edge of a Competition.

func (*CompetitionClient) Update

func (c *CompetitionClient) Update() *CompetitionUpdate

Update returns an update builder for Competition.

func (*CompetitionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CompetitionClient) UpdateOneID

func (c *CompetitionClient) UpdateOneID(id uuid.UUID) *CompetitionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CompetitionClient) Use

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

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

type CompetitionConnection

type CompetitionConnection struct {
	Edges      []*CompetitionEdge `json:"edges"`
	PageInfo   PageInfo           `json:"pageInfo"`
	TotalCount int                `json:"totalCount"`
}

CompetitionConnection is the connection containing edges to Competition.

type CompetitionCreate

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

CompetitionCreate is the builder for creating a Competition entity.

func (*CompetitionCreate) AddCompetitionToTeamIDs

func (cc *CompetitionCreate) AddCompetitionToTeamIDs(ids ...uuid.UUID) *CompetitionCreate

AddCompetitionToTeamIDs adds the "CompetitionToTeams" edge to the Team entity by IDs.

func (*CompetitionCreate) AddCompetitionToTeams

func (cc *CompetitionCreate) AddCompetitionToTeams(t ...*Team) *CompetitionCreate

AddCompetitionToTeams adds the "CompetitionToTeams" edges to the Team entity.

func (*CompetitionCreate) Exec

func (cc *CompetitionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CompetitionCreate) ExecX

func (cc *CompetitionCreate) ExecX(ctx context.Context)

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

func (*CompetitionCreate) Mutation

func (cc *CompetitionCreate) Mutation() *CompetitionMutation

Mutation returns the CompetitionMutation object of the builder.

func (*CompetitionCreate) Save

Save creates the Competition in the database.

func (*CompetitionCreate) SaveX

func (cc *CompetitionCreate) SaveX(ctx context.Context) *Competition

SaveX calls Save and panics if Save returns an error.

func (*CompetitionCreate) SetCompetitionToProvider

func (cc *CompetitionCreate) SetCompetitionToProvider(p *Provider) *CompetitionCreate

SetCompetitionToProvider sets the "CompetitionToProvider" edge to the Provider entity.

func (*CompetitionCreate) SetCompetitionToProviderID

func (cc *CompetitionCreate) SetCompetitionToProviderID(id uuid.UUID) *CompetitionCreate

SetCompetitionToProviderID sets the "CompetitionToProvider" edge to the Provider entity by ID.

func (*CompetitionCreate) SetID

SetID sets the "id" field.

func (*CompetitionCreate) SetName

func (cc *CompetitionCreate) SetName(s string) *CompetitionCreate

SetName sets the "name" field.

func (*CompetitionCreate) SetNillableID

func (cc *CompetitionCreate) SetNillableID(u *uuid.UUID) *CompetitionCreate

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

type CompetitionCreateBulk

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

CompetitionCreateBulk is the builder for creating many Competition entities in bulk.

func (*CompetitionCreateBulk) Exec

func (ccb *CompetitionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CompetitionCreateBulk) ExecX

func (ccb *CompetitionCreateBulk) ExecX(ctx context.Context)

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

func (*CompetitionCreateBulk) Save

func (ccb *CompetitionCreateBulk) Save(ctx context.Context) ([]*Competition, error)

Save creates the Competition entities in the database.

func (*CompetitionCreateBulk) SaveX

func (ccb *CompetitionCreateBulk) SaveX(ctx context.Context) []*Competition

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

type CompetitionDelete

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

CompetitionDelete is the builder for deleting a Competition entity.

func (*CompetitionDelete) Exec

func (cd *CompetitionDelete) Exec(ctx context.Context) (int, error)

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

func (*CompetitionDelete) ExecX

func (cd *CompetitionDelete) ExecX(ctx context.Context) int

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

func (*CompetitionDelete) Where

Where appends a list predicates to the CompetitionDelete builder.

type CompetitionDeleteOne

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

CompetitionDeleteOne is the builder for deleting a single Competition entity.

func (*CompetitionDeleteOne) Exec

func (cdo *CompetitionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CompetitionDeleteOne) ExecX

func (cdo *CompetitionDeleteOne) ExecX(ctx context.Context)

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

type CompetitionEdge

type CompetitionEdge struct {
	Node   *Competition `json:"node"`
	Cursor Cursor       `json:"cursor"`
}

CompetitionEdge is the edge representation of Competition.

type CompetitionEdges

type CompetitionEdges struct {
	// CompetitionToTeams holds the value of the CompetitionToTeams edge.
	CompetitionToTeams []*Team `json:"CompetitionToTeams,omitempty"`
	// CompetitionToProvider holds the value of the CompetitionToProvider edge.
	CompetitionToProvider *Provider `json:"CompetitionToProvider,omitempty"`
	// contains filtered or unexported fields
}

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

func (CompetitionEdges) CompetitionToProviderOrErr

func (e CompetitionEdges) CompetitionToProviderOrErr() (*Provider, error)

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

func (CompetitionEdges) CompetitionToTeamsOrErr

func (e CompetitionEdges) CompetitionToTeamsOrErr() ([]*Team, error)

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

type CompetitionGroupBy

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

CompetitionGroupBy is the group-by builder for Competition entities.

func (*CompetitionGroupBy) Aggregate

func (cgb *CompetitionGroupBy) Aggregate(fns ...AggregateFunc) *CompetitionGroupBy

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

func (*CompetitionGroupBy) Bool

func (cgb *CompetitionGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*CompetitionGroupBy) BoolX

func (cgb *CompetitionGroupBy) BoolX(ctx context.Context) bool

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

func (*CompetitionGroupBy) Bools

func (cgb *CompetitionGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*CompetitionGroupBy) BoolsX

func (cgb *CompetitionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*CompetitionGroupBy) Float64

func (cgb *CompetitionGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*CompetitionGroupBy) Float64X

func (cgb *CompetitionGroupBy) Float64X(ctx context.Context) float64

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

func (*CompetitionGroupBy) Float64s

func (cgb *CompetitionGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*CompetitionGroupBy) Float64sX

func (cgb *CompetitionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*CompetitionGroupBy) Int

func (cgb *CompetitionGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*CompetitionGroupBy) IntX

func (cgb *CompetitionGroupBy) IntX(ctx context.Context) int

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

func (*CompetitionGroupBy) Ints

func (cgb *CompetitionGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*CompetitionGroupBy) IntsX

func (cgb *CompetitionGroupBy) IntsX(ctx context.Context) []int

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

func (*CompetitionGroupBy) Scan

func (cgb *CompetitionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*CompetitionGroupBy) ScanX

func (cgb *CompetitionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*CompetitionGroupBy) String

func (cgb *CompetitionGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*CompetitionGroupBy) StringX

func (cgb *CompetitionGroupBy) StringX(ctx context.Context) string

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

func (*CompetitionGroupBy) Strings

func (cgb *CompetitionGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*CompetitionGroupBy) StringsX

func (cgb *CompetitionGroupBy) StringsX(ctx context.Context) []string

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

type CompetitionMutation

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

CompetitionMutation represents an operation that mutates the Competition nodes in the graph.

func (*CompetitionMutation) AddCompetitionToTeamIDs

func (m *CompetitionMutation) AddCompetitionToTeamIDs(ids ...uuid.UUID)

AddCompetitionToTeamIDs adds the "CompetitionToTeams" edge to the Team entity by ids.

func (*CompetitionMutation) AddField

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

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

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

func (*CompetitionMutation) AddedField

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

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

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

func (*CompetitionMutation) AddedIDs

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

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

func (*CompetitionMutation) ClearCompetitionToProvider

func (m *CompetitionMutation) ClearCompetitionToProvider()

ClearCompetitionToProvider clears the "CompetitionToProvider" edge to the Provider entity.

func (*CompetitionMutation) ClearCompetitionToTeams

func (m *CompetitionMutation) ClearCompetitionToTeams()

ClearCompetitionToTeams clears the "CompetitionToTeams" edge to the Team entity.

func (*CompetitionMutation) ClearEdge

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

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

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

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

func (*CompetitionMutation) ClearedFields

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

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

func (CompetitionMutation) Client

func (m CompetitionMutation) 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 (*CompetitionMutation) CompetitionToProviderCleared

func (m *CompetitionMutation) CompetitionToProviderCleared() bool

CompetitionToProviderCleared reports if the "CompetitionToProvider" edge to the Provider entity was cleared.

func (*CompetitionMutation) CompetitionToProviderID

func (m *CompetitionMutation) CompetitionToProviderID() (id uuid.UUID, exists bool)

CompetitionToProviderID returns the "CompetitionToProvider" edge ID in the mutation.

func (*CompetitionMutation) CompetitionToProviderIDs

func (m *CompetitionMutation) CompetitionToProviderIDs() (ids []uuid.UUID)

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

func (*CompetitionMutation) CompetitionToTeamsCleared

func (m *CompetitionMutation) CompetitionToTeamsCleared() bool

CompetitionToTeamsCleared reports if the "CompetitionToTeams" edge to the Team entity was cleared.

func (*CompetitionMutation) CompetitionToTeamsIDs

func (m *CompetitionMutation) CompetitionToTeamsIDs() (ids []uuid.UUID)

CompetitionToTeamsIDs returns the "CompetitionToTeams" edge IDs in the mutation.

func (*CompetitionMutation) EdgeCleared

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

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

func (*CompetitionMutation) Field

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

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

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

func (*CompetitionMutation) Fields

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

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

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

func (*CompetitionMutation) IDs

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

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

func (*CompetitionMutation) Name

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

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

func (*CompetitionMutation) OldField

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

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

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

func (m *CompetitionMutation) Op() Op

Op returns the operation name.

func (*CompetitionMutation) RemoveCompetitionToTeamIDs

func (m *CompetitionMutation) RemoveCompetitionToTeamIDs(ids ...uuid.UUID)

RemoveCompetitionToTeamIDs removes the "CompetitionToTeams" edge to the Team entity by IDs.

func (*CompetitionMutation) RemovedCompetitionToTeamsIDs

func (m *CompetitionMutation) RemovedCompetitionToTeamsIDs() (ids []uuid.UUID)

RemovedCompetitionToTeams returns the removed IDs of the "CompetitionToTeams" edge to the Team entity.

func (*CompetitionMutation) RemovedEdges

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

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

func (*CompetitionMutation) RemovedIDs

func (m *CompetitionMutation) 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 (*CompetitionMutation) ResetCompetitionToProvider

func (m *CompetitionMutation) ResetCompetitionToProvider()

ResetCompetitionToProvider resets all changes to the "CompetitionToProvider" edge.

func (*CompetitionMutation) ResetCompetitionToTeams

func (m *CompetitionMutation) ResetCompetitionToTeams()

ResetCompetitionToTeams resets all changes to the "CompetitionToTeams" edge.

func (*CompetitionMutation) ResetEdge

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

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

func (m *CompetitionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CompetitionMutation) SetCompetitionToProviderID

func (m *CompetitionMutation) SetCompetitionToProviderID(id uuid.UUID)

SetCompetitionToProviderID sets the "CompetitionToProvider" edge to the Provider entity by id.

func (*CompetitionMutation) SetField

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

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

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

func (*CompetitionMutation) SetName

func (m *CompetitionMutation) SetName(s string)

SetName sets the "name" field.

func (CompetitionMutation) Tx

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

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

func (*CompetitionMutation) Type

func (m *CompetitionMutation) Type() string

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

func (*CompetitionMutation) Where

func (m *CompetitionMutation) Where(ps ...predicate.Competition)

Where appends a list predicates to the CompetitionMutation builder.

type CompetitionOrder

type CompetitionOrder struct {
	Direction OrderDirection         `json:"direction"`
	Field     *CompetitionOrderField `json:"field"`
}

CompetitionOrder defines the ordering of Competition.

type CompetitionOrderField

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

CompetitionOrderField defines the ordering field of Competition.

type CompetitionPaginateOption

type CompetitionPaginateOption func(*competitionPager) error

CompetitionPaginateOption enables pagination customization.

func WithCompetitionFilter

func WithCompetitionFilter(filter func(*CompetitionQuery) (*CompetitionQuery, error)) CompetitionPaginateOption

WithCompetitionFilter configures pagination filter.

func WithCompetitionOrder

func WithCompetitionOrder(order *CompetitionOrder) CompetitionPaginateOption

WithCompetitionOrder configures pagination ordering.

type CompetitionQuery

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

CompetitionQuery is the builder for querying Competition entities.

func (*CompetitionQuery) All

func (cq *CompetitionQuery) All(ctx context.Context) ([]*Competition, error)

All executes the query and returns a list of Competitions.

func (*CompetitionQuery) AllX

func (cq *CompetitionQuery) AllX(ctx context.Context) []*Competition

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

func (*CompetitionQuery) Clone

func (cq *CompetitionQuery) Clone() *CompetitionQuery

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

func (*CompetitionQuery) CollectFields

func (c *CompetitionQuery) CollectFields(ctx context.Context, satisfies ...string) *CompetitionQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*CompetitionQuery) Count

func (cq *CompetitionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CompetitionQuery) CountX

func (cq *CompetitionQuery) CountX(ctx context.Context) int

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

func (*CompetitionQuery) Exist

func (cq *CompetitionQuery) Exist(ctx context.Context) (bool, error)

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

func (*CompetitionQuery) ExistX

func (cq *CompetitionQuery) ExistX(ctx context.Context) bool

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

func (*CompetitionQuery) First

func (cq *CompetitionQuery) First(ctx context.Context) (*Competition, error)

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

func (*CompetitionQuery) FirstID

func (cq *CompetitionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CompetitionQuery) FirstIDX

func (cq *CompetitionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CompetitionQuery) FirstX

func (cq *CompetitionQuery) FirstX(ctx context.Context) *Competition

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

func (*CompetitionQuery) GroupBy

func (cq *CompetitionQuery) GroupBy(field string, fields ...string) *CompetitionGroupBy

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

Example:

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

client.Competition.Query().
	GroupBy(competition.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CompetitionQuery) IDs

func (cq *CompetitionQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*CompetitionQuery) IDsX

func (cq *CompetitionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CompetitionQuery) Limit

func (cq *CompetitionQuery) Limit(limit int) *CompetitionQuery

Limit adds a limit step to the query.

func (*CompetitionQuery) Offset

func (cq *CompetitionQuery) Offset(offset int) *CompetitionQuery

Offset adds an offset step to the query.

func (*CompetitionQuery) Only

func (cq *CompetitionQuery) Only(ctx context.Context) (*Competition, error)

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

func (*CompetitionQuery) OnlyID

func (cq *CompetitionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CompetitionQuery) OnlyIDX

func (cq *CompetitionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CompetitionQuery) OnlyX

func (cq *CompetitionQuery) OnlyX(ctx context.Context) *Competition

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

func (*CompetitionQuery) Order

func (cq *CompetitionQuery) Order(o ...OrderFunc) *CompetitionQuery

Order adds an order step to the query.

func (*CompetitionQuery) Paginate

func (c *CompetitionQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CompetitionPaginateOption,
) (*CompetitionConnection, error)

Paginate executes the query and returns a relay based cursor connection to Competition.

func (*CompetitionQuery) QueryCompetitionToProvider

func (cq *CompetitionQuery) QueryCompetitionToProvider() *ProviderQuery

QueryCompetitionToProvider chains the current query on the "CompetitionToProvider" edge.

func (*CompetitionQuery) QueryCompetitionToTeams

func (cq *CompetitionQuery) QueryCompetitionToTeams() *TeamQuery

QueryCompetitionToTeams chains the current query on the "CompetitionToTeams" edge.

func (*CompetitionQuery) Select

func (cq *CompetitionQuery) Select(fields ...string) *CompetitionSelect

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

Example:

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

client.Competition.Query().
	Select(competition.FieldName).
	Scan(ctx, &v)

func (*CompetitionQuery) Unique

func (cq *CompetitionQuery) Unique(unique bool) *CompetitionQuery

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

Where adds a new predicate for the CompetitionQuery builder.

func (*CompetitionQuery) WithCompetitionToProvider

func (cq *CompetitionQuery) WithCompetitionToProvider(opts ...func(*ProviderQuery)) *CompetitionQuery

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

func (*CompetitionQuery) WithCompetitionToTeams

func (cq *CompetitionQuery) WithCompetitionToTeams(opts ...func(*TeamQuery)) *CompetitionQuery

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

type CompetitionSelect

type CompetitionSelect struct {
	*CompetitionQuery
	// contains filtered or unexported fields
}

CompetitionSelect is the builder for selecting fields of Competition entities.

func (*CompetitionSelect) Bool

func (cs *CompetitionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*CompetitionSelect) BoolX

func (cs *CompetitionSelect) BoolX(ctx context.Context) bool

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

func (*CompetitionSelect) Bools

func (cs *CompetitionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*CompetitionSelect) BoolsX

func (cs *CompetitionSelect) BoolsX(ctx context.Context) []bool

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

func (*CompetitionSelect) Float64

func (cs *CompetitionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*CompetitionSelect) Float64X

func (cs *CompetitionSelect) Float64X(ctx context.Context) float64

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

func (*CompetitionSelect) Float64s

func (cs *CompetitionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*CompetitionSelect) Float64sX

func (cs *CompetitionSelect) Float64sX(ctx context.Context) []float64

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

func (*CompetitionSelect) Int

func (cs *CompetitionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*CompetitionSelect) IntX

func (cs *CompetitionSelect) IntX(ctx context.Context) int

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

func (*CompetitionSelect) Ints

func (cs *CompetitionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*CompetitionSelect) IntsX

func (cs *CompetitionSelect) IntsX(ctx context.Context) []int

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

func (*CompetitionSelect) Scan

func (cs *CompetitionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*CompetitionSelect) ScanX

func (cs *CompetitionSelect) ScanX(ctx context.Context, v interface{})

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

func (*CompetitionSelect) String

func (cs *CompetitionSelect) String(ctx context.Context) (_ string, err error)

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

func (*CompetitionSelect) StringX

func (cs *CompetitionSelect) StringX(ctx context.Context) string

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

func (*CompetitionSelect) Strings

func (cs *CompetitionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*CompetitionSelect) StringsX

func (cs *CompetitionSelect) StringsX(ctx context.Context) []string

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

type CompetitionUpdate

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

CompetitionUpdate is the builder for updating Competition entities.

func (*CompetitionUpdate) AddCompetitionToTeamIDs

func (cu *CompetitionUpdate) AddCompetitionToTeamIDs(ids ...uuid.UUID) *CompetitionUpdate

AddCompetitionToTeamIDs adds the "CompetitionToTeams" edge to the Team entity by IDs.

func (*CompetitionUpdate) AddCompetitionToTeams

func (cu *CompetitionUpdate) AddCompetitionToTeams(t ...*Team) *CompetitionUpdate

AddCompetitionToTeams adds the "CompetitionToTeams" edges to the Team entity.

func (*CompetitionUpdate) ClearCompetitionToProvider

func (cu *CompetitionUpdate) ClearCompetitionToProvider() *CompetitionUpdate

ClearCompetitionToProvider clears the "CompetitionToProvider" edge to the Provider entity.

func (*CompetitionUpdate) ClearCompetitionToTeams

func (cu *CompetitionUpdate) ClearCompetitionToTeams() *CompetitionUpdate

ClearCompetitionToTeams clears all "CompetitionToTeams" edges to the Team entity.

func (*CompetitionUpdate) Exec

func (cu *CompetitionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CompetitionUpdate) ExecX

func (cu *CompetitionUpdate) ExecX(ctx context.Context)

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

func (*CompetitionUpdate) Mutation

func (cu *CompetitionUpdate) Mutation() *CompetitionMutation

Mutation returns the CompetitionMutation object of the builder.

func (*CompetitionUpdate) RemoveCompetitionToTeamIDs

func (cu *CompetitionUpdate) RemoveCompetitionToTeamIDs(ids ...uuid.UUID) *CompetitionUpdate

RemoveCompetitionToTeamIDs removes the "CompetitionToTeams" edge to Team entities by IDs.

func (*CompetitionUpdate) RemoveCompetitionToTeams

func (cu *CompetitionUpdate) RemoveCompetitionToTeams(t ...*Team) *CompetitionUpdate

RemoveCompetitionToTeams removes "CompetitionToTeams" edges to Team entities.

func (*CompetitionUpdate) Save

func (cu *CompetitionUpdate) Save(ctx context.Context) (int, error)

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

func (*CompetitionUpdate) SaveX

func (cu *CompetitionUpdate) SaveX(ctx context.Context) int

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

func (*CompetitionUpdate) SetCompetitionToProvider

func (cu *CompetitionUpdate) SetCompetitionToProvider(p *Provider) *CompetitionUpdate

SetCompetitionToProvider sets the "CompetitionToProvider" edge to the Provider entity.

func (*CompetitionUpdate) SetCompetitionToProviderID

func (cu *CompetitionUpdate) SetCompetitionToProviderID(id uuid.UUID) *CompetitionUpdate

SetCompetitionToProviderID sets the "CompetitionToProvider" edge to the Provider entity by ID.

func (*CompetitionUpdate) SetName

func (cu *CompetitionUpdate) SetName(s string) *CompetitionUpdate

SetName sets the "name" field.

func (*CompetitionUpdate) Where

Where appends a list predicates to the CompetitionUpdate builder.

type CompetitionUpdateOne

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

CompetitionUpdateOne is the builder for updating a single Competition entity.

func (*CompetitionUpdateOne) AddCompetitionToTeamIDs

func (cuo *CompetitionUpdateOne) AddCompetitionToTeamIDs(ids ...uuid.UUID) *CompetitionUpdateOne

AddCompetitionToTeamIDs adds the "CompetitionToTeams" edge to the Team entity by IDs.

func (*CompetitionUpdateOne) AddCompetitionToTeams

func (cuo *CompetitionUpdateOne) AddCompetitionToTeams(t ...*Team) *CompetitionUpdateOne

AddCompetitionToTeams adds the "CompetitionToTeams" edges to the Team entity.

func (*CompetitionUpdateOne) ClearCompetitionToProvider

func (cuo *CompetitionUpdateOne) ClearCompetitionToProvider() *CompetitionUpdateOne

ClearCompetitionToProvider clears the "CompetitionToProvider" edge to the Provider entity.

func (*CompetitionUpdateOne) ClearCompetitionToTeams

func (cuo *CompetitionUpdateOne) ClearCompetitionToTeams() *CompetitionUpdateOne

ClearCompetitionToTeams clears all "CompetitionToTeams" edges to the Team entity.

func (*CompetitionUpdateOne) Exec

func (cuo *CompetitionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CompetitionUpdateOne) ExecX

func (cuo *CompetitionUpdateOne) ExecX(ctx context.Context)

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

func (*CompetitionUpdateOne) Mutation

func (cuo *CompetitionUpdateOne) Mutation() *CompetitionMutation

Mutation returns the CompetitionMutation object of the builder.

func (*CompetitionUpdateOne) RemoveCompetitionToTeamIDs

func (cuo *CompetitionUpdateOne) RemoveCompetitionToTeamIDs(ids ...uuid.UUID) *CompetitionUpdateOne

RemoveCompetitionToTeamIDs removes the "CompetitionToTeams" edge to Team entities by IDs.

func (*CompetitionUpdateOne) RemoveCompetitionToTeams

func (cuo *CompetitionUpdateOne) RemoveCompetitionToTeams(t ...*Team) *CompetitionUpdateOne

RemoveCompetitionToTeams removes "CompetitionToTeams" edges to Team entities.

func (*CompetitionUpdateOne) Save

Save executes the query and returns the updated Competition entity.

func (*CompetitionUpdateOne) SaveX

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

func (*CompetitionUpdateOne) Select

func (cuo *CompetitionUpdateOne) Select(field string, fields ...string) *CompetitionUpdateOne

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

func (*CompetitionUpdateOne) SetCompetitionToProvider

func (cuo *CompetitionUpdateOne) SetCompetitionToProvider(p *Provider) *CompetitionUpdateOne

SetCompetitionToProvider sets the "CompetitionToProvider" edge to the Provider entity.

func (*CompetitionUpdateOne) SetCompetitionToProviderID

func (cuo *CompetitionUpdateOne) SetCompetitionToProviderID(id uuid.UUID) *CompetitionUpdateOne

SetCompetitionToProviderID sets the "CompetitionToProvider" edge to the Provider entity by ID.

func (*CompetitionUpdateOne) SetName

SetName sets the "name" field.

type Competitions

type Competitions []*Competition

Competitions is a parsable slice of Competition.

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 Cursor

type Cursor struct {
	ID    uuid.UUID `msgpack:"i"`
	Value Value     `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type Edge

type Edge struct {
	Type string      `json:"type,omitempty"` // edge type.
	Name string      `json:"name,omitempty"` // edge name.
	IDs  []uuid.UUID `json:"ids,omitempty"`  // node ids (where this edge point to).
}

Edges between two nodes.

type Field

type Field struct {
	Type  string `json:"type,omitempty"`  // field type.
	Name  string `json:"name,omitempty"`  // field name (as in struct).
	Value string `json:"value,omitempty"` // stringified value.
}

Field of a node.

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 Node

type Node struct {
	ID     uuid.UUID `json:"id,omitempty"`     // node id.
	Type   string    `json:"type,omitempty"`   // node type.
	Fields []*Field  `json:"fields,omitempty"` // node fields.
	Edges  []*Edge   `json:"edges,omitempty"`  // node edges.
}

Node in the graph.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, uuid.UUID) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	Node(context.Context) (*Node, error)
}

Noder wraps the basic Node method.

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 OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

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 PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

type Policy

type Policy = ent.Policy

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

type Provider

type Provider struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	// [REQUIRED] The unique name (aka. slug) for the provider.
	Name string `json:"name,omitempty"`
	// Type holds the value of the "type" field.
	// [REQUIRED] The type of provider this is (must match a registered one in https://github.com/BradHacker/compsole/tree/main/compsole/providers)
	Type string `json:"type,omitempty"`
	// Config holds the value of the "config" field.
	// [REQUIRED] This is the JSON configuration for the provider.
	Config string `json:"config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProviderQuery when eager-loading is set.
	Edges ProviderEdges `json:"edges"`
	// contains filtered or unexported fields
}

Provider is the model entity for the Provider schema.

func (*Provider) Node

func (pr *Provider) Node(ctx context.Context) (node *Node, err error)

func (*Provider) ProviderToCompetitions

func (pr *Provider) ProviderToCompetitions(ctx context.Context) ([]*Competition, error)

func (*Provider) QueryProviderToCompetitions

func (pr *Provider) QueryProviderToCompetitions() *CompetitionQuery

QueryProviderToCompetitions queries the "ProviderToCompetitions" edge of the Provider entity.

func (*Provider) String

func (pr *Provider) String() string

String implements the fmt.Stringer.

func (*Provider) ToEdge

func (pr *Provider) ToEdge(order *ProviderOrder) *ProviderEdge

ToEdge converts Provider into ProviderEdge.

func (*Provider) Unwrap

func (pr *Provider) Unwrap() *Provider

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

func (pr *Provider) Update() *ProviderUpdateOne

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

type ProviderClient

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

ProviderClient is a client for the Provider schema.

func NewProviderClient

func NewProviderClient(c config) *ProviderClient

NewProviderClient returns a client for the Provider from the given config.

func (*ProviderClient) Create

func (c *ProviderClient) Create() *ProviderCreate

Create returns a create builder for Provider.

func (*ProviderClient) CreateBulk

func (c *ProviderClient) CreateBulk(builders ...*ProviderCreate) *ProviderCreateBulk

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

func (*ProviderClient) Delete

func (c *ProviderClient) Delete() *ProviderDelete

Delete returns a delete builder for Provider.

func (*ProviderClient) DeleteOne

func (c *ProviderClient) DeleteOne(pr *Provider) *ProviderDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ProviderClient) DeleteOneID

func (c *ProviderClient) DeleteOneID(id uuid.UUID) *ProviderDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ProviderClient) Get

func (c *ProviderClient) Get(ctx context.Context, id uuid.UUID) (*Provider, error)

Get returns a Provider entity by its id.

func (*ProviderClient) GetX

func (c *ProviderClient) GetX(ctx context.Context, id uuid.UUID) *Provider

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

func (*ProviderClient) Hooks

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

Hooks returns the client hooks.

func (*ProviderClient) Query

func (c *ProviderClient) Query() *ProviderQuery

Query returns a query builder for Provider.

func (*ProviderClient) QueryProviderToCompetitions

func (c *ProviderClient) QueryProviderToCompetitions(pr *Provider) *CompetitionQuery

QueryProviderToCompetitions queries the ProviderToCompetitions edge of a Provider.

func (*ProviderClient) Update

func (c *ProviderClient) Update() *ProviderUpdate

Update returns an update builder for Provider.

func (*ProviderClient) UpdateOne

func (c *ProviderClient) UpdateOne(pr *Provider) *ProviderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProviderClient) UpdateOneID

func (c *ProviderClient) UpdateOneID(id uuid.UUID) *ProviderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProviderClient) Use

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

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

type ProviderConnection

type ProviderConnection struct {
	Edges      []*ProviderEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

ProviderConnection is the connection containing edges to Provider.

type ProviderCreate

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

ProviderCreate is the builder for creating a Provider entity.

func (*ProviderCreate) AddProviderToCompetitionIDs

func (pc *ProviderCreate) AddProviderToCompetitionIDs(ids ...uuid.UUID) *ProviderCreate

AddProviderToCompetitionIDs adds the "ProviderToCompetitions" edge to the Competition entity by IDs.

func (*ProviderCreate) AddProviderToCompetitions

func (pc *ProviderCreate) AddProviderToCompetitions(c ...*Competition) *ProviderCreate

AddProviderToCompetitions adds the "ProviderToCompetitions" edges to the Competition entity.

func (*ProviderCreate) Exec

func (pc *ProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderCreate) ExecX

func (pc *ProviderCreate) ExecX(ctx context.Context)

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

func (*ProviderCreate) Mutation

func (pc *ProviderCreate) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderCreate) Save

func (pc *ProviderCreate) Save(ctx context.Context) (*Provider, error)

Save creates the Provider in the database.

func (*ProviderCreate) SaveX

func (pc *ProviderCreate) SaveX(ctx context.Context) *Provider

SaveX calls Save and panics if Save returns an error.

func (*ProviderCreate) SetConfig

func (pc *ProviderCreate) SetConfig(s string) *ProviderCreate

SetConfig sets the "config" field.

func (*ProviderCreate) SetID

func (pc *ProviderCreate) SetID(u uuid.UUID) *ProviderCreate

SetID sets the "id" field.

func (*ProviderCreate) SetName

func (pc *ProviderCreate) SetName(s string) *ProviderCreate

SetName sets the "name" field.

func (*ProviderCreate) SetNillableID

func (pc *ProviderCreate) SetNillableID(u *uuid.UUID) *ProviderCreate

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

func (*ProviderCreate) SetType

func (pc *ProviderCreate) SetType(s string) *ProviderCreate

SetType sets the "type" field.

type ProviderCreateBulk

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

ProviderCreateBulk is the builder for creating many Provider entities in bulk.

func (*ProviderCreateBulk) Exec

func (pcb *ProviderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderCreateBulk) ExecX

func (pcb *ProviderCreateBulk) ExecX(ctx context.Context)

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

func (*ProviderCreateBulk) Save

func (pcb *ProviderCreateBulk) Save(ctx context.Context) ([]*Provider, error)

Save creates the Provider entities in the database.

func (*ProviderCreateBulk) SaveX

func (pcb *ProviderCreateBulk) SaveX(ctx context.Context) []*Provider

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

type ProviderDelete

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

ProviderDelete is the builder for deleting a Provider entity.

func (*ProviderDelete) Exec

func (pd *ProviderDelete) Exec(ctx context.Context) (int, error)

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

func (*ProviderDelete) ExecX

func (pd *ProviderDelete) ExecX(ctx context.Context) int

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

func (*ProviderDelete) Where

func (pd *ProviderDelete) Where(ps ...predicate.Provider) *ProviderDelete

Where appends a list predicates to the ProviderDelete builder.

type ProviderDeleteOne

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

ProviderDeleteOne is the builder for deleting a single Provider entity.

func (*ProviderDeleteOne) Exec

func (pdo *ProviderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProviderDeleteOne) ExecX

func (pdo *ProviderDeleteOne) ExecX(ctx context.Context)

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

type ProviderEdge

type ProviderEdge struct {
	Node   *Provider `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

ProviderEdge is the edge representation of Provider.

type ProviderEdges

type ProviderEdges struct {
	// ProviderToCompetitions holds the value of the ProviderToCompetitions edge.
	ProviderToCompetitions []*Competition `json:"ProviderToCompetitions,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProviderEdges) ProviderToCompetitionsOrErr

func (e ProviderEdges) ProviderToCompetitionsOrErr() ([]*Competition, error)

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

type ProviderGroupBy

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

ProviderGroupBy is the group-by builder for Provider entities.

func (*ProviderGroupBy) Aggregate

func (pgb *ProviderGroupBy) Aggregate(fns ...AggregateFunc) *ProviderGroupBy

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

func (*ProviderGroupBy) Bool

func (pgb *ProviderGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ProviderGroupBy) BoolX

func (pgb *ProviderGroupBy) BoolX(ctx context.Context) bool

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

func (*ProviderGroupBy) Bools

func (pgb *ProviderGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ProviderGroupBy) BoolsX

func (pgb *ProviderGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ProviderGroupBy) Float64

func (pgb *ProviderGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ProviderGroupBy) Float64X

func (pgb *ProviderGroupBy) Float64X(ctx context.Context) float64

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

func (*ProviderGroupBy) Float64s

func (pgb *ProviderGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ProviderGroupBy) Float64sX

func (pgb *ProviderGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ProviderGroupBy) Int

func (pgb *ProviderGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ProviderGroupBy) IntX

func (pgb *ProviderGroupBy) IntX(ctx context.Context) int

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

func (*ProviderGroupBy) Ints

func (pgb *ProviderGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ProviderGroupBy) IntsX

func (pgb *ProviderGroupBy) IntsX(ctx context.Context) []int

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

func (*ProviderGroupBy) Scan

func (pgb *ProviderGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ProviderGroupBy) ScanX

func (pgb *ProviderGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ProviderGroupBy) String

func (pgb *ProviderGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ProviderGroupBy) StringX

func (pgb *ProviderGroupBy) StringX(ctx context.Context) string

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

func (*ProviderGroupBy) Strings

func (pgb *ProviderGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ProviderGroupBy) StringsX

func (pgb *ProviderGroupBy) StringsX(ctx context.Context) []string

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

type ProviderMutation

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

ProviderMutation represents an operation that mutates the Provider nodes in the graph.

func (*ProviderMutation) AddField

func (m *ProviderMutation) 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 (*ProviderMutation) AddProviderToCompetitionIDs

func (m *ProviderMutation) AddProviderToCompetitionIDs(ids ...uuid.UUID)

AddProviderToCompetitionIDs adds the "ProviderToCompetitions" edge to the Competition entity by ids.

func (*ProviderMutation) AddedEdges

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

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

func (*ProviderMutation) AddedField

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

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

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

func (*ProviderMutation) AddedIDs

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

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

func (*ProviderMutation) ClearEdge

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

func (m *ProviderMutation) 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 (*ProviderMutation) ClearProviderToCompetitions

func (m *ProviderMutation) ClearProviderToCompetitions()

ClearProviderToCompetitions clears the "ProviderToCompetitions" edge to the Competition entity.

func (*ProviderMutation) ClearedEdges

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

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

func (*ProviderMutation) ClearedFields

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

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

func (ProviderMutation) Client

func (m ProviderMutation) 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 (*ProviderMutation) Config

func (m *ProviderMutation) Config() (r string, exists bool)

Config returns the value of the "config" field in the mutation.

func (*ProviderMutation) EdgeCleared

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

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

func (*ProviderMutation) Field

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

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

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

func (*ProviderMutation) Fields

func (m *ProviderMutation) 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 (*ProviderMutation) GetType

func (m *ProviderMutation) GetType() (r string, exists bool)

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

func (*ProviderMutation) ID

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

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

func (*ProviderMutation) IDs

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

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

func (*ProviderMutation) Name

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

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

func (*ProviderMutation) OldConfig

func (m *ProviderMutation) OldConfig(ctx context.Context) (v string, err error)

OldConfig returns the old "config" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldField

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

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

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

func (m *ProviderMutation) OldType(ctx context.Context) (v string, err error)

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

func (m *ProviderMutation) Op() Op

Op returns the operation name.

func (*ProviderMutation) ProviderToCompetitionsCleared

func (m *ProviderMutation) ProviderToCompetitionsCleared() bool

ProviderToCompetitionsCleared reports if the "ProviderToCompetitions" edge to the Competition entity was cleared.

func (*ProviderMutation) ProviderToCompetitionsIDs

func (m *ProviderMutation) ProviderToCompetitionsIDs() (ids []uuid.UUID)

ProviderToCompetitionsIDs returns the "ProviderToCompetitions" edge IDs in the mutation.

func (*ProviderMutation) RemoveProviderToCompetitionIDs

func (m *ProviderMutation) RemoveProviderToCompetitionIDs(ids ...uuid.UUID)

RemoveProviderToCompetitionIDs removes the "ProviderToCompetitions" edge to the Competition entity by IDs.

func (*ProviderMutation) RemovedEdges

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

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

func (*ProviderMutation) RemovedIDs

func (m *ProviderMutation) 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 (*ProviderMutation) RemovedProviderToCompetitionsIDs

func (m *ProviderMutation) RemovedProviderToCompetitionsIDs() (ids []uuid.UUID)

RemovedProviderToCompetitions returns the removed IDs of the "ProviderToCompetitions" edge to the Competition entity.

func (*ProviderMutation) ResetConfig

func (m *ProviderMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*ProviderMutation) ResetEdge

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

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

func (m *ProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProviderMutation) ResetProviderToCompetitions

func (m *ProviderMutation) ResetProviderToCompetitions()

ResetProviderToCompetitions resets all changes to the "ProviderToCompetitions" edge.

func (*ProviderMutation) ResetType

func (m *ProviderMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ProviderMutation) SetConfig

func (m *ProviderMutation) SetConfig(s string)

SetConfig sets the "config" field.

func (*ProviderMutation) SetField

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

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

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

func (*ProviderMutation) SetName

func (m *ProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*ProviderMutation) SetType

func (m *ProviderMutation) SetType(s string)

SetType sets the "type" field.

func (ProviderMutation) Tx

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

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

func (*ProviderMutation) Type

func (m *ProviderMutation) Type() string

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

func (*ProviderMutation) Where

func (m *ProviderMutation) Where(ps ...predicate.Provider)

Where appends a list predicates to the ProviderMutation builder.

type ProviderOrder

type ProviderOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *ProviderOrderField `json:"field"`
}

ProviderOrder defines the ordering of Provider.

type ProviderOrderField

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

ProviderOrderField defines the ordering field of Provider.

type ProviderPaginateOption

type ProviderPaginateOption func(*providerPager) error

ProviderPaginateOption enables pagination customization.

func WithProviderFilter

func WithProviderFilter(filter func(*ProviderQuery) (*ProviderQuery, error)) ProviderPaginateOption

WithProviderFilter configures pagination filter.

func WithProviderOrder

func WithProviderOrder(order *ProviderOrder) ProviderPaginateOption

WithProviderOrder configures pagination ordering.

type ProviderQuery

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

ProviderQuery is the builder for querying Provider entities.

func (*ProviderQuery) All

func (pq *ProviderQuery) All(ctx context.Context) ([]*Provider, error)

All executes the query and returns a list of Providers.

func (*ProviderQuery) AllX

func (pq *ProviderQuery) AllX(ctx context.Context) []*Provider

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

func (*ProviderQuery) Clone

func (pq *ProviderQuery) Clone() *ProviderQuery

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

func (*ProviderQuery) CollectFields

func (pr *ProviderQuery) CollectFields(ctx context.Context, satisfies ...string) *ProviderQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ProviderQuery) Count

func (pq *ProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProviderQuery) CountX

func (pq *ProviderQuery) CountX(ctx context.Context) int

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

func (*ProviderQuery) Exist

func (pq *ProviderQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProviderQuery) ExistX

func (pq *ProviderQuery) ExistX(ctx context.Context) bool

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

func (*ProviderQuery) First

func (pq *ProviderQuery) First(ctx context.Context) (*Provider, error)

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

func (*ProviderQuery) FirstID

func (pq *ProviderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ProviderQuery) FirstIDX

func (pq *ProviderQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ProviderQuery) FirstX

func (pq *ProviderQuery) FirstX(ctx context.Context) *Provider

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

func (*ProviderQuery) GroupBy

func (pq *ProviderQuery) GroupBy(field string, fields ...string) *ProviderGroupBy

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

Example:

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

client.Provider.Query().
	GroupBy(provider.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProviderQuery) IDs

func (pq *ProviderQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ProviderQuery) IDsX

func (pq *ProviderQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ProviderQuery) Limit

func (pq *ProviderQuery) Limit(limit int) *ProviderQuery

Limit adds a limit step to the query.

func (*ProviderQuery) Offset

func (pq *ProviderQuery) Offset(offset int) *ProviderQuery

Offset adds an offset step to the query.

func (*ProviderQuery) Only

func (pq *ProviderQuery) Only(ctx context.Context) (*Provider, error)

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

func (*ProviderQuery) OnlyID

func (pq *ProviderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ProviderQuery) OnlyIDX

func (pq *ProviderQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ProviderQuery) OnlyX

func (pq *ProviderQuery) OnlyX(ctx context.Context) *Provider

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

func (*ProviderQuery) Order

func (pq *ProviderQuery) Order(o ...OrderFunc) *ProviderQuery

Order adds an order step to the query.

func (*ProviderQuery) Paginate

func (pr *ProviderQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ProviderPaginateOption,
) (*ProviderConnection, error)

Paginate executes the query and returns a relay based cursor connection to Provider.

func (*ProviderQuery) QueryProviderToCompetitions

func (pq *ProviderQuery) QueryProviderToCompetitions() *CompetitionQuery

QueryProviderToCompetitions chains the current query on the "ProviderToCompetitions" edge.

func (*ProviderQuery) Select

func (pq *ProviderQuery) Select(fields ...string) *ProviderSelect

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

Example:

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

client.Provider.Query().
	Select(provider.FieldName).
	Scan(ctx, &v)

func (*ProviderQuery) Unique

func (pq *ProviderQuery) Unique(unique bool) *ProviderQuery

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

func (pq *ProviderQuery) Where(ps ...predicate.Provider) *ProviderQuery

Where adds a new predicate for the ProviderQuery builder.

func (*ProviderQuery) WithProviderToCompetitions

func (pq *ProviderQuery) WithProviderToCompetitions(opts ...func(*CompetitionQuery)) *ProviderQuery

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

type ProviderSelect

type ProviderSelect struct {
	*ProviderQuery
	// contains filtered or unexported fields
}

ProviderSelect is the builder for selecting fields of Provider entities.

func (*ProviderSelect) Bool

func (ps *ProviderSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ProviderSelect) BoolX

func (ps *ProviderSelect) BoolX(ctx context.Context) bool

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

func (*ProviderSelect) Bools

func (ps *ProviderSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ProviderSelect) BoolsX

func (ps *ProviderSelect) BoolsX(ctx context.Context) []bool

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

func (*ProviderSelect) Float64

func (ps *ProviderSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ProviderSelect) Float64X

func (ps *ProviderSelect) Float64X(ctx context.Context) float64

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

func (*ProviderSelect) Float64s

func (ps *ProviderSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ProviderSelect) Float64sX

func (ps *ProviderSelect) Float64sX(ctx context.Context) []float64

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

func (*ProviderSelect) Int

func (ps *ProviderSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ProviderSelect) IntX

func (ps *ProviderSelect) IntX(ctx context.Context) int

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

func (*ProviderSelect) Ints

func (ps *ProviderSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ProviderSelect) IntsX

func (ps *ProviderSelect) IntsX(ctx context.Context) []int

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

func (*ProviderSelect) Scan

func (ps *ProviderSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ProviderSelect) ScanX

func (ps *ProviderSelect) ScanX(ctx context.Context, v interface{})

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

func (*ProviderSelect) String

func (ps *ProviderSelect) String(ctx context.Context) (_ string, err error)

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

func (*ProviderSelect) StringX

func (ps *ProviderSelect) StringX(ctx context.Context) string

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

func (*ProviderSelect) Strings

func (ps *ProviderSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ProviderSelect) StringsX

func (ps *ProviderSelect) StringsX(ctx context.Context) []string

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

type ProviderUpdate

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

ProviderUpdate is the builder for updating Provider entities.

func (*ProviderUpdate) AddProviderToCompetitionIDs

func (pu *ProviderUpdate) AddProviderToCompetitionIDs(ids ...uuid.UUID) *ProviderUpdate

AddProviderToCompetitionIDs adds the "ProviderToCompetitions" edge to the Competition entity by IDs.

func (*ProviderUpdate) AddProviderToCompetitions

func (pu *ProviderUpdate) AddProviderToCompetitions(c ...*Competition) *ProviderUpdate

AddProviderToCompetitions adds the "ProviderToCompetitions" edges to the Competition entity.

func (*ProviderUpdate) ClearProviderToCompetitions

func (pu *ProviderUpdate) ClearProviderToCompetitions() *ProviderUpdate

ClearProviderToCompetitions clears all "ProviderToCompetitions" edges to the Competition entity.

func (*ProviderUpdate) Exec

func (pu *ProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderUpdate) ExecX

func (pu *ProviderUpdate) ExecX(ctx context.Context)

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

func (*ProviderUpdate) Mutation

func (pu *ProviderUpdate) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderUpdate) RemoveProviderToCompetitionIDs

func (pu *ProviderUpdate) RemoveProviderToCompetitionIDs(ids ...uuid.UUID) *ProviderUpdate

RemoveProviderToCompetitionIDs removes the "ProviderToCompetitions" edge to Competition entities by IDs.

func (*ProviderUpdate) RemoveProviderToCompetitions

func (pu *ProviderUpdate) RemoveProviderToCompetitions(c ...*Competition) *ProviderUpdate

RemoveProviderToCompetitions removes "ProviderToCompetitions" edges to Competition entities.

func (*ProviderUpdate) Save

func (pu *ProviderUpdate) Save(ctx context.Context) (int, error)

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

func (*ProviderUpdate) SaveX

func (pu *ProviderUpdate) SaveX(ctx context.Context) int

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

func (*ProviderUpdate) SetConfig

func (pu *ProviderUpdate) SetConfig(s string) *ProviderUpdate

SetConfig sets the "config" field.

func (*ProviderUpdate) SetName

func (pu *ProviderUpdate) SetName(s string) *ProviderUpdate

SetName sets the "name" field.

func (*ProviderUpdate) SetType

func (pu *ProviderUpdate) SetType(s string) *ProviderUpdate

SetType sets the "type" field.

func (*ProviderUpdate) Where

func (pu *ProviderUpdate) Where(ps ...predicate.Provider) *ProviderUpdate

Where appends a list predicates to the ProviderUpdate builder.

type ProviderUpdateOne

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

ProviderUpdateOne is the builder for updating a single Provider entity.

func (*ProviderUpdateOne) AddProviderToCompetitionIDs

func (puo *ProviderUpdateOne) AddProviderToCompetitionIDs(ids ...uuid.UUID) *ProviderUpdateOne

AddProviderToCompetitionIDs adds the "ProviderToCompetitions" edge to the Competition entity by IDs.

func (*ProviderUpdateOne) AddProviderToCompetitions

func (puo *ProviderUpdateOne) AddProviderToCompetitions(c ...*Competition) *ProviderUpdateOne

AddProviderToCompetitions adds the "ProviderToCompetitions" edges to the Competition entity.

func (*ProviderUpdateOne) ClearProviderToCompetitions

func (puo *ProviderUpdateOne) ClearProviderToCompetitions() *ProviderUpdateOne

ClearProviderToCompetitions clears all "ProviderToCompetitions" edges to the Competition entity.

func (*ProviderUpdateOne) Exec

func (puo *ProviderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProviderUpdateOne) ExecX

func (puo *ProviderUpdateOne) ExecX(ctx context.Context)

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

func (*ProviderUpdateOne) Mutation

func (puo *ProviderUpdateOne) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderUpdateOne) RemoveProviderToCompetitionIDs

func (puo *ProviderUpdateOne) RemoveProviderToCompetitionIDs(ids ...uuid.UUID) *ProviderUpdateOne

RemoveProviderToCompetitionIDs removes the "ProviderToCompetitions" edge to Competition entities by IDs.

func (*ProviderUpdateOne) RemoveProviderToCompetitions

func (puo *ProviderUpdateOne) RemoveProviderToCompetitions(c ...*Competition) *ProviderUpdateOne

RemoveProviderToCompetitions removes "ProviderToCompetitions" edges to Competition entities.

func (*ProviderUpdateOne) Save

func (puo *ProviderUpdateOne) Save(ctx context.Context) (*Provider, error)

Save executes the query and returns the updated Provider entity.

func (*ProviderUpdateOne) SaveX

func (puo *ProviderUpdateOne) SaveX(ctx context.Context) *Provider

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

func (*ProviderUpdateOne) Select

func (puo *ProviderUpdateOne) Select(field string, fields ...string) *ProviderUpdateOne

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

func (*ProviderUpdateOne) SetConfig

func (puo *ProviderUpdateOne) SetConfig(s string) *ProviderUpdateOne

SetConfig sets the "config" field.

func (*ProviderUpdateOne) SetName

func (puo *ProviderUpdateOne) SetName(s string) *ProviderUpdateOne

SetName sets the "name" field.

func (*ProviderUpdateOne) SetType

func (puo *ProviderUpdateOne) SetType(s string) *ProviderUpdateOne

SetType sets the "type" field.

type Providers

type Providers []*Provider

Providers is a parsable slice of Provider.

type Query

type Query = ent.Query

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

type RollbackFunc

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

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type ServiceAccount

type ServiceAccount struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	// [REQUIRED] The display/common name for the service account.
	DisplayName string `json:"display_name,omitempty"`
	// APIKey holds the value of the "api_key" field.
	// [REQUIRED] The API key for the service account. Equivalent to a username.
	APIKey uuid.UUID `json:"api_key,omitempty"`
	// APISecret holds the value of the "api_secret" field.
	// [REQUIRED] The API secret for the service account. This value MUST be protected.
	APISecret uuid.UUID `json:"api_secret,omitempty"`
	// Active holds the value of the "active" field.
	// [REQUIRED] Determines whether or not the service account is active or not
	Active bool `json:"active,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ServiceAccountQuery when eager-loading is set.
	Edges ServiceAccountEdges `json:"edges"`
	// contains filtered or unexported fields
}

ServiceAccount is the model entity for the ServiceAccount schema.

func (*ServiceAccount) Node

func (sa *ServiceAccount) Node(ctx context.Context) (node *Node, err error)

func (*ServiceAccount) QueryServiceAccountToActions

func (sa *ServiceAccount) QueryServiceAccountToActions() *ActionQuery

QueryServiceAccountToActions queries the "ServiceAccountToActions" edge of the ServiceAccount entity.

func (*ServiceAccount) QueryServiceAccountToToken

func (sa *ServiceAccount) QueryServiceAccountToToken() *ServiceTokenQuery

QueryServiceAccountToToken queries the "ServiceAccountToToken" edge of the ServiceAccount entity.

func (*ServiceAccount) ServiceAccountToActions

func (sa *ServiceAccount) ServiceAccountToActions(ctx context.Context) ([]*Action, error)

func (*ServiceAccount) ServiceAccountToToken

func (sa *ServiceAccount) ServiceAccountToToken(ctx context.Context) ([]*ServiceToken, error)

func (*ServiceAccount) String

func (sa *ServiceAccount) String() string

String implements the fmt.Stringer.

func (*ServiceAccount) ToEdge

ToEdge converts ServiceAccount into ServiceAccountEdge.

func (*ServiceAccount) Unwrap

func (sa *ServiceAccount) Unwrap() *ServiceAccount

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

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

type ServiceAccountClient

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

ServiceAccountClient is a client for the ServiceAccount schema.

func NewServiceAccountClient

func NewServiceAccountClient(c config) *ServiceAccountClient

NewServiceAccountClient returns a client for the ServiceAccount from the given config.

func (*ServiceAccountClient) Create

Create returns a create builder for ServiceAccount.

func (*ServiceAccountClient) CreateBulk

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

func (*ServiceAccountClient) Delete

Delete returns a delete builder for ServiceAccount.

func (*ServiceAccountClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ServiceAccountClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*ServiceAccountClient) Get

Get returns a ServiceAccount entity by its id.

func (*ServiceAccountClient) GetX

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

func (*ServiceAccountClient) Hooks

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

Hooks returns the client hooks.

func (*ServiceAccountClient) Query

Query returns a query builder for ServiceAccount.

func (*ServiceAccountClient) QueryServiceAccountToActions

func (c *ServiceAccountClient) QueryServiceAccountToActions(sa *ServiceAccount) *ActionQuery

QueryServiceAccountToActions queries the ServiceAccountToActions edge of a ServiceAccount.

func (*ServiceAccountClient) QueryServiceAccountToToken

func (c *ServiceAccountClient) QueryServiceAccountToToken(sa *ServiceAccount) *ServiceTokenQuery

QueryServiceAccountToToken queries the ServiceAccountToToken edge of a ServiceAccount.

func (*ServiceAccountClient) Update

Update returns an update builder for ServiceAccount.

func (*ServiceAccountClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ServiceAccountClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ServiceAccountClient) Use

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

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

type ServiceAccountConnection

type ServiceAccountConnection struct {
	Edges      []*ServiceAccountEdge `json:"edges"`
	PageInfo   PageInfo              `json:"pageInfo"`
	TotalCount int                   `json:"totalCount"`
}

ServiceAccountConnection is the connection containing edges to ServiceAccount.

type ServiceAccountCreate

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

ServiceAccountCreate is the builder for creating a ServiceAccount entity.

func (*ServiceAccountCreate) AddServiceAccountToActionIDs

func (sac *ServiceAccountCreate) AddServiceAccountToActionIDs(ids ...uuid.UUID) *ServiceAccountCreate

AddServiceAccountToActionIDs adds the "ServiceAccountToActions" edge to the Action entity by IDs.

func (*ServiceAccountCreate) AddServiceAccountToActions

func (sac *ServiceAccountCreate) AddServiceAccountToActions(a ...*Action) *ServiceAccountCreate

AddServiceAccountToActions adds the "ServiceAccountToActions" edges to the Action entity.

func (*ServiceAccountCreate) AddServiceAccountToToken

func (sac *ServiceAccountCreate) AddServiceAccountToToken(s ...*ServiceToken) *ServiceAccountCreate

AddServiceAccountToToken adds the "ServiceAccountToToken" edges to the ServiceToken entity.

func (*ServiceAccountCreate) AddServiceAccountToTokenIDs

func (sac *ServiceAccountCreate) AddServiceAccountToTokenIDs(ids ...uuid.UUID) *ServiceAccountCreate

AddServiceAccountToTokenIDs adds the "ServiceAccountToToken" edge to the ServiceToken entity by IDs.

func (*ServiceAccountCreate) Exec

func (sac *ServiceAccountCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceAccountCreate) ExecX

func (sac *ServiceAccountCreate) ExecX(ctx context.Context)

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

func (*ServiceAccountCreate) Mutation

Mutation returns the ServiceAccountMutation object of the builder.

func (*ServiceAccountCreate) Save

Save creates the ServiceAccount in the database.

func (*ServiceAccountCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ServiceAccountCreate) SetAPIKey

SetAPIKey sets the "api_key" field.

func (*ServiceAccountCreate) SetAPISecret

func (sac *ServiceAccountCreate) SetAPISecret(u uuid.UUID) *ServiceAccountCreate

SetAPISecret sets the "api_secret" field.

func (*ServiceAccountCreate) SetActive

func (sac *ServiceAccountCreate) SetActive(b bool) *ServiceAccountCreate

SetActive sets the "active" field.

func (*ServiceAccountCreate) SetDisplayName

func (sac *ServiceAccountCreate) SetDisplayName(s string) *ServiceAccountCreate

SetDisplayName sets the "display_name" field.

func (*ServiceAccountCreate) SetID

SetID sets the "id" field.

func (*ServiceAccountCreate) SetNillableID

func (sac *ServiceAccountCreate) SetNillableID(u *uuid.UUID) *ServiceAccountCreate

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

type ServiceAccountCreateBulk

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

ServiceAccountCreateBulk is the builder for creating many ServiceAccount entities in bulk.

func (*ServiceAccountCreateBulk) Exec

Exec executes the query.

func (*ServiceAccountCreateBulk) ExecX

func (sacb *ServiceAccountCreateBulk) ExecX(ctx context.Context)

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

func (*ServiceAccountCreateBulk) Save

Save creates the ServiceAccount entities in the database.

func (*ServiceAccountCreateBulk) SaveX

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

type ServiceAccountDelete

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

ServiceAccountDelete is the builder for deleting a ServiceAccount entity.

func (*ServiceAccountDelete) Exec

func (sad *ServiceAccountDelete) Exec(ctx context.Context) (int, error)

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

func (*ServiceAccountDelete) ExecX

func (sad *ServiceAccountDelete) ExecX(ctx context.Context) int

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

func (*ServiceAccountDelete) Where

Where appends a list predicates to the ServiceAccountDelete builder.

type ServiceAccountDeleteOne

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

ServiceAccountDeleteOne is the builder for deleting a single ServiceAccount entity.

func (*ServiceAccountDeleteOne) Exec

func (sado *ServiceAccountDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ServiceAccountDeleteOne) ExecX

func (sado *ServiceAccountDeleteOne) ExecX(ctx context.Context)

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

type ServiceAccountEdge

type ServiceAccountEdge struct {
	Node   *ServiceAccount `json:"node"`
	Cursor Cursor          `json:"cursor"`
}

ServiceAccountEdge is the edge representation of ServiceAccount.

type ServiceAccountEdges

type ServiceAccountEdges struct {
	// ServiceAccountToToken holds the value of the ServiceAccountToToken edge.
	ServiceAccountToToken []*ServiceToken `json:"ServiceAccountToToken,omitempty"`
	// ServiceAccountToActions holds the value of the ServiceAccountToActions edge.
	ServiceAccountToActions []*Action `json:"ServiceAccountToActions,omitempty"`
	// contains filtered or unexported fields
}

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

func (ServiceAccountEdges) ServiceAccountToActionsOrErr

func (e ServiceAccountEdges) ServiceAccountToActionsOrErr() ([]*Action, error)

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

func (ServiceAccountEdges) ServiceAccountToTokenOrErr

func (e ServiceAccountEdges) ServiceAccountToTokenOrErr() ([]*ServiceToken, error)

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

type ServiceAccountGroupBy

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

ServiceAccountGroupBy is the group-by builder for ServiceAccount entities.

func (*ServiceAccountGroupBy) Aggregate

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

func (*ServiceAccountGroupBy) Bool

func (sagb *ServiceAccountGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ServiceAccountGroupBy) BoolX

func (sagb *ServiceAccountGroupBy) BoolX(ctx context.Context) bool

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

func (*ServiceAccountGroupBy) Bools

func (sagb *ServiceAccountGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ServiceAccountGroupBy) BoolsX

func (sagb *ServiceAccountGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ServiceAccountGroupBy) Float64

func (sagb *ServiceAccountGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ServiceAccountGroupBy) Float64X

func (sagb *ServiceAccountGroupBy) Float64X(ctx context.Context) float64

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

func (*ServiceAccountGroupBy) Float64s

func (sagb *ServiceAccountGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ServiceAccountGroupBy) Float64sX

func (sagb *ServiceAccountGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ServiceAccountGroupBy) Int

func (sagb *ServiceAccountGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ServiceAccountGroupBy) IntX

func (sagb *ServiceAccountGroupBy) IntX(ctx context.Context) int

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

func (*ServiceAccountGroupBy) Ints

func (sagb *ServiceAccountGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ServiceAccountGroupBy) IntsX

func (sagb *ServiceAccountGroupBy) IntsX(ctx context.Context) []int

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

func (*ServiceAccountGroupBy) Scan

func (sagb *ServiceAccountGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ServiceAccountGroupBy) ScanX

func (sagb *ServiceAccountGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ServiceAccountGroupBy) String

func (sagb *ServiceAccountGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ServiceAccountGroupBy) StringX

func (sagb *ServiceAccountGroupBy) StringX(ctx context.Context) string

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

func (*ServiceAccountGroupBy) Strings

func (sagb *ServiceAccountGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ServiceAccountGroupBy) StringsX

func (sagb *ServiceAccountGroupBy) StringsX(ctx context.Context) []string

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

type ServiceAccountMutation

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

ServiceAccountMutation represents an operation that mutates the ServiceAccount nodes in the graph.

func (*ServiceAccountMutation) APIKey

func (m *ServiceAccountMutation) APIKey() (r uuid.UUID, exists bool)

APIKey returns the value of the "api_key" field in the mutation.

func (*ServiceAccountMutation) APISecret

func (m *ServiceAccountMutation) APISecret() (r uuid.UUID, exists bool)

APISecret returns the value of the "api_secret" field in the mutation.

func (*ServiceAccountMutation) Active

func (m *ServiceAccountMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*ServiceAccountMutation) AddField

func (m *ServiceAccountMutation) 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 (*ServiceAccountMutation) AddServiceAccountToActionIDs

func (m *ServiceAccountMutation) AddServiceAccountToActionIDs(ids ...uuid.UUID)

AddServiceAccountToActionIDs adds the "ServiceAccountToActions" edge to the Action entity by ids.

func (*ServiceAccountMutation) AddServiceAccountToTokenIDs

func (m *ServiceAccountMutation) AddServiceAccountToTokenIDs(ids ...uuid.UUID)

AddServiceAccountToTokenIDs adds the "ServiceAccountToToken" edge to the ServiceToken entity by ids.

func (*ServiceAccountMutation) AddedEdges

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

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

func (*ServiceAccountMutation) AddedField

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

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

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

func (*ServiceAccountMutation) AddedIDs

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

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

func (*ServiceAccountMutation) ClearEdge

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

func (m *ServiceAccountMutation) 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 (*ServiceAccountMutation) ClearServiceAccountToActions

func (m *ServiceAccountMutation) ClearServiceAccountToActions()

ClearServiceAccountToActions clears the "ServiceAccountToActions" edge to the Action entity.

func (*ServiceAccountMutation) ClearServiceAccountToToken

func (m *ServiceAccountMutation) ClearServiceAccountToToken()

ClearServiceAccountToToken clears the "ServiceAccountToToken" edge to the ServiceToken entity.

func (*ServiceAccountMutation) ClearedEdges

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

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

func (*ServiceAccountMutation) ClearedFields

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

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

func (ServiceAccountMutation) Client

func (m ServiceAccountMutation) 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 (*ServiceAccountMutation) DisplayName

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

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

func (*ServiceAccountMutation) EdgeCleared

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

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

func (*ServiceAccountMutation) Field

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

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

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

func (*ServiceAccountMutation) Fields

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

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

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

func (*ServiceAccountMutation) IDs

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

func (*ServiceAccountMutation) OldAPIKey

func (m *ServiceAccountMutation) OldAPIKey(ctx context.Context) (v uuid.UUID, err error)

OldAPIKey returns the old "api_key" field's value of the ServiceAccount entity. If the ServiceAccount 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 (*ServiceAccountMutation) OldAPISecret

func (m *ServiceAccountMutation) OldAPISecret(ctx context.Context) (v uuid.UUID, err error)

OldAPISecret returns the old "api_secret" field's value of the ServiceAccount entity. If the ServiceAccount 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 (*ServiceAccountMutation) OldActive

func (m *ServiceAccountMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the ServiceAccount entity. If the ServiceAccount 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 (*ServiceAccountMutation) OldDisplayName

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

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

func (m *ServiceAccountMutation) 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 (*ServiceAccountMutation) Op

func (m *ServiceAccountMutation) Op() Op

Op returns the operation name.

func (*ServiceAccountMutation) RemoveServiceAccountToActionIDs

func (m *ServiceAccountMutation) RemoveServiceAccountToActionIDs(ids ...uuid.UUID)

RemoveServiceAccountToActionIDs removes the "ServiceAccountToActions" edge to the Action entity by IDs.

func (*ServiceAccountMutation) RemoveServiceAccountToTokenIDs

func (m *ServiceAccountMutation) RemoveServiceAccountToTokenIDs(ids ...uuid.UUID)

RemoveServiceAccountToTokenIDs removes the "ServiceAccountToToken" edge to the ServiceToken entity by IDs.

func (*ServiceAccountMutation) RemovedEdges

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

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

func (*ServiceAccountMutation) RemovedIDs

func (m *ServiceAccountMutation) 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 (*ServiceAccountMutation) RemovedServiceAccountToActionsIDs

func (m *ServiceAccountMutation) RemovedServiceAccountToActionsIDs() (ids []uuid.UUID)

RemovedServiceAccountToActions returns the removed IDs of the "ServiceAccountToActions" edge to the Action entity.

func (*ServiceAccountMutation) RemovedServiceAccountToTokenIDs

func (m *ServiceAccountMutation) RemovedServiceAccountToTokenIDs() (ids []uuid.UUID)

RemovedServiceAccountToToken returns the removed IDs of the "ServiceAccountToToken" edge to the ServiceToken entity.

func (*ServiceAccountMutation) ResetAPIKey

func (m *ServiceAccountMutation) ResetAPIKey()

ResetAPIKey resets all changes to the "api_key" field.

func (*ServiceAccountMutation) ResetAPISecret

func (m *ServiceAccountMutation) ResetAPISecret()

ResetAPISecret resets all changes to the "api_secret" field.

func (*ServiceAccountMutation) ResetActive

func (m *ServiceAccountMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*ServiceAccountMutation) ResetDisplayName

func (m *ServiceAccountMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*ServiceAccountMutation) ResetEdge

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

func (m *ServiceAccountMutation) 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 (*ServiceAccountMutation) ResetServiceAccountToActions

func (m *ServiceAccountMutation) ResetServiceAccountToActions()

ResetServiceAccountToActions resets all changes to the "ServiceAccountToActions" edge.

func (*ServiceAccountMutation) ResetServiceAccountToToken

func (m *ServiceAccountMutation) ResetServiceAccountToToken()

ResetServiceAccountToToken resets all changes to the "ServiceAccountToToken" edge.

func (*ServiceAccountMutation) ServiceAccountToActionsCleared

func (m *ServiceAccountMutation) ServiceAccountToActionsCleared() bool

ServiceAccountToActionsCleared reports if the "ServiceAccountToActions" edge to the Action entity was cleared.

func (*ServiceAccountMutation) ServiceAccountToActionsIDs

func (m *ServiceAccountMutation) ServiceAccountToActionsIDs() (ids []uuid.UUID)

ServiceAccountToActionsIDs returns the "ServiceAccountToActions" edge IDs in the mutation.

func (*ServiceAccountMutation) ServiceAccountToTokenCleared

func (m *ServiceAccountMutation) ServiceAccountToTokenCleared() bool

ServiceAccountToTokenCleared reports if the "ServiceAccountToToken" edge to the ServiceToken entity was cleared.

func (*ServiceAccountMutation) ServiceAccountToTokenIDs

func (m *ServiceAccountMutation) ServiceAccountToTokenIDs() (ids []uuid.UUID)

ServiceAccountToTokenIDs returns the "ServiceAccountToToken" edge IDs in the mutation.

func (*ServiceAccountMutation) SetAPIKey

func (m *ServiceAccountMutation) SetAPIKey(u uuid.UUID)

SetAPIKey sets the "api_key" field.

func (*ServiceAccountMutation) SetAPISecret

func (m *ServiceAccountMutation) SetAPISecret(u uuid.UUID)

SetAPISecret sets the "api_secret" field.

func (*ServiceAccountMutation) SetActive

func (m *ServiceAccountMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*ServiceAccountMutation) SetDisplayName

func (m *ServiceAccountMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*ServiceAccountMutation) SetField

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

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

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

func (ServiceAccountMutation) Tx

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

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

func (*ServiceAccountMutation) Type

func (m *ServiceAccountMutation) Type() string

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

func (*ServiceAccountMutation) Where

Where appends a list predicates to the ServiceAccountMutation builder.

type ServiceAccountOrder

type ServiceAccountOrder struct {
	Direction OrderDirection            `json:"direction"`
	Field     *ServiceAccountOrderField `json:"field"`
}

ServiceAccountOrder defines the ordering of ServiceAccount.

type ServiceAccountOrderField

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

ServiceAccountOrderField defines the ordering field of ServiceAccount.

type ServiceAccountPaginateOption

type ServiceAccountPaginateOption func(*serviceAccountPager) error

ServiceAccountPaginateOption enables pagination customization.

func WithServiceAccountFilter

func WithServiceAccountFilter(filter func(*ServiceAccountQuery) (*ServiceAccountQuery, error)) ServiceAccountPaginateOption

WithServiceAccountFilter configures pagination filter.

func WithServiceAccountOrder

func WithServiceAccountOrder(order *ServiceAccountOrder) ServiceAccountPaginateOption

WithServiceAccountOrder configures pagination ordering.

type ServiceAccountQuery

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

ServiceAccountQuery is the builder for querying ServiceAccount entities.

func (*ServiceAccountQuery) All

All executes the query and returns a list of ServiceAccounts.

func (*ServiceAccountQuery) AllX

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

func (*ServiceAccountQuery) Clone

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

func (*ServiceAccountQuery) CollectFields

func (sa *ServiceAccountQuery) CollectFields(ctx context.Context, satisfies ...string) *ServiceAccountQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ServiceAccountQuery) Count

func (saq *ServiceAccountQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ServiceAccountQuery) CountX

func (saq *ServiceAccountQuery) CountX(ctx context.Context) int

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

func (*ServiceAccountQuery) Exist

func (saq *ServiceAccountQuery) Exist(ctx context.Context) (bool, error)

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

func (*ServiceAccountQuery) ExistX

func (saq *ServiceAccountQuery) ExistX(ctx context.Context) bool

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

func (*ServiceAccountQuery) First

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

func (*ServiceAccountQuery) FirstID

func (saq *ServiceAccountQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ServiceAccountQuery) FirstIDX

func (saq *ServiceAccountQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ServiceAccountQuery) FirstX

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

func (*ServiceAccountQuery) GroupBy

func (saq *ServiceAccountQuery) GroupBy(field string, fields ...string) *ServiceAccountGroupBy

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 {
	DisplayName string `json:"display_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ServiceAccount.Query().
	GroupBy(serviceaccount.FieldDisplayName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ServiceAccountQuery) IDs

func (saq *ServiceAccountQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ServiceAccountQuery) IDsX

func (saq *ServiceAccountQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ServiceAccountQuery) Limit

func (saq *ServiceAccountQuery) Limit(limit int) *ServiceAccountQuery

Limit adds a limit step to the query.

func (*ServiceAccountQuery) Offset

func (saq *ServiceAccountQuery) Offset(offset int) *ServiceAccountQuery

Offset adds an offset step to the query.

func (*ServiceAccountQuery) Only

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

func (*ServiceAccountQuery) OnlyID

func (saq *ServiceAccountQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ServiceAccountQuery) OnlyIDX

func (saq *ServiceAccountQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ServiceAccountQuery) OnlyX

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

func (*ServiceAccountQuery) Order

Order adds an order step to the query.

func (*ServiceAccountQuery) Paginate

func (sa *ServiceAccountQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ServiceAccountPaginateOption,
) (*ServiceAccountConnection, error)

Paginate executes the query and returns a relay based cursor connection to ServiceAccount.

func (*ServiceAccountQuery) QueryServiceAccountToActions

func (saq *ServiceAccountQuery) QueryServiceAccountToActions() *ActionQuery

QueryServiceAccountToActions chains the current query on the "ServiceAccountToActions" edge.

func (*ServiceAccountQuery) QueryServiceAccountToToken

func (saq *ServiceAccountQuery) QueryServiceAccountToToken() *ServiceTokenQuery

QueryServiceAccountToToken chains the current query on the "ServiceAccountToToken" edge.

func (*ServiceAccountQuery) Select

func (saq *ServiceAccountQuery) Select(fields ...string) *ServiceAccountSelect

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 {
	DisplayName string `json:"display_name,omitempty"`
}

client.ServiceAccount.Query().
	Select(serviceaccount.FieldDisplayName).
	Scan(ctx, &v)

func (*ServiceAccountQuery) Unique

func (saq *ServiceAccountQuery) Unique(unique bool) *ServiceAccountQuery

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

Where adds a new predicate for the ServiceAccountQuery builder.

func (*ServiceAccountQuery) WithServiceAccountToActions

func (saq *ServiceAccountQuery) WithServiceAccountToActions(opts ...func(*ActionQuery)) *ServiceAccountQuery

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

func (*ServiceAccountQuery) WithServiceAccountToToken

func (saq *ServiceAccountQuery) WithServiceAccountToToken(opts ...func(*ServiceTokenQuery)) *ServiceAccountQuery

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

type ServiceAccountSelect

type ServiceAccountSelect struct {
	*ServiceAccountQuery
	// contains filtered or unexported fields
}

ServiceAccountSelect is the builder for selecting fields of ServiceAccount entities.

func (*ServiceAccountSelect) Bool

func (sas *ServiceAccountSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ServiceAccountSelect) BoolX

func (sas *ServiceAccountSelect) BoolX(ctx context.Context) bool

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

func (*ServiceAccountSelect) Bools

func (sas *ServiceAccountSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ServiceAccountSelect) BoolsX

func (sas *ServiceAccountSelect) BoolsX(ctx context.Context) []bool

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

func (*ServiceAccountSelect) Float64

func (sas *ServiceAccountSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ServiceAccountSelect) Float64X

func (sas *ServiceAccountSelect) Float64X(ctx context.Context) float64

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

func (*ServiceAccountSelect) Float64s

func (sas *ServiceAccountSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ServiceAccountSelect) Float64sX

func (sas *ServiceAccountSelect) Float64sX(ctx context.Context) []float64

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

func (*ServiceAccountSelect) Int

func (sas *ServiceAccountSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ServiceAccountSelect) IntX

func (sas *ServiceAccountSelect) IntX(ctx context.Context) int

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

func (*ServiceAccountSelect) Ints

func (sas *ServiceAccountSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ServiceAccountSelect) IntsX

func (sas *ServiceAccountSelect) IntsX(ctx context.Context) []int

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

func (*ServiceAccountSelect) Scan

func (sas *ServiceAccountSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ServiceAccountSelect) ScanX

func (sas *ServiceAccountSelect) ScanX(ctx context.Context, v interface{})

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

func (*ServiceAccountSelect) String

func (sas *ServiceAccountSelect) String(ctx context.Context) (_ string, err error)

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

func (*ServiceAccountSelect) StringX

func (sas *ServiceAccountSelect) StringX(ctx context.Context) string

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

func (*ServiceAccountSelect) Strings

func (sas *ServiceAccountSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ServiceAccountSelect) StringsX

func (sas *ServiceAccountSelect) StringsX(ctx context.Context) []string

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

type ServiceAccountUpdate

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

ServiceAccountUpdate is the builder for updating ServiceAccount entities.

func (*ServiceAccountUpdate) AddServiceAccountToActionIDs

func (sau *ServiceAccountUpdate) AddServiceAccountToActionIDs(ids ...uuid.UUID) *ServiceAccountUpdate

AddServiceAccountToActionIDs adds the "ServiceAccountToActions" edge to the Action entity by IDs.

func (*ServiceAccountUpdate) AddServiceAccountToActions

func (sau *ServiceAccountUpdate) AddServiceAccountToActions(a ...*Action) *ServiceAccountUpdate

AddServiceAccountToActions adds the "ServiceAccountToActions" edges to the Action entity.

func (*ServiceAccountUpdate) AddServiceAccountToToken

func (sau *ServiceAccountUpdate) AddServiceAccountToToken(s ...*ServiceToken) *ServiceAccountUpdate

AddServiceAccountToToken adds the "ServiceAccountToToken" edges to the ServiceToken entity.

func (*ServiceAccountUpdate) AddServiceAccountToTokenIDs

func (sau *ServiceAccountUpdate) AddServiceAccountToTokenIDs(ids ...uuid.UUID) *ServiceAccountUpdate

AddServiceAccountToTokenIDs adds the "ServiceAccountToToken" edge to the ServiceToken entity by IDs.

func (*ServiceAccountUpdate) ClearServiceAccountToActions

func (sau *ServiceAccountUpdate) ClearServiceAccountToActions() *ServiceAccountUpdate

ClearServiceAccountToActions clears all "ServiceAccountToActions" edges to the Action entity.

func (*ServiceAccountUpdate) ClearServiceAccountToToken

func (sau *ServiceAccountUpdate) ClearServiceAccountToToken() *ServiceAccountUpdate

ClearServiceAccountToToken clears all "ServiceAccountToToken" edges to the ServiceToken entity.

func (*ServiceAccountUpdate) Exec

func (sau *ServiceAccountUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceAccountUpdate) ExecX

func (sau *ServiceAccountUpdate) ExecX(ctx context.Context)

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

func (*ServiceAccountUpdate) Mutation

Mutation returns the ServiceAccountMutation object of the builder.

func (*ServiceAccountUpdate) RemoveServiceAccountToActionIDs

func (sau *ServiceAccountUpdate) RemoveServiceAccountToActionIDs(ids ...uuid.UUID) *ServiceAccountUpdate

RemoveServiceAccountToActionIDs removes the "ServiceAccountToActions" edge to Action entities by IDs.

func (*ServiceAccountUpdate) RemoveServiceAccountToActions

func (sau *ServiceAccountUpdate) RemoveServiceAccountToActions(a ...*Action) *ServiceAccountUpdate

RemoveServiceAccountToActions removes "ServiceAccountToActions" edges to Action entities.

func (*ServiceAccountUpdate) RemoveServiceAccountToToken

func (sau *ServiceAccountUpdate) RemoveServiceAccountToToken(s ...*ServiceToken) *ServiceAccountUpdate

RemoveServiceAccountToToken removes "ServiceAccountToToken" edges to ServiceToken entities.

func (*ServiceAccountUpdate) RemoveServiceAccountToTokenIDs

func (sau *ServiceAccountUpdate) RemoveServiceAccountToTokenIDs(ids ...uuid.UUID) *ServiceAccountUpdate

RemoveServiceAccountToTokenIDs removes the "ServiceAccountToToken" edge to ServiceToken entities by IDs.

func (*ServiceAccountUpdate) Save

func (sau *ServiceAccountUpdate) Save(ctx context.Context) (int, error)

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

func (*ServiceAccountUpdate) SaveX

func (sau *ServiceAccountUpdate) SaveX(ctx context.Context) int

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

func (*ServiceAccountUpdate) SetAPIKey

SetAPIKey sets the "api_key" field.

func (*ServiceAccountUpdate) SetAPISecret

func (sau *ServiceAccountUpdate) SetAPISecret(u uuid.UUID) *ServiceAccountUpdate

SetAPISecret sets the "api_secret" field.

func (*ServiceAccountUpdate) SetActive

func (sau *ServiceAccountUpdate) SetActive(b bool) *ServiceAccountUpdate

SetActive sets the "active" field.

func (*ServiceAccountUpdate) SetDisplayName

func (sau *ServiceAccountUpdate) SetDisplayName(s string) *ServiceAccountUpdate

SetDisplayName sets the "display_name" field.

func (*ServiceAccountUpdate) Where

Where appends a list predicates to the ServiceAccountUpdate builder.

type ServiceAccountUpdateOne

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

ServiceAccountUpdateOne is the builder for updating a single ServiceAccount entity.

func (*ServiceAccountUpdateOne) AddServiceAccountToActionIDs

func (sauo *ServiceAccountUpdateOne) AddServiceAccountToActionIDs(ids ...uuid.UUID) *ServiceAccountUpdateOne

AddServiceAccountToActionIDs adds the "ServiceAccountToActions" edge to the Action entity by IDs.

func (*ServiceAccountUpdateOne) AddServiceAccountToActions

func (sauo *ServiceAccountUpdateOne) AddServiceAccountToActions(a ...*Action) *ServiceAccountUpdateOne

AddServiceAccountToActions adds the "ServiceAccountToActions" edges to the Action entity.

func (*ServiceAccountUpdateOne) AddServiceAccountToToken

func (sauo *ServiceAccountUpdateOne) AddServiceAccountToToken(s ...*ServiceToken) *ServiceAccountUpdateOne

AddServiceAccountToToken adds the "ServiceAccountToToken" edges to the ServiceToken entity.

func (*ServiceAccountUpdateOne) AddServiceAccountToTokenIDs

func (sauo *ServiceAccountUpdateOne) AddServiceAccountToTokenIDs(ids ...uuid.UUID) *ServiceAccountUpdateOne

AddServiceAccountToTokenIDs adds the "ServiceAccountToToken" edge to the ServiceToken entity by IDs.

func (*ServiceAccountUpdateOne) ClearServiceAccountToActions

func (sauo *ServiceAccountUpdateOne) ClearServiceAccountToActions() *ServiceAccountUpdateOne

ClearServiceAccountToActions clears all "ServiceAccountToActions" edges to the Action entity.

func (*ServiceAccountUpdateOne) ClearServiceAccountToToken

func (sauo *ServiceAccountUpdateOne) ClearServiceAccountToToken() *ServiceAccountUpdateOne

ClearServiceAccountToToken clears all "ServiceAccountToToken" edges to the ServiceToken entity.

func (*ServiceAccountUpdateOne) Exec

func (sauo *ServiceAccountUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ServiceAccountUpdateOne) ExecX

func (sauo *ServiceAccountUpdateOne) ExecX(ctx context.Context)

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

func (*ServiceAccountUpdateOne) Mutation

Mutation returns the ServiceAccountMutation object of the builder.

func (*ServiceAccountUpdateOne) RemoveServiceAccountToActionIDs

func (sauo *ServiceAccountUpdateOne) RemoveServiceAccountToActionIDs(ids ...uuid.UUID) *ServiceAccountUpdateOne

RemoveServiceAccountToActionIDs removes the "ServiceAccountToActions" edge to Action entities by IDs.

func (*ServiceAccountUpdateOne) RemoveServiceAccountToActions

func (sauo *ServiceAccountUpdateOne) RemoveServiceAccountToActions(a ...*Action) *ServiceAccountUpdateOne

RemoveServiceAccountToActions removes "ServiceAccountToActions" edges to Action entities.

func (*ServiceAccountUpdateOne) RemoveServiceAccountToToken

func (sauo *ServiceAccountUpdateOne) RemoveServiceAccountToToken(s ...*ServiceToken) *ServiceAccountUpdateOne

RemoveServiceAccountToToken removes "ServiceAccountToToken" edges to ServiceToken entities.

func (*ServiceAccountUpdateOne) RemoveServiceAccountToTokenIDs

func (sauo *ServiceAccountUpdateOne) RemoveServiceAccountToTokenIDs(ids ...uuid.UUID) *ServiceAccountUpdateOne

RemoveServiceAccountToTokenIDs removes the "ServiceAccountToToken" edge to ServiceToken entities by IDs.

func (*ServiceAccountUpdateOne) Save

Save executes the query and returns the updated ServiceAccount entity.

func (*ServiceAccountUpdateOne) SaveX

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

func (*ServiceAccountUpdateOne) Select

func (sauo *ServiceAccountUpdateOne) Select(field string, fields ...string) *ServiceAccountUpdateOne

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

func (*ServiceAccountUpdateOne) SetAPIKey

SetAPIKey sets the "api_key" field.

func (*ServiceAccountUpdateOne) SetAPISecret

SetAPISecret sets the "api_secret" field.

func (*ServiceAccountUpdateOne) SetActive

SetActive sets the "active" field.

func (*ServiceAccountUpdateOne) SetDisplayName

func (sauo *ServiceAccountUpdateOne) SetDisplayName(s string) *ServiceAccountUpdateOne

SetDisplayName sets the "display_name" field.

type ServiceAccounts

type ServiceAccounts []*ServiceAccount

ServiceAccounts is a parsable slice of ServiceAccount.

type ServiceToken

type ServiceToken struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Token holds the value of the "token" field.
	// [REQUIRED] The API token for a service account session.
	Token string `json:"token,omitempty"`
	// RefreshToken holds the value of the "refresh_token" field.
	// [REQUIRED] The refresh token used to renew an expired service account session. These are valid for `REFRESH_WINDOW` hours.
	RefreshToken string `json:"refresh_token,omitempty"`
	// IssuedAt holds the value of the "issued_at" field.
	// [REQUIRED] The time the token was issued
	IssuedAt int64 `json:"issued_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ServiceTokenQuery when eager-loading is set.
	Edges ServiceTokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

ServiceToken is the model entity for the ServiceToken schema.

func (*ServiceToken) Node

func (st *ServiceToken) Node(ctx context.Context) (node *Node, err error)

func (*ServiceToken) QueryTokenToServiceAccount

func (st *ServiceToken) QueryTokenToServiceAccount() *ServiceAccountQuery

QueryTokenToServiceAccount queries the "TokenToServiceAccount" edge of the ServiceToken entity.

func (*ServiceToken) String

func (st *ServiceToken) String() string

String implements the fmt.Stringer.

func (*ServiceToken) ToEdge

func (st *ServiceToken) ToEdge(order *ServiceTokenOrder) *ServiceTokenEdge

ToEdge converts ServiceToken into ServiceTokenEdge.

func (*ServiceToken) TokenToServiceAccount

func (st *ServiceToken) TokenToServiceAccount(ctx context.Context) (*ServiceAccount, error)

func (*ServiceToken) Unwrap

func (st *ServiceToken) Unwrap() *ServiceToken

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

func (st *ServiceToken) Update() *ServiceTokenUpdateOne

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

type ServiceTokenClient

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

ServiceTokenClient is a client for the ServiceToken schema.

func NewServiceTokenClient

func NewServiceTokenClient(c config) *ServiceTokenClient

NewServiceTokenClient returns a client for the ServiceToken from the given config.

func (*ServiceTokenClient) Create

Create returns a create builder for ServiceToken.

func (*ServiceTokenClient) CreateBulk

func (c *ServiceTokenClient) CreateBulk(builders ...*ServiceTokenCreate) *ServiceTokenCreateBulk

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

func (*ServiceTokenClient) Delete

Delete returns a delete builder for ServiceToken.

func (*ServiceTokenClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ServiceTokenClient) DeleteOneID

func (c *ServiceTokenClient) DeleteOneID(id uuid.UUID) *ServiceTokenDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ServiceTokenClient) Get

Get returns a ServiceToken entity by its id.

func (*ServiceTokenClient) GetX

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

func (*ServiceTokenClient) Hooks

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

Hooks returns the client hooks.

func (*ServiceTokenClient) Query

Query returns a query builder for ServiceToken.

func (*ServiceTokenClient) QueryTokenToServiceAccount

func (c *ServiceTokenClient) QueryTokenToServiceAccount(st *ServiceToken) *ServiceAccountQuery

QueryTokenToServiceAccount queries the TokenToServiceAccount edge of a ServiceToken.

func (*ServiceTokenClient) Update

Update returns an update builder for ServiceToken.

func (*ServiceTokenClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ServiceTokenClient) UpdateOneID

func (c *ServiceTokenClient) UpdateOneID(id uuid.UUID) *ServiceTokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ServiceTokenClient) Use

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

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

type ServiceTokenConnection

type ServiceTokenConnection struct {
	Edges      []*ServiceTokenEdge `json:"edges"`
	PageInfo   PageInfo            `json:"pageInfo"`
	TotalCount int                 `json:"totalCount"`
}

ServiceTokenConnection is the connection containing edges to ServiceToken.

type ServiceTokenCreate

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

ServiceTokenCreate is the builder for creating a ServiceToken entity.

func (*ServiceTokenCreate) Exec

func (stc *ServiceTokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceTokenCreate) ExecX

func (stc *ServiceTokenCreate) ExecX(ctx context.Context)

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

func (*ServiceTokenCreate) Mutation

func (stc *ServiceTokenCreate) Mutation() *ServiceTokenMutation

Mutation returns the ServiceTokenMutation object of the builder.

func (*ServiceTokenCreate) Save

Save creates the ServiceToken in the database.

func (*ServiceTokenCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ServiceTokenCreate) SetID

SetID sets the "id" field.

func (*ServiceTokenCreate) SetIssuedAt

func (stc *ServiceTokenCreate) SetIssuedAt(i int64) *ServiceTokenCreate

SetIssuedAt sets the "issued_at" field.

func (*ServiceTokenCreate) SetNillableID

func (stc *ServiceTokenCreate) SetNillableID(u *uuid.UUID) *ServiceTokenCreate

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

func (*ServiceTokenCreate) SetRefreshToken

func (stc *ServiceTokenCreate) SetRefreshToken(s string) *ServiceTokenCreate

SetRefreshToken sets the "refresh_token" field.

func (*ServiceTokenCreate) SetToken

func (stc *ServiceTokenCreate) SetToken(s string) *ServiceTokenCreate

SetToken sets the "token" field.

func (*ServiceTokenCreate) SetTokenToServiceAccount

func (stc *ServiceTokenCreate) SetTokenToServiceAccount(s *ServiceAccount) *ServiceTokenCreate

SetTokenToServiceAccount sets the "TokenToServiceAccount" edge to the ServiceAccount entity.

func (*ServiceTokenCreate) SetTokenToServiceAccountID

func (stc *ServiceTokenCreate) SetTokenToServiceAccountID(id uuid.UUID) *ServiceTokenCreate

SetTokenToServiceAccountID sets the "TokenToServiceAccount" edge to the ServiceAccount entity by ID.

type ServiceTokenCreateBulk

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

ServiceTokenCreateBulk is the builder for creating many ServiceToken entities in bulk.

func (*ServiceTokenCreateBulk) Exec

func (stcb *ServiceTokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceTokenCreateBulk) ExecX

func (stcb *ServiceTokenCreateBulk) ExecX(ctx context.Context)

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

func (*ServiceTokenCreateBulk) Save

Save creates the ServiceToken entities in the database.

func (*ServiceTokenCreateBulk) SaveX

func (stcb *ServiceTokenCreateBulk) SaveX(ctx context.Context) []*ServiceToken

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

type ServiceTokenDelete

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

ServiceTokenDelete is the builder for deleting a ServiceToken entity.

func (*ServiceTokenDelete) Exec

func (std *ServiceTokenDelete) Exec(ctx context.Context) (int, error)

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

func (*ServiceTokenDelete) ExecX

func (std *ServiceTokenDelete) ExecX(ctx context.Context) int

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

func (*ServiceTokenDelete) Where

Where appends a list predicates to the ServiceTokenDelete builder.

type ServiceTokenDeleteOne

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

ServiceTokenDeleteOne is the builder for deleting a single ServiceToken entity.

func (*ServiceTokenDeleteOne) Exec

func (stdo *ServiceTokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ServiceTokenDeleteOne) ExecX

func (stdo *ServiceTokenDeleteOne) ExecX(ctx context.Context)

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

type ServiceTokenEdge

type ServiceTokenEdge struct {
	Node   *ServiceToken `json:"node"`
	Cursor Cursor        `json:"cursor"`
}

ServiceTokenEdge is the edge representation of ServiceToken.

type ServiceTokenEdges

type ServiceTokenEdges struct {
	// TokenToServiceAccount holds the value of the TokenToServiceAccount edge.
	TokenToServiceAccount *ServiceAccount `json:"TokenToServiceAccount,omitempty"`
	// contains filtered or unexported fields
}

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

func (ServiceTokenEdges) TokenToServiceAccountOrErr

func (e ServiceTokenEdges) TokenToServiceAccountOrErr() (*ServiceAccount, error)

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

type ServiceTokenGroupBy

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

ServiceTokenGroupBy is the group-by builder for ServiceToken entities.

func (*ServiceTokenGroupBy) Aggregate

func (stgb *ServiceTokenGroupBy) Aggregate(fns ...AggregateFunc) *ServiceTokenGroupBy

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

func (*ServiceTokenGroupBy) Bool

func (stgb *ServiceTokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ServiceTokenGroupBy) BoolX

func (stgb *ServiceTokenGroupBy) BoolX(ctx context.Context) bool

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

func (*ServiceTokenGroupBy) Bools

func (stgb *ServiceTokenGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ServiceTokenGroupBy) BoolsX

func (stgb *ServiceTokenGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ServiceTokenGroupBy) Float64

func (stgb *ServiceTokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ServiceTokenGroupBy) Float64X

func (stgb *ServiceTokenGroupBy) Float64X(ctx context.Context) float64

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

func (*ServiceTokenGroupBy) Float64s

func (stgb *ServiceTokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ServiceTokenGroupBy) Float64sX

func (stgb *ServiceTokenGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ServiceTokenGroupBy) Int

func (stgb *ServiceTokenGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ServiceTokenGroupBy) IntX

func (stgb *ServiceTokenGroupBy) IntX(ctx context.Context) int

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

func (*ServiceTokenGroupBy) Ints

func (stgb *ServiceTokenGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ServiceTokenGroupBy) IntsX

func (stgb *ServiceTokenGroupBy) IntsX(ctx context.Context) []int

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

func (*ServiceTokenGroupBy) Scan

func (stgb *ServiceTokenGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ServiceTokenGroupBy) ScanX

func (stgb *ServiceTokenGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ServiceTokenGroupBy) String

func (stgb *ServiceTokenGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ServiceTokenGroupBy) StringX

func (stgb *ServiceTokenGroupBy) StringX(ctx context.Context) string

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

func (*ServiceTokenGroupBy) Strings

func (stgb *ServiceTokenGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ServiceTokenGroupBy) StringsX

func (stgb *ServiceTokenGroupBy) StringsX(ctx context.Context) []string

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

type ServiceTokenMutation

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

ServiceTokenMutation represents an operation that mutates the ServiceToken nodes in the graph.

func (*ServiceTokenMutation) AddField

func (m *ServiceTokenMutation) 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 (*ServiceTokenMutation) AddIssuedAt

func (m *ServiceTokenMutation) AddIssuedAt(i int64)

AddIssuedAt adds i to the "issued_at" field.

func (*ServiceTokenMutation) AddedEdges

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

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

func (*ServiceTokenMutation) AddedField

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

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

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

func (*ServiceTokenMutation) AddedIDs

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

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

func (*ServiceTokenMutation) AddedIssuedAt

func (m *ServiceTokenMutation) AddedIssuedAt() (r int64, exists bool)

AddedIssuedAt returns the value that was added to the "issued_at" field in this mutation.

func (*ServiceTokenMutation) ClearEdge

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

func (m *ServiceTokenMutation) 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 (*ServiceTokenMutation) ClearTokenToServiceAccount

func (m *ServiceTokenMutation) ClearTokenToServiceAccount()

ClearTokenToServiceAccount clears the "TokenToServiceAccount" edge to the ServiceAccount entity.

func (*ServiceTokenMutation) ClearedEdges

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

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

func (*ServiceTokenMutation) ClearedFields

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

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

func (ServiceTokenMutation) Client

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

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

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

func (*ServiceTokenMutation) Field

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

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

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

func (*ServiceTokenMutation) Fields

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

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

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

func (*ServiceTokenMutation) IDs

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

func (*ServiceTokenMutation) IssuedAt

func (m *ServiceTokenMutation) IssuedAt() (r int64, exists bool)

IssuedAt returns the value of the "issued_at" field in the mutation.

func (*ServiceTokenMutation) OldField

func (m *ServiceTokenMutation) 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 (*ServiceTokenMutation) OldIssuedAt

func (m *ServiceTokenMutation) OldIssuedAt(ctx context.Context) (v int64, err error)

OldIssuedAt returns the old "issued_at" field's value of the ServiceToken entity. If the ServiceToken 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 (*ServiceTokenMutation) OldRefreshToken

func (m *ServiceTokenMutation) OldRefreshToken(ctx context.Context) (v string, err error)

OldRefreshToken returns the old "refresh_token" field's value of the ServiceToken entity. If the ServiceToken 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 (*ServiceTokenMutation) OldToken

func (m *ServiceTokenMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the ServiceToken entity. If the ServiceToken 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 (*ServiceTokenMutation) Op

func (m *ServiceTokenMutation) Op() Op

Op returns the operation name.

func (*ServiceTokenMutation) RefreshToken

func (m *ServiceTokenMutation) RefreshToken() (r string, exists bool)

RefreshToken returns the value of the "refresh_token" field in the mutation.

func (*ServiceTokenMutation) RemovedEdges

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

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

func (*ServiceTokenMutation) RemovedIDs

func (m *ServiceTokenMutation) 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 (*ServiceTokenMutation) ResetEdge

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

func (m *ServiceTokenMutation) 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 (*ServiceTokenMutation) ResetIssuedAt

func (m *ServiceTokenMutation) ResetIssuedAt()

ResetIssuedAt resets all changes to the "issued_at" field.

func (*ServiceTokenMutation) ResetRefreshToken

func (m *ServiceTokenMutation) ResetRefreshToken()

ResetRefreshToken resets all changes to the "refresh_token" field.

func (*ServiceTokenMutation) ResetToken

func (m *ServiceTokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*ServiceTokenMutation) ResetTokenToServiceAccount

func (m *ServiceTokenMutation) ResetTokenToServiceAccount()

ResetTokenToServiceAccount resets all changes to the "TokenToServiceAccount" edge.

func (*ServiceTokenMutation) SetField

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

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

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

func (*ServiceTokenMutation) SetIssuedAt

func (m *ServiceTokenMutation) SetIssuedAt(i int64)

SetIssuedAt sets the "issued_at" field.

func (*ServiceTokenMutation) SetRefreshToken

func (m *ServiceTokenMutation) SetRefreshToken(s string)

SetRefreshToken sets the "refresh_token" field.

func (*ServiceTokenMutation) SetToken

func (m *ServiceTokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*ServiceTokenMutation) SetTokenToServiceAccountID

func (m *ServiceTokenMutation) SetTokenToServiceAccountID(id uuid.UUID)

SetTokenToServiceAccountID sets the "TokenToServiceAccount" edge to the ServiceAccount entity by id.

func (*ServiceTokenMutation) Token

func (m *ServiceTokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (*ServiceTokenMutation) TokenToServiceAccountCleared

func (m *ServiceTokenMutation) TokenToServiceAccountCleared() bool

TokenToServiceAccountCleared reports if the "TokenToServiceAccount" edge to the ServiceAccount entity was cleared.

func (*ServiceTokenMutation) TokenToServiceAccountID

func (m *ServiceTokenMutation) TokenToServiceAccountID() (id uuid.UUID, exists bool)

TokenToServiceAccountID returns the "TokenToServiceAccount" edge ID in the mutation.

func (*ServiceTokenMutation) TokenToServiceAccountIDs

func (m *ServiceTokenMutation) TokenToServiceAccountIDs() (ids []uuid.UUID)

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

func (ServiceTokenMutation) Tx

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

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

func (*ServiceTokenMutation) Type

func (m *ServiceTokenMutation) Type() string

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

func (*ServiceTokenMutation) Where

Where appends a list predicates to the ServiceTokenMutation builder.

type ServiceTokenOrder

type ServiceTokenOrder struct {
	Direction OrderDirection          `json:"direction"`
	Field     *ServiceTokenOrderField `json:"field"`
}

ServiceTokenOrder defines the ordering of ServiceToken.

type ServiceTokenOrderField

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

ServiceTokenOrderField defines the ordering field of ServiceToken.

type ServiceTokenPaginateOption

type ServiceTokenPaginateOption func(*serviceTokenPager) error

ServiceTokenPaginateOption enables pagination customization.

func WithServiceTokenFilter

func WithServiceTokenFilter(filter func(*ServiceTokenQuery) (*ServiceTokenQuery, error)) ServiceTokenPaginateOption

WithServiceTokenFilter configures pagination filter.

func WithServiceTokenOrder

func WithServiceTokenOrder(order *ServiceTokenOrder) ServiceTokenPaginateOption

WithServiceTokenOrder configures pagination ordering.

type ServiceTokenQuery

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

ServiceTokenQuery is the builder for querying ServiceToken entities.

func (*ServiceTokenQuery) All

func (stq *ServiceTokenQuery) All(ctx context.Context) ([]*ServiceToken, error)

All executes the query and returns a list of ServiceTokens.

func (*ServiceTokenQuery) AllX

func (stq *ServiceTokenQuery) AllX(ctx context.Context) []*ServiceToken

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

func (*ServiceTokenQuery) Clone

func (stq *ServiceTokenQuery) Clone() *ServiceTokenQuery

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

func (*ServiceTokenQuery) CollectFields

func (st *ServiceTokenQuery) CollectFields(ctx context.Context, satisfies ...string) *ServiceTokenQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ServiceTokenQuery) Count

func (stq *ServiceTokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ServiceTokenQuery) CountX

func (stq *ServiceTokenQuery) CountX(ctx context.Context) int

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

func (*ServiceTokenQuery) Exist

func (stq *ServiceTokenQuery) Exist(ctx context.Context) (bool, error)

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

func (*ServiceTokenQuery) ExistX

func (stq *ServiceTokenQuery) ExistX(ctx context.Context) bool

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

func (*ServiceTokenQuery) First

func (stq *ServiceTokenQuery) First(ctx context.Context) (*ServiceToken, error)

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

func (*ServiceTokenQuery) FirstID

func (stq *ServiceTokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ServiceTokenQuery) FirstIDX

func (stq *ServiceTokenQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ServiceTokenQuery) FirstX

func (stq *ServiceTokenQuery) FirstX(ctx context.Context) *ServiceToken

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

func (*ServiceTokenQuery) GroupBy

func (stq *ServiceTokenQuery) GroupBy(field string, fields ...string) *ServiceTokenGroupBy

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 {
	Token string `json:"token,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ServiceToken.Query().
	GroupBy(servicetoken.FieldToken).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ServiceTokenQuery) IDs

func (stq *ServiceTokenQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*ServiceTokenQuery) IDsX

func (stq *ServiceTokenQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ServiceTokenQuery) Limit

func (stq *ServiceTokenQuery) Limit(limit int) *ServiceTokenQuery

Limit adds a limit step to the query.

func (*ServiceTokenQuery) Offset

func (stq *ServiceTokenQuery) Offset(offset int) *ServiceTokenQuery

Offset adds an offset step to the query.

func (*ServiceTokenQuery) Only

func (stq *ServiceTokenQuery) Only(ctx context.Context) (*ServiceToken, error)

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

func (*ServiceTokenQuery) OnlyID

func (stq *ServiceTokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ServiceTokenQuery) OnlyIDX

func (stq *ServiceTokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ServiceTokenQuery) OnlyX

func (stq *ServiceTokenQuery) OnlyX(ctx context.Context) *ServiceToken

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

func (*ServiceTokenQuery) Order

func (stq *ServiceTokenQuery) Order(o ...OrderFunc) *ServiceTokenQuery

Order adds an order step to the query.

func (*ServiceTokenQuery) Paginate

func (st *ServiceTokenQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ServiceTokenPaginateOption,
) (*ServiceTokenConnection, error)

Paginate executes the query and returns a relay based cursor connection to ServiceToken.

func (*ServiceTokenQuery) QueryTokenToServiceAccount

func (stq *ServiceTokenQuery) QueryTokenToServiceAccount() *ServiceAccountQuery

QueryTokenToServiceAccount chains the current query on the "TokenToServiceAccount" edge.

func (*ServiceTokenQuery) Select

func (stq *ServiceTokenQuery) Select(fields ...string) *ServiceTokenSelect

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 {
	Token string `json:"token,omitempty"`
}

client.ServiceToken.Query().
	Select(servicetoken.FieldToken).
	Scan(ctx, &v)

func (*ServiceTokenQuery) Unique

func (stq *ServiceTokenQuery) Unique(unique bool) *ServiceTokenQuery

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

Where adds a new predicate for the ServiceTokenQuery builder.

func (*ServiceTokenQuery) WithTokenToServiceAccount

func (stq *ServiceTokenQuery) WithTokenToServiceAccount(opts ...func(*ServiceAccountQuery)) *ServiceTokenQuery

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

type ServiceTokenSelect

type ServiceTokenSelect struct {
	*ServiceTokenQuery
	// contains filtered or unexported fields
}

ServiceTokenSelect is the builder for selecting fields of ServiceToken entities.

func (*ServiceTokenSelect) Bool

func (sts *ServiceTokenSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ServiceTokenSelect) BoolX

func (sts *ServiceTokenSelect) BoolX(ctx context.Context) bool

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

func (*ServiceTokenSelect) Bools

func (sts *ServiceTokenSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ServiceTokenSelect) BoolsX

func (sts *ServiceTokenSelect) BoolsX(ctx context.Context) []bool

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

func (*ServiceTokenSelect) Float64

func (sts *ServiceTokenSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ServiceTokenSelect) Float64X

func (sts *ServiceTokenSelect) Float64X(ctx context.Context) float64

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

func (*ServiceTokenSelect) Float64s

func (sts *ServiceTokenSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ServiceTokenSelect) Float64sX

func (sts *ServiceTokenSelect) Float64sX(ctx context.Context) []float64

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

func (*ServiceTokenSelect) Int

func (sts *ServiceTokenSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ServiceTokenSelect) IntX

func (sts *ServiceTokenSelect) IntX(ctx context.Context) int

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

func (*ServiceTokenSelect) Ints

func (sts *ServiceTokenSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ServiceTokenSelect) IntsX

func (sts *ServiceTokenSelect) IntsX(ctx context.Context) []int

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

func (*ServiceTokenSelect) Scan

func (sts *ServiceTokenSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ServiceTokenSelect) ScanX

func (sts *ServiceTokenSelect) ScanX(ctx context.Context, v interface{})

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

func (*ServiceTokenSelect) String

func (sts *ServiceTokenSelect) String(ctx context.Context) (_ string, err error)

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

func (*ServiceTokenSelect) StringX

func (sts *ServiceTokenSelect) StringX(ctx context.Context) string

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

func (*ServiceTokenSelect) Strings

func (sts *ServiceTokenSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ServiceTokenSelect) StringsX

func (sts *ServiceTokenSelect) StringsX(ctx context.Context) []string

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

type ServiceTokenUpdate

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

ServiceTokenUpdate is the builder for updating ServiceToken entities.

func (*ServiceTokenUpdate) AddIssuedAt

func (stu *ServiceTokenUpdate) AddIssuedAt(i int64) *ServiceTokenUpdate

AddIssuedAt adds i to the "issued_at" field.

func (*ServiceTokenUpdate) ClearTokenToServiceAccount

func (stu *ServiceTokenUpdate) ClearTokenToServiceAccount() *ServiceTokenUpdate

ClearTokenToServiceAccount clears the "TokenToServiceAccount" edge to the ServiceAccount entity.

func (*ServiceTokenUpdate) Exec

func (stu *ServiceTokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceTokenUpdate) ExecX

func (stu *ServiceTokenUpdate) ExecX(ctx context.Context)

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

func (*ServiceTokenUpdate) Mutation

func (stu *ServiceTokenUpdate) Mutation() *ServiceTokenMutation

Mutation returns the ServiceTokenMutation object of the builder.

func (*ServiceTokenUpdate) Save

func (stu *ServiceTokenUpdate) Save(ctx context.Context) (int, error)

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

func (*ServiceTokenUpdate) SaveX

func (stu *ServiceTokenUpdate) SaveX(ctx context.Context) int

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

func (*ServiceTokenUpdate) SetIssuedAt

func (stu *ServiceTokenUpdate) SetIssuedAt(i int64) *ServiceTokenUpdate

SetIssuedAt sets the "issued_at" field.

func (*ServiceTokenUpdate) SetRefreshToken

func (stu *ServiceTokenUpdate) SetRefreshToken(s string) *ServiceTokenUpdate

SetRefreshToken sets the "refresh_token" field.

func (*ServiceTokenUpdate) SetToken

func (stu *ServiceTokenUpdate) SetToken(s string) *ServiceTokenUpdate

SetToken sets the "token" field.

func (*ServiceTokenUpdate) SetTokenToServiceAccount

func (stu *ServiceTokenUpdate) SetTokenToServiceAccount(s *ServiceAccount) *ServiceTokenUpdate

SetTokenToServiceAccount sets the "TokenToServiceAccount" edge to the ServiceAccount entity.

func (*ServiceTokenUpdate) SetTokenToServiceAccountID

func (stu *ServiceTokenUpdate) SetTokenToServiceAccountID(id uuid.UUID) *ServiceTokenUpdate

SetTokenToServiceAccountID sets the "TokenToServiceAccount" edge to the ServiceAccount entity by ID.

func (*ServiceTokenUpdate) Where

Where appends a list predicates to the ServiceTokenUpdate builder.

type ServiceTokenUpdateOne

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

ServiceTokenUpdateOne is the builder for updating a single ServiceToken entity.

func (*ServiceTokenUpdateOne) AddIssuedAt

func (stuo *ServiceTokenUpdateOne) AddIssuedAt(i int64) *ServiceTokenUpdateOne

AddIssuedAt adds i to the "issued_at" field.

func (*ServiceTokenUpdateOne) ClearTokenToServiceAccount

func (stuo *ServiceTokenUpdateOne) ClearTokenToServiceAccount() *ServiceTokenUpdateOne

ClearTokenToServiceAccount clears the "TokenToServiceAccount" edge to the ServiceAccount entity.

func (*ServiceTokenUpdateOne) Exec

func (stuo *ServiceTokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ServiceTokenUpdateOne) ExecX

func (stuo *ServiceTokenUpdateOne) ExecX(ctx context.Context)

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

func (*ServiceTokenUpdateOne) Mutation

func (stuo *ServiceTokenUpdateOne) Mutation() *ServiceTokenMutation

Mutation returns the ServiceTokenMutation object of the builder.

func (*ServiceTokenUpdateOne) Save

Save executes the query and returns the updated ServiceToken entity.

func (*ServiceTokenUpdateOne) SaveX

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

func (*ServiceTokenUpdateOne) Select

func (stuo *ServiceTokenUpdateOne) Select(field string, fields ...string) *ServiceTokenUpdateOne

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

func (*ServiceTokenUpdateOne) SetIssuedAt

func (stuo *ServiceTokenUpdateOne) SetIssuedAt(i int64) *ServiceTokenUpdateOne

SetIssuedAt sets the "issued_at" field.

func (*ServiceTokenUpdateOne) SetRefreshToken

func (stuo *ServiceTokenUpdateOne) SetRefreshToken(s string) *ServiceTokenUpdateOne

SetRefreshToken sets the "refresh_token" field.

func (*ServiceTokenUpdateOne) SetToken

SetToken sets the "token" field.

func (*ServiceTokenUpdateOne) SetTokenToServiceAccount

func (stuo *ServiceTokenUpdateOne) SetTokenToServiceAccount(s *ServiceAccount) *ServiceTokenUpdateOne

SetTokenToServiceAccount sets the "TokenToServiceAccount" edge to the ServiceAccount entity.

func (*ServiceTokenUpdateOne) SetTokenToServiceAccountID

func (stuo *ServiceTokenUpdateOne) SetTokenToServiceAccountID(id uuid.UUID) *ServiceTokenUpdateOne

SetTokenToServiceAccountID sets the "TokenToServiceAccount" edge to the ServiceAccount entity by ID.

type ServiceTokens

type ServiceTokens []*ServiceToken

ServiceTokens is a parsable slice of ServiceToken.

type Team

type Team struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// TeamNumber holds the value of the "team_number" field.
	// [REQUIRED] The team number.
	TeamNumber int `json:"team_number,omitempty"`
	// Name holds the value of the "name" field.
	// [OPTIONAL] The display name for the team.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TeamQuery when eager-loading is set.
	Edges TeamEdges `json:"edges"`
	// contains filtered or unexported fields
}

Team is the model entity for the Team schema.

func (*Team) Node

func (t *Team) Node(ctx context.Context) (node *Node, err error)

func (*Team) QueryTeamToCompetition

func (t *Team) QueryTeamToCompetition() *CompetitionQuery

QueryTeamToCompetition queries the "TeamToCompetition" edge of the Team entity.

func (*Team) QueryTeamToUsers

func (t *Team) QueryTeamToUsers() *UserQuery

QueryTeamToUsers queries the "TeamToUsers" edge of the Team entity.

func (*Team) QueryTeamToVmObjects

func (t *Team) QueryTeamToVmObjects() *VmObjectQuery

QueryTeamToVmObjects queries the "TeamToVmObjects" edge of the Team entity.

func (*Team) String

func (t *Team) String() string

String implements the fmt.Stringer.

func (*Team) TeamToCompetition

func (t *Team) TeamToCompetition(ctx context.Context) (*Competition, error)

func (*Team) TeamToUsers

func (t *Team) TeamToUsers(ctx context.Context) ([]*User, error)

func (*Team) TeamToVmObjects

func (t *Team) TeamToVmObjects(ctx context.Context) ([]*VmObject, error)

func (*Team) ToEdge

func (t *Team) ToEdge(order *TeamOrder) *TeamEdge

ToEdge converts Team into TeamEdge.

func (*Team) Unwrap

func (t *Team) Unwrap() *Team

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

func (t *Team) Update() *TeamUpdateOne

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

type TeamClient

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

TeamClient is a client for the Team schema.

func NewTeamClient

func NewTeamClient(c config) *TeamClient

NewTeamClient returns a client for the Team from the given config.

func (*TeamClient) Create

func (c *TeamClient) Create() *TeamCreate

Create returns a create builder for Team.

func (*TeamClient) CreateBulk

func (c *TeamClient) CreateBulk(builders ...*TeamCreate) *TeamCreateBulk

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

func (*TeamClient) Delete

func (c *TeamClient) Delete() *TeamDelete

Delete returns a delete builder for Team.

func (*TeamClient) DeleteOne

func (c *TeamClient) DeleteOne(t *Team) *TeamDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TeamClient) DeleteOneID

func (c *TeamClient) DeleteOneID(id uuid.UUID) *TeamDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TeamClient) Get

func (c *TeamClient) Get(ctx context.Context, id uuid.UUID) (*Team, error)

Get returns a Team entity by its id.

func (*TeamClient) GetX

func (c *TeamClient) GetX(ctx context.Context, id uuid.UUID) *Team

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

func (*TeamClient) Hooks

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

Hooks returns the client hooks.

func (*TeamClient) Query

func (c *TeamClient) Query() *TeamQuery

Query returns a query builder for Team.

func (*TeamClient) QueryTeamToCompetition

func (c *TeamClient) QueryTeamToCompetition(t *Team) *CompetitionQuery

QueryTeamToCompetition queries the TeamToCompetition edge of a Team.

func (*TeamClient) QueryTeamToUsers

func (c *TeamClient) QueryTeamToUsers(t *Team) *UserQuery

QueryTeamToUsers queries the TeamToUsers edge of a Team.

func (*TeamClient) QueryTeamToVmObjects

func (c *TeamClient) QueryTeamToVmObjects(t *Team) *VmObjectQuery

QueryTeamToVmObjects queries the TeamToVmObjects edge of a Team.

func (*TeamClient) Update

func (c *TeamClient) Update() *TeamUpdate

Update returns an update builder for Team.

func (*TeamClient) UpdateOne

func (c *TeamClient) UpdateOne(t *Team) *TeamUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TeamClient) UpdateOneID

func (c *TeamClient) UpdateOneID(id uuid.UUID) *TeamUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TeamClient) Use

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

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

type TeamConnection

type TeamConnection struct {
	Edges      []*TeamEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

TeamConnection is the connection containing edges to Team.

type TeamCreate

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

TeamCreate is the builder for creating a Team entity.

func (*TeamCreate) AddTeamToUserIDs

func (tc *TeamCreate) AddTeamToUserIDs(ids ...uuid.UUID) *TeamCreate

AddTeamToUserIDs adds the "TeamToUsers" edge to the User entity by IDs.

func (*TeamCreate) AddTeamToUsers

func (tc *TeamCreate) AddTeamToUsers(u ...*User) *TeamCreate

AddTeamToUsers adds the "TeamToUsers" edges to the User entity.

func (*TeamCreate) AddTeamToVmObjectIDs

func (tc *TeamCreate) AddTeamToVmObjectIDs(ids ...uuid.UUID) *TeamCreate

AddTeamToVmObjectIDs adds the "TeamToVmObjects" edge to the VmObject entity by IDs.

func (*TeamCreate) AddTeamToVmObjects

func (tc *TeamCreate) AddTeamToVmObjects(v ...*VmObject) *TeamCreate

AddTeamToVmObjects adds the "TeamToVmObjects" edges to the VmObject entity.

func (*TeamCreate) Exec

func (tc *TeamCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TeamCreate) ExecX

func (tc *TeamCreate) ExecX(ctx context.Context)

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

func (*TeamCreate) Mutation

func (tc *TeamCreate) Mutation() *TeamMutation

Mutation returns the TeamMutation object of the builder.

func (*TeamCreate) Save

func (tc *TeamCreate) Save(ctx context.Context) (*Team, error)

Save creates the Team in the database.

func (*TeamCreate) SaveX

func (tc *TeamCreate) SaveX(ctx context.Context) *Team

SaveX calls Save and panics if Save returns an error.

func (*TeamCreate) SetID

func (tc *TeamCreate) SetID(u uuid.UUID) *TeamCreate

SetID sets the "id" field.

func (*TeamCreate) SetName

func (tc *TeamCreate) SetName(s string) *TeamCreate

SetName sets the "name" field.

func (*TeamCreate) SetNillableID

func (tc *TeamCreate) SetNillableID(u *uuid.UUID) *TeamCreate

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

func (*TeamCreate) SetNillableName

func (tc *TeamCreate) SetNillableName(s *string) *TeamCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*TeamCreate) SetTeamNumber

func (tc *TeamCreate) SetTeamNumber(i int) *TeamCreate

SetTeamNumber sets the "team_number" field.

func (*TeamCreate) SetTeamToCompetition

func (tc *TeamCreate) SetTeamToCompetition(c *Competition) *TeamCreate

SetTeamToCompetition sets the "TeamToCompetition" edge to the Competition entity.

func (*TeamCreate) SetTeamToCompetitionID

func (tc *TeamCreate) SetTeamToCompetitionID(id uuid.UUID) *TeamCreate

SetTeamToCompetitionID sets the "TeamToCompetition" edge to the Competition entity by ID.

type TeamCreateBulk

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

TeamCreateBulk is the builder for creating many Team entities in bulk.

func (*TeamCreateBulk) Exec

func (tcb *TeamCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TeamCreateBulk) ExecX

func (tcb *TeamCreateBulk) ExecX(ctx context.Context)

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

func (*TeamCreateBulk) Save

func (tcb *TeamCreateBulk) Save(ctx context.Context) ([]*Team, error)

Save creates the Team entities in the database.

func (*TeamCreateBulk) SaveX

func (tcb *TeamCreateBulk) SaveX(ctx context.Context) []*Team

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

type TeamDelete

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

TeamDelete is the builder for deleting a Team entity.

func (*TeamDelete) Exec

func (td *TeamDelete) Exec(ctx context.Context) (int, error)

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

func (*TeamDelete) ExecX

func (td *TeamDelete) ExecX(ctx context.Context) int

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

func (*TeamDelete) Where

func (td *TeamDelete) Where(ps ...predicate.Team) *TeamDelete

Where appends a list predicates to the TeamDelete builder.

type TeamDeleteOne

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

TeamDeleteOne is the builder for deleting a single Team entity.

func (*TeamDeleteOne) Exec

func (tdo *TeamDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TeamDeleteOne) ExecX

func (tdo *TeamDeleteOne) ExecX(ctx context.Context)

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

type TeamEdge

type TeamEdge struct {
	Node   *Team  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TeamEdge is the edge representation of Team.

type TeamEdges

type TeamEdges struct {
	// TeamToCompetition holds the value of the TeamToCompetition edge.
	TeamToCompetition *Competition `json:"TeamToCompetition,omitempty"`
	// TeamToVmObjects holds the value of the TeamToVmObjects edge.
	TeamToVmObjects []*VmObject `json:"TeamToVmObjects,omitempty"`
	// TeamToUsers holds the value of the TeamToUsers edge.
	TeamToUsers []*User `json:"TeamToUsers,omitempty"`
	// contains filtered or unexported fields
}

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

func (TeamEdges) TeamToCompetitionOrErr

func (e TeamEdges) TeamToCompetitionOrErr() (*Competition, error)

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

func (TeamEdges) TeamToUsersOrErr

func (e TeamEdges) TeamToUsersOrErr() ([]*User, error)

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

func (TeamEdges) TeamToVmObjectsOrErr

func (e TeamEdges) TeamToVmObjectsOrErr() ([]*VmObject, error)

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

type TeamGroupBy

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

TeamGroupBy is the group-by builder for Team entities.

func (*TeamGroupBy) Aggregate

func (tgb *TeamGroupBy) Aggregate(fns ...AggregateFunc) *TeamGroupBy

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

func (*TeamGroupBy) Bool

func (tgb *TeamGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TeamGroupBy) BoolX

func (tgb *TeamGroupBy) BoolX(ctx context.Context) bool

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

func (*TeamGroupBy) Bools

func (tgb *TeamGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TeamGroupBy) BoolsX

func (tgb *TeamGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TeamGroupBy) Float64

func (tgb *TeamGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TeamGroupBy) Float64X

func (tgb *TeamGroupBy) Float64X(ctx context.Context) float64

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

func (*TeamGroupBy) Float64s

func (tgb *TeamGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TeamGroupBy) Float64sX

func (tgb *TeamGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TeamGroupBy) Int

func (tgb *TeamGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TeamGroupBy) IntX

func (tgb *TeamGroupBy) IntX(ctx context.Context) int

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

func (*TeamGroupBy) Ints

func (tgb *TeamGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TeamGroupBy) IntsX

func (tgb *TeamGroupBy) IntsX(ctx context.Context) []int

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

func (*TeamGroupBy) Scan

func (tgb *TeamGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TeamGroupBy) ScanX

func (tgb *TeamGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TeamGroupBy) String

func (tgb *TeamGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TeamGroupBy) StringX

func (tgb *TeamGroupBy) StringX(ctx context.Context) string

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

func (*TeamGroupBy) Strings

func (tgb *TeamGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TeamGroupBy) StringsX

func (tgb *TeamGroupBy) StringsX(ctx context.Context) []string

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

type TeamMutation

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

TeamMutation represents an operation that mutates the Team nodes in the graph.

func (*TeamMutation) AddField

func (m *TeamMutation) 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 (*TeamMutation) AddTeamNumber

func (m *TeamMutation) AddTeamNumber(i int)

AddTeamNumber adds i to the "team_number" field.

func (*TeamMutation) AddTeamToUserIDs

func (m *TeamMutation) AddTeamToUserIDs(ids ...uuid.UUID)

AddTeamToUserIDs adds the "TeamToUsers" edge to the User entity by ids.

func (*TeamMutation) AddTeamToVmObjectIDs

func (m *TeamMutation) AddTeamToVmObjectIDs(ids ...uuid.UUID)

AddTeamToVmObjectIDs adds the "TeamToVmObjects" edge to the VmObject entity by ids.

func (*TeamMutation) AddedEdges

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

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

func (*TeamMutation) AddedField

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

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

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

func (*TeamMutation) AddedIDs

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

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

func (*TeamMutation) AddedTeamNumber

func (m *TeamMutation) AddedTeamNumber() (r int, exists bool)

AddedTeamNumber returns the value that was added to the "team_number" field in this mutation.

func (*TeamMutation) ClearEdge

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

func (m *TeamMutation) 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 (*TeamMutation) ClearName

func (m *TeamMutation) ClearName()

ClearName clears the value of the "name" field.

func (*TeamMutation) ClearTeamToCompetition

func (m *TeamMutation) ClearTeamToCompetition()

ClearTeamToCompetition clears the "TeamToCompetition" edge to the Competition entity.

func (*TeamMutation) ClearTeamToUsers

func (m *TeamMutation) ClearTeamToUsers()

ClearTeamToUsers clears the "TeamToUsers" edge to the User entity.

func (*TeamMutation) ClearTeamToVmObjects

func (m *TeamMutation) ClearTeamToVmObjects()

ClearTeamToVmObjects clears the "TeamToVmObjects" edge to the VmObject entity.

func (*TeamMutation) ClearedEdges

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

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

func (*TeamMutation) ClearedFields

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

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

func (TeamMutation) Client

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

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

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

func (*TeamMutation) Field

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

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

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

func (*TeamMutation) Fields

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

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

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

func (*TeamMutation) IDs

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

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

func (*TeamMutation) Name

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

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

func (*TeamMutation) NameCleared

func (m *TeamMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*TeamMutation) OldField

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

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

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

func (m *TeamMutation) OldTeamNumber(ctx context.Context) (v int, err error)

OldTeamNumber returns the old "team_number" field's value of the Team entity. If the Team 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 (*TeamMutation) Op

func (m *TeamMutation) Op() Op

Op returns the operation name.

func (*TeamMutation) RemoveTeamToUserIDs

func (m *TeamMutation) RemoveTeamToUserIDs(ids ...uuid.UUID)

RemoveTeamToUserIDs removes the "TeamToUsers" edge to the User entity by IDs.

func (*TeamMutation) RemoveTeamToVmObjectIDs

func (m *TeamMutation) RemoveTeamToVmObjectIDs(ids ...uuid.UUID)

RemoveTeamToVmObjectIDs removes the "TeamToVmObjects" edge to the VmObject entity by IDs.

func (*TeamMutation) RemovedEdges

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

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

func (*TeamMutation) RemovedIDs

func (m *TeamMutation) 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 (*TeamMutation) RemovedTeamToUsersIDs

func (m *TeamMutation) RemovedTeamToUsersIDs() (ids []uuid.UUID)

RemovedTeamToUsers returns the removed IDs of the "TeamToUsers" edge to the User entity.

func (*TeamMutation) RemovedTeamToVmObjectsIDs

func (m *TeamMutation) RemovedTeamToVmObjectsIDs() (ids []uuid.UUID)

RemovedTeamToVmObjects returns the removed IDs of the "TeamToVmObjects" edge to the VmObject entity.

func (*TeamMutation) ResetEdge

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

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

func (m *TeamMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TeamMutation) ResetTeamNumber

func (m *TeamMutation) ResetTeamNumber()

ResetTeamNumber resets all changes to the "team_number" field.

func (*TeamMutation) ResetTeamToCompetition

func (m *TeamMutation) ResetTeamToCompetition()

ResetTeamToCompetition resets all changes to the "TeamToCompetition" edge.

func (*TeamMutation) ResetTeamToUsers

func (m *TeamMutation) ResetTeamToUsers()

ResetTeamToUsers resets all changes to the "TeamToUsers" edge.

func (*TeamMutation) ResetTeamToVmObjects

func (m *TeamMutation) ResetTeamToVmObjects()

ResetTeamToVmObjects resets all changes to the "TeamToVmObjects" edge.

func (*TeamMutation) SetField

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

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

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

func (*TeamMutation) SetName

func (m *TeamMutation) SetName(s string)

SetName sets the "name" field.

func (*TeamMutation) SetTeamNumber

func (m *TeamMutation) SetTeamNumber(i int)

SetTeamNumber sets the "team_number" field.

func (*TeamMutation) SetTeamToCompetitionID

func (m *TeamMutation) SetTeamToCompetitionID(id uuid.UUID)

SetTeamToCompetitionID sets the "TeamToCompetition" edge to the Competition entity by id.

func (*TeamMutation) TeamNumber

func (m *TeamMutation) TeamNumber() (r int, exists bool)

TeamNumber returns the value of the "team_number" field in the mutation.

func (*TeamMutation) TeamToCompetitionCleared

func (m *TeamMutation) TeamToCompetitionCleared() bool

TeamToCompetitionCleared reports if the "TeamToCompetition" edge to the Competition entity was cleared.

func (*TeamMutation) TeamToCompetitionID

func (m *TeamMutation) TeamToCompetitionID() (id uuid.UUID, exists bool)

TeamToCompetitionID returns the "TeamToCompetition" edge ID in the mutation.

func (*TeamMutation) TeamToCompetitionIDs

func (m *TeamMutation) TeamToCompetitionIDs() (ids []uuid.UUID)

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

func (*TeamMutation) TeamToUsersCleared

func (m *TeamMutation) TeamToUsersCleared() bool

TeamToUsersCleared reports if the "TeamToUsers" edge to the User entity was cleared.

func (*TeamMutation) TeamToUsersIDs

func (m *TeamMutation) TeamToUsersIDs() (ids []uuid.UUID)

TeamToUsersIDs returns the "TeamToUsers" edge IDs in the mutation.

func (*TeamMutation) TeamToVmObjectsCleared

func (m *TeamMutation) TeamToVmObjectsCleared() bool

TeamToVmObjectsCleared reports if the "TeamToVmObjects" edge to the VmObject entity was cleared.

func (*TeamMutation) TeamToVmObjectsIDs

func (m *TeamMutation) TeamToVmObjectsIDs() (ids []uuid.UUID)

TeamToVmObjectsIDs returns the "TeamToVmObjects" edge IDs in the mutation.

func (TeamMutation) Tx

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

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

func (*TeamMutation) Type

func (m *TeamMutation) Type() string

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

func (*TeamMutation) Where

func (m *TeamMutation) Where(ps ...predicate.Team)

Where appends a list predicates to the TeamMutation builder.

type TeamOrder

type TeamOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *TeamOrderField `json:"field"`
}

TeamOrder defines the ordering of Team.

type TeamOrderField

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

TeamOrderField defines the ordering field of Team.

type TeamPaginateOption

type TeamPaginateOption func(*teamPager) error

TeamPaginateOption enables pagination customization.

func WithTeamFilter

func WithTeamFilter(filter func(*TeamQuery) (*TeamQuery, error)) TeamPaginateOption

WithTeamFilter configures pagination filter.

func WithTeamOrder

func WithTeamOrder(order *TeamOrder) TeamPaginateOption

WithTeamOrder configures pagination ordering.

type TeamQuery

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

TeamQuery is the builder for querying Team entities.

func (*TeamQuery) All

func (tq *TeamQuery) All(ctx context.Context) ([]*Team, error)

All executes the query and returns a list of Teams.

func (*TeamQuery) AllX

func (tq *TeamQuery) AllX(ctx context.Context) []*Team

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

func (*TeamQuery) Clone

func (tq *TeamQuery) Clone() *TeamQuery

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

func (*TeamQuery) CollectFields

func (t *TeamQuery) CollectFields(ctx context.Context, satisfies ...string) *TeamQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TeamQuery) Count

func (tq *TeamQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TeamQuery) CountX

func (tq *TeamQuery) CountX(ctx context.Context) int

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

func (*TeamQuery) Exist

func (tq *TeamQuery) Exist(ctx context.Context) (bool, error)

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

func (*TeamQuery) ExistX

func (tq *TeamQuery) ExistX(ctx context.Context) bool

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

func (*TeamQuery) First

func (tq *TeamQuery) First(ctx context.Context) (*Team, error)

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

func (*TeamQuery) FirstID

func (tq *TeamQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*TeamQuery) FirstIDX

func (tq *TeamQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*TeamQuery) FirstX

func (tq *TeamQuery) FirstX(ctx context.Context) *Team

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

func (*TeamQuery) GroupBy

func (tq *TeamQuery) GroupBy(field string, fields ...string) *TeamGroupBy

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 {
	TeamNumber int `json:"team_number,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Team.Query().
	GroupBy(team.FieldTeamNumber).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TeamQuery) IDs

func (tq *TeamQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*TeamQuery) IDsX

func (tq *TeamQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*TeamQuery) Limit

func (tq *TeamQuery) Limit(limit int) *TeamQuery

Limit adds a limit step to the query.

func (*TeamQuery) Offset

func (tq *TeamQuery) Offset(offset int) *TeamQuery

Offset adds an offset step to the query.

func (*TeamQuery) Only

func (tq *TeamQuery) Only(ctx context.Context) (*Team, error)

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

func (*TeamQuery) OnlyID

func (tq *TeamQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*TeamQuery) OnlyIDX

func (tq *TeamQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*TeamQuery) OnlyX

func (tq *TeamQuery) OnlyX(ctx context.Context) *Team

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

func (*TeamQuery) Order

func (tq *TeamQuery) Order(o ...OrderFunc) *TeamQuery

Order adds an order step to the query.

func (*TeamQuery) Paginate

func (t *TeamQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TeamPaginateOption,
) (*TeamConnection, error)

Paginate executes the query and returns a relay based cursor connection to Team.

func (*TeamQuery) QueryTeamToCompetition

func (tq *TeamQuery) QueryTeamToCompetition() *CompetitionQuery

QueryTeamToCompetition chains the current query on the "TeamToCompetition" edge.

func (*TeamQuery) QueryTeamToUsers

func (tq *TeamQuery) QueryTeamToUsers() *UserQuery

QueryTeamToUsers chains the current query on the "TeamToUsers" edge.

func (*TeamQuery) QueryTeamToVmObjects

func (tq *TeamQuery) QueryTeamToVmObjects() *VmObjectQuery

QueryTeamToVmObjects chains the current query on the "TeamToVmObjects" edge.

func (*TeamQuery) Select

func (tq *TeamQuery) Select(fields ...string) *TeamSelect

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 {
	TeamNumber int `json:"team_number,omitempty"`
}

client.Team.Query().
	Select(team.FieldTeamNumber).
	Scan(ctx, &v)

func (*TeamQuery) Unique

func (tq *TeamQuery) Unique(unique bool) *TeamQuery

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

func (tq *TeamQuery) Where(ps ...predicate.Team) *TeamQuery

Where adds a new predicate for the TeamQuery builder.

func (*TeamQuery) WithTeamToCompetition

func (tq *TeamQuery) WithTeamToCompetition(opts ...func(*CompetitionQuery)) *TeamQuery

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

func (*TeamQuery) WithTeamToUsers

func (tq *TeamQuery) WithTeamToUsers(opts ...func(*UserQuery)) *TeamQuery

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

func (*TeamQuery) WithTeamToVmObjects

func (tq *TeamQuery) WithTeamToVmObjects(opts ...func(*VmObjectQuery)) *TeamQuery

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

type TeamSelect

type TeamSelect struct {
	*TeamQuery
	// contains filtered or unexported fields
}

TeamSelect is the builder for selecting fields of Team entities.

func (*TeamSelect) Bool

func (ts *TeamSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TeamSelect) BoolX

func (ts *TeamSelect) BoolX(ctx context.Context) bool

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

func (*TeamSelect) Bools

func (ts *TeamSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TeamSelect) BoolsX

func (ts *TeamSelect) BoolsX(ctx context.Context) []bool

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

func (*TeamSelect) Float64

func (ts *TeamSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TeamSelect) Float64X

func (ts *TeamSelect) Float64X(ctx context.Context) float64

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

func (*TeamSelect) Float64s

func (ts *TeamSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TeamSelect) Float64sX

func (ts *TeamSelect) Float64sX(ctx context.Context) []float64

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

func (*TeamSelect) Int

func (ts *TeamSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TeamSelect) IntX

func (ts *TeamSelect) IntX(ctx context.Context) int

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

func (*TeamSelect) Ints

func (ts *TeamSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TeamSelect) IntsX

func (ts *TeamSelect) IntsX(ctx context.Context) []int

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

func (*TeamSelect) Scan

func (ts *TeamSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TeamSelect) ScanX

func (ts *TeamSelect) ScanX(ctx context.Context, v interface{})

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

func (*TeamSelect) String

func (ts *TeamSelect) String(ctx context.Context) (_ string, err error)

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

func (*TeamSelect) StringX

func (ts *TeamSelect) StringX(ctx context.Context) string

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

func (*TeamSelect) Strings

func (ts *TeamSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TeamSelect) StringsX

func (ts *TeamSelect) StringsX(ctx context.Context) []string

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

type TeamUpdate

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

TeamUpdate is the builder for updating Team entities.

func (*TeamUpdate) AddTeamNumber

func (tu *TeamUpdate) AddTeamNumber(i int) *TeamUpdate

AddTeamNumber adds i to the "team_number" field.

func (*TeamUpdate) AddTeamToUserIDs

func (tu *TeamUpdate) AddTeamToUserIDs(ids ...uuid.UUID) *TeamUpdate

AddTeamToUserIDs adds the "TeamToUsers" edge to the User entity by IDs.

func (*TeamUpdate) AddTeamToUsers

func (tu *TeamUpdate) AddTeamToUsers(u ...*User) *TeamUpdate

AddTeamToUsers adds the "TeamToUsers" edges to the User entity.

func (*TeamUpdate) AddTeamToVmObjectIDs

func (tu *TeamUpdate) AddTeamToVmObjectIDs(ids ...uuid.UUID) *TeamUpdate

AddTeamToVmObjectIDs adds the "TeamToVmObjects" edge to the VmObject entity by IDs.

func (*TeamUpdate) AddTeamToVmObjects

func (tu *TeamUpdate) AddTeamToVmObjects(v ...*VmObject) *TeamUpdate

AddTeamToVmObjects adds the "TeamToVmObjects" edges to the VmObject entity.

func (*TeamUpdate) ClearName

func (tu *TeamUpdate) ClearName() *TeamUpdate

ClearName clears the value of the "name" field.

func (*TeamUpdate) ClearTeamToCompetition

func (tu *TeamUpdate) ClearTeamToCompetition() *TeamUpdate

ClearTeamToCompetition clears the "TeamToCompetition" edge to the Competition entity.

func (*TeamUpdate) ClearTeamToUsers

func (tu *TeamUpdate) ClearTeamToUsers() *TeamUpdate

ClearTeamToUsers clears all "TeamToUsers" edges to the User entity.

func (*TeamUpdate) ClearTeamToVmObjects

func (tu *TeamUpdate) ClearTeamToVmObjects() *TeamUpdate

ClearTeamToVmObjects clears all "TeamToVmObjects" edges to the VmObject entity.

func (*TeamUpdate) Exec

func (tu *TeamUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TeamUpdate) ExecX

func (tu *TeamUpdate) ExecX(ctx context.Context)

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

func (*TeamUpdate) Mutation

func (tu *TeamUpdate) Mutation() *TeamMutation

Mutation returns the TeamMutation object of the builder.

func (*TeamUpdate) RemoveTeamToUserIDs

func (tu *TeamUpdate) RemoveTeamToUserIDs(ids ...uuid.UUID) *TeamUpdate

RemoveTeamToUserIDs removes the "TeamToUsers" edge to User entities by IDs.

func (*TeamUpdate) RemoveTeamToUsers

func (tu *TeamUpdate) RemoveTeamToUsers(u ...*User) *TeamUpdate

RemoveTeamToUsers removes "TeamToUsers" edges to User entities.

func (*TeamUpdate) RemoveTeamToVmObjectIDs

func (tu *TeamUpdate) RemoveTeamToVmObjectIDs(ids ...uuid.UUID) *TeamUpdate

RemoveTeamToVmObjectIDs removes the "TeamToVmObjects" edge to VmObject entities by IDs.

func (*TeamUpdate) RemoveTeamToVmObjects

func (tu *TeamUpdate) RemoveTeamToVmObjects(v ...*VmObject) *TeamUpdate

RemoveTeamToVmObjects removes "TeamToVmObjects" edges to VmObject entities.

func (*TeamUpdate) Save

func (tu *TeamUpdate) Save(ctx context.Context) (int, error)

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

func (*TeamUpdate) SaveX

func (tu *TeamUpdate) SaveX(ctx context.Context) int

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

func (*TeamUpdate) SetName

func (tu *TeamUpdate) SetName(s string) *TeamUpdate

SetName sets the "name" field.

func (*TeamUpdate) SetNillableName

func (tu *TeamUpdate) SetNillableName(s *string) *TeamUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*TeamUpdate) SetTeamNumber

func (tu *TeamUpdate) SetTeamNumber(i int) *TeamUpdate

SetTeamNumber sets the "team_number" field.

func (*TeamUpdate) SetTeamToCompetition

func (tu *TeamUpdate) SetTeamToCompetition(c *Competition) *TeamUpdate

SetTeamToCompetition sets the "TeamToCompetition" edge to the Competition entity.

func (*TeamUpdate) SetTeamToCompetitionID

func (tu *TeamUpdate) SetTeamToCompetitionID(id uuid.UUID) *TeamUpdate

SetTeamToCompetitionID sets the "TeamToCompetition" edge to the Competition entity by ID.

func (*TeamUpdate) Where

func (tu *TeamUpdate) Where(ps ...predicate.Team) *TeamUpdate

Where appends a list predicates to the TeamUpdate builder.

type TeamUpdateOne

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

TeamUpdateOne is the builder for updating a single Team entity.

func (*TeamUpdateOne) AddTeamNumber

func (tuo *TeamUpdateOne) AddTeamNumber(i int) *TeamUpdateOne

AddTeamNumber adds i to the "team_number" field.

func (*TeamUpdateOne) AddTeamToUserIDs

func (tuo *TeamUpdateOne) AddTeamToUserIDs(ids ...uuid.UUID) *TeamUpdateOne

AddTeamToUserIDs adds the "TeamToUsers" edge to the User entity by IDs.

func (*TeamUpdateOne) AddTeamToUsers

func (tuo *TeamUpdateOne) AddTeamToUsers(u ...*User) *TeamUpdateOne

AddTeamToUsers adds the "TeamToUsers" edges to the User entity.

func (*TeamUpdateOne) AddTeamToVmObjectIDs

func (tuo *TeamUpdateOne) AddTeamToVmObjectIDs(ids ...uuid.UUID) *TeamUpdateOne

AddTeamToVmObjectIDs adds the "TeamToVmObjects" edge to the VmObject entity by IDs.

func (*TeamUpdateOne) AddTeamToVmObjects

func (tuo *TeamUpdateOne) AddTeamToVmObjects(v ...*VmObject) *TeamUpdateOne

AddTeamToVmObjects adds the "TeamToVmObjects" edges to the VmObject entity.

func (*TeamUpdateOne) ClearName

func (tuo *TeamUpdateOne) ClearName() *TeamUpdateOne

ClearName clears the value of the "name" field.

func (*TeamUpdateOne) ClearTeamToCompetition

func (tuo *TeamUpdateOne) ClearTeamToCompetition() *TeamUpdateOne

ClearTeamToCompetition clears the "TeamToCompetition" edge to the Competition entity.

func (*TeamUpdateOne) ClearTeamToUsers

func (tuo *TeamUpdateOne) ClearTeamToUsers() *TeamUpdateOne

ClearTeamToUsers clears all "TeamToUsers" edges to the User entity.

func (*TeamUpdateOne) ClearTeamToVmObjects

func (tuo *TeamUpdateOne) ClearTeamToVmObjects() *TeamUpdateOne

ClearTeamToVmObjects clears all "TeamToVmObjects" edges to the VmObject entity.

func (*TeamUpdateOne) Exec

func (tuo *TeamUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TeamUpdateOne) ExecX

func (tuo *TeamUpdateOne) ExecX(ctx context.Context)

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

func (*TeamUpdateOne) Mutation

func (tuo *TeamUpdateOne) Mutation() *TeamMutation

Mutation returns the TeamMutation object of the builder.

func (*TeamUpdateOne) RemoveTeamToUserIDs

func (tuo *TeamUpdateOne) RemoveTeamToUserIDs(ids ...uuid.UUID) *TeamUpdateOne

RemoveTeamToUserIDs removes the "TeamToUsers" edge to User entities by IDs.

func (*TeamUpdateOne) RemoveTeamToUsers

func (tuo *TeamUpdateOne) RemoveTeamToUsers(u ...*User) *TeamUpdateOne

RemoveTeamToUsers removes "TeamToUsers" edges to User entities.

func (*TeamUpdateOne) RemoveTeamToVmObjectIDs

func (tuo *TeamUpdateOne) RemoveTeamToVmObjectIDs(ids ...uuid.UUID) *TeamUpdateOne

RemoveTeamToVmObjectIDs removes the "TeamToVmObjects" edge to VmObject entities by IDs.

func (*TeamUpdateOne) RemoveTeamToVmObjects

func (tuo *TeamUpdateOne) RemoveTeamToVmObjects(v ...*VmObject) *TeamUpdateOne

RemoveTeamToVmObjects removes "TeamToVmObjects" edges to VmObject entities.

func (*TeamUpdateOne) Save

func (tuo *TeamUpdateOne) Save(ctx context.Context) (*Team, error)

Save executes the query and returns the updated Team entity.

func (*TeamUpdateOne) SaveX

func (tuo *TeamUpdateOne) SaveX(ctx context.Context) *Team

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

func (*TeamUpdateOne) Select

func (tuo *TeamUpdateOne) Select(field string, fields ...string) *TeamUpdateOne

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

func (*TeamUpdateOne) SetName

func (tuo *TeamUpdateOne) SetName(s string) *TeamUpdateOne

SetName sets the "name" field.

func (*TeamUpdateOne) SetNillableName

func (tuo *TeamUpdateOne) SetNillableName(s *string) *TeamUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*TeamUpdateOne) SetTeamNumber

func (tuo *TeamUpdateOne) SetTeamNumber(i int) *TeamUpdateOne

SetTeamNumber sets the "team_number" field.

func (*TeamUpdateOne) SetTeamToCompetition

func (tuo *TeamUpdateOne) SetTeamToCompetition(c *Competition) *TeamUpdateOne

SetTeamToCompetition sets the "TeamToCompetition" edge to the Competition entity.

func (*TeamUpdateOne) SetTeamToCompetitionID

func (tuo *TeamUpdateOne) SetTeamToCompetitionID(id uuid.UUID) *TeamUpdateOne

SetTeamToCompetitionID sets the "TeamToCompetition" edge to the Competition entity by ID.

type Teams

type Teams []*Team

Teams is a parsable slice of Team.

type Token

type Token struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Token holds the value of the "token" field.
	// [REQUIRED] The auth-token cookie value for the user session.
	Token string `json:"token,omitempty"`
	// ExpireAt holds the value of the "expire_at" field.
	// [REQUIRED] The time the token should expire.
	ExpireAt int64 `json:"expire_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TokenQuery when eager-loading is set.
	Edges TokenEdges `json:"edges"`
	// contains filtered or unexported fields
}

Token is the model entity for the Token schema.

func (*Token) Node

func (t *Token) Node(ctx context.Context) (node *Node, err error)

func (*Token) QueryTokenToUser

func (t *Token) QueryTokenToUser() *UserQuery

QueryTokenToUser queries the "TokenToUser" edge of the Token entity.

func (*Token) String

func (t *Token) String() string

String implements the fmt.Stringer.

func (*Token) ToEdge

func (t *Token) ToEdge(order *TokenOrder) *TokenEdge

ToEdge converts Token into TokenEdge.

func (*Token) TokenToUser

func (t *Token) TokenToUser(ctx context.Context) (*User, error)

func (*Token) Unwrap

func (t *Token) Unwrap() *Token

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

func (t *Token) Update() *TokenUpdateOne

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

type TokenClient

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

TokenClient is a client for the Token schema.

func NewTokenClient

func NewTokenClient(c config) *TokenClient

NewTokenClient returns a client for the Token from the given config.

func (*TokenClient) Create

func (c *TokenClient) Create() *TokenCreate

Create returns a create builder for Token.

func (*TokenClient) CreateBulk

func (c *TokenClient) CreateBulk(builders ...*TokenCreate) *TokenCreateBulk

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

func (*TokenClient) Delete

func (c *TokenClient) Delete() *TokenDelete

Delete returns a delete builder for Token.

func (*TokenClient) DeleteOne

func (c *TokenClient) DeleteOne(t *Token) *TokenDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TokenClient) DeleteOneID

func (c *TokenClient) DeleteOneID(id uuid.UUID) *TokenDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TokenClient) Get

func (c *TokenClient) Get(ctx context.Context, id uuid.UUID) (*Token, error)

Get returns a Token entity by its id.

func (*TokenClient) GetX

func (c *TokenClient) GetX(ctx context.Context, id uuid.UUID) *Token

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

func (*TokenClient) Hooks

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

Hooks returns the client hooks.

func (*TokenClient) Query

func (c *TokenClient) Query() *TokenQuery

Query returns a query builder for Token.

func (*TokenClient) QueryTokenToUser

func (c *TokenClient) QueryTokenToUser(t *Token) *UserQuery

QueryTokenToUser queries the TokenToUser edge of a Token.

func (*TokenClient) Update

func (c *TokenClient) Update() *TokenUpdate

Update returns an update builder for Token.

func (*TokenClient) UpdateOne

func (c *TokenClient) UpdateOne(t *Token) *TokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenClient) UpdateOneID

func (c *TokenClient) UpdateOneID(id uuid.UUID) *TokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenClient) Use

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

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

type TokenConnection

type TokenConnection struct {
	Edges      []*TokenEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

TokenConnection is the connection containing edges to Token.

type TokenCreate

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

TokenCreate is the builder for creating a Token entity.

func (*TokenCreate) Exec

func (tc *TokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreate) ExecX

func (tc *TokenCreate) ExecX(ctx context.Context)

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

func (*TokenCreate) Mutation

func (tc *TokenCreate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenCreate) Save

func (tc *TokenCreate) Save(ctx context.Context) (*Token, error)

Save creates the Token in the database.

func (*TokenCreate) SaveX

func (tc *TokenCreate) SaveX(ctx context.Context) *Token

SaveX calls Save and panics if Save returns an error.

func (*TokenCreate) SetExpireAt

func (tc *TokenCreate) SetExpireAt(i int64) *TokenCreate

SetExpireAt sets the "expire_at" field.

func (*TokenCreate) SetID

func (tc *TokenCreate) SetID(u uuid.UUID) *TokenCreate

SetID sets the "id" field.

func (*TokenCreate) SetNillableID

func (tc *TokenCreate) SetNillableID(u *uuid.UUID) *TokenCreate

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

func (*TokenCreate) SetToken

func (tc *TokenCreate) SetToken(s string) *TokenCreate

SetToken sets the "token" field.

func (*TokenCreate) SetTokenToUser

func (tc *TokenCreate) SetTokenToUser(u *User) *TokenCreate

SetTokenToUser sets the "TokenToUser" edge to the User entity.

func (*TokenCreate) SetTokenToUserID

func (tc *TokenCreate) SetTokenToUserID(id uuid.UUID) *TokenCreate

SetTokenToUserID sets the "TokenToUser" edge to the User entity by ID.

type TokenCreateBulk

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

TokenCreateBulk is the builder for creating many Token entities in bulk.

func (*TokenCreateBulk) Exec

func (tcb *TokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreateBulk) ExecX

func (tcb *TokenCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreateBulk) Save

func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error)

Save creates the Token entities in the database.

func (*TokenCreateBulk) SaveX

func (tcb *TokenCreateBulk) SaveX(ctx context.Context) []*Token

SaveX is like Save, but panics if an error occurs.

type TokenDelete

type TokenDelete struct {
	// contains filtered or unexported fields
}

TokenDelete is the builder for deleting a Token entity.

func (*TokenDelete) Exec

func (td *TokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TokenDelete) ExecX

func (td *TokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TokenDelete) Where

func (td *TokenDelete) Where(ps ...predicate.Token) *TokenDelete

Where appends a list predicates to the TokenDelete builder.

type TokenDeleteOne

type TokenDeleteOne struct {
	// contains filtered or unexported fields
}

TokenDeleteOne is the builder for deleting a single Token entity.

func (*TokenDeleteOne) Exec

func (tdo *TokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TokenDeleteOne) ExecX

func (tdo *TokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TokenEdge

type TokenEdge struct {
	Node   *Token `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TokenEdge is the edge representation of Token.

type TokenEdges

type TokenEdges struct {
	// TokenToUser holds the value of the TokenToUser edge.
	TokenToUser *User `json:"TokenToUser,omitempty"`
	// contains filtered or unexported fields
}

TokenEdges holds the relations/edges for other nodes in the graph.

func (TokenEdges) TokenToUserOrErr

func (e TokenEdges) TokenToUserOrErr() (*User, error)

TokenToUserOrErr returns the TokenToUser value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TokenGroupBy

type TokenGroupBy struct {
	// contains filtered or unexported fields
}

TokenGroupBy is the group-by builder for Token entities.

func (*TokenGroupBy) Aggregate

func (tgb *TokenGroupBy) Aggregate(fns ...AggregateFunc) *TokenGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TokenGroupBy) Bool

func (tgb *TokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) BoolX

func (tgb *TokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenGroupBy) Bools

func (tgb *TokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) BoolsX

func (tgb *TokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenGroupBy) Float64

func (tgb *TokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) Float64X

func (tgb *TokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenGroupBy) Float64s

func (tgb *TokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) Float64sX

func (tgb *TokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenGroupBy) Int

func (tgb *TokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) IntX

func (tgb *TokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenGroupBy) Ints

func (tgb *TokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) IntsX

func (tgb *TokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenGroupBy) Scan

func (tgb *TokenGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TokenGroupBy) ScanX

func (tgb *TokenGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TokenGroupBy) String

func (tgb *TokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) StringX

func (tgb *TokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenGroupBy) Strings

func (tgb *TokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*TokenGroupBy) StringsX

func (tgb *TokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenMutation

type TokenMutation struct {
	// contains filtered or unexported fields
}

TokenMutation represents an operation that mutates the Token nodes in the graph.

func (*TokenMutation) AddExpireAt

func (m *TokenMutation) AddExpireAt(i int64)

AddExpireAt adds i to the "expire_at" field.

func (*TokenMutation) AddField

func (m *TokenMutation) 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 (*TokenMutation) AddedEdges

func (m *TokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TokenMutation) AddedExpireAt

func (m *TokenMutation) AddedExpireAt() (r int64, exists bool)

AddedExpireAt returns the value that was added to the "expire_at" field in this mutation.

func (*TokenMutation) AddedField

func (m *TokenMutation) 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 (*TokenMutation) AddedFields

func (m *TokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TokenMutation) AddedIDs

func (m *TokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TokenMutation) ClearEdge

func (m *TokenMutation) 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 (*TokenMutation) ClearField

func (m *TokenMutation) 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 (*TokenMutation) ClearTokenToUser

func (m *TokenMutation) ClearTokenToUser()

ClearTokenToUser clears the "TokenToUser" edge to the User entity.

func (*TokenMutation) ClearedEdges

func (m *TokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TokenMutation) ClearedFields

func (m *TokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TokenMutation) Client

func (m TokenMutation) 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 (*TokenMutation) EdgeCleared

func (m *TokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TokenMutation) ExpireAt

func (m *TokenMutation) ExpireAt() (r int64, exists bool)

ExpireAt returns the value of the "expire_at" field in the mutation.

func (*TokenMutation) Field

func (m *TokenMutation) 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 (*TokenMutation) FieldCleared

func (m *TokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TokenMutation) Fields

func (m *TokenMutation) 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 (*TokenMutation) ID

func (m *TokenMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TokenMutation) IDs

func (m *TokenMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TokenMutation) OldExpireAt

func (m *TokenMutation) OldExpireAt(ctx context.Context) (v int64, err error)

OldExpireAt returns the old "expire_at" field's value of the Token entity. If the Token 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 (*TokenMutation) OldField

func (m *TokenMutation) 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 (*TokenMutation) OldToken

func (m *TokenMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Token entity. If the Token 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 (*TokenMutation) Op

func (m *TokenMutation) Op() Op

Op returns the operation name.

func (*TokenMutation) RemovedEdges

func (m *TokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TokenMutation) RemovedIDs

func (m *TokenMutation) 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 (*TokenMutation) ResetEdge

func (m *TokenMutation) 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 (*TokenMutation) ResetExpireAt

func (m *TokenMutation) ResetExpireAt()

ResetExpireAt resets all changes to the "expire_at" field.

func (*TokenMutation) ResetField

func (m *TokenMutation) 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 (*TokenMutation) ResetToken

func (m *TokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*TokenMutation) ResetTokenToUser

func (m *TokenMutation) ResetTokenToUser()

ResetTokenToUser resets all changes to the "TokenToUser" edge.

func (*TokenMutation) SetExpireAt

func (m *TokenMutation) SetExpireAt(i int64)

SetExpireAt sets the "expire_at" field.

func (*TokenMutation) SetField

func (m *TokenMutation) 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 (*TokenMutation) SetID

func (m *TokenMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Token entities.

func (*TokenMutation) SetToken

func (m *TokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*TokenMutation) SetTokenToUserID

func (m *TokenMutation) SetTokenToUserID(id uuid.UUID)

SetTokenToUserID sets the "TokenToUser" edge to the User entity by id.

func (*TokenMutation) Token

func (m *TokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (*TokenMutation) TokenToUserCleared

func (m *TokenMutation) TokenToUserCleared() bool

TokenToUserCleared reports if the "TokenToUser" edge to the User entity was cleared.

func (*TokenMutation) TokenToUserID

func (m *TokenMutation) TokenToUserID() (id uuid.UUID, exists bool)

TokenToUserID returns the "TokenToUser" edge ID in the mutation.

func (*TokenMutation) TokenToUserIDs

func (m *TokenMutation) TokenToUserIDs() (ids []uuid.UUID)

TokenToUserIDs returns the "TokenToUser" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TokenToUserID instead. It exists only for internal usage by the builders.

func (TokenMutation) Tx

func (m TokenMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TokenMutation) Type

func (m *TokenMutation) Type() string

Type returns the node type of this mutation (Token).

func (*TokenMutation) Where

func (m *TokenMutation) Where(ps ...predicate.Token)

Where appends a list predicates to the TokenMutation builder.

type TokenOrder

type TokenOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *TokenOrderField `json:"field"`
}

TokenOrder defines the ordering of Token.

type TokenOrderField

type TokenOrderField struct {
	// contains filtered or unexported fields
}

TokenOrderField defines the ordering field of Token.

type TokenPaginateOption

type TokenPaginateOption func(*tokenPager) error

TokenPaginateOption enables pagination customization.

func WithTokenFilter

func WithTokenFilter(filter func(*TokenQuery) (*TokenQuery, error)) TokenPaginateOption

WithTokenFilter configures pagination filter.

func WithTokenOrder

func WithTokenOrder(order *TokenOrder) TokenPaginateOption

WithTokenOrder configures pagination ordering.

type TokenQuery

type TokenQuery struct {
	// contains filtered or unexported fields
}

TokenQuery is the builder for querying Token entities.

func (*TokenQuery) All

func (tq *TokenQuery) All(ctx context.Context) ([]*Token, error)

All executes the query and returns a list of Tokens.

func (*TokenQuery) AllX

func (tq *TokenQuery) AllX(ctx context.Context) []*Token

AllX is like All, but panics if an error occurs.

func (*TokenQuery) Clone

func (tq *TokenQuery) Clone() *TokenQuery

Clone returns a duplicate of the TokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TokenQuery) CollectFields

func (t *TokenQuery) CollectFields(ctx context.Context, satisfies ...string) *TokenQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TokenQuery) Count

func (tq *TokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TokenQuery) CountX

func (tq *TokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TokenQuery) Exist

func (tq *TokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TokenQuery) ExistX

func (tq *TokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TokenQuery) First

func (tq *TokenQuery) First(ctx context.Context) (*Token, error)

First returns the first Token entity from the query. Returns a *NotFoundError when no Token was found.

func (*TokenQuery) FirstID

func (tq *TokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Token ID from the query. Returns a *NotFoundError when no Token ID was found.

func (*TokenQuery) FirstIDX

func (tq *TokenQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TokenQuery) FirstX

func (tq *TokenQuery) FirstX(ctx context.Context) *Token

FirstX is like First, but panics if an error occurs.

func (*TokenQuery) GroupBy

func (tq *TokenQuery) GroupBy(field string, fields ...string) *TokenGroupBy

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 {
	Token string `json:"token,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Token.Query().
	GroupBy(token.FieldToken).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenQuery) IDs

func (tq *TokenQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of Token IDs.

func (*TokenQuery) IDsX

func (tq *TokenQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TokenQuery) Limit

func (tq *TokenQuery) Limit(limit int) *TokenQuery

Limit adds a limit step to the query.

func (*TokenQuery) Offset

func (tq *TokenQuery) Offset(offset int) *TokenQuery

Offset adds an offset step to the query.

func (*TokenQuery) Only

func (tq *TokenQuery) Only(ctx context.Context) (*Token, error)

Only returns a single Token entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Token entity is found. Returns a *NotFoundError when no Token entities are found.

func (*TokenQuery) OnlyID

func (tq *TokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Token ID in the query. Returns a *NotSingularError when more than one Token ID is found. Returns a *NotFoundError when no entities are found.

func (*TokenQuery) OnlyIDX

func (tq *TokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TokenQuery) OnlyX

func (tq *TokenQuery) OnlyX(ctx context.Context) *Token

OnlyX is like Only, but panics if an error occurs.

func (*TokenQuery) Order

func (tq *TokenQuery) Order(o ...OrderFunc) *TokenQuery

Order adds an order step to the query.

func (*TokenQuery) Paginate

func (t *TokenQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TokenPaginateOption,
) (*TokenConnection, error)

Paginate executes the query and returns a relay based cursor connection to Token.

func (*TokenQuery) QueryTokenToUser

func (tq *TokenQuery) QueryTokenToUser() *UserQuery

QueryTokenToUser chains the current query on the "TokenToUser" edge.

func (*TokenQuery) Select

func (tq *TokenQuery) Select(fields ...string) *TokenSelect

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 {
	Token string `json:"token,omitempty"`
}

client.Token.Query().
	Select(token.FieldToken).
	Scan(ctx, &v)

func (*TokenQuery) Unique

func (tq *TokenQuery) Unique(unique bool) *TokenQuery

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 (*TokenQuery) Where

func (tq *TokenQuery) Where(ps ...predicate.Token) *TokenQuery

Where adds a new predicate for the TokenQuery builder.

func (*TokenQuery) WithTokenToUser

func (tq *TokenQuery) WithTokenToUser(opts ...func(*UserQuery)) *TokenQuery

WithTokenToUser tells the query-builder to eager-load the nodes that are connected to the "TokenToUser" edge. The optional arguments are used to configure the query builder of the edge.

type TokenSelect

type TokenSelect struct {
	*TokenQuery
	// contains filtered or unexported fields
}

TokenSelect is the builder for selecting fields of Token entities.

func (*TokenSelect) Bool

func (ts *TokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolX

func (ts *TokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenSelect) Bools

func (ts *TokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolsX

func (ts *TokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenSelect) Float64

func (ts *TokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64X

func (ts *TokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenSelect) Float64s

func (ts *TokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64sX

func (ts *TokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenSelect) Int

func (ts *TokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntX

func (ts *TokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenSelect) Ints

func (ts *TokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntsX

func (ts *TokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenSelect) Scan

func (ts *TokenSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TokenSelect) ScanX

func (ts *TokenSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TokenSelect) String

func (ts *TokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringX

func (ts *TokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenSelect) Strings

func (ts *TokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringsX

func (ts *TokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenUpdate

type TokenUpdate struct {
	// contains filtered or unexported fields
}

TokenUpdate is the builder for updating Token entities.

func (*TokenUpdate) AddExpireAt

func (tu *TokenUpdate) AddExpireAt(i int64) *TokenUpdate

AddExpireAt adds i to the "expire_at" field.

func (*TokenUpdate) ClearTokenToUser

func (tu *TokenUpdate) ClearTokenToUser() *TokenUpdate

ClearTokenToUser clears the "TokenToUser" edge to the User entity.

func (*TokenUpdate) Exec

func (tu *TokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpdate) ExecX

func (tu *TokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdate) Mutation

func (tu *TokenUpdate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdate) Save

func (tu *TokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TokenUpdate) SaveX

func (tu *TokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdate) SetExpireAt

func (tu *TokenUpdate) SetExpireAt(i int64) *TokenUpdate

SetExpireAt sets the "expire_at" field.

func (*TokenUpdate) SetToken

func (tu *TokenUpdate) SetToken(s string) *TokenUpdate

SetToken sets the "token" field.

func (*TokenUpdate) SetTokenToUser

func (tu *TokenUpdate) SetTokenToUser(u *User) *TokenUpdate

SetTokenToUser sets the "TokenToUser" edge to the User entity.

func (*TokenUpdate) SetTokenToUserID

func (tu *TokenUpdate) SetTokenToUserID(id uuid.UUID) *TokenUpdate

SetTokenToUserID sets the "TokenToUser" edge to the User entity by ID.

func (*TokenUpdate) Where

func (tu *TokenUpdate) Where(ps ...predicate.Token) *TokenUpdate

Where appends a list predicates to the TokenUpdate builder.

type TokenUpdateOne

type TokenUpdateOne struct {
	// contains filtered or unexported fields
}

TokenUpdateOne is the builder for updating a single Token entity.

func (*TokenUpdateOne) AddExpireAt

func (tuo *TokenUpdateOne) AddExpireAt(i int64) *TokenUpdateOne

AddExpireAt adds i to the "expire_at" field.

func (*TokenUpdateOne) ClearTokenToUser

func (tuo *TokenUpdateOne) ClearTokenToUser() *TokenUpdateOne

ClearTokenToUser clears the "TokenToUser" edge to the User entity.

func (*TokenUpdateOne) Exec

func (tuo *TokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TokenUpdateOne) ExecX

func (tuo *TokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdateOne) Mutation

func (tuo *TokenUpdateOne) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdateOne) Save

func (tuo *TokenUpdateOne) Save(ctx context.Context) (*Token, error)

Save executes the query and returns the updated Token entity.

func (*TokenUpdateOne) SaveX

func (tuo *TokenUpdateOne) SaveX(ctx context.Context) *Token

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdateOne) Select

func (tuo *TokenUpdateOne) Select(field string, fields ...string) *TokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TokenUpdateOne) SetExpireAt

func (tuo *TokenUpdateOne) SetExpireAt(i int64) *TokenUpdateOne

SetExpireAt sets the "expire_at" field.

func (*TokenUpdateOne) SetToken

func (tuo *TokenUpdateOne) SetToken(s string) *TokenUpdateOne

SetToken sets the "token" field.

func (*TokenUpdateOne) SetTokenToUser

func (tuo *TokenUpdateOne) SetTokenToUser(u *User) *TokenUpdateOne

SetTokenToUser sets the "TokenToUser" edge to the User entity.

func (*TokenUpdateOne) SetTokenToUserID

func (tuo *TokenUpdateOne) SetTokenToUserID(id uuid.UUID) *TokenUpdateOne

SetTokenToUserID sets the "TokenToUser" edge to the User entity by ID.

type Tokens

type Tokens []*Token

Tokens is a parsable slice of Token.

type Tx

type Tx struct {

	// Action is the client for interacting with the Action builders.
	Action *ActionClient
	// Competition is the client for interacting with the Competition builders.
	Competition *CompetitionClient
	// Provider is the client for interacting with the Provider builders.
	Provider *ProviderClient
	// ServiceAccount is the client for interacting with the ServiceAccount builders.
	ServiceAccount *ServiceAccountClient
	// ServiceToken is the client for interacting with the ServiceToken builders.
	ServiceToken *ServiceTokenClient
	// Team is the client for interacting with the Team builders.
	Team *TeamClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// VmObject is the client for interacting with the VmObject builders.
	VmObject *VmObjectClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Username holds the value of the "username" field.
	// [REQUIRED] The username for the user.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	// [REQUIRED] The hashed password for the user.
	Password string `json:"-"`
	// FirstName holds the value of the "first_name" field.
	// [OPTIONAL] The display first name for the user.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	// [OPTIONAL] The display last name for the user
	LastName string `json:"last_name,omitempty"`
	// Role holds the value of the "role" field.
	// [REQUIRED] The role of the user. Admins have full access.
	Role user.Role `json:"role,omitempty"`
	// Provider holds the value of the "provider" field.
	// [REQUIRED] The type of login the user will be using.
	Provider user.Provider `json:"provider,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) Node

func (u *User) Node(ctx context.Context) (node *Node, err error)

func (*User) QueryUserToActions

func (u *User) QueryUserToActions() *ActionQuery

QueryUserToActions queries the "UserToActions" edge of the User entity.

func (*User) QueryUserToTeam

func (u *User) QueryUserToTeam() *TeamQuery

QueryUserToTeam queries the "UserToTeam" edge of the User entity.

func (*User) QueryUserToToken

func (u *User) QueryUserToToken() *TokenQuery

QueryUserToToken queries the "UserToToken" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) ToEdge

func (u *User) ToEdge(order *UserOrder) *UserEdge

ToEdge converts User into UserEdge.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) UserToActions

func (u *User) UserToActions(ctx context.Context) ([]*Action, error)

func (*User) UserToTeam

func (u *User) UserToTeam(ctx context.Context) (*Team, error)

func (*User) UserToToken

func (u *User) UserToToken(ctx context.Context) ([]*Token, error)

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryUserToActions

func (c *UserClient) QueryUserToActions(u *User) *ActionQuery

QueryUserToActions queries the UserToActions edge of a User.

func (*UserClient) QueryUserToTeam

func (c *UserClient) QueryUserToTeam(u *User) *TeamQuery

QueryUserToTeam queries the UserToTeam edge of a User.

func (*UserClient) QueryUserToToken

func (c *UserClient) QueryUserToToken(u *User) *TokenQuery

QueryUserToToken queries the UserToToken edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserConnection

type UserConnection struct {
	Edges      []*UserEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

UserConnection is the connection containing edges to User.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddUserToActionIDs

func (uc *UserCreate) AddUserToActionIDs(ids ...uuid.UUID) *UserCreate

AddUserToActionIDs adds the "UserToActions" edge to the Action entity by IDs.

func (*UserCreate) AddUserToActions

func (uc *UserCreate) AddUserToActions(a ...*Action) *UserCreate

AddUserToActions adds the "UserToActions" edges to the Action entity.

func (*UserCreate) AddUserToToken

func (uc *UserCreate) AddUserToToken(t ...*Token) *UserCreate

AddUserToToken adds the "UserToToken" edges to the Token entity.

func (*UserCreate) AddUserToTokenIDs

func (uc *UserCreate) AddUserToTokenIDs(ids ...uuid.UUID) *UserCreate

AddUserToTokenIDs adds the "UserToToken" edge to the Token entity by IDs.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "first_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillableFirstName

func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableLastName

func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserCreate) SetNillableUserToTeamID

func (uc *UserCreate) SetNillableUserToTeamID(id *uuid.UUID) *UserCreate

SetNillableUserToTeamID sets the "UserToTeam" edge to the Team entity by ID if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetProvider

func (uc *UserCreate) SetProvider(u user.Provider) *UserCreate

SetProvider sets the "provider" field.

func (*UserCreate) SetRole

func (uc *UserCreate) SetRole(u user.Role) *UserCreate

SetRole sets the "role" field.

func (*UserCreate) SetUserToTeam

func (uc *UserCreate) SetUserToTeam(t *Team) *UserCreate

SetUserToTeam sets the "UserToTeam" edge to the Team entity.

func (*UserCreate) SetUserToTeamID

func (uc *UserCreate) SetUserToTeamID(id uuid.UUID) *UserCreate

SetUserToTeamID sets the "UserToTeam" edge to the Team entity by ID.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type UserEdge

type UserEdge struct {
	Node   *User  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

UserEdge is the edge representation of User.

type UserEdges

type UserEdges struct {
	// UserToTeam holds the value of the UserToTeam edge.
	UserToTeam *Team `json:"UserToTeam,omitempty"`
	// UserToToken holds the value of the UserToToken edge.
	UserToToken []*Token `json:"UserToToken,omitempty"`
	// UserToActions holds the value of the UserToActions edge.
	UserToActions []*Action `json:"UserToActions,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) UserToActionsOrErr

func (e UserEdges) UserToActionsOrErr() ([]*Action, error)

UserToActionsOrErr returns the UserToActions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) UserToTeamOrErr

func (e UserEdges) UserToTeamOrErr() (*Team, error)

UserToTeamOrErr returns the UserToTeam value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) UserToTokenOrErr

func (e UserEdges) UserToTokenOrErr() ([]*Token, error)

UserToTokenOrErr returns the UserToToken value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddUserToActionIDs

func (m *UserMutation) AddUserToActionIDs(ids ...uuid.UUID)

AddUserToActionIDs adds the "UserToActions" edge to the Action entity by ids.

func (*UserMutation) AddUserToTokenIDs

func (m *UserMutation) AddUserToTokenIDs(ids ...uuid.UUID)

AddUserToTokenIDs adds the "UserToToken" edge to the Token entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearUserToActions

func (m *UserMutation) ClearUserToActions()

ClearUserToActions clears the "UserToActions" edge to the Action entity.

func (*UserMutation) ClearUserToTeam

func (m *UserMutation) ClearUserToTeam()

ClearUserToTeam clears the "UserToTeam" edge to the Team entity.

func (*UserMutation) ClearUserToToken

func (m *UserMutation) ClearUserToToken()

ClearUserToToken clears the "UserToToken" edge to the Token entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldProvider

func (m *UserMutation) OldProvider(ctx context.Context) (v user.Provider, err error)

OldProvider returns the old "provider" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v user.Role, err error)

OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) Provider

func (m *UserMutation) Provider() (r user.Provider, exists bool)

Provider returns the value of the "provider" field in the mutation.

func (*UserMutation) RemoveUserToActionIDs

func (m *UserMutation) RemoveUserToActionIDs(ids ...uuid.UUID)

RemoveUserToActionIDs removes the "UserToActions" edge to the Action entity by IDs.

func (*UserMutation) RemoveUserToTokenIDs

func (m *UserMutation) RemoveUserToTokenIDs(ids ...uuid.UUID)

RemoveUserToTokenIDs removes the "UserToToken" edge to the Token entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedUserToActionsIDs

func (m *UserMutation) RemovedUserToActionsIDs() (ids []uuid.UUID)

RemovedUserToActions returns the removed IDs of the "UserToActions" edge to the Action entity.

func (*UserMutation) RemovedUserToTokenIDs

func (m *UserMutation) RemovedUserToTokenIDs() (ids []uuid.UUID)

RemovedUserToToken returns the removed IDs of the "UserToToken" edge to the Token entity.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetProvider

func (m *UserMutation) ResetProvider()

ResetProvider resets all changes to the "provider" field.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetUserToActions

func (m *UserMutation) ResetUserToActions()

ResetUserToActions resets all changes to the "UserToActions" edge.

func (*UserMutation) ResetUserToTeam

func (m *UserMutation) ResetUserToTeam()

ResetUserToTeam resets all changes to the "UserToTeam" edge.

func (*UserMutation) ResetUserToToken

func (m *UserMutation) ResetUserToToken()

ResetUserToToken resets all changes to the "UserToToken" edge.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) Role

func (m *UserMutation) Role() (r user.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetProvider

func (m *UserMutation) SetProvider(u user.Provider)

SetProvider sets the "provider" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(u user.Role)

SetRole sets the "role" field.

func (*UserMutation) SetUserToTeamID

func (m *UserMutation) SetUserToTeamID(id uuid.UUID)

SetUserToTeamID sets the "UserToTeam" edge to the Team entity by id.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UserToActionsCleared

func (m *UserMutation) UserToActionsCleared() bool

UserToActionsCleared reports if the "UserToActions" edge to the Action entity was cleared.

func (*UserMutation) UserToActionsIDs

func (m *UserMutation) UserToActionsIDs() (ids []uuid.UUID)

UserToActionsIDs returns the "UserToActions" edge IDs in the mutation.

func (*UserMutation) UserToTeamCleared

func (m *UserMutation) UserToTeamCleared() bool

UserToTeamCleared reports if the "UserToTeam" edge to the Team entity was cleared.

func (*UserMutation) UserToTeamID

func (m *UserMutation) UserToTeamID() (id uuid.UUID, exists bool)

UserToTeamID returns the "UserToTeam" edge ID in the mutation.

func (*UserMutation) UserToTeamIDs

func (m *UserMutation) UserToTeamIDs() (ids []uuid.UUID)

UserToTeamIDs returns the "UserToTeam" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserToTeamID instead. It exists only for internal usage by the builders.

func (*UserMutation) UserToTokenCleared

func (m *UserMutation) UserToTokenCleared() bool

UserToTokenCleared reports if the "UserToToken" edge to the Token entity was cleared.

func (*UserMutation) UserToTokenIDs

func (m *UserMutation) UserToTokenIDs() (ids []uuid.UUID)

UserToTokenIDs returns the "UserToToken" edge IDs in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserOrder

type UserOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *UserOrderField `json:"field"`
}

UserOrder defines the ordering of User.

type UserOrderField

type UserOrderField struct {
	// contains filtered or unexported fields
}

UserOrderField defines the ordering field of User.

type UserPaginateOption

type UserPaginateOption func(*userPager) error

UserPaginateOption enables pagination customization.

func WithUserFilter

func WithUserFilter(filter func(*UserQuery) (*UserQuery, error)) UserPaginateOption

WithUserFilter configures pagination filter.

func WithUserOrder

func WithUserOrder(order *UserOrder) UserPaginateOption

WithUserOrder configures pagination ordering.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) CollectFields

func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) *UserQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) Paginate

func (u *UserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...UserPaginateOption,
) (*UserConnection, error)

Paginate executes the query and returns a relay based cursor connection to User.

func (*UserQuery) QueryUserToActions

func (uq *UserQuery) QueryUserToActions() *ActionQuery

QueryUserToActions chains the current query on the "UserToActions" edge.

func (*UserQuery) QueryUserToTeam

func (uq *UserQuery) QueryUserToTeam() *TeamQuery

QueryUserToTeam chains the current query on the "UserToTeam" edge.

func (*UserQuery) QueryUserToToken

func (uq *UserQuery) QueryUserToToken() *TokenQuery

QueryUserToToken chains the current query on the "UserToToken" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithUserToActions

func (uq *UserQuery) WithUserToActions(opts ...func(*ActionQuery)) *UserQuery

WithUserToActions tells the query-builder to eager-load the nodes that are connected to the "UserToActions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithUserToTeam

func (uq *UserQuery) WithUserToTeam(opts ...func(*TeamQuery)) *UserQuery

WithUserToTeam tells the query-builder to eager-load the nodes that are connected to the "UserToTeam" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithUserToToken

func (uq *UserQuery) WithUserToToken(opts ...func(*TokenQuery)) *UserQuery

WithUserToToken tells the query-builder to eager-load the nodes that are connected to the "UserToToken" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddUserToActionIDs

func (uu *UserUpdate) AddUserToActionIDs(ids ...uuid.UUID) *UserUpdate

AddUserToActionIDs adds the "UserToActions" edge to the Action entity by IDs.

func (*UserUpdate) AddUserToActions

func (uu *UserUpdate) AddUserToActions(a ...*Action) *UserUpdate

AddUserToActions adds the "UserToActions" edges to the Action entity.

func (*UserUpdate) AddUserToToken

func (uu *UserUpdate) AddUserToToken(t ...*Token) *UserUpdate

AddUserToToken adds the "UserToToken" edges to the Token entity.

func (*UserUpdate) AddUserToTokenIDs

func (uu *UserUpdate) AddUserToTokenIDs(ids ...uuid.UUID) *UserUpdate

AddUserToTokenIDs adds the "UserToToken" edge to the Token entity by IDs.

func (*UserUpdate) ClearUserToActions

func (uu *UserUpdate) ClearUserToActions() *UserUpdate

ClearUserToActions clears all "UserToActions" edges to the Action entity.

func (*UserUpdate) ClearUserToTeam

func (uu *UserUpdate) ClearUserToTeam() *UserUpdate

ClearUserToTeam clears the "UserToTeam" edge to the Team entity.

func (*UserUpdate) ClearUserToToken

func (uu *UserUpdate) ClearUserToToken() *UserUpdate

ClearUserToToken clears all "UserToToken" edges to the Token entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveUserToActionIDs

func (uu *UserUpdate) RemoveUserToActionIDs(ids ...uuid.UUID) *UserUpdate

RemoveUserToActionIDs removes the "UserToActions" edge to Action entities by IDs.

func (*UserUpdate) RemoveUserToActions

func (uu *UserUpdate) RemoveUserToActions(a ...*Action) *UserUpdate

RemoveUserToActions removes "UserToActions" edges to Action entities.

func (*UserUpdate) RemoveUserToToken

func (uu *UserUpdate) RemoveUserToToken(t ...*Token) *UserUpdate

RemoveUserToToken removes "UserToToken" edges to Token entities.

func (*UserUpdate) RemoveUserToTokenIDs

func (uu *UserUpdate) RemoveUserToTokenIDs(ids ...uuid.UUID) *UserUpdate

RemoveUserToTokenIDs removes the "UserToToken" edge to Token entities by IDs.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillableFirstName

func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdate) SetNillableLastName

func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdate) SetNillableUserToTeamID

func (uu *UserUpdate) SetNillableUserToTeamID(id *uuid.UUID) *UserUpdate

SetNillableUserToTeamID sets the "UserToTeam" edge to the Team entity by ID if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetProvider

func (uu *UserUpdate) SetProvider(u user.Provider) *UserUpdate

SetProvider sets the "provider" field.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(u user.Role) *UserUpdate

SetRole sets the "role" field.

func (*UserUpdate) SetUserToTeam

func (uu *UserUpdate) SetUserToTeam(t *Team) *UserUpdate

SetUserToTeam sets the "UserToTeam" edge to the Team entity.

func (*UserUpdate) SetUserToTeamID

func (uu *UserUpdate) SetUserToTeamID(id uuid.UUID) *UserUpdate

SetUserToTeamID sets the "UserToTeam" edge to the Team entity by ID.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddUserToActionIDs

func (uuo *UserUpdateOne) AddUserToActionIDs(ids ...uuid.UUID) *UserUpdateOne

AddUserToActionIDs adds the "UserToActions" edge to the Action entity by IDs.

func (*UserUpdateOne) AddUserToActions

func (uuo *UserUpdateOne) AddUserToActions(a ...*Action) *UserUpdateOne

AddUserToActions adds the "UserToActions" edges to the Action entity.

func (*UserUpdateOne) AddUserToToken

func (uuo *UserUpdateOne) AddUserToToken(t ...*Token) *UserUpdateOne

AddUserToToken adds the "UserToToken" edges to the Token entity.

func (*UserUpdateOne) AddUserToTokenIDs

func (uuo *UserUpdateOne) AddUserToTokenIDs(ids ...uuid.UUID) *UserUpdateOne

AddUserToTokenIDs adds the "UserToToken" edge to the Token entity by IDs.

func (*UserUpdateOne) ClearUserToActions

func (uuo *UserUpdateOne) ClearUserToActions() *UserUpdateOne

ClearUserToActions clears all "UserToActions" edges to the Action entity.

func (*UserUpdateOne) ClearUserToTeam

func (uuo *UserUpdateOne) ClearUserToTeam() *UserUpdateOne

ClearUserToTeam clears the "UserToTeam" edge to the Team entity.

func (*UserUpdateOne) ClearUserToToken

func (uuo *UserUpdateOne) ClearUserToToken() *UserUpdateOne

ClearUserToToken clears all "UserToToken" edges to the Token entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveUserToActionIDs

func (uuo *UserUpdateOne) RemoveUserToActionIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveUserToActionIDs removes the "UserToActions" edge to Action entities by IDs.

func (*UserUpdateOne) RemoveUserToActions

func (uuo *UserUpdateOne) RemoveUserToActions(a ...*Action) *UserUpdateOne

RemoveUserToActions removes "UserToActions" edges to Action entities.

func (*UserUpdateOne) RemoveUserToToken

func (uuo *UserUpdateOne) RemoveUserToToken(t ...*Token) *UserUpdateOne

RemoveUserToToken removes "UserToToken" edges to Token entities.

func (*UserUpdateOne) RemoveUserToTokenIDs

func (uuo *UserUpdateOne) RemoveUserToTokenIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveUserToTokenIDs removes the "UserToToken" edge to Token entities by IDs.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillableFirstName

func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastName

func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUserToTeamID

func (uuo *UserUpdateOne) SetNillableUserToTeamID(id *uuid.UUID) *UserUpdateOne

SetNillableUserToTeamID sets the "UserToTeam" edge to the Team entity by ID if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetProvider

func (uuo *UserUpdateOne) SetProvider(u user.Provider) *UserUpdateOne

SetProvider sets the "provider" field.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(u user.Role) *UserUpdateOne

SetRole sets the "role" field.

func (*UserUpdateOne) SetUserToTeam

func (uuo *UserUpdateOne) SetUserToTeam(t *Team) *UserUpdateOne

SetUserToTeam sets the "UserToTeam" edge to the Team entity.

func (*UserUpdateOne) SetUserToTeamID

func (uuo *UserUpdateOne) SetUserToTeamID(id uuid.UUID) *UserUpdateOne

SetUserToTeamID sets the "UserToTeam" edge to the Team entity by ID.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

type VmObject

type VmObject struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	// [REQUIRED] A user-friendly name for the VM. This will be provider-specific.
	Name string `json:"name,omitempty"`
	// Identifier holds the value of the "identifier" field.
	// [REQUIRED] The identifier of the VM. This will be provider-specific.
	Identifier string `json:"identifier,omitempty"`
	// IPAddresses holds the value of the "ip_addresses" field.
	// [OPTIONAL] IP addresses of the VM. This will be displayed to the user.
	IPAddresses []string `json:"ip_addresses,omitempty"`
	// Locked holds the value of the "locked" field.
	// [REQUIRED] (default is false) If a vm is locked, standard users will not be able to access this VM.
	Locked bool `json:"locked,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VmObjectQuery when eager-loading is set.
	Edges VmObjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

VmObject is the model entity for the VmObject schema.

func (*VmObject) Node

func (vo *VmObject) Node(ctx context.Context) (node *Node, err error)

func (*VmObject) QueryVmObjectToTeam

func (vo *VmObject) QueryVmObjectToTeam() *TeamQuery

QueryVmObjectToTeam queries the "VmObjectToTeam" edge of the VmObject entity.

func (*VmObject) String

func (vo *VmObject) String() string

String implements the fmt.Stringer.

func (*VmObject) ToEdge

func (vo *VmObject) ToEdge(order *VmObjectOrder) *VmObjectEdge

ToEdge converts VmObject into VmObjectEdge.

func (*VmObject) Unwrap

func (vo *VmObject) Unwrap() *VmObject

Unwrap unwraps the VmObject 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 (*VmObject) Update

func (vo *VmObject) Update() *VmObjectUpdateOne

Update returns a builder for updating this VmObject. Note that you need to call VmObject.Unwrap() before calling this method if this VmObject was returned from a transaction, and the transaction was committed or rolled back.

func (*VmObject) VmObjectToTeam

func (vo *VmObject) VmObjectToTeam(ctx context.Context) (*Team, error)

type VmObjectClient

type VmObjectClient struct {
	// contains filtered or unexported fields
}

VmObjectClient is a client for the VmObject schema.

func NewVmObjectClient

func NewVmObjectClient(c config) *VmObjectClient

NewVmObjectClient returns a client for the VmObject from the given config.

func (*VmObjectClient) Create

func (c *VmObjectClient) Create() *VmObjectCreate

Create returns a create builder for VmObject.

func (*VmObjectClient) CreateBulk

func (c *VmObjectClient) CreateBulk(builders ...*VmObjectCreate) *VmObjectCreateBulk

CreateBulk returns a builder for creating a bulk of VmObject entities.

func (*VmObjectClient) Delete

func (c *VmObjectClient) Delete() *VmObjectDelete

Delete returns a delete builder for VmObject.

func (*VmObjectClient) DeleteOne

func (c *VmObjectClient) DeleteOne(vo *VmObject) *VmObjectDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*VmObjectClient) DeleteOneID

func (c *VmObjectClient) DeleteOneID(id uuid.UUID) *VmObjectDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*VmObjectClient) Get

func (c *VmObjectClient) Get(ctx context.Context, id uuid.UUID) (*VmObject, error)

Get returns a VmObject entity by its id.

func (*VmObjectClient) GetX

func (c *VmObjectClient) GetX(ctx context.Context, id uuid.UUID) *VmObject

GetX is like Get, but panics if an error occurs.

func (*VmObjectClient) Hooks

func (c *VmObjectClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VmObjectClient) Query

func (c *VmObjectClient) Query() *VmObjectQuery

Query returns a query builder for VmObject.

func (*VmObjectClient) QueryVmObjectToTeam

func (c *VmObjectClient) QueryVmObjectToTeam(vo *VmObject) *TeamQuery

QueryVmObjectToTeam queries the VmObjectToTeam edge of a VmObject.

func (*VmObjectClient) Update

func (c *VmObjectClient) Update() *VmObjectUpdate

Update returns an update builder for VmObject.

func (*VmObjectClient) UpdateOne

func (c *VmObjectClient) UpdateOne(vo *VmObject) *VmObjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VmObjectClient) UpdateOneID

func (c *VmObjectClient) UpdateOneID(id uuid.UUID) *VmObjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VmObjectClient) Use

func (c *VmObjectClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `vmobject.Hooks(f(g(h())))`.

type VmObjectConnection

type VmObjectConnection struct {
	Edges      []*VmObjectEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

VmObjectConnection is the connection containing edges to VmObject.

type VmObjectCreate

type VmObjectCreate struct {
	// contains filtered or unexported fields
}

VmObjectCreate is the builder for creating a VmObject entity.

func (*VmObjectCreate) Exec

func (voc *VmObjectCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VmObjectCreate) ExecX

func (voc *VmObjectCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VmObjectCreate) Mutation

func (voc *VmObjectCreate) Mutation() *VmObjectMutation

Mutation returns the VmObjectMutation object of the builder.

func (*VmObjectCreate) Save

func (voc *VmObjectCreate) Save(ctx context.Context) (*VmObject, error)

Save creates the VmObject in the database.

func (*VmObjectCreate) SaveX

func (voc *VmObjectCreate) SaveX(ctx context.Context) *VmObject

SaveX calls Save and panics if Save returns an error.

func (*VmObjectCreate) SetID

func (voc *VmObjectCreate) SetID(u uuid.UUID) *VmObjectCreate

SetID sets the "id" field.

func (*VmObjectCreate) SetIPAddresses

func (voc *VmObjectCreate) SetIPAddresses(s []string) *VmObjectCreate

SetIPAddresses sets the "ip_addresses" field.

func (*VmObjectCreate) SetIdentifier

func (voc *VmObjectCreate) SetIdentifier(s string) *VmObjectCreate

SetIdentifier sets the "identifier" field.

func (*VmObjectCreate) SetLocked

func (voc *VmObjectCreate) SetLocked(b bool) *VmObjectCreate

SetLocked sets the "locked" field.

func (*VmObjectCreate) SetName

func (voc *VmObjectCreate) SetName(s string) *VmObjectCreate

SetName sets the "name" field.

func (*VmObjectCreate) SetNillableID

func (voc *VmObjectCreate) SetNillableID(u *uuid.UUID) *VmObjectCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*VmObjectCreate) SetNillableLocked

func (voc *VmObjectCreate) SetNillableLocked(b *bool) *VmObjectCreate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*VmObjectCreate) SetNillableVmObjectToTeamID

func (voc *VmObjectCreate) SetNillableVmObjectToTeamID(id *uuid.UUID) *VmObjectCreate

SetNillableVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by ID if the given value is not nil.

func (*VmObjectCreate) SetVmObjectToTeam

func (voc *VmObjectCreate) SetVmObjectToTeam(t *Team) *VmObjectCreate

SetVmObjectToTeam sets the "VmObjectToTeam" edge to the Team entity.

func (*VmObjectCreate) SetVmObjectToTeamID

func (voc *VmObjectCreate) SetVmObjectToTeamID(id uuid.UUID) *VmObjectCreate

SetVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by ID.

type VmObjectCreateBulk

type VmObjectCreateBulk struct {
	// contains filtered or unexported fields
}

VmObjectCreateBulk is the builder for creating many VmObject entities in bulk.

func (*VmObjectCreateBulk) Exec

func (vocb *VmObjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VmObjectCreateBulk) ExecX

func (vocb *VmObjectCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VmObjectCreateBulk) Save

func (vocb *VmObjectCreateBulk) Save(ctx context.Context) ([]*VmObject, error)

Save creates the VmObject entities in the database.

func (*VmObjectCreateBulk) SaveX

func (vocb *VmObjectCreateBulk) SaveX(ctx context.Context) []*VmObject

SaveX is like Save, but panics if an error occurs.

type VmObjectDelete

type VmObjectDelete struct {
	// contains filtered or unexported fields
}

VmObjectDelete is the builder for deleting a VmObject entity.

func (*VmObjectDelete) Exec

func (vod *VmObjectDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VmObjectDelete) ExecX

func (vod *VmObjectDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VmObjectDelete) Where

func (vod *VmObjectDelete) Where(ps ...predicate.VmObject) *VmObjectDelete

Where appends a list predicates to the VmObjectDelete builder.

type VmObjectDeleteOne

type VmObjectDeleteOne struct {
	// contains filtered or unexported fields
}

VmObjectDeleteOne is the builder for deleting a single VmObject entity.

func (*VmObjectDeleteOne) Exec

func (vodo *VmObjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VmObjectDeleteOne) ExecX

func (vodo *VmObjectDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type VmObjectEdge

type VmObjectEdge struct {
	Node   *VmObject `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

VmObjectEdge is the edge representation of VmObject.

type VmObjectEdges

type VmObjectEdges struct {
	// VmObjectToTeam holds the value of the VmObjectToTeam edge.
	VmObjectToTeam *Team `json:"VmObjectToTeam,omitempty"`
	// contains filtered or unexported fields
}

VmObjectEdges holds the relations/edges for other nodes in the graph.

func (VmObjectEdges) VmObjectToTeamOrErr

func (e VmObjectEdges) VmObjectToTeamOrErr() (*Team, error)

VmObjectToTeamOrErr returns the VmObjectToTeam value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type VmObjectGroupBy

type VmObjectGroupBy struct {
	// contains filtered or unexported fields
}

VmObjectGroupBy is the group-by builder for VmObject entities.

func (*VmObjectGroupBy) Aggregate

func (vogb *VmObjectGroupBy) Aggregate(fns ...AggregateFunc) *VmObjectGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VmObjectGroupBy) Bool

func (vogb *VmObjectGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) BoolX

func (vogb *VmObjectGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VmObjectGroupBy) Bools

func (vogb *VmObjectGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) BoolsX

func (vogb *VmObjectGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VmObjectGroupBy) Float64

func (vogb *VmObjectGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) Float64X

func (vogb *VmObjectGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VmObjectGroupBy) Float64s

func (vogb *VmObjectGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) Float64sX

func (vogb *VmObjectGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VmObjectGroupBy) Int

func (vogb *VmObjectGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) IntX

func (vogb *VmObjectGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VmObjectGroupBy) Ints

func (vogb *VmObjectGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) IntsX

func (vogb *VmObjectGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VmObjectGroupBy) Scan

func (vogb *VmObjectGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*VmObjectGroupBy) ScanX

func (vogb *VmObjectGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*VmObjectGroupBy) String

func (vogb *VmObjectGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) StringX

func (vogb *VmObjectGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VmObjectGroupBy) Strings

func (vogb *VmObjectGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*VmObjectGroupBy) StringsX

func (vogb *VmObjectGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VmObjectMutation

type VmObjectMutation struct {
	// contains filtered or unexported fields
}

VmObjectMutation represents an operation that mutates the VmObject nodes in the graph.

func (*VmObjectMutation) AddField

func (m *VmObjectMutation) 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 (*VmObjectMutation) AddedEdges

func (m *VmObjectMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VmObjectMutation) AddedField

func (m *VmObjectMutation) 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 (*VmObjectMutation) AddedFields

func (m *VmObjectMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VmObjectMutation) AddedIDs

func (m *VmObjectMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VmObjectMutation) ClearEdge

func (m *VmObjectMutation) 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 (*VmObjectMutation) ClearField

func (m *VmObjectMutation) 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 (*VmObjectMutation) ClearIPAddresses

func (m *VmObjectMutation) ClearIPAddresses()

ClearIPAddresses clears the value of the "ip_addresses" field.

func (*VmObjectMutation) ClearVmObjectToTeam

func (m *VmObjectMutation) ClearVmObjectToTeam()

ClearVmObjectToTeam clears the "VmObjectToTeam" edge to the Team entity.

func (*VmObjectMutation) ClearedEdges

func (m *VmObjectMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VmObjectMutation) ClearedFields

func (m *VmObjectMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VmObjectMutation) Client

func (m VmObjectMutation) 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 (*VmObjectMutation) EdgeCleared

func (m *VmObjectMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VmObjectMutation) Field

func (m *VmObjectMutation) 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 (*VmObjectMutation) FieldCleared

func (m *VmObjectMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VmObjectMutation) Fields

func (m *VmObjectMutation) 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 (*VmObjectMutation) ID

func (m *VmObjectMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*VmObjectMutation) IDs

func (m *VmObjectMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*VmObjectMutation) IPAddresses

func (m *VmObjectMutation) IPAddresses() (r []string, exists bool)

IPAddresses returns the value of the "ip_addresses" field in the mutation.

func (*VmObjectMutation) IPAddressesCleared

func (m *VmObjectMutation) IPAddressesCleared() bool

IPAddressesCleared returns if the "ip_addresses" field was cleared in this mutation.

func (*VmObjectMutation) Identifier

func (m *VmObjectMutation) Identifier() (r string, exists bool)

Identifier returns the value of the "identifier" field in the mutation.

func (*VmObjectMutation) Locked

func (m *VmObjectMutation) Locked() (r bool, exists bool)

Locked returns the value of the "locked" field in the mutation.

func (*VmObjectMutation) Name

func (m *VmObjectMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*VmObjectMutation) OldField

func (m *VmObjectMutation) 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 (*VmObjectMutation) OldIPAddresses

func (m *VmObjectMutation) OldIPAddresses(ctx context.Context) (v []string, err error)

OldIPAddresses returns the old "ip_addresses" field's value of the VmObject entity. If the VmObject 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 (*VmObjectMutation) OldIdentifier

func (m *VmObjectMutation) OldIdentifier(ctx context.Context) (v string, err error)

OldIdentifier returns the old "identifier" field's value of the VmObject entity. If the VmObject 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 (*VmObjectMutation) OldLocked

func (m *VmObjectMutation) OldLocked(ctx context.Context) (v bool, err error)

OldLocked returns the old "locked" field's value of the VmObject entity. If the VmObject 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 (*VmObjectMutation) OldName

func (m *VmObjectMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the VmObject entity. If the VmObject 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 (*VmObjectMutation) Op

func (m *VmObjectMutation) Op() Op

Op returns the operation name.

func (*VmObjectMutation) RemovedEdges

func (m *VmObjectMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VmObjectMutation) RemovedIDs

func (m *VmObjectMutation) 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 (*VmObjectMutation) ResetEdge

func (m *VmObjectMutation) 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 (*VmObjectMutation) ResetField

func (m *VmObjectMutation) 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 (*VmObjectMutation) ResetIPAddresses

func (m *VmObjectMutation) ResetIPAddresses()

ResetIPAddresses resets all changes to the "ip_addresses" field.

func (*VmObjectMutation) ResetIdentifier

func (m *VmObjectMutation) ResetIdentifier()

ResetIdentifier resets all changes to the "identifier" field.

func (*VmObjectMutation) ResetLocked

func (m *VmObjectMutation) ResetLocked()

ResetLocked resets all changes to the "locked" field.

func (*VmObjectMutation) ResetName

func (m *VmObjectMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*VmObjectMutation) ResetVmObjectToTeam

func (m *VmObjectMutation) ResetVmObjectToTeam()

ResetVmObjectToTeam resets all changes to the "VmObjectToTeam" edge.

func (*VmObjectMutation) SetField

func (m *VmObjectMutation) 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 (*VmObjectMutation) SetID

func (m *VmObjectMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of VmObject entities.

func (*VmObjectMutation) SetIPAddresses

func (m *VmObjectMutation) SetIPAddresses(s []string)

SetIPAddresses sets the "ip_addresses" field.

func (*VmObjectMutation) SetIdentifier

func (m *VmObjectMutation) SetIdentifier(s string)

SetIdentifier sets the "identifier" field.

func (*VmObjectMutation) SetLocked

func (m *VmObjectMutation) SetLocked(b bool)

SetLocked sets the "locked" field.

func (*VmObjectMutation) SetName

func (m *VmObjectMutation) SetName(s string)

SetName sets the "name" field.

func (*VmObjectMutation) SetVmObjectToTeamID

func (m *VmObjectMutation) SetVmObjectToTeamID(id uuid.UUID)

SetVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by id.

func (VmObjectMutation) Tx

func (m VmObjectMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VmObjectMutation) Type

func (m *VmObjectMutation) Type() string

Type returns the node type of this mutation (VmObject).

func (*VmObjectMutation) VmObjectToTeamCleared

func (m *VmObjectMutation) VmObjectToTeamCleared() bool

VmObjectToTeamCleared reports if the "VmObjectToTeam" edge to the Team entity was cleared.

func (*VmObjectMutation) VmObjectToTeamID

func (m *VmObjectMutation) VmObjectToTeamID() (id uuid.UUID, exists bool)

VmObjectToTeamID returns the "VmObjectToTeam" edge ID in the mutation.

func (*VmObjectMutation) VmObjectToTeamIDs

func (m *VmObjectMutation) VmObjectToTeamIDs() (ids []uuid.UUID)

VmObjectToTeamIDs returns the "VmObjectToTeam" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use VmObjectToTeamID instead. It exists only for internal usage by the builders.

func (*VmObjectMutation) Where

func (m *VmObjectMutation) Where(ps ...predicate.VmObject)

Where appends a list predicates to the VmObjectMutation builder.

type VmObjectOrder

type VmObjectOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *VmObjectOrderField `json:"field"`
}

VmObjectOrder defines the ordering of VmObject.

type VmObjectOrderField

type VmObjectOrderField struct {
	// contains filtered or unexported fields
}

VmObjectOrderField defines the ordering field of VmObject.

type VmObjectPaginateOption

type VmObjectPaginateOption func(*vmObjectPager) error

VmObjectPaginateOption enables pagination customization.

func WithVmObjectFilter

func WithVmObjectFilter(filter func(*VmObjectQuery) (*VmObjectQuery, error)) VmObjectPaginateOption

WithVmObjectFilter configures pagination filter.

func WithVmObjectOrder

func WithVmObjectOrder(order *VmObjectOrder) VmObjectPaginateOption

WithVmObjectOrder configures pagination ordering.

type VmObjectQuery

type VmObjectQuery struct {
	// contains filtered or unexported fields
}

VmObjectQuery is the builder for querying VmObject entities.

func (*VmObjectQuery) All

func (voq *VmObjectQuery) All(ctx context.Context) ([]*VmObject, error)

All executes the query and returns a list of VmObjects.

func (*VmObjectQuery) AllX

func (voq *VmObjectQuery) AllX(ctx context.Context) []*VmObject

AllX is like All, but panics if an error occurs.

func (*VmObjectQuery) Clone

func (voq *VmObjectQuery) Clone() *VmObjectQuery

Clone returns a duplicate of the VmObjectQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VmObjectQuery) CollectFields

func (vo *VmObjectQuery) CollectFields(ctx context.Context, satisfies ...string) *VmObjectQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*VmObjectQuery) Count

func (voq *VmObjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VmObjectQuery) CountX

func (voq *VmObjectQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VmObjectQuery) Exist

func (voq *VmObjectQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VmObjectQuery) ExistX

func (voq *VmObjectQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VmObjectQuery) First

func (voq *VmObjectQuery) First(ctx context.Context) (*VmObject, error)

First returns the first VmObject entity from the query. Returns a *NotFoundError when no VmObject was found.

func (*VmObjectQuery) FirstID

func (voq *VmObjectQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first VmObject ID from the query. Returns a *NotFoundError when no VmObject ID was found.

func (*VmObjectQuery) FirstIDX

func (voq *VmObjectQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*VmObjectQuery) FirstX

func (voq *VmObjectQuery) FirstX(ctx context.Context) *VmObject

FirstX is like First, but panics if an error occurs.

func (*VmObjectQuery) GroupBy

func (voq *VmObjectQuery) GroupBy(field string, fields ...string) *VmObjectGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.VmObject.Query().
	GroupBy(vmobject.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VmObjectQuery) IDs

func (voq *VmObjectQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs executes the query and returns a list of VmObject IDs.

func (*VmObjectQuery) IDsX

func (voq *VmObjectQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*VmObjectQuery) Limit

func (voq *VmObjectQuery) Limit(limit int) *VmObjectQuery

Limit adds a limit step to the query.

func (*VmObjectQuery) Offset

func (voq *VmObjectQuery) Offset(offset int) *VmObjectQuery

Offset adds an offset step to the query.

func (*VmObjectQuery) Only

func (voq *VmObjectQuery) Only(ctx context.Context) (*VmObject, error)

Only returns a single VmObject entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one VmObject entity is found. Returns a *NotFoundError when no VmObject entities are found.

func (*VmObjectQuery) OnlyID

func (voq *VmObjectQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only VmObject ID in the query. Returns a *NotSingularError when more than one VmObject ID is found. Returns a *NotFoundError when no entities are found.

func (*VmObjectQuery) OnlyIDX

func (voq *VmObjectQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VmObjectQuery) OnlyX

func (voq *VmObjectQuery) OnlyX(ctx context.Context) *VmObject

OnlyX is like Only, but panics if an error occurs.

func (*VmObjectQuery) Order

func (voq *VmObjectQuery) Order(o ...OrderFunc) *VmObjectQuery

Order adds an order step to the query.

func (*VmObjectQuery) Paginate

func (vo *VmObjectQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...VmObjectPaginateOption,
) (*VmObjectConnection, error)

Paginate executes the query and returns a relay based cursor connection to VmObject.

func (*VmObjectQuery) QueryVmObjectToTeam

func (voq *VmObjectQuery) QueryVmObjectToTeam() *TeamQuery

QueryVmObjectToTeam chains the current query on the "VmObjectToTeam" edge.

func (*VmObjectQuery) Select

func (voq *VmObjectQuery) Select(fields ...string) *VmObjectSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.VmObject.Query().
	Select(vmobject.FieldName).
	Scan(ctx, &v)

func (*VmObjectQuery) Unique

func (voq *VmObjectQuery) Unique(unique bool) *VmObjectQuery

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 (*VmObjectQuery) Where

func (voq *VmObjectQuery) Where(ps ...predicate.VmObject) *VmObjectQuery

Where adds a new predicate for the VmObjectQuery builder.

func (*VmObjectQuery) WithVmObjectToTeam

func (voq *VmObjectQuery) WithVmObjectToTeam(opts ...func(*TeamQuery)) *VmObjectQuery

WithVmObjectToTeam tells the query-builder to eager-load the nodes that are connected to the "VmObjectToTeam" edge. The optional arguments are used to configure the query builder of the edge.

type VmObjectSelect

type VmObjectSelect struct {
	*VmObjectQuery
	// contains filtered or unexported fields
}

VmObjectSelect is the builder for selecting fields of VmObject entities.

func (*VmObjectSelect) Bool

func (vos *VmObjectSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) BoolX

func (vos *VmObjectSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VmObjectSelect) Bools

func (vos *VmObjectSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) BoolsX

func (vos *VmObjectSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VmObjectSelect) Float64

func (vos *VmObjectSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) Float64X

func (vos *VmObjectSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VmObjectSelect) Float64s

func (vos *VmObjectSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) Float64sX

func (vos *VmObjectSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VmObjectSelect) Int

func (vos *VmObjectSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) IntX

func (vos *VmObjectSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VmObjectSelect) Ints

func (vos *VmObjectSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) IntsX

func (vos *VmObjectSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VmObjectSelect) Scan

func (vos *VmObjectSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*VmObjectSelect) ScanX

func (vos *VmObjectSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*VmObjectSelect) String

func (vos *VmObjectSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) StringX

func (vos *VmObjectSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VmObjectSelect) Strings

func (vos *VmObjectSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VmObjectSelect) StringsX

func (vos *VmObjectSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VmObjectUpdate

type VmObjectUpdate struct {
	// contains filtered or unexported fields
}

VmObjectUpdate is the builder for updating VmObject entities.

func (*VmObjectUpdate) ClearIPAddresses

func (vou *VmObjectUpdate) ClearIPAddresses() *VmObjectUpdate

ClearIPAddresses clears the value of the "ip_addresses" field.

func (*VmObjectUpdate) ClearVmObjectToTeam

func (vou *VmObjectUpdate) ClearVmObjectToTeam() *VmObjectUpdate

ClearVmObjectToTeam clears the "VmObjectToTeam" edge to the Team entity.

func (*VmObjectUpdate) Exec

func (vou *VmObjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VmObjectUpdate) ExecX

func (vou *VmObjectUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VmObjectUpdate) Mutation

func (vou *VmObjectUpdate) Mutation() *VmObjectMutation

Mutation returns the VmObjectMutation object of the builder.

func (*VmObjectUpdate) Save

func (vou *VmObjectUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VmObjectUpdate) SaveX

func (vou *VmObjectUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VmObjectUpdate) SetIPAddresses

func (vou *VmObjectUpdate) SetIPAddresses(s []string) *VmObjectUpdate

SetIPAddresses sets the "ip_addresses" field.

func (*VmObjectUpdate) SetIdentifier

func (vou *VmObjectUpdate) SetIdentifier(s string) *VmObjectUpdate

SetIdentifier sets the "identifier" field.

func (*VmObjectUpdate) SetLocked

func (vou *VmObjectUpdate) SetLocked(b bool) *VmObjectUpdate

SetLocked sets the "locked" field.

func (*VmObjectUpdate) SetName

func (vou *VmObjectUpdate) SetName(s string) *VmObjectUpdate

SetName sets the "name" field.

func (*VmObjectUpdate) SetNillableLocked

func (vou *VmObjectUpdate) SetNillableLocked(b *bool) *VmObjectUpdate

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*VmObjectUpdate) SetNillableVmObjectToTeamID

func (vou *VmObjectUpdate) SetNillableVmObjectToTeamID(id *uuid.UUID) *VmObjectUpdate

SetNillableVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by ID if the given value is not nil.

func (*VmObjectUpdate) SetVmObjectToTeam

func (vou *VmObjectUpdate) SetVmObjectToTeam(t *Team) *VmObjectUpdate

SetVmObjectToTeam sets the "VmObjectToTeam" edge to the Team entity.

func (*VmObjectUpdate) SetVmObjectToTeamID

func (vou *VmObjectUpdate) SetVmObjectToTeamID(id uuid.UUID) *VmObjectUpdate

SetVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by ID.

func (*VmObjectUpdate) Where

func (vou *VmObjectUpdate) Where(ps ...predicate.VmObject) *VmObjectUpdate

Where appends a list predicates to the VmObjectUpdate builder.

type VmObjectUpdateOne

type VmObjectUpdateOne struct {
	// contains filtered or unexported fields
}

VmObjectUpdateOne is the builder for updating a single VmObject entity.

func (*VmObjectUpdateOne) ClearIPAddresses

func (vouo *VmObjectUpdateOne) ClearIPAddresses() *VmObjectUpdateOne

ClearIPAddresses clears the value of the "ip_addresses" field.

func (*VmObjectUpdateOne) ClearVmObjectToTeam

func (vouo *VmObjectUpdateOne) ClearVmObjectToTeam() *VmObjectUpdateOne

ClearVmObjectToTeam clears the "VmObjectToTeam" edge to the Team entity.

func (*VmObjectUpdateOne) Exec

func (vouo *VmObjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VmObjectUpdateOne) ExecX

func (vouo *VmObjectUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VmObjectUpdateOne) Mutation

func (vouo *VmObjectUpdateOne) Mutation() *VmObjectMutation

Mutation returns the VmObjectMutation object of the builder.

func (*VmObjectUpdateOne) Save

func (vouo *VmObjectUpdateOne) Save(ctx context.Context) (*VmObject, error)

Save executes the query and returns the updated VmObject entity.

func (*VmObjectUpdateOne) SaveX

func (vouo *VmObjectUpdateOne) SaveX(ctx context.Context) *VmObject

SaveX is like Save, but panics if an error occurs.

func (*VmObjectUpdateOne) Select

func (vouo *VmObjectUpdateOne) Select(field string, fields ...string) *VmObjectUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VmObjectUpdateOne) SetIPAddresses

func (vouo *VmObjectUpdateOne) SetIPAddresses(s []string) *VmObjectUpdateOne

SetIPAddresses sets the "ip_addresses" field.

func (*VmObjectUpdateOne) SetIdentifier

func (vouo *VmObjectUpdateOne) SetIdentifier(s string) *VmObjectUpdateOne

SetIdentifier sets the "identifier" field.

func (*VmObjectUpdateOne) SetLocked

func (vouo *VmObjectUpdateOne) SetLocked(b bool) *VmObjectUpdateOne

SetLocked sets the "locked" field.

func (*VmObjectUpdateOne) SetName

func (vouo *VmObjectUpdateOne) SetName(s string) *VmObjectUpdateOne

SetName sets the "name" field.

func (*VmObjectUpdateOne) SetNillableLocked

func (vouo *VmObjectUpdateOne) SetNillableLocked(b *bool) *VmObjectUpdateOne

SetNillableLocked sets the "locked" field if the given value is not nil.

func (*VmObjectUpdateOne) SetNillableVmObjectToTeamID

func (vouo *VmObjectUpdateOne) SetNillableVmObjectToTeamID(id *uuid.UUID) *VmObjectUpdateOne

SetNillableVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by ID if the given value is not nil.

func (*VmObjectUpdateOne) SetVmObjectToTeam

func (vouo *VmObjectUpdateOne) SetVmObjectToTeam(t *Team) *VmObjectUpdateOne

SetVmObjectToTeam sets the "VmObjectToTeam" edge to the Team entity.

func (*VmObjectUpdateOne) SetVmObjectToTeamID

func (vouo *VmObjectUpdateOne) SetVmObjectToTeamID(id uuid.UUID) *VmObjectUpdateOne

SetVmObjectToTeamID sets the "VmObjectToTeam" edge to the Team entity by ID.

type VmObjects

type VmObjects []*VmObject

VmObjects is a parsable slice of VmObject.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL