ent

package
v0.0.0-...-63ea8a0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 18 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.
	TypeAuthorizationCode = "AuthorizationCode"
	TypeServiceProvider   = "ServiceProvider"
	TypeWhiteList         = "WhiteList"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type AuthorizationCode

type AuthorizationCode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuthorizationCodeQuery when eager-loading is set.
	Edges AuthorizationCodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuthorizationCode is the model entity for the AuthorizationCode schema.

func (*AuthorizationCode) QueryOwner

func (ac *AuthorizationCode) QueryOwner() *ServiceProviderQuery

QueryOwner queries the "owner" edge of the AuthorizationCode entity.

func (*AuthorizationCode) String

func (ac *AuthorizationCode) String() string

String implements the fmt.Stringer.

func (*AuthorizationCode) Unwrap

func (ac *AuthorizationCode) Unwrap() *AuthorizationCode

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

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

type AuthorizationCodeClient

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

AuthorizationCodeClient is a client for the AuthorizationCode schema.

func NewAuthorizationCodeClient

func NewAuthorizationCodeClient(c config) *AuthorizationCodeClient

NewAuthorizationCodeClient returns a client for the AuthorizationCode from the given config.

func (*AuthorizationCodeClient) Create

Create returns a builder for creating a AuthorizationCode entity.

func (*AuthorizationCodeClient) CreateBulk

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

func (*AuthorizationCodeClient) Delete

Delete returns a delete builder for AuthorizationCode.

func (*AuthorizationCodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuthorizationCodeClient) DeleteOneID

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

func (*AuthorizationCodeClient) Get

Get returns a AuthorizationCode entity by its id.

func (*AuthorizationCodeClient) GetX

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

func (*AuthorizationCodeClient) Hooks

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

Hooks returns the client hooks.

func (*AuthorizationCodeClient) Query

Query returns a query builder for AuthorizationCode.

func (*AuthorizationCodeClient) QueryOwner

QueryOwner queries the owner edge of a AuthorizationCode.

func (*AuthorizationCodeClient) Update

Update returns an update builder for AuthorizationCode.

func (*AuthorizationCodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuthorizationCodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*AuthorizationCodeClient) Use

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

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

type AuthorizationCodeCreate

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

AuthorizationCodeCreate is the builder for creating a AuthorizationCode entity.

func (*AuthorizationCodeCreate) Exec

Exec executes the query.

func (*AuthorizationCodeCreate) ExecX

func (acc *AuthorizationCodeCreate) ExecX(ctx context.Context)

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

func (*AuthorizationCodeCreate) Mutation

Mutation returns the AuthorizationCodeMutation object of the builder.

func (*AuthorizationCodeCreate) Save

Save creates the AuthorizationCode in the database.

func (*AuthorizationCodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AuthorizationCodeCreate) SetNillableOwnerID

func (acc *AuthorizationCodeCreate) SetNillableOwnerID(id *int) *AuthorizationCodeCreate

SetNillableOwnerID sets the "owner" edge to the ServiceProvider entity by ID if the given value is not nil.

func (*AuthorizationCodeCreate) SetOwner

SetOwner sets the "owner" edge to the ServiceProvider entity.

func (*AuthorizationCodeCreate) SetOwnerID

SetOwnerID sets the "owner" edge to the ServiceProvider entity by ID.

func (*AuthorizationCodeCreate) SetToken

SetToken sets the "token" field.

type AuthorizationCodeCreateBulk

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

AuthorizationCodeCreateBulk is the builder for creating many AuthorizationCode entities in bulk.

func (*AuthorizationCodeCreateBulk) Exec

Exec executes the query.

func (*AuthorizationCodeCreateBulk) ExecX

func (accb *AuthorizationCodeCreateBulk) ExecX(ctx context.Context)

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

func (*AuthorizationCodeCreateBulk) Save

Save creates the AuthorizationCode entities in the database.

func (*AuthorizationCodeCreateBulk) SaveX

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

type AuthorizationCodeDelete

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

AuthorizationCodeDelete is the builder for deleting a AuthorizationCode entity.

func (*AuthorizationCodeDelete) Exec

func (acd *AuthorizationCodeDelete) Exec(ctx context.Context) (int, error)

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

func (*AuthorizationCodeDelete) ExecX

func (acd *AuthorizationCodeDelete) ExecX(ctx context.Context) int

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

func (*AuthorizationCodeDelete) Where

Where appends a list predicates to the AuthorizationCodeDelete builder.

type AuthorizationCodeDeleteOne

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

AuthorizationCodeDeleteOne is the builder for deleting a single AuthorizationCode entity.

func (*AuthorizationCodeDeleteOne) Exec

Exec executes the deletion query.

func (*AuthorizationCodeDeleteOne) ExecX

func (acdo *AuthorizationCodeDeleteOne) ExecX(ctx context.Context)

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

type AuthorizationCodeEdges

type AuthorizationCodeEdges struct {
	// Owner holds the value of the owner edge.
	Owner *ServiceProvider `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuthorizationCodeEdges) OwnerOrErr

func (e AuthorizationCodeEdges) OwnerOrErr() (*ServiceProvider, error)

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

type AuthorizationCodeGroupBy

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

AuthorizationCodeGroupBy is the group-by builder for AuthorizationCode entities.

func (*AuthorizationCodeGroupBy) Aggregate

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

func (*AuthorizationCodeGroupBy) Bool

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

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

func (*AuthorizationCodeGroupBy) BoolX

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

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

func (*AuthorizationCodeGroupBy) Bools

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

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

func (*AuthorizationCodeGroupBy) BoolsX

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

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

func (*AuthorizationCodeGroupBy) Float64

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

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

func (*AuthorizationCodeGroupBy) Float64X

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

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

func (*AuthorizationCodeGroupBy) Float64s

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

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

func (*AuthorizationCodeGroupBy) Float64sX

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

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

func (*AuthorizationCodeGroupBy) Int

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

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

func (*AuthorizationCodeGroupBy) IntX

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

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

func (*AuthorizationCodeGroupBy) Ints

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

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

func (*AuthorizationCodeGroupBy) IntsX

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

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

func (*AuthorizationCodeGroupBy) Scan

func (acgb *AuthorizationCodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuthorizationCodeGroupBy) ScanX

func (s *AuthorizationCodeGroupBy) ScanX(ctx context.Context, v any)

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

func (*AuthorizationCodeGroupBy) String

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

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

func (*AuthorizationCodeGroupBy) StringX

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

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

func (*AuthorizationCodeGroupBy) Strings

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

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

func (*AuthorizationCodeGroupBy) StringsX

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

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

type AuthorizationCodeMutation

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

AuthorizationCodeMutation represents an operation that mutates the AuthorizationCode nodes in the graph.

func (*AuthorizationCodeMutation) AddField

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

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

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

func (*AuthorizationCodeMutation) AddedField

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

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

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

func (*AuthorizationCodeMutation) AddedIDs

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

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

func (*AuthorizationCodeMutation) ClearEdge

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

func (m *AuthorizationCodeMutation) 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 (*AuthorizationCodeMutation) ClearOwner

func (m *AuthorizationCodeMutation) ClearOwner()

ClearOwner clears the "owner" edge to the ServiceProvider entity.

func (*AuthorizationCodeMutation) ClearedEdges

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

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

func (*AuthorizationCodeMutation) ClearedFields

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

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

func (AuthorizationCodeMutation) Client

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

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

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

func (*AuthorizationCodeMutation) Field

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

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

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

func (*AuthorizationCodeMutation) Fields

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

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

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

func (*AuthorizationCodeMutation) 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 (*AuthorizationCodeMutation) OldField

func (m *AuthorizationCodeMutation) 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 (*AuthorizationCodeMutation) OldToken

func (m *AuthorizationCodeMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the AuthorizationCode entity. If the AuthorizationCode 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 (*AuthorizationCodeMutation) Op

func (m *AuthorizationCodeMutation) Op() Op

Op returns the operation name.

func (*AuthorizationCodeMutation) OwnerCleared

func (m *AuthorizationCodeMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the ServiceProvider entity was cleared.

func (*AuthorizationCodeMutation) OwnerID

func (m *AuthorizationCodeMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*AuthorizationCodeMutation) OwnerIDs

func (m *AuthorizationCodeMutation) OwnerIDs() (ids []int)

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

func (*AuthorizationCodeMutation) RemovedEdges

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

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

func (*AuthorizationCodeMutation) RemovedIDs

func (m *AuthorizationCodeMutation) 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 (*AuthorizationCodeMutation) ResetEdge

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

func (m *AuthorizationCodeMutation) 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 (*AuthorizationCodeMutation) ResetOwner

func (m *AuthorizationCodeMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*AuthorizationCodeMutation) ResetToken

func (m *AuthorizationCodeMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*AuthorizationCodeMutation) SetField

func (m *AuthorizationCodeMutation) 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 (*AuthorizationCodeMutation) SetOwnerID

func (m *AuthorizationCodeMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the ServiceProvider entity by id.

func (*AuthorizationCodeMutation) SetToken

func (m *AuthorizationCodeMutation) SetToken(s string)

SetToken sets the "token" field.

func (*AuthorizationCodeMutation) Token

func (m *AuthorizationCodeMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (AuthorizationCodeMutation) Tx

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

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

func (*AuthorizationCodeMutation) Type

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

func (*AuthorizationCodeMutation) Where

Where appends a list predicates to the AuthorizationCodeMutation builder.

type AuthorizationCodeQuery

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

AuthorizationCodeQuery is the builder for querying AuthorizationCode entities.

func (*AuthorizationCodeQuery) Aggregate

Aggregate returns a AuthorizationCodeSelect configured with the given aggregations.

func (*AuthorizationCodeQuery) All

All executes the query and returns a list of AuthorizationCodes.

func (*AuthorizationCodeQuery) AllX

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

func (*AuthorizationCodeQuery) Clone

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

func (*AuthorizationCodeQuery) Count

func (acq *AuthorizationCodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuthorizationCodeQuery) CountX

func (acq *AuthorizationCodeQuery) CountX(ctx context.Context) int

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

func (*AuthorizationCodeQuery) Exist

func (acq *AuthorizationCodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuthorizationCodeQuery) ExistX

func (acq *AuthorizationCodeQuery) ExistX(ctx context.Context) bool

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

func (*AuthorizationCodeQuery) First

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

func (*AuthorizationCodeQuery) FirstID

func (acq *AuthorizationCodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AuthorizationCodeQuery) FirstIDX

func (acq *AuthorizationCodeQuery) FirstIDX(ctx context.Context) int

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

func (*AuthorizationCodeQuery) FirstX

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

func (*AuthorizationCodeQuery) GroupBy

func (acq *AuthorizationCodeQuery) GroupBy(field string, fields ...string) *AuthorizationCodeGroupBy

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.AuthorizationCode.Query().
	GroupBy(authorizationcode.FieldToken).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuthorizationCodeQuery) IDs

func (acq *AuthorizationCodeQuery) IDs(ctx context.Context) ([]int, error)

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

func (*AuthorizationCodeQuery) IDsX

func (acq *AuthorizationCodeQuery) IDsX(ctx context.Context) []int

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

func (*AuthorizationCodeQuery) Limit

Limit adds a limit step to the query.

func (*AuthorizationCodeQuery) Offset

func (acq *AuthorizationCodeQuery) Offset(offset int) *AuthorizationCodeQuery

Offset adds an offset step to the query.

func (*AuthorizationCodeQuery) Only

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

func (*AuthorizationCodeQuery) OnlyID

func (acq *AuthorizationCodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AuthorizationCodeQuery) OnlyIDX

func (acq *AuthorizationCodeQuery) OnlyIDX(ctx context.Context) int

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

func (*AuthorizationCodeQuery) OnlyX

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

func (*AuthorizationCodeQuery) Order

Order adds an order step to the query.

func (*AuthorizationCodeQuery) QueryOwner

func (acq *AuthorizationCodeQuery) QueryOwner() *ServiceProviderQuery

QueryOwner chains the current query on the "owner" edge.

func (*AuthorizationCodeQuery) Select

func (acq *AuthorizationCodeQuery) Select(fields ...string) *AuthorizationCodeSelect

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.AuthorizationCode.Query().
	Select(authorizationcode.FieldToken).
	Scan(ctx, &v)

func (*AuthorizationCodeQuery) Unique

func (acq *AuthorizationCodeQuery) Unique(unique bool) *AuthorizationCodeQuery

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

Where adds a new predicate for the AuthorizationCodeQuery builder.

func (*AuthorizationCodeQuery) WithOwner

func (acq *AuthorizationCodeQuery) WithOwner(opts ...func(*ServiceProviderQuery)) *AuthorizationCodeQuery

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

type AuthorizationCodeSelect

type AuthorizationCodeSelect struct {
	*AuthorizationCodeQuery
	// contains filtered or unexported fields
}

AuthorizationCodeSelect is the builder for selecting fields of AuthorizationCode entities.

func (*AuthorizationCodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*AuthorizationCodeSelect) Bool

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

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

func (*AuthorizationCodeSelect) BoolX

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

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

func (*AuthorizationCodeSelect) Bools

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

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

func (*AuthorizationCodeSelect) BoolsX

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

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

func (*AuthorizationCodeSelect) Float64

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

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

func (*AuthorizationCodeSelect) Float64X

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

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

func (*AuthorizationCodeSelect) Float64s

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

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

func (*AuthorizationCodeSelect) Float64sX

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

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

func (*AuthorizationCodeSelect) Int

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

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

func (*AuthorizationCodeSelect) IntX

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

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

func (*AuthorizationCodeSelect) Ints

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

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

func (*AuthorizationCodeSelect) IntsX

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

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

func (*AuthorizationCodeSelect) Scan

func (acs *AuthorizationCodeSelect) Scan(ctx context.Context, v any) error

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

func (*AuthorizationCodeSelect) ScanX

func (s *AuthorizationCodeSelect) ScanX(ctx context.Context, v any)

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

func (*AuthorizationCodeSelect) String

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

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

func (*AuthorizationCodeSelect) StringX

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

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

func (*AuthorizationCodeSelect) Strings

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

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

func (*AuthorizationCodeSelect) StringsX

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

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

type AuthorizationCodeUpdate

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

AuthorizationCodeUpdate is the builder for updating AuthorizationCode entities.

func (*AuthorizationCodeUpdate) ClearOwner

ClearOwner clears the "owner" edge to the ServiceProvider entity.

func (*AuthorizationCodeUpdate) Exec

Exec executes the query.

func (*AuthorizationCodeUpdate) ExecX

func (acu *AuthorizationCodeUpdate) ExecX(ctx context.Context)

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

func (*AuthorizationCodeUpdate) Mutation

Mutation returns the AuthorizationCodeMutation object of the builder.

func (*AuthorizationCodeUpdate) Save

func (acu *AuthorizationCodeUpdate) Save(ctx context.Context) (int, error)

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

func (*AuthorizationCodeUpdate) SaveX

func (acu *AuthorizationCodeUpdate) SaveX(ctx context.Context) int

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

func (*AuthorizationCodeUpdate) SetNillableOwnerID

func (acu *AuthorizationCodeUpdate) SetNillableOwnerID(id *int) *AuthorizationCodeUpdate

SetNillableOwnerID sets the "owner" edge to the ServiceProvider entity by ID if the given value is not nil.

func (*AuthorizationCodeUpdate) SetOwner

SetOwner sets the "owner" edge to the ServiceProvider entity.

func (*AuthorizationCodeUpdate) SetOwnerID

SetOwnerID sets the "owner" edge to the ServiceProvider entity by ID.

func (*AuthorizationCodeUpdate) SetToken

SetToken sets the "token" field.

func (*AuthorizationCodeUpdate) Where

Where appends a list predicates to the AuthorizationCodeUpdate builder.

type AuthorizationCodeUpdateOne

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

AuthorizationCodeUpdateOne is the builder for updating a single AuthorizationCode entity.

func (*AuthorizationCodeUpdateOne) ClearOwner

ClearOwner clears the "owner" edge to the ServiceProvider entity.

func (*AuthorizationCodeUpdateOne) Exec

Exec executes the query on the entity.

func (*AuthorizationCodeUpdateOne) ExecX

func (acuo *AuthorizationCodeUpdateOne) ExecX(ctx context.Context)

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

func (*AuthorizationCodeUpdateOne) Mutation

Mutation returns the AuthorizationCodeMutation object of the builder.

func (*AuthorizationCodeUpdateOne) Save

Save executes the query and returns the updated AuthorizationCode entity.

func (*AuthorizationCodeUpdateOne) SaveX

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

func (*AuthorizationCodeUpdateOne) Select

func (acuo *AuthorizationCodeUpdateOne) Select(field string, fields ...string) *AuthorizationCodeUpdateOne

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

func (*AuthorizationCodeUpdateOne) SetNillableOwnerID

func (acuo *AuthorizationCodeUpdateOne) SetNillableOwnerID(id *int) *AuthorizationCodeUpdateOne

SetNillableOwnerID sets the "owner" edge to the ServiceProvider entity by ID if the given value is not nil.

func (*AuthorizationCodeUpdateOne) SetOwner

SetOwner sets the "owner" edge to the ServiceProvider entity.

func (*AuthorizationCodeUpdateOne) SetOwnerID

SetOwnerID sets the "owner" edge to the ServiceProvider entity by ID.

func (*AuthorizationCodeUpdateOne) SetToken

SetToken sets the "token" field.

type AuthorizationCodes

type AuthorizationCodes []*AuthorizationCode

AuthorizationCodes is a parsable slice of AuthorizationCode.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AuthorizationCode is the client for interacting with the AuthorizationCode builders.
	AuthorizationCode *AuthorizationCodeClient
	// ServiceProvider is the client for interacting with the ServiceProvider builders.
	ServiceProvider *ServiceProviderClient
	// WhiteList is the client for interacting with the WhiteList builders.
	WhiteList *WhiteListClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

client.Debug().
	AuthorizationCode.
	Query().
	Count(ctx)

func (*Client) Tx

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

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

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

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type ServiceProvider

type ServiceProvider struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Host holds the value of the "host" field.
	Host string `json:"host,omitempty"`
	// DestinationIP holds the value of the "destination_ip" field.
	DestinationIP string `json:"destination_ip,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ServiceProviderQuery when eager-loading is set.
	Edges ServiceProviderEdges `json:"edges"`
	// contains filtered or unexported fields
}

ServiceProvider is the model entity for the ServiceProvider schema.

func (*ServiceProvider) QueryAuthorizationCodes

func (sp *ServiceProvider) QueryAuthorizationCodes() *AuthorizationCodeQuery

QueryAuthorizationCodes queries the "authorization_codes" edge of the ServiceProvider entity.

func (*ServiceProvider) QueryWhitelists

func (sp *ServiceProvider) QueryWhitelists() *WhiteListQuery

QueryWhitelists queries the "whitelists" edge of the ServiceProvider entity.

func (*ServiceProvider) String

func (sp *ServiceProvider) String() string

String implements the fmt.Stringer.

func (*ServiceProvider) Unwrap

func (sp *ServiceProvider) Unwrap() *ServiceProvider

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

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

type ServiceProviderClient

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

ServiceProviderClient is a client for the ServiceProvider schema.

func NewServiceProviderClient

func NewServiceProviderClient(c config) *ServiceProviderClient

NewServiceProviderClient returns a client for the ServiceProvider from the given config.

func (*ServiceProviderClient) Create

Create returns a builder for creating a ServiceProvider entity.

func (*ServiceProviderClient) CreateBulk

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

func (*ServiceProviderClient) Delete

Delete returns a delete builder for ServiceProvider.

func (*ServiceProviderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ServiceProviderClient) DeleteOneID

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

func (*ServiceProviderClient) Get

Get returns a ServiceProvider entity by its id.

func (*ServiceProviderClient) GetX

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

func (*ServiceProviderClient) Hooks

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

Hooks returns the client hooks.

func (*ServiceProviderClient) Query

Query returns a query builder for ServiceProvider.

func (*ServiceProviderClient) QueryAuthorizationCodes

func (c *ServiceProviderClient) QueryAuthorizationCodes(sp *ServiceProvider) *AuthorizationCodeQuery

QueryAuthorizationCodes queries the authorization_codes edge of a ServiceProvider.

func (*ServiceProviderClient) QueryWhitelists

func (c *ServiceProviderClient) QueryWhitelists(sp *ServiceProvider) *WhiteListQuery

QueryWhitelists queries the whitelists edge of a ServiceProvider.

func (*ServiceProviderClient) Update

Update returns an update builder for ServiceProvider.

func (*ServiceProviderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ServiceProviderClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*ServiceProviderClient) Use

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

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

type ServiceProviderCreate

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

ServiceProviderCreate is the builder for creating a ServiceProvider entity.

func (*ServiceProviderCreate) AddAuthorizationCodeIDs

func (spc *ServiceProviderCreate) AddAuthorizationCodeIDs(ids ...int) *ServiceProviderCreate

AddAuthorizationCodeIDs adds the "authorization_codes" edge to the AuthorizationCode entity by IDs.

func (*ServiceProviderCreate) AddAuthorizationCodes

func (spc *ServiceProviderCreate) AddAuthorizationCodes(a ...*AuthorizationCode) *ServiceProviderCreate

AddAuthorizationCodes adds the "authorization_codes" edges to the AuthorizationCode entity.

func (*ServiceProviderCreate) AddWhitelistIDs

func (spc *ServiceProviderCreate) AddWhitelistIDs(ids ...int) *ServiceProviderCreate

AddWhitelistIDs adds the "whitelists" edge to the WhiteList entity by IDs.

func (*ServiceProviderCreate) AddWhitelists

func (spc *ServiceProviderCreate) AddWhitelists(w ...*WhiteList) *ServiceProviderCreate

AddWhitelists adds the "whitelists" edges to the WhiteList entity.

func (*ServiceProviderCreate) Exec

func (spc *ServiceProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceProviderCreate) ExecX

func (spc *ServiceProviderCreate) ExecX(ctx context.Context)

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

func (*ServiceProviderCreate) Mutation

Mutation returns the ServiceProviderMutation object of the builder.

func (*ServiceProviderCreate) Save

Save creates the ServiceProvider in the database.

func (*ServiceProviderCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ServiceProviderCreate) SetDestinationIP

func (spc *ServiceProviderCreate) SetDestinationIP(s string) *ServiceProviderCreate

SetDestinationIP sets the "destination_ip" field.

func (*ServiceProviderCreate) SetHost

SetHost sets the "host" field.

type ServiceProviderCreateBulk

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

ServiceProviderCreateBulk is the builder for creating many ServiceProvider entities in bulk.

func (*ServiceProviderCreateBulk) Exec

Exec executes the query.

func (*ServiceProviderCreateBulk) ExecX

func (spcb *ServiceProviderCreateBulk) ExecX(ctx context.Context)

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

func (*ServiceProviderCreateBulk) Save

Save creates the ServiceProvider entities in the database.

func (*ServiceProviderCreateBulk) SaveX

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

type ServiceProviderDelete

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

ServiceProviderDelete is the builder for deleting a ServiceProvider entity.

func (*ServiceProviderDelete) Exec

func (spd *ServiceProviderDelete) Exec(ctx context.Context) (int, error)

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

func (*ServiceProviderDelete) ExecX

func (spd *ServiceProviderDelete) ExecX(ctx context.Context) int

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

func (*ServiceProviderDelete) Where

Where appends a list predicates to the ServiceProviderDelete builder.

type ServiceProviderDeleteOne

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

ServiceProviderDeleteOne is the builder for deleting a single ServiceProvider entity.

func (*ServiceProviderDeleteOne) Exec

Exec executes the deletion query.

func (*ServiceProviderDeleteOne) ExecX

func (spdo *ServiceProviderDeleteOne) ExecX(ctx context.Context)

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

type ServiceProviderEdges

type ServiceProviderEdges struct {
	// Whitelists holds the value of the whitelists edge.
	Whitelists []*WhiteList `json:"whitelists,omitempty"`
	// AuthorizationCodes holds the value of the authorization_codes edge.
	AuthorizationCodes []*AuthorizationCode `json:"authorization_codes,omitempty"`
	// contains filtered or unexported fields
}

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

func (ServiceProviderEdges) AuthorizationCodesOrErr

func (e ServiceProviderEdges) AuthorizationCodesOrErr() ([]*AuthorizationCode, error)

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

func (ServiceProviderEdges) WhitelistsOrErr

func (e ServiceProviderEdges) WhitelistsOrErr() ([]*WhiteList, error)

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

type ServiceProviderGroupBy

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

ServiceProviderGroupBy is the group-by builder for ServiceProvider entities.

func (*ServiceProviderGroupBy) Aggregate

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

func (*ServiceProviderGroupBy) Bool

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

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

func (*ServiceProviderGroupBy) BoolX

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

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

func (*ServiceProviderGroupBy) Bools

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

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

func (*ServiceProviderGroupBy) BoolsX

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

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

func (*ServiceProviderGroupBy) Float64

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

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

func (*ServiceProviderGroupBy) Float64X

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

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

func (*ServiceProviderGroupBy) Float64s

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

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

func (*ServiceProviderGroupBy) Float64sX

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

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

func (*ServiceProviderGroupBy) Int

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

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

func (*ServiceProviderGroupBy) IntX

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

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

func (*ServiceProviderGroupBy) Ints

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

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

func (*ServiceProviderGroupBy) IntsX

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

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

func (*ServiceProviderGroupBy) Scan

func (spgb *ServiceProviderGroupBy) Scan(ctx context.Context, v any) error

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

func (*ServiceProviderGroupBy) ScanX

func (s *ServiceProviderGroupBy) ScanX(ctx context.Context, v any)

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

func (*ServiceProviderGroupBy) String

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

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

func (*ServiceProviderGroupBy) StringX

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

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

func (*ServiceProviderGroupBy) Strings

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

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

func (*ServiceProviderGroupBy) StringsX

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

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

type ServiceProviderMutation

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

ServiceProviderMutation represents an operation that mutates the ServiceProvider nodes in the graph.

func (*ServiceProviderMutation) AddAuthorizationCodeIDs

func (m *ServiceProviderMutation) AddAuthorizationCodeIDs(ids ...int)

AddAuthorizationCodeIDs adds the "authorization_codes" edge to the AuthorizationCode entity by ids.

func (*ServiceProviderMutation) AddField

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) AddWhitelistIDs

func (m *ServiceProviderMutation) AddWhitelistIDs(ids ...int)

AddWhitelistIDs adds the "whitelists" edge to the WhiteList entity by ids.

func (*ServiceProviderMutation) AddedEdges

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

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

func (*ServiceProviderMutation) AddedField

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

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

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

func (*ServiceProviderMutation) AddedIDs

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

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

func (*ServiceProviderMutation) AuthorizationCodesCleared

func (m *ServiceProviderMutation) AuthorizationCodesCleared() bool

AuthorizationCodesCleared reports if the "authorization_codes" edge to the AuthorizationCode entity was cleared.

func (*ServiceProviderMutation) AuthorizationCodesIDs

func (m *ServiceProviderMutation) AuthorizationCodesIDs() (ids []int)

AuthorizationCodesIDs returns the "authorization_codes" edge IDs in the mutation.

func (*ServiceProviderMutation) ClearAuthorizationCodes

func (m *ServiceProviderMutation) ClearAuthorizationCodes()

ClearAuthorizationCodes clears the "authorization_codes" edge to the AuthorizationCode entity.

func (*ServiceProviderMutation) ClearEdge

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

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) ClearWhitelists

func (m *ServiceProviderMutation) ClearWhitelists()

ClearWhitelists clears the "whitelists" edge to the WhiteList entity.

func (*ServiceProviderMutation) ClearedEdges

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

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

func (*ServiceProviderMutation) ClearedFields

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

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

func (ServiceProviderMutation) Client

func (m ServiceProviderMutation) 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 (*ServiceProviderMutation) DestinationIP

func (m *ServiceProviderMutation) DestinationIP() (r string, exists bool)

DestinationIP returns the value of the "destination_ip" field in the mutation.

func (*ServiceProviderMutation) EdgeCleared

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

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

func (*ServiceProviderMutation) Field

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

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

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

func (*ServiceProviderMutation) Fields

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) Host

func (m *ServiceProviderMutation) Host() (r string, exists bool)

Host returns the value of the "host" field in the mutation.

func (*ServiceProviderMutation) ID

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

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

func (*ServiceProviderMutation) IDs

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

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

func (*ServiceProviderMutation) OldDestinationIP

func (m *ServiceProviderMutation) OldDestinationIP(ctx context.Context) (v string, err error)

OldDestinationIP returns the old "destination_ip" field's value of the ServiceProvider entity. If the ServiceProvider 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 (*ServiceProviderMutation) OldField

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) OldHost

func (m *ServiceProviderMutation) OldHost(ctx context.Context) (v string, err error)

OldHost returns the old "host" field's value of the ServiceProvider entity. If the ServiceProvider 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 (*ServiceProviderMutation) Op

func (m *ServiceProviderMutation) Op() Op

Op returns the operation name.

func (*ServiceProviderMutation) RemoveAuthorizationCodeIDs

func (m *ServiceProviderMutation) RemoveAuthorizationCodeIDs(ids ...int)

RemoveAuthorizationCodeIDs removes the "authorization_codes" edge to the AuthorizationCode entity by IDs.

func (*ServiceProviderMutation) RemoveWhitelistIDs

func (m *ServiceProviderMutation) RemoveWhitelistIDs(ids ...int)

RemoveWhitelistIDs removes the "whitelists" edge to the WhiteList entity by IDs.

func (*ServiceProviderMutation) RemovedAuthorizationCodesIDs

func (m *ServiceProviderMutation) RemovedAuthorizationCodesIDs() (ids []int)

RemovedAuthorizationCodes returns the removed IDs of the "authorization_codes" edge to the AuthorizationCode entity.

func (*ServiceProviderMutation) RemovedEdges

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

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

func (*ServiceProviderMutation) RemovedIDs

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) RemovedWhitelistsIDs

func (m *ServiceProviderMutation) RemovedWhitelistsIDs() (ids []int)

RemovedWhitelists returns the removed IDs of the "whitelists" edge to the WhiteList entity.

func (*ServiceProviderMutation) ResetAuthorizationCodes

func (m *ServiceProviderMutation) ResetAuthorizationCodes()

ResetAuthorizationCodes resets all changes to the "authorization_codes" edge.

func (*ServiceProviderMutation) ResetDestinationIP

func (m *ServiceProviderMutation) ResetDestinationIP()

ResetDestinationIP resets all changes to the "destination_ip" field.

func (*ServiceProviderMutation) ResetEdge

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

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) ResetHost

func (m *ServiceProviderMutation) ResetHost()

ResetHost resets all changes to the "host" field.

func (*ServiceProviderMutation) ResetWhitelists

func (m *ServiceProviderMutation) ResetWhitelists()

ResetWhitelists resets all changes to the "whitelists" edge.

func (*ServiceProviderMutation) SetDestinationIP

func (m *ServiceProviderMutation) SetDestinationIP(s string)

SetDestinationIP sets the "destination_ip" field.

func (*ServiceProviderMutation) SetField

func (m *ServiceProviderMutation) 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 (*ServiceProviderMutation) SetHost

func (m *ServiceProviderMutation) SetHost(s string)

SetHost sets the "host" field.

func (ServiceProviderMutation) Tx

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

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

func (*ServiceProviderMutation) Type

func (m *ServiceProviderMutation) Type() string

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

func (*ServiceProviderMutation) Where

Where appends a list predicates to the ServiceProviderMutation builder.

func (*ServiceProviderMutation) WhitelistsCleared

func (m *ServiceProviderMutation) WhitelistsCleared() bool

WhitelistsCleared reports if the "whitelists" edge to the WhiteList entity was cleared.

func (*ServiceProviderMutation) WhitelistsIDs

func (m *ServiceProviderMutation) WhitelistsIDs() (ids []int)

WhitelistsIDs returns the "whitelists" edge IDs in the mutation.

type ServiceProviderQuery

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

ServiceProviderQuery is the builder for querying ServiceProvider entities.

func (*ServiceProviderQuery) Aggregate

Aggregate returns a ServiceProviderSelect configured with the given aggregations.

func (*ServiceProviderQuery) All

All executes the query and returns a list of ServiceProviders.

func (*ServiceProviderQuery) AllX

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

func (*ServiceProviderQuery) Clone

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

func (*ServiceProviderQuery) Count

func (spq *ServiceProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ServiceProviderQuery) CountX

func (spq *ServiceProviderQuery) CountX(ctx context.Context) int

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

func (*ServiceProviderQuery) Exist

func (spq *ServiceProviderQuery) Exist(ctx context.Context) (bool, error)

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

func (*ServiceProviderQuery) ExistX

func (spq *ServiceProviderQuery) ExistX(ctx context.Context) bool

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

func (*ServiceProviderQuery) First

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

func (*ServiceProviderQuery) FirstID

func (spq *ServiceProviderQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ServiceProviderQuery) FirstIDX

func (spq *ServiceProviderQuery) FirstIDX(ctx context.Context) int

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

func (*ServiceProviderQuery) FirstX

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

func (*ServiceProviderQuery) GroupBy

func (spq *ServiceProviderQuery) GroupBy(field string, fields ...string) *ServiceProviderGroupBy

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

client.ServiceProvider.Query().
	GroupBy(serviceprovider.FieldHost).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ServiceProviderQuery) IDs

func (spq *ServiceProviderQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ServiceProviderQuery) IDsX

func (spq *ServiceProviderQuery) IDsX(ctx context.Context) []int

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

func (*ServiceProviderQuery) Limit

func (spq *ServiceProviderQuery) Limit(limit int) *ServiceProviderQuery

Limit adds a limit step to the query.

func (*ServiceProviderQuery) Offset

func (spq *ServiceProviderQuery) Offset(offset int) *ServiceProviderQuery

Offset adds an offset step to the query.

func (*ServiceProviderQuery) Only

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

func (*ServiceProviderQuery) OnlyID

func (spq *ServiceProviderQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ServiceProviderQuery) OnlyIDX

func (spq *ServiceProviderQuery) OnlyIDX(ctx context.Context) int

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

func (*ServiceProviderQuery) OnlyX

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

func (*ServiceProviderQuery) Order

Order adds an order step to the query.

func (*ServiceProviderQuery) QueryAuthorizationCodes

func (spq *ServiceProviderQuery) QueryAuthorizationCodes() *AuthorizationCodeQuery

QueryAuthorizationCodes chains the current query on the "authorization_codes" edge.

func (*ServiceProviderQuery) QueryWhitelists

func (spq *ServiceProviderQuery) QueryWhitelists() *WhiteListQuery

QueryWhitelists chains the current query on the "whitelists" edge.

func (*ServiceProviderQuery) Select

func (spq *ServiceProviderQuery) Select(fields ...string) *ServiceProviderSelect

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

client.ServiceProvider.Query().
	Select(serviceprovider.FieldHost).
	Scan(ctx, &v)

func (*ServiceProviderQuery) Unique

func (spq *ServiceProviderQuery) Unique(unique bool) *ServiceProviderQuery

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

Where adds a new predicate for the ServiceProviderQuery builder.

func (*ServiceProviderQuery) WithAuthorizationCodes

func (spq *ServiceProviderQuery) WithAuthorizationCodes(opts ...func(*AuthorizationCodeQuery)) *ServiceProviderQuery

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

func (*ServiceProviderQuery) WithWhitelists

func (spq *ServiceProviderQuery) WithWhitelists(opts ...func(*WhiteListQuery)) *ServiceProviderQuery

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

type ServiceProviderSelect

type ServiceProviderSelect struct {
	*ServiceProviderQuery
	// contains filtered or unexported fields
}

ServiceProviderSelect is the builder for selecting fields of ServiceProvider entities.

func (*ServiceProviderSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*ServiceProviderSelect) Bool

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

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

func (*ServiceProviderSelect) BoolX

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

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

func (*ServiceProviderSelect) Bools

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

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

func (*ServiceProviderSelect) BoolsX

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

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

func (*ServiceProviderSelect) Float64

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

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

func (*ServiceProviderSelect) Float64X

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

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

func (*ServiceProviderSelect) Float64s

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

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

func (*ServiceProviderSelect) Float64sX

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

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

func (*ServiceProviderSelect) Int

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

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

func (*ServiceProviderSelect) IntX

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

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

func (*ServiceProviderSelect) Ints

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

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

func (*ServiceProviderSelect) IntsX

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

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

func (*ServiceProviderSelect) Scan

func (sps *ServiceProviderSelect) Scan(ctx context.Context, v any) error

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

func (*ServiceProviderSelect) ScanX

func (s *ServiceProviderSelect) ScanX(ctx context.Context, v any)

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

func (*ServiceProviderSelect) String

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

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

func (*ServiceProviderSelect) StringX

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

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

func (*ServiceProviderSelect) Strings

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

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

func (*ServiceProviderSelect) StringsX

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

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

type ServiceProviderUpdate

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

ServiceProviderUpdate is the builder for updating ServiceProvider entities.

func (*ServiceProviderUpdate) AddAuthorizationCodeIDs

func (spu *ServiceProviderUpdate) AddAuthorizationCodeIDs(ids ...int) *ServiceProviderUpdate

AddAuthorizationCodeIDs adds the "authorization_codes" edge to the AuthorizationCode entity by IDs.

func (*ServiceProviderUpdate) AddAuthorizationCodes

func (spu *ServiceProviderUpdate) AddAuthorizationCodes(a ...*AuthorizationCode) *ServiceProviderUpdate

AddAuthorizationCodes adds the "authorization_codes" edges to the AuthorizationCode entity.

func (*ServiceProviderUpdate) AddWhitelistIDs

func (spu *ServiceProviderUpdate) AddWhitelistIDs(ids ...int) *ServiceProviderUpdate

AddWhitelistIDs adds the "whitelists" edge to the WhiteList entity by IDs.

func (*ServiceProviderUpdate) AddWhitelists

func (spu *ServiceProviderUpdate) AddWhitelists(w ...*WhiteList) *ServiceProviderUpdate

AddWhitelists adds the "whitelists" edges to the WhiteList entity.

func (*ServiceProviderUpdate) ClearAuthorizationCodes

func (spu *ServiceProviderUpdate) ClearAuthorizationCodes() *ServiceProviderUpdate

ClearAuthorizationCodes clears all "authorization_codes" edges to the AuthorizationCode entity.

func (*ServiceProviderUpdate) ClearWhitelists

func (spu *ServiceProviderUpdate) ClearWhitelists() *ServiceProviderUpdate

ClearWhitelists clears all "whitelists" edges to the WhiteList entity.

func (*ServiceProviderUpdate) Exec

func (spu *ServiceProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ServiceProviderUpdate) ExecX

func (spu *ServiceProviderUpdate) ExecX(ctx context.Context)

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

func (*ServiceProviderUpdate) Mutation

Mutation returns the ServiceProviderMutation object of the builder.

func (*ServiceProviderUpdate) RemoveAuthorizationCodeIDs

func (spu *ServiceProviderUpdate) RemoveAuthorizationCodeIDs(ids ...int) *ServiceProviderUpdate

RemoveAuthorizationCodeIDs removes the "authorization_codes" edge to AuthorizationCode entities by IDs.

func (*ServiceProviderUpdate) RemoveAuthorizationCodes

func (spu *ServiceProviderUpdate) RemoveAuthorizationCodes(a ...*AuthorizationCode) *ServiceProviderUpdate

RemoveAuthorizationCodes removes "authorization_codes" edges to AuthorizationCode entities.

func (*ServiceProviderUpdate) RemoveWhitelistIDs

func (spu *ServiceProviderUpdate) RemoveWhitelistIDs(ids ...int) *ServiceProviderUpdate

RemoveWhitelistIDs removes the "whitelists" edge to WhiteList entities by IDs.

func (*ServiceProviderUpdate) RemoveWhitelists

func (spu *ServiceProviderUpdate) RemoveWhitelists(w ...*WhiteList) *ServiceProviderUpdate

RemoveWhitelists removes "whitelists" edges to WhiteList entities.

func (*ServiceProviderUpdate) Save

func (spu *ServiceProviderUpdate) Save(ctx context.Context) (int, error)

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

func (*ServiceProviderUpdate) SaveX

func (spu *ServiceProviderUpdate) SaveX(ctx context.Context) int

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

func (*ServiceProviderUpdate) SetDestinationIP

func (spu *ServiceProviderUpdate) SetDestinationIP(s string) *ServiceProviderUpdate

SetDestinationIP sets the "destination_ip" field.

func (*ServiceProviderUpdate) SetHost

SetHost sets the "host" field.

func (*ServiceProviderUpdate) Where

Where appends a list predicates to the ServiceProviderUpdate builder.

type ServiceProviderUpdateOne

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

ServiceProviderUpdateOne is the builder for updating a single ServiceProvider entity.

func (*ServiceProviderUpdateOne) AddAuthorizationCodeIDs

func (spuo *ServiceProviderUpdateOne) AddAuthorizationCodeIDs(ids ...int) *ServiceProviderUpdateOne

AddAuthorizationCodeIDs adds the "authorization_codes" edge to the AuthorizationCode entity by IDs.

func (*ServiceProviderUpdateOne) AddAuthorizationCodes

func (spuo *ServiceProviderUpdateOne) AddAuthorizationCodes(a ...*AuthorizationCode) *ServiceProviderUpdateOne

AddAuthorizationCodes adds the "authorization_codes" edges to the AuthorizationCode entity.

func (*ServiceProviderUpdateOne) AddWhitelistIDs

func (spuo *ServiceProviderUpdateOne) AddWhitelistIDs(ids ...int) *ServiceProviderUpdateOne

AddWhitelistIDs adds the "whitelists" edge to the WhiteList entity by IDs.

func (*ServiceProviderUpdateOne) AddWhitelists

func (spuo *ServiceProviderUpdateOne) AddWhitelists(w ...*WhiteList) *ServiceProviderUpdateOne

AddWhitelists adds the "whitelists" edges to the WhiteList entity.

func (*ServiceProviderUpdateOne) ClearAuthorizationCodes

func (spuo *ServiceProviderUpdateOne) ClearAuthorizationCodes() *ServiceProviderUpdateOne

ClearAuthorizationCodes clears all "authorization_codes" edges to the AuthorizationCode entity.

func (*ServiceProviderUpdateOne) ClearWhitelists

func (spuo *ServiceProviderUpdateOne) ClearWhitelists() *ServiceProviderUpdateOne

ClearWhitelists clears all "whitelists" edges to the WhiteList entity.

func (*ServiceProviderUpdateOne) Exec

Exec executes the query on the entity.

func (*ServiceProviderUpdateOne) ExecX

func (spuo *ServiceProviderUpdateOne) ExecX(ctx context.Context)

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

func (*ServiceProviderUpdateOne) Mutation

Mutation returns the ServiceProviderMutation object of the builder.

func (*ServiceProviderUpdateOne) RemoveAuthorizationCodeIDs

func (spuo *ServiceProviderUpdateOne) RemoveAuthorizationCodeIDs(ids ...int) *ServiceProviderUpdateOne

RemoveAuthorizationCodeIDs removes the "authorization_codes" edge to AuthorizationCode entities by IDs.

func (*ServiceProviderUpdateOne) RemoveAuthorizationCodes

func (spuo *ServiceProviderUpdateOne) RemoveAuthorizationCodes(a ...*AuthorizationCode) *ServiceProviderUpdateOne

RemoveAuthorizationCodes removes "authorization_codes" edges to AuthorizationCode entities.

func (*ServiceProviderUpdateOne) RemoveWhitelistIDs

func (spuo *ServiceProviderUpdateOne) RemoveWhitelistIDs(ids ...int) *ServiceProviderUpdateOne

RemoveWhitelistIDs removes the "whitelists" edge to WhiteList entities by IDs.

func (*ServiceProviderUpdateOne) RemoveWhitelists

func (spuo *ServiceProviderUpdateOne) RemoveWhitelists(w ...*WhiteList) *ServiceProviderUpdateOne

RemoveWhitelists removes "whitelists" edges to WhiteList entities.

func (*ServiceProviderUpdateOne) Save

Save executes the query and returns the updated ServiceProvider entity.

func (*ServiceProviderUpdateOne) SaveX

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

func (*ServiceProviderUpdateOne) Select

func (spuo *ServiceProviderUpdateOne) Select(field string, fields ...string) *ServiceProviderUpdateOne

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

func (*ServiceProviderUpdateOne) SetDestinationIP

func (spuo *ServiceProviderUpdateOne) SetDestinationIP(s string) *ServiceProviderUpdateOne

SetDestinationIP sets the "destination_ip" field.

func (*ServiceProviderUpdateOne) SetHost

SetHost sets the "host" field.

type ServiceProviders

type ServiceProviders []*ServiceProvider

ServiceProviders is a parsable slice of ServiceProvider.

type Tx

type Tx struct {

	// AuthorizationCode is the client for interacting with the AuthorizationCode builders.
	AuthorizationCode *AuthorizationCodeClient
	// ServiceProvider is the client for interacting with the ServiceProvider builders.
	ServiceProvider *ServiceProviderClient
	// WhiteList is the client for interacting with the WhiteList builders.
	WhiteList *WhiteListClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

type WhiteList

type WhiteList struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WhiteListQuery when eager-loading is set.
	Edges WhiteListEdges `json:"edges"`
	// contains filtered or unexported fields
}

WhiteList is the model entity for the WhiteList schema.

func (*WhiteList) QueryOwner

func (wl *WhiteList) QueryOwner() *ServiceProviderQuery

QueryOwner queries the "owner" edge of the WhiteList entity.

func (*WhiteList) String

func (wl *WhiteList) String() string

String implements the fmt.Stringer.

func (*WhiteList) Unwrap

func (wl *WhiteList) Unwrap() *WhiteList

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

func (wl *WhiteList) Update() *WhiteListUpdateOne

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

type WhiteListClient

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

WhiteListClient is a client for the WhiteList schema.

func NewWhiteListClient

func NewWhiteListClient(c config) *WhiteListClient

NewWhiteListClient returns a client for the WhiteList from the given config.

func (*WhiteListClient) Create

func (c *WhiteListClient) Create() *WhiteListCreate

Create returns a builder for creating a WhiteList entity.

func (*WhiteListClient) CreateBulk

func (c *WhiteListClient) CreateBulk(builders ...*WhiteListCreate) *WhiteListCreateBulk

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

func (*WhiteListClient) Delete

func (c *WhiteListClient) Delete() *WhiteListDelete

Delete returns a delete builder for WhiteList.

func (*WhiteListClient) DeleteOne

func (c *WhiteListClient) DeleteOne(wl *WhiteList) *WhiteListDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WhiteListClient) DeleteOneID

func (c *WhiteListClient) DeleteOneID(id int) *WhiteListDeleteOne

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

func (*WhiteListClient) Get

func (c *WhiteListClient) Get(ctx context.Context, id int) (*WhiteList, error)

Get returns a WhiteList entity by its id.

func (*WhiteListClient) GetX

func (c *WhiteListClient) GetX(ctx context.Context, id int) *WhiteList

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

func (*WhiteListClient) Hooks

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

Hooks returns the client hooks.

func (*WhiteListClient) Query

func (c *WhiteListClient) Query() *WhiteListQuery

Query returns a query builder for WhiteList.

func (*WhiteListClient) QueryOwner

func (c *WhiteListClient) QueryOwner(wl *WhiteList) *ServiceProviderQuery

QueryOwner queries the owner edge of a WhiteList.

func (*WhiteListClient) Update

func (c *WhiteListClient) Update() *WhiteListUpdate

Update returns an update builder for WhiteList.

func (*WhiteListClient) UpdateOne

func (c *WhiteListClient) UpdateOne(wl *WhiteList) *WhiteListUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WhiteListClient) UpdateOneID

func (c *WhiteListClient) UpdateOneID(id int) *WhiteListUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WhiteListClient) Use

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

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

type WhiteListCreate

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

WhiteListCreate is the builder for creating a WhiteList entity.

func (*WhiteListCreate) Exec

func (wlc *WhiteListCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WhiteListCreate) ExecX

func (wlc *WhiteListCreate) ExecX(ctx context.Context)

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

func (*WhiteListCreate) Mutation

func (wlc *WhiteListCreate) Mutation() *WhiteListMutation

Mutation returns the WhiteListMutation object of the builder.

func (*WhiteListCreate) Save

func (wlc *WhiteListCreate) Save(ctx context.Context) (*WhiteList, error)

Save creates the WhiteList in the database.

func (*WhiteListCreate) SaveX

func (wlc *WhiteListCreate) SaveX(ctx context.Context) *WhiteList

SaveX calls Save and panics if Save returns an error.

func (*WhiteListCreate) SetNillableOwnerID

func (wlc *WhiteListCreate) SetNillableOwnerID(id *int) *WhiteListCreate

SetNillableOwnerID sets the "owner" edge to the ServiceProvider entity by ID if the given value is not nil.

func (*WhiteListCreate) SetOwner

func (wlc *WhiteListCreate) SetOwner(s *ServiceProvider) *WhiteListCreate

SetOwner sets the "owner" edge to the ServiceProvider entity.

func (*WhiteListCreate) SetOwnerID

func (wlc *WhiteListCreate) SetOwnerID(id int) *WhiteListCreate

SetOwnerID sets the "owner" edge to the ServiceProvider entity by ID.

func (*WhiteListCreate) SetPath

func (wlc *WhiteListCreate) SetPath(s string) *WhiteListCreate

SetPath sets the "path" field.

type WhiteListCreateBulk

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

WhiteListCreateBulk is the builder for creating many WhiteList entities in bulk.

func (*WhiteListCreateBulk) Exec

func (wlcb *WhiteListCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WhiteListCreateBulk) ExecX

func (wlcb *WhiteListCreateBulk) ExecX(ctx context.Context)

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

func (*WhiteListCreateBulk) Save

func (wlcb *WhiteListCreateBulk) Save(ctx context.Context) ([]*WhiteList, error)

Save creates the WhiteList entities in the database.

func (*WhiteListCreateBulk) SaveX

func (wlcb *WhiteListCreateBulk) SaveX(ctx context.Context) []*WhiteList

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

type WhiteListDelete

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

WhiteListDelete is the builder for deleting a WhiteList entity.

func (*WhiteListDelete) Exec

func (wld *WhiteListDelete) Exec(ctx context.Context) (int, error)

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

func (*WhiteListDelete) ExecX

func (wld *WhiteListDelete) ExecX(ctx context.Context) int

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

func (*WhiteListDelete) Where

Where appends a list predicates to the WhiteListDelete builder.

type WhiteListDeleteOne

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

WhiteListDeleteOne is the builder for deleting a single WhiteList entity.

func (*WhiteListDeleteOne) Exec

func (wldo *WhiteListDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WhiteListDeleteOne) ExecX

func (wldo *WhiteListDeleteOne) ExecX(ctx context.Context)

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

type WhiteListEdges

type WhiteListEdges struct {
	// Owner holds the value of the owner edge.
	Owner *ServiceProvider `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (WhiteListEdges) OwnerOrErr

func (e WhiteListEdges) OwnerOrErr() (*ServiceProvider, error)

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

type WhiteListGroupBy

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

WhiteListGroupBy is the group-by builder for WhiteList entities.

func (*WhiteListGroupBy) Aggregate

func (wlgb *WhiteListGroupBy) Aggregate(fns ...AggregateFunc) *WhiteListGroupBy

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

func (*WhiteListGroupBy) Bool

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

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

func (*WhiteListGroupBy) BoolX

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

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

func (*WhiteListGroupBy) Bools

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

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

func (*WhiteListGroupBy) BoolsX

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

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

func (*WhiteListGroupBy) Float64

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

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

func (*WhiteListGroupBy) Float64X

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

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

func (*WhiteListGroupBy) Float64s

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

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

func (*WhiteListGroupBy) Float64sX

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

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

func (*WhiteListGroupBy) Int

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

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

func (*WhiteListGroupBy) IntX

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

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

func (*WhiteListGroupBy) Ints

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

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

func (*WhiteListGroupBy) IntsX

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

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

func (*WhiteListGroupBy) Scan

func (wlgb *WhiteListGroupBy) Scan(ctx context.Context, v any) error

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

func (*WhiteListGroupBy) ScanX

func (s *WhiteListGroupBy) ScanX(ctx context.Context, v any)

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

func (*WhiteListGroupBy) String

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

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

func (*WhiteListGroupBy) StringX

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

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

func (*WhiteListGroupBy) Strings

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

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

func (*WhiteListGroupBy) StringsX

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

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

type WhiteListMutation

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

WhiteListMutation represents an operation that mutates the WhiteList nodes in the graph.

func (*WhiteListMutation) AddField

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

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

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

func (*WhiteListMutation) AddedField

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

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

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

func (*WhiteListMutation) AddedIDs

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

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

func (*WhiteListMutation) ClearEdge

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

func (m *WhiteListMutation) 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 (*WhiteListMutation) ClearOwner

func (m *WhiteListMutation) ClearOwner()

ClearOwner clears the "owner" edge to the ServiceProvider entity.

func (*WhiteListMutation) ClearedEdges

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

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

func (*WhiteListMutation) ClearedFields

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

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

func (WhiteListMutation) Client

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

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

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

func (*WhiteListMutation) Field

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

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

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

func (*WhiteListMutation) Fields

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

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

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

func (*WhiteListMutation) IDs

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

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

func (*WhiteListMutation) OldField

func (m *WhiteListMutation) 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 (*WhiteListMutation) OldPath

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

OldPath returns the old "path" field's value of the WhiteList entity. If the WhiteList 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 (*WhiteListMutation) Op

func (m *WhiteListMutation) Op() Op

Op returns the operation name.

func (*WhiteListMutation) OwnerCleared

func (m *WhiteListMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the ServiceProvider entity was cleared.

func (*WhiteListMutation) OwnerID

func (m *WhiteListMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*WhiteListMutation) OwnerIDs

func (m *WhiteListMutation) OwnerIDs() (ids []int)

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

func (*WhiteListMutation) Path

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

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

func (*WhiteListMutation) RemovedEdges

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

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

func (*WhiteListMutation) RemovedIDs

func (m *WhiteListMutation) 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 (*WhiteListMutation) ResetEdge

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

func (m *WhiteListMutation) 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 (*WhiteListMutation) ResetOwner

func (m *WhiteListMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*WhiteListMutation) ResetPath

func (m *WhiteListMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*WhiteListMutation) SetField

func (m *WhiteListMutation) 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 (*WhiteListMutation) SetOwnerID

func (m *WhiteListMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the ServiceProvider entity by id.

func (*WhiteListMutation) SetPath

func (m *WhiteListMutation) SetPath(s string)

SetPath sets the "path" field.

func (WhiteListMutation) Tx

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

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

func (*WhiteListMutation) Type

func (m *WhiteListMutation) Type() string

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

func (*WhiteListMutation) Where

func (m *WhiteListMutation) Where(ps ...predicate.WhiteList)

Where appends a list predicates to the WhiteListMutation builder.

type WhiteListQuery

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

WhiteListQuery is the builder for querying WhiteList entities.

func (*WhiteListQuery) Aggregate

func (wlq *WhiteListQuery) Aggregate(fns ...AggregateFunc) *WhiteListSelect

Aggregate returns a WhiteListSelect configured with the given aggregations.

func (*WhiteListQuery) All

func (wlq *WhiteListQuery) All(ctx context.Context) ([]*WhiteList, error)

All executes the query and returns a list of WhiteLists.

func (*WhiteListQuery) AllX

func (wlq *WhiteListQuery) AllX(ctx context.Context) []*WhiteList

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

func (*WhiteListQuery) Clone

func (wlq *WhiteListQuery) Clone() *WhiteListQuery

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

func (*WhiteListQuery) Count

func (wlq *WhiteListQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WhiteListQuery) CountX

func (wlq *WhiteListQuery) CountX(ctx context.Context) int

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

func (*WhiteListQuery) Exist

func (wlq *WhiteListQuery) Exist(ctx context.Context) (bool, error)

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

func (*WhiteListQuery) ExistX

func (wlq *WhiteListQuery) ExistX(ctx context.Context) bool

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

func (*WhiteListQuery) First

func (wlq *WhiteListQuery) First(ctx context.Context) (*WhiteList, error)

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

func (*WhiteListQuery) FirstID

func (wlq *WhiteListQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*WhiteListQuery) FirstIDX

func (wlq *WhiteListQuery) FirstIDX(ctx context.Context) int

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

func (*WhiteListQuery) FirstX

func (wlq *WhiteListQuery) FirstX(ctx context.Context) *WhiteList

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

func (*WhiteListQuery) GroupBy

func (wlq *WhiteListQuery) GroupBy(field string, fields ...string) *WhiteListGroupBy

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

client.WhiteList.Query().
	GroupBy(whitelist.FieldPath).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WhiteListQuery) IDs

func (wlq *WhiteListQuery) IDs(ctx context.Context) ([]int, error)

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

func (*WhiteListQuery) IDsX

func (wlq *WhiteListQuery) IDsX(ctx context.Context) []int

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

func (*WhiteListQuery) Limit

func (wlq *WhiteListQuery) Limit(limit int) *WhiteListQuery

Limit adds a limit step to the query.

func (*WhiteListQuery) Offset

func (wlq *WhiteListQuery) Offset(offset int) *WhiteListQuery

Offset adds an offset step to the query.

func (*WhiteListQuery) Only

func (wlq *WhiteListQuery) Only(ctx context.Context) (*WhiteList, error)

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

func (*WhiteListQuery) OnlyID

func (wlq *WhiteListQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*WhiteListQuery) OnlyIDX

func (wlq *WhiteListQuery) OnlyIDX(ctx context.Context) int

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

func (*WhiteListQuery) OnlyX

func (wlq *WhiteListQuery) OnlyX(ctx context.Context) *WhiteList

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

func (*WhiteListQuery) Order

func (wlq *WhiteListQuery) Order(o ...OrderFunc) *WhiteListQuery

Order adds an order step to the query.

func (*WhiteListQuery) QueryOwner

func (wlq *WhiteListQuery) QueryOwner() *ServiceProviderQuery

QueryOwner chains the current query on the "owner" edge.

func (*WhiteListQuery) Select

func (wlq *WhiteListQuery) Select(fields ...string) *WhiteListSelect

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

client.WhiteList.Query().
	Select(whitelist.FieldPath).
	Scan(ctx, &v)

func (*WhiteListQuery) Unique

func (wlq *WhiteListQuery) Unique(unique bool) *WhiteListQuery

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

func (wlq *WhiteListQuery) Where(ps ...predicate.WhiteList) *WhiteListQuery

Where adds a new predicate for the WhiteListQuery builder.

func (*WhiteListQuery) WithOwner

func (wlq *WhiteListQuery) WithOwner(opts ...func(*ServiceProviderQuery)) *WhiteListQuery

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

type WhiteListSelect

type WhiteListSelect struct {
	*WhiteListQuery
	// contains filtered or unexported fields
}

WhiteListSelect is the builder for selecting fields of WhiteList entities.

func (*WhiteListSelect) Aggregate

func (wls *WhiteListSelect) Aggregate(fns ...AggregateFunc) *WhiteListSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WhiteListSelect) Bool

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

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

func (*WhiteListSelect) BoolX

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

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

func (*WhiteListSelect) Bools

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

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

func (*WhiteListSelect) BoolsX

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

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

func (*WhiteListSelect) Float64

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

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

func (*WhiteListSelect) Float64X

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

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

func (*WhiteListSelect) Float64s

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

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

func (*WhiteListSelect) Float64sX

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

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

func (*WhiteListSelect) Int

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

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

func (*WhiteListSelect) IntX

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

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

func (*WhiteListSelect) Ints

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

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

func (*WhiteListSelect) IntsX

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

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

func (*WhiteListSelect) Scan

func (wls *WhiteListSelect) Scan(ctx context.Context, v any) error

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

func (*WhiteListSelect) ScanX

func (s *WhiteListSelect) ScanX(ctx context.Context, v any)

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

func (*WhiteListSelect) String

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

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

func (*WhiteListSelect) StringX

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

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

func (*WhiteListSelect) Strings

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

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

func (*WhiteListSelect) StringsX

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

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

type WhiteListUpdate

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

WhiteListUpdate is the builder for updating WhiteList entities.

func (*WhiteListUpdate) ClearOwner

func (wlu *WhiteListUpdate) ClearOwner() *WhiteListUpdate

ClearOwner clears the "owner" edge to the ServiceProvider entity.

func (*WhiteListUpdate) Exec

func (wlu *WhiteListUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WhiteListUpdate) ExecX

func (wlu *WhiteListUpdate) ExecX(ctx context.Context)

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

func (*WhiteListUpdate) Mutation

func (wlu *WhiteListUpdate) Mutation() *WhiteListMutation

Mutation returns the WhiteListMutation object of the builder.

func (*WhiteListUpdate) Save

func (wlu *WhiteListUpdate) Save(ctx context.Context) (int, error)

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

func (*WhiteListUpdate) SaveX

func (wlu *WhiteListUpdate) SaveX(ctx context.Context) int

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

func (*WhiteListUpdate) SetNillableOwnerID

func (wlu *WhiteListUpdate) SetNillableOwnerID(id *int) *WhiteListUpdate

SetNillableOwnerID sets the "owner" edge to the ServiceProvider entity by ID if the given value is not nil.

func (*WhiteListUpdate) SetOwner

func (wlu *WhiteListUpdate) SetOwner(s *ServiceProvider) *WhiteListUpdate

SetOwner sets the "owner" edge to the ServiceProvider entity.

func (*WhiteListUpdate) SetOwnerID

func (wlu *WhiteListUpdate) SetOwnerID(id int) *WhiteListUpdate

SetOwnerID sets the "owner" edge to the ServiceProvider entity by ID.

func (*WhiteListUpdate) SetPath

func (wlu *WhiteListUpdate) SetPath(s string) *WhiteListUpdate

SetPath sets the "path" field.

func (*WhiteListUpdate) Where

Where appends a list predicates to the WhiteListUpdate builder.

type WhiteListUpdateOne

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

WhiteListUpdateOne is the builder for updating a single WhiteList entity.

func (*WhiteListUpdateOne) ClearOwner

func (wluo *WhiteListUpdateOne) ClearOwner() *WhiteListUpdateOne

ClearOwner clears the "owner" edge to the ServiceProvider entity.

func (*WhiteListUpdateOne) Exec

func (wluo *WhiteListUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WhiteListUpdateOne) ExecX

func (wluo *WhiteListUpdateOne) ExecX(ctx context.Context)

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

func (*WhiteListUpdateOne) Mutation

func (wluo *WhiteListUpdateOne) Mutation() *WhiteListMutation

Mutation returns the WhiteListMutation object of the builder.

func (*WhiteListUpdateOne) Save

func (wluo *WhiteListUpdateOne) Save(ctx context.Context) (*WhiteList, error)

Save executes the query and returns the updated WhiteList entity.

func (*WhiteListUpdateOne) SaveX

func (wluo *WhiteListUpdateOne) SaveX(ctx context.Context) *WhiteList

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

func (*WhiteListUpdateOne) Select

func (wluo *WhiteListUpdateOne) Select(field string, fields ...string) *WhiteListUpdateOne

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

func (*WhiteListUpdateOne) SetNillableOwnerID

func (wluo *WhiteListUpdateOne) SetNillableOwnerID(id *int) *WhiteListUpdateOne

SetNillableOwnerID sets the "owner" edge to the ServiceProvider entity by ID if the given value is not nil.

func (*WhiteListUpdateOne) SetOwner

SetOwner sets the "owner" edge to the ServiceProvider entity.

func (*WhiteListUpdateOne) SetOwnerID

func (wluo *WhiteListUpdateOne) SetOwnerID(id int) *WhiteListUpdateOne

SetOwnerID sets the "owner" edge to the ServiceProvider entity by ID.

func (*WhiteListUpdateOne) SetPath

func (wluo *WhiteListUpdateOne) SetPath(s string) *WhiteListUpdateOne

SetPath sets the "path" field.

type WhiteLists

type WhiteLists []*WhiteList

WhiteLists is a parsable slice of WhiteList.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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